On 12/05/2022 12:12, Hannes Reinecke wrote:
Rather than re-using the failed command the snic driver should
reserve one command for TMFs.
Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
---
drivers/scsi/snic/snic.h | 2 +-
drivers/scsi/snic/snic_main.c | 8 +++++++
drivers/scsi/snic/snic_scsi.c | 44 +++++++++++++++++------------------
3 files changed, 31 insertions(+), 23 deletions(-)
diff --git a/drivers/scsi/snic/snic.h b/drivers/scsi/snic/snic.h
index 4ec7e30678e1..28059b66f191 100644
--- a/drivers/scsi/snic/snic.h
+++ b/drivers/scsi/snic/snic.h
@@ -380,7 +380,7 @@ int snic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
int snic_abort_cmd(struct scsi_cmnd *);
int snic_device_reset(struct scsi_cmnd *);
int snic_host_reset(struct scsi_cmnd *);
-int snic_reset(struct Scsi_Host *, struct scsi_cmnd *);
+int snic_reset(struct Scsi_Host *);
void snic_shutdown_scsi_cleanup(struct snic *);
diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c
index 29d56396058c..3375153dd636 100644
--- a/drivers/scsi/snic/snic_main.c
+++ b/drivers/scsi/snic/snic_main.c
@@ -663,6 +663,14 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_get_conf;
}
Hi Hannes,
+ /*
+ * Hack alert: reduce can_queue by one after scsi_add_host()
+ * had been called.
I am not sure how this helps as I did not think that reducing
shost->can_queue after scsi_add_host() had any effect. Maybe pre-
6eb045e092ef it did.
As an alternative interim solution, maybe you could just allocate a
regular single scsi request for this TMF at init time.
+ * This essentially reserves the topmost request for TMF.
+ * Should be replaced by reserved command
+ * once support is being added.
+ */
+ shost->can_queue--;
snic_set_state(snic, SNIC_ONLINE);
Thanks,
John