aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/linit.c
diff options
context:
space:
mode:
authorBalsundar P <balsundar.p@microsemi.com>2019-10-15 11:52:02 +0530
committerMartin K. Petersen <martin.petersen@oracle.com>2019-10-18 19:34:18 -0400
commit572ee53a9badf62f3973d66f6475f9ce69720a25 (patch)
tree9671bbe558a782765de951661e1f002b47323414 /drivers/scsi/aacraid/linit.c
parentscsi: aacraid: setting different timeout for src and thor (diff)
downloadlinux-dev-572ee53a9badf62f3973d66f6475f9ce69720a25.tar.xz
linux-dev-572ee53a9badf62f3973d66f6475f9ce69720a25.zip
scsi: aacraid: check adapter health
Currently driver waits for the command IOCTL from the firmware and if the firmware enters nonresponsive state, the driver doesn't respond till the firmware is responsive again. Check that firmware is alive, otherwise return -EBUSY. [mkp: clarified commit desc] Link: https://lore.kernel.org/r/1571120524-6037-6-git-send-email-balsundar.p@microsemi.com Signed-off-by: Balsundar P <balsundar.p@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/aacraid/linit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 40f78509ca94..55a55c56fea9 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -612,9 +612,13 @@ static struct device_attribute *aac_dev_attrs[] = {
static int aac_ioctl(struct scsi_device *sdev, unsigned int cmd,
void __user *arg)
{
+ int retval;
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
+ retval = aac_adapter_check_health(dev);
+ if (retval)
+ return -EBUSY;
return aac_do_ioctl(dev, cmd, arg);
}