aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>2015-03-26 10:41:29 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-04-09 19:54:40 -0400
commitf9c4259678cbde854a4e94398d66ef379178fd7c (patch)
tree98622484a949c8de2377fc06983a80eeccbc1ced
parentdafde947bce37b10f3681d6b9df473ba7136fc05 (diff)
aacraid: IOCTL fix
After getting the platform shutdown command "VM_CloseAll" response from the firmware, driver was getting configuration IOCTL request from the upper layers and it sends down to firmware. This causes firmware assert issue. This patch fixes the firmware assert issue. During the shutdown, if driver gets commands from the upper layer, driver sends error code to the upper layers. Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r--drivers/scsi/aacraid/aacraid.h1
-rw-r--r--drivers/scsi/aacraid/comminit.c3
-rw-r--r--drivers/scsi/aacraid/linit.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 9b469a4254b7..43d80763bb7d 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1222,6 +1222,7 @@ struct aac_dev
1222 int msi_enabled; /* MSI/MSI-X enabled */ 1222 int msi_enabled; /* MSI/MSI-X enabled */
1223 struct msix_entry msixentry[AAC_MAX_MSIX]; 1223 struct msix_entry msixentry[AAC_MAX_MSIX];
1224 struct aac_msix_ctx aac_msix[AAC_MAX_MSIX]; /* context */ 1224 struct aac_msix_ctx aac_msix[AAC_MAX_MSIX]; /* context */
1225 u8 adapter_shutdown;
1225}; 1226};
1226 1227
1227#define aac_adapter_interrupt(dev) \ 1228#define aac_adapter_interrupt(dev) \
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 284b1c54be7f..27432b9ea235 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -231,6 +231,7 @@ int aac_send_shutdown(struct aac_dev * dev)
231 /* FIB should be freed only after getting the response from the F/W */ 231 /* FIB should be freed only after getting the response from the F/W */
232 if (status != -ERESTARTSYS) 232 if (status != -ERESTARTSYS)
233 aac_fib_free(fibctx); 233 aac_fib_free(fibctx);
234 dev->adapter_shutdown = 1;
234 if ((dev->pdev->device == PMC_DEVICE_S7 || 235 if ((dev->pdev->device == PMC_DEVICE_S7 ||
235 dev->pdev->device == PMC_DEVICE_S8 || 236 dev->pdev->device == PMC_DEVICE_S8 ||
236 dev->pdev->device == PMC_DEVICE_S9) && 237 dev->pdev->device == PMC_DEVICE_S9) &&
@@ -400,6 +401,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
400 } 401 }
401 dev->max_msix = 0; 402 dev->max_msix = 0;
402 dev->msi_enabled = 0; 403 dev->msi_enabled = 0;
404 dev->adapter_shutdown = 0;
403 if ((!aac_adapter_sync_cmd(dev, GET_COMM_PREFERRED_SETTINGS, 405 if ((!aac_adapter_sync_cmd(dev, GET_COMM_PREFERRED_SETTINGS,
404 0, 0, 0, 0, 0, 0, 406 0, 0, 0, 0, 0, 0,
405 status+0, status+1, status+2, status+3, status+4)) 407 status+0, status+1, status+2, status+3, status+4))
@@ -511,6 +513,7 @@ static void aac_define_int_mode(struct aac_dev *dev)
511 513
512 int i, msi_count; 514 int i, msi_count;
513 515
516 msi_count = i = 0;
514 /* max. vectors from GET_COMM_PREFERRED_SETTINGS */ 517 /* max. vectors from GET_COMM_PREFERRED_SETTINGS */
515 if (dev->max_msix == 0 || 518 if (dev->max_msix == 0 ||
516 dev->pdev->device == PMC_DEVICE_S6 || 519 dev->pdev->device == PMC_DEVICE_S6 ||
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 75c3501e51b3..36653a9d9ade 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -713,7 +713,9 @@ static long aac_cfg_ioctl(struct file *file,
713 unsigned int cmd, unsigned long arg) 713 unsigned int cmd, unsigned long arg)
714{ 714{
715 int ret; 715 int ret;
716 if (!capable(CAP_SYS_RAWIO)) 716 struct aac_dev *aac;
717 aac = (struct aac_dev *)file->private_data;
718 if (!capable(CAP_SYS_RAWIO) || aac->adapter_shutdown)
717 return -EPERM; 719 return -EPERM;
718 mutex_lock(&aac_mutex); 720 mutex_lock(&aac_mutex);
719 ret = aac_do_ioctl(file->private_data, cmd, (void __user *)arg); 721 ret = aac_do_ioctl(file->private_data, cmd, (void __user *)arg);