scsi: fnic: Fix sg_reset success path
Subsystems (2)
Karan Tilak Kumar
maintainerPATCH 1/1 scsi: fnic: Fix sg_reset success path
sg_reset performs a device reset/lun reset on a lun. Since it is issued by the user, it does not come into the driver with a tag or a queue id.
Fix the fnic driver to create an io_req and use a scsi command tag. Fix the ITMF path to special case the sg_reset response.
Reviewed-by Sesidhar Baddela <[email protected]>
Reviewed-by Arulprabhu Ponnusamy <[email protected]>
Tested-by Karan Tilak Kumar <[email protected]>
Signed-off-by Karan Tilak Kumar <[email protected]>
--- drivers/scsi/fnic/fnic.h | 4 ++- drivers/scsi/fnic/fnic_io.h | 2 ++ drivers/scsi/fnic/fnic_main.c | 2 ++ drivers/scsi/fnic/fnic_scsi.c | 64 +++++++++++++++++++++++++---------- 4 files changed, 54 insertions(+), 18 deletions(-)
drivers/scsi/fnic/fnic.h +3 -1
@@ -27,7 +27,7 @@#define DRV_NAME "fnic"#define DRV_DESCRIPTION "Cisco FCoE HBA Driver" -#define DRV_VERSION "1.6.0.56" +#define DRV_VERSION "1.6.0.57"#define PFX DRV_NAME ": "#define DFX DRV_NAME "%d: "
@@ -237,6 +237,8 @@ struct fnic {unsigned int cq_count;struct mutex sgreset_mutex; +spinlock_t sgreset_lock;/* lock for sgreset */ +struct scsi_cmnd *sgreset_sc;struct dentry *fnic_stats_debugfs_host;struct dentry *fnic_stats_debugfs_file;struct dentry *fnic_reset_debugfs_file;
drivers/scsi/fnic/fnic_io.h +2 -0
@@ -52,6 +52,8 @@ struct fnic_io_req {unsigned long start_time;/* in jiffies */ struct completion *abts_done;/* completion for abts */ struct completion *dr_done;/* completion for device reset */ +unsigned int tag; +struct scsi_cmnd *sc;/* midlayer's cmd pointer*/ };enum fnic_port_speeds {
drivers/scsi/fnic/fnic_main.c +2 -0
@@ -754,6 +754,8 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i <FNIC_IO_LOCKS ; i++)spin_lock_init (&fnic->io_req_lock[i]); +spin_lock_init (&fnic->sgreset_lock); + err = -ENOMEM ; fnic->io_req_pool =mempool_create_slab_pool (2 , fnic_io_req_cache);if (!fnic->io_req_pool)
drivers/scsi/fnic/fnic_scsi.c +47 -17
133 lines not on this page · raw message
Signature · 1 line
2.31.1
Martin K. Petersen
AppliedQuoted 8 lines · Karan Tilak Kumar
sg_resetperforms a device reset/lun reset on a lun. Since it is issued by the user, it does not come into the driver with a tag or a queue id.
Fix the fnic driver to create anio_reqand use a scsi command tag. Fix the ITMF path to special case thesg_resetresponse.[...]
Applied to 6.6/scsi-fixes, thanks!
[1/1] scsi: fnic: Fix sg_reset success path
https://git.kernel.org/mkp/scsi/c/514f0c400bde
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering