On 4/30/20 5:15 PM, Ming Lei wrote:
On Thu, Apr 30, 2020 at 03:18:27PM +0200, Hannes Reinecke wrote:
When issuing a LUN reset we should be using a reserved command
to avoid overwriting the original command.
Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
---
drivers/scsi/csiostor/csio_init.c | 1 +
drivers/scsi/csiostor/csio_scsi.c | 48 +++++++++++++++++++++++----------------
2 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index 8dea7d53788a..5e1b0a24caf6 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -622,6 +622,7 @@ csio_shost_init(struct csio_hw *hw, struct device *dev,
ln->dev_num = (shost->host_no << 16);
shost->can_queue = CSIO_MAX_QUEUE;
+ shost->nr_reserved_cmds = 1;
->can_queue isn't increased by 1 given CSIO_MAX_QUEUE isn't changed, so
setting shost->nr_reserved_cmds as 1 will cause io queue depth reduced by 1,
that is supposed to not happen.
We cannot increase MAX_QUEUE arbitrarily as this is a compile time
variable, which seems to relate to a hardware setting.
But I can see to update the reserved command functionality for allowing
to fetch commands from the normal I/O tag pool; in the case of LUN reset
it shouldn't make much of a difference as the all I/O is quiesced anyway.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer