Commit 572ee53a authored by Balsundar P's avatar Balsundar P Committed by Martin K. Petersen

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.comSigned-off-by: default avatarBalsundar P <balsundar.p@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e2fd90dd
...@@ -612,9 +612,13 @@ static struct device_attribute *aac_dev_attrs[] = { ...@@ -612,9 +612,13 @@ static struct device_attribute *aac_dev_attrs[] = {
static int aac_ioctl(struct scsi_device *sdev, unsigned int cmd, static int aac_ioctl(struct scsi_device *sdev, unsigned int cmd,
void __user *arg) void __user *arg)
{ {
int retval;
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
if (!capable(CAP_SYS_RAWIO)) if (!capable(CAP_SYS_RAWIO))
return -EPERM; return -EPERM;
retval = aac_adapter_check_health(dev);
if (retval)
return -EBUSY;
return aac_do_ioctl(dev, cmd, arg); return aac_do_ioctl(dev, cmd, arg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment