OSDN Git Service

scsi: smartpqi: Update LUN reset handler
authorKevin Barnett <kevin.barnett@microchip.com>
Tue, 28 Sep 2021 23:54:35 +0000 (18:54 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Oct 2021 04:13:15 +0000 (00:13 -0400)
commit6ce1ddf53252dfd9debaef87648488c85d84a482
treeb92df37fc0ab5c3713e1bb3aafcb0f56ff76d2f7
parent5d1f03e6f49ae80d417dc72d1ee16a3379e2c026
scsi: smartpqi: Update LUN reset handler

Enhance check for commands queued to the controller.  Add new function
pqi_nonempty_inbound_queue_count() that will wait for all I/O queued for
submission to controller across all queue groups to drain.  Add helper
functions to obtain queue command counts for each queue group.  These
queues should drain quickly as they are already staged to be submitted down
to the controller's IB queue.

Enhance check for outstanding command completion.  Update the count of
outstanding commands while waiting.  This value was not re-obtained and was
potentially causing infinite wait for all completions.

Link: https://lore.kernel.org/r/20210928235442.201875-5-don.brace@microchip.com
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Acked-by: John Donnelly <john.p.donnelly@oracle.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/smartpqi/smartpqi_init.c