]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit - drivers/scsi/mpt3sas/mpt3sas_scsih.c
scsi: mpt3sas: wait for and flush running commands on shutdown/unload
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Fri, 16 Feb 2018 22:39:58 +0000 (20:39 -0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 22 Feb 2018 03:59:39 +0000 (22:59 -0500)
commitc666d3be99c000bb889a33353e9be0fa5808d3de
treed8905cad89a71ec8b69c758c770f90d8eb429700
parent9ff549ffb4fb4cc9a4b24d1de9dc3e68287797c4
scsi: mpt3sas: wait for and flush running commands on shutdown/unload

This patch finishes all outstanding SCSI IO commands (but not other commands,
e.g., task management) in the shutdown and unload paths.

It first waits for the commands to complete (this is done after setting
'ioc->remove_host = 1 ', which prevents new commands to be queued) then it
flushes commands that might still be running.

This avoids triggering error handling (e.g., abort command) for all commands
possibly completed by the adapter after interrupts disabled.

[mauricfo: introduced something in commit message.]

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Tested-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/mpt3sas/mpt3sas_base.h
drivers/scsi/mpt3sas/mpt3sas_scsih.c