提交 f9c42596 编写于 作者: M Mahesh Rajashekhara 提交者: James Bottomley

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: NMahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: NHannes Reinecke <hare@suse.de>
Reviewed-by: NMurthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
上级 dafde947
...@@ -1222,6 +1222,7 @@ struct aac_dev ...@@ -1222,6 +1222,7 @@ struct aac_dev
int msi_enabled; /* MSI/MSI-X enabled */ int msi_enabled; /* MSI/MSI-X enabled */
struct msix_entry msixentry[AAC_MAX_MSIX]; struct msix_entry msixentry[AAC_MAX_MSIX];
struct aac_msix_ctx aac_msix[AAC_MAX_MSIX]; /* context */ struct aac_msix_ctx aac_msix[AAC_MAX_MSIX]; /* context */
u8 adapter_shutdown;
}; };
#define aac_adapter_interrupt(dev) \ #define aac_adapter_interrupt(dev) \
......
...@@ -231,6 +231,7 @@ int aac_send_shutdown(struct aac_dev * dev) ...@@ -231,6 +231,7 @@ int aac_send_shutdown(struct aac_dev * dev)
/* FIB should be freed only after getting the response from the F/W */ /* FIB should be freed only after getting the response from the F/W */
if (status != -ERESTARTSYS) if (status != -ERESTARTSYS)
aac_fib_free(fibctx); aac_fib_free(fibctx);
dev->adapter_shutdown = 1;
if ((dev->pdev->device == PMC_DEVICE_S7 || if ((dev->pdev->device == PMC_DEVICE_S7 ||
dev->pdev->device == PMC_DEVICE_S8 || dev->pdev->device == PMC_DEVICE_S8 ||
dev->pdev->device == PMC_DEVICE_S9) && dev->pdev->device == PMC_DEVICE_S9) &&
...@@ -400,6 +401,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev) ...@@ -400,6 +401,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
} }
dev->max_msix = 0; dev->max_msix = 0;
dev->msi_enabled = 0; dev->msi_enabled = 0;
dev->adapter_shutdown = 0;
if ((!aac_adapter_sync_cmd(dev, GET_COMM_PREFERRED_SETTINGS, if ((!aac_adapter_sync_cmd(dev, GET_COMM_PREFERRED_SETTINGS,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
status+0, status+1, status+2, status+3, status+4)) 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,6 +513,7 @@ static void aac_define_int_mode(struct aac_dev *dev)
int i, msi_count; int i, msi_count;
msi_count = i = 0;
/* max. vectors from GET_COMM_PREFERRED_SETTINGS */ /* max. vectors from GET_COMM_PREFERRED_SETTINGS */
if (dev->max_msix == 0 || if (dev->max_msix == 0 ||
dev->pdev->device == PMC_DEVICE_S6 || dev->pdev->device == PMC_DEVICE_S6 ||
......
...@@ -713,7 +713,9 @@ static long aac_cfg_ioctl(struct file *file, ...@@ -713,7 +713,9 @@ static long aac_cfg_ioctl(struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
int ret; int ret;
if (!capable(CAP_SYS_RAWIO)) struct aac_dev *aac;
aac = (struct aac_dev *)file->private_data;
if (!capable(CAP_SYS_RAWIO) || aac->adapter_shutdown)
return -EPERM; return -EPERM;
mutex_lock(&aac_mutex); mutex_lock(&aac_mutex);
ret = aac_do_ioctl(file->private_data, cmd, (void __user *)arg); ret = aac_do_ioctl(file->private_data, cmd, (void __user *)arg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册