scsi: hpsa: Correct dev cmds outstanding for retried cmds
authorDon Brace <don.brace@microchip.com>
Mon, 15 Feb 2021 22:26:57 +0000 (16:26 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 23 Feb 2021 03:43:48 +0000 (22:43 -0500)
commitf749d8b7a9896bc6e5ffe104cc64345037e0b152
tree03d73fa2eae33a9d49ba8d597912cd3e58476751
parentaaf15f8c6de932861f1fce6aeec6a89ac0e354b6
scsi: hpsa: Correct dev cmds outstanding for retried cmds

Prevent incrementing device->commands_outstanding for ioaccel command
retries that are driver initiated.  If the command goes through the retry
path, the device->commands_outstanding counter has already accounted for
the number of commands outstanding to the device.  Only commands going
through function hpsa_cmd_resolve_events decrement this counter.

 - ioaccel commands go to either HBA disks or to logical volumes comprised
   of SSDs.

The extra increment is causing device resets to hang.

 - Resets wait for all device outstanding commands to complete before
   returning.

Replace unused field abort_pending with retry_pending. This is a
maintenance driver so these changes have the least impact/risk.

Link: https://lore.kernel.org/r/161342801747.29388.13045495968308188518.stgit@brunhilda
Tested-by: Joe Szczypek <jszczype@redhat.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hpsa.c
drivers/scsi/hpsa_cmd.h