From: Balsundar P <balsunda...@microsemi.com>

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

Signed-off-by: Balsundar P <balsunda...@microsemi.com>
---
 drivers/scsi/aacraid/linit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index acc0250a4b62..2055307f4f3d 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -613,9 +613,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);
 }
 
-- 
2.18.1

Reply via email to