Commit aa00832b authored by Sumit.Saxena@avagotech.com's avatar Sumit.Saxena@avagotech.com Committed by Christoph Hellwig

megaraid_sas: do not process IOCTLs and SCSI commands during driver removal

Do not process any SCSI and IOCTL command further (return them with
appropriate return values to callers), while driver removal is in
progress or PCI shutdown is invoked.
Signed-off-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: default avatarKashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 6e755ddc
...@@ -1571,6 +1571,12 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) ...@@ -1571,6 +1571,12 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
instance = (struct megasas_instance *) instance = (struct megasas_instance *)
scmd->device->host->hostdata; scmd->device->host->hostdata;
if (instance->unload == 1) {
scmd->result = DID_NO_CONNECT << 16;
scmd->scsi_done(scmd);
return 0;
}
if (instance->issuepend_done == 0) if (instance->issuepend_done == 0)
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
...@@ -5011,10 +5017,6 @@ static int megasas_io_attach(struct megasas_instance *instance) ...@@ -5011,10 +5017,6 @@ static int megasas_io_attach(struct megasas_instance *instance)
return -ENODEV; return -ENODEV;
} }
/*
* Trigger SCSI to scan our drives
*/
scsi_scan_host(host);
return 0; return 0;
} }
...@@ -5344,6 +5346,10 @@ static int megasas_probe_one(struct pci_dev *pdev, ...@@ -5344,6 +5346,10 @@ static int megasas_probe_one(struct pci_dev *pdev,
goto fail_io_attach; goto fail_io_attach;
instance->unload = 0; instance->unload = 0;
/*
* Trigger SCSI to scan our drives
*/
scsi_scan_host(host);
/* /*
* Initiate AEN (Asynchronous Event Notification) * Initiate AEN (Asynchronous Event Notification)
...@@ -6107,6 +6113,11 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, ...@@ -6107,6 +6113,11 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
megasas_issue_blocked_cmd(instance, cmd, 0); megasas_issue_blocked_cmd(instance, cmd, 0);
cmd->sync_cmd = 0; cmd->sync_cmd = 0;
if (instance->unload == 1) {
dev_info(&instance->pdev->dev, "Driver unload is in progress "
"don't submit data to application\n");
goto out;
}
/* /*
* copy out the kernel buffers to user buffers * copy out the kernel buffers to user buffers
*/ */
......
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