mpt2sas: Added DID_NO_CONNECT return when driver remove and avoid shutdown call
PATCH 5/7 mpt2sas: Added DID_NO_CONNECT return when driver remove and avoid shutdown call
Quoted 1 line
From
scsih_qcmd, we add checkfor theioc->remove_hostflag, and returnDID_NO_CONNECT.
Driver should not call shutdown call from _scsih_remove otherwise, The scsi midlayer can be deadlocked when devices are removed from the driver pci_driver->shutdown handler.
Signed-off-by Kashyap Desai <[email protected]>
---
drivers/scsi/mpt2sas/mpt2sas_scsih.c +1 -2
@@ -3766,7 +3766,7 @@ _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))return 0 ; } -if (ioc->pci_error_recovery) { +if (ioc->pci_error_recovery || ioc->remove_host) { scmd->result =DID_NO_CONNECT <<16 ; scmd->scsi_done (scmd);return 0 ;
@@ -7314,7 +7314,6 @@ _scsih_remove(struct pci_dev *pdev) }sas_remove_host (shost); -_scsih_shutdown (pdev);list_del (&ioc->list);scsi_remove_host (shost);scsi_host_put (shost);