1. 02 3月, 2017 1 次提交
    • D
      scsi: sd: Check for unaligned partial completion · c46f0917
      Damien Le Moal 提交于
      Commit <f2e767bb> ("mpt3sas: Force request partial completion
      alignment") was not considering the case of commands not operating on
      logical block size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned
      partial replies). In this case, forcing alignment of resid to the device
      logical block size can break the command result, e.g. in the case of
      REQ_OP_ZONE_REPORT, the exact number of zone reported by the device.
      
      Move the partial completion alignement check of mpt3sas to a generic
      implementation in sd_done(). The check is added within the default
      section of the initial req_op() switch case so that the report and reset
      zone commands are ignored. In addition, as sd_done() is not called for
      passthrough requests, resid corrections are not done as intended by the
      initial mpt3sas patch.
      
      Fixes: f2e767bb ("mpt3sas: Force request partial completion alignment")
      Cc: <stable@vger.kernel.org> # v4.10
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c46f0917
  2. 10 2月, 2017 1 次提交
  3. 01 2月, 2017 3 次提交
  4. 18 1月, 2017 1 次提交
  5. 15 12月, 2016 1 次提交
  6. 23 11月, 2016 1 次提交
  7. 12 11月, 2016 1 次提交
    • A
      scsi: mpt3sas: Fix secure erase premature termination · 18f6084a
      Andrey Grodzovsky 提交于
      This is a work around for a bug with LSI Fusion MPT SAS2 when perfoming
      secure erase. Due to the very long time the operation takes, commands
      issued during the erase will time out and will trigger execution of the
      abort hook. Even though the abort hook is called for the specific
      command which timed out, this leads to entire device halt
      (scsi_state terminated) and premature termination of the secure erase.
      
      Set device state to busy while ATA passthrough commands are in progress.
      
      [mkp: hand applied to 4.9/scsi-fixes, tweaked patch description]
      Signed-off-by: NAndrey Grodzovsky <andrey2805@gmail.com>
      Acked-by: NSreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Cc: <linux-scsi@vger.kernel.org>
      Cc: Sathya Prakash <sathya.prakash@broadcom.com>
      Cc: Chaitra P B <chaitra.basappa@broadcom.com>
      Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      Cc: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      18f6084a
  8. 09 11月, 2016 8 次提交
  9. 02 11月, 2016 1 次提交
    • S
      scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk · 6d3a56ed
      Sreekanth Reddy 提交于
      While merging mpt3sas & mpt2sas code, we added the is_warpdrive check
      condition on the wrong line
      
      ---------------------------------------------------------------------------
       scsih_target_alloc(struct scsi_target *starget)
                              sas_target_priv_data->handle = raid_device->handle;
                              sas_target_priv_data->sas_address = raid_device->wwid;
                              sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME;
      -                       raid_device->starget = starget;
      +                       sas_target_priv_data->raid_device = raid_device;
      +                       if (ioc->is_warpdrive)
      +                               raid_device->starget = starget;
                      }
                      spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
                      return 0;
      ------------------------------------------------------------------------------
      
      That check should be for the line sas_target_priv_data->raid_device =
      raid_device;
      
      Due to above hunk, we are not initializing raid_device's starget for
      raid volumes, and so during raid disk deletion driver is not calling
      scsi_remove_target() API as driver observes starget field of
      raid_device's structure as NULL.
      Signed-off-by: NSreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Cc: <stable@vger.kernel.org> # v4.4+
      Fixes: 7786ab6a ("mpt3sas: Ported WarpDrive product SSS6200 support")
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      6d3a56ed
  10. 09 8月, 2016 5 次提交
  11. 16 7月, 2016 1 次提交
  12. 13 7月, 2016 1 次提交
  13. 23 5月, 2016 1 次提交
  14. 12 5月, 2016 4 次提交
  15. 26 4月, 2016 1 次提交
  16. 24 2月, 2016 5 次提交
  17. 14 11月, 2015 1 次提交
  18. 12 11月, 2015 3 次提交
    • S
      mpt3sas: Single driver module which supports both SAS 2.0 & SAS 3.0 HBAs · c84b06a4
      Sreekanth Reddy 提交于
      Modified the mpt3sas driver to have a single driver module which
      supports both SAS 2.0 & SAS 3.0 HBA devices.
      
      * Added SAS 2.0 HBA device IDs to the mpt3sas_pci_table pci table.
      
      * Created two separate SCSI host templates for SAS2 and SAS3 HBAs so
        that, during the driver load time driver can use corresponding host
        template(based the pci device ID) while registering a scsi host
        adapter instance for that pci device.
      
      * Registered two IOCTL devices, mpt2ctl is for SAS2 HBAs & mpt3ctl for
        SAS3 HBAs. Also updated the code to make sure that mpt2ctl device
        processes only those ioctl cmds issued for the SAS2 HBAs and mpt3ctl
        device processes only those ioctl cmds issued for the SAS3 HBAs.
      
      * Added separate indexing for SAS2 and SAS3 HBAs.
      
      * Replaced compile time check 'MPT2SAS_SCSI' to run time check
        'hba_mpi_version_belonged' whereever needed.
      
      * Aliased this merged driver to mpt2sas using MODULE_ALIAS.
      
      * Moved global varaible 'driver_name' to per adapter instance variable.
      
      * Created two raid function template and used corresponding raid
        function templates based on the run time check
        'hba_mpi_version_belonged'.
      
      * Moved mpt2sas_warpdrive.c file from mpt2sas to mpt3sas folder and
        renamed it as mpt3sas_warpdrive.c.
      
      * Also renamed the functions in mpt3sas_warpdrive.c file to follow
        current driver function name convention.
      
      * Updated the Makefile to build mpt3sas_warpdrive.o file for these
        WarpDrive-specific functions.
      
      * Also in function mpt3sas_setup_direct_io(), used sector_div() API
        instead of division operator (which gives compilation errors on 32 bit
        machines).
      
      * Removed mpt2sas files, mpt2sas directory & mpt3sas_module.c file.
      
      * Added module parameter 'hbas_to_enumerate' which permits using this
        merged driver as a legacy mpt2sas driver or as a legacy mpt3sas
        driver.
      
        Here are the available options for this module parameter:
      
         0 - Merged driver which enumerates both SAS 2.0 & SAS 3.0 HBAs
         1 - Acts as legacy mpt2sas driver, which enumerates only SAS 2.0 HBAs
         2 - Acts as legacy mpt3sas driver, which enumerates only SAS 3.0 HBAs
      
      * Removed mpt2sas entries from SCSI's Kconfig and Makefile files.
      Signed-off-by: NSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c84b06a4
    • S
      mpt3sas: setpci reset kernel oops fix · 08c4d550
      Sreekanth Reddy 提交于
      setpci reset on nytro warpdrive card along with sysfs access and cli
      ioctl access resulted in kernel oops
      
      1. pci_access_mutex lock added to provide synchronization between IOCTL,
         sysfs, PCI resource handling path
      
      2. gioc_lock spinlock to protect list operations over multiple
         controllers
      
      This patch is ported from commit 6229b414 ("mpt2sas: setpci reset
      kernel oops fix").
      Signed-off-by: NSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      08c4d550
    • S
      mpt3sas: Refcount fw_events and fix unsafe list usage · 146b16c8
      Sreekanth Reddy 提交于
      The fw_event_work struct is concurrently referenced at shutdown. Add a
      refcount to protect it and refactor the code to use it.
      
      Additionally, refactor _scsih_fw_event_cleanup_queue() such that it no
      longer iterates over the list without holding the lock since
      _firmware_event_work() concurrently deletes items from the list.
      
      This patch is ported from commit 008549f6 ("mpt2sas: Refcount
      fw_events and fix unsafe list usage"). These changes are also required
      for mpt3sas.
      Signed-off-by: NSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      146b16c8