scsi: mpt3sas: Fix Sync cache command failure during driver unload
authorSuganath Prabu <suganath-prabu.subramani@broadcom.com>
Wed, 31 Oct 2018 13:23:36 +0000 (18:53 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:14:08 +0000 (09:14 +0100)
commite9a57946f976ab2c389dffe9c4b3d9e90c1c5268
tree434c7a91e8ff1b6c22b3bc4cadf44931c1bbdf1b
parent670a0b329da806d0d99dcb47dc71efab61d4633b
scsi: mpt3sas: Fix Sync cache command failure during driver unload

[ Upstream commit 9029a72500b95578a35877a43473b82cb0386c53 ]

This is to fix SYNC CACHE and START STOP command failures with
DID_NO_CONNECT during driver unload.

In driver's IO submission patch (i.e. in driver's .queuecommand()) driver
won't allow any SCSI commands to the IOC when ioc->remove_host flag is set
and hence SYNC CACHE commands which are issued to the target drives (where
write cache is enabled) during driver unload time is failed with
DID_NO_CONNECT status.

Now modified the driver to allow SYNC CACHE and START STOP commands to IOC,
even when remove_host flag is set.

Signed-off-by: Suganath Prabu <suganath-prabu.subramani@broadcom.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/mpt3sas/mpt3sas_scsih.c