aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit.Saxena@avagotech.com <Sumit.Saxena@avagotech.com>2014-11-17 04:54:08 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-24 08:39:01 -0500
commitaa00832b4ca6491c3540ef637ee89a7394711858 (patch)
tree89ad6b57ca4dd325e48d771a99e11448d70630de
parent6e755ddc2935d970574263db3eca547eb70e67d7 (diff)
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: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index de67cf310462..3ccfbec682d0 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1571,6 +1571,12 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
1571 instance = (struct megasas_instance *) 1571 instance = (struct megasas_instance *)
1572 scmd->device->host->hostdata; 1572 scmd->device->host->hostdata;
1573 1573
1574 if (instance->unload == 1) {
1575 scmd->result = DID_NO_CONNECT << 16;
1576 scmd->scsi_done(scmd);
1577 return 0;
1578 }
1579
1574 if (instance->issuepend_done == 0) 1580 if (instance->issuepend_done == 0)
1575 return SCSI_MLQUEUE_HOST_BUSY; 1581 return SCSI_MLQUEUE_HOST_BUSY;
1576 1582
@@ -5011,10 +5017,6 @@ static int megasas_io_attach(struct megasas_instance *instance)
5011 return -ENODEV; 5017 return -ENODEV;
5012 } 5018 }
5013 5019
5014 /*
5015 * Trigger SCSI to scan our drives
5016 */
5017 scsi_scan_host(host);
5018 return 0; 5020 return 0;
5019} 5021}
5020 5022
@@ -5344,6 +5346,10 @@ retry_irq_register:
5344 goto fail_io_attach; 5346 goto fail_io_attach;
5345 5347
5346 instance->unload = 0; 5348 instance->unload = 0;
5349 /*
5350 * Trigger SCSI to scan our drives
5351 */
5352 scsi_scan_host(host);
5347 5353
5348 /* 5354 /*
5349 * Initiate AEN (Asynchronous Event Notification) 5355 * Initiate AEN (Asynchronous Event Notification)
@@ -6107,6 +6113,11 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
6107 megasas_issue_blocked_cmd(instance, cmd, 0); 6113 megasas_issue_blocked_cmd(instance, cmd, 0);
6108 cmd->sync_cmd = 0; 6114 cmd->sync_cmd = 0;
6109 6115
6116 if (instance->unload == 1) {
6117 dev_info(&instance->pdev->dev, "Driver unload is in progress "
6118 "don't submit data to application\n");
6119 goto out;
6120 }
6110 /* 6121 /*
6111 * copy out the kernel buffers to user buffers 6122 * copy out the kernel buffers to user buffers
6112 */ 6123 */