All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/7] megaraid_sas : Do not process IOCTLs and SCSI commands during driver removal
@ 2014-11-10 12:21 Sumit.Saxena
  2014-11-11 13:42 ` Tomas Henzl
  0 siblings, 1 reply; 4+ messages in thread
From: Sumit.Saxena @ 2014-11-10 12:21 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, hch, jbottomley, kashyap.desai, aradford

Do not process any SCSI and IOCTL command further(return them with appropriate return values to callers),
while driver removal is in progress/PCI shutdown is invoked. 

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index f6a69a3..7754eeb 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1572,6 +1572,12 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
 	instance = (struct megasas_instance *)
 	    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)
 		return SCSI_MLQUEUE_HOST_BUSY;
 
@@ -4957,10 +4963,6 @@ static int megasas_io_attach(struct megasas_instance *instance)
 		return -ENODEV;
 	}
 
-	/*
-	 * Trigger SCSI to scan our drives
-	 */
-	scsi_scan_host(host);
 	return 0;
 }
 
@@ -5288,6 +5290,10 @@ retry_irq_register:
 		goto fail_io_attach;
 
 	instance->unload = 0;
+	/*
+	 * Trigger SCSI to scan our drives
+	 */
+	scsi_scan_host(host);
 
 	/*
 	 * Initiate AEN (Asynchronous Event Notification)
@@ -6051,6 +6057,12 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
 	megasas_issue_blocked_cmd(instance, cmd, 0);
 	cmd->sync_cmd = 0;
 
+	if (instance->unload == 1) {
+		dev_info(&instance->pdev->dev, "we are doing unload so no need"
+			"to submit data to application. This may be force exit"
+			"from driver\n");
+		goto out;
+	}
 	/*
 	 * copy out the kernel buffers to user buffers
 	 */
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-13  7:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 12:21 [PATCH 3/7] megaraid_sas : Do not process IOCTLs and SCSI commands during driver removal Sumit.Saxena
2014-11-11 13:42 ` Tomas Henzl
2014-11-12 11:08   ` Kashyap Desai
2014-11-13  7:35   ` Kashyap Desai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.