diff mbox series

[5/7] scsi: aacraid: check adapter health

Message ID 1571120524-6037-6-git-send-email-balsundar.p@microsemi.com (mailing list archive)
State Changes Requested
Headers show
Series scsi: aacraid updates | expand

Commit Message

balsundar.p@microsemi.com Oct. 15, 2019, 6:22 a.m. UTC
From: Balsundar P <balsundar.p@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 <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/linit.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

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);
 }