linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi/arcmsr: Add timeout module parameter
@ 2014-08-02 19:42 Ari Sundholm
  2014-08-04 11:15 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Ari Sundholm @ 2014-08-02 19:42 UTC (permalink / raw)
  To: linux-scsi

From: Ari Sundholm <asundhol@cs.hut.fi>

Backported from Areca's current version of the driver.

Signed-off-by: Ari Sundholm <asundhol@cs.hut.fi>
---
 drivers/scsi/arcmsr/arcmsr_hba.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 652b41b..e79b62b 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -79,6 +79,9 @@ MODULE_VERSION(ARCMSR_DRIVER_VERSION);
 #define	ARCMSR_RETRYCOUNT	12
 
 wait_queue_head_t wait_q;
+static int timeout;
+module_param(timeout, int, 0644);
+MODULE_PARM_DESC(timeout, " scsi cmd timeout value (0 - 120 sec.)");
 static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb,
 					struct scsi_cmnd *cmd);
 static int arcmsr_iop_confirm(struct AdapterControlBlock *acb);
@@ -1151,6 +1154,14 @@ static int arcmsr_build_ccb(struct AdapterControlBlock *acb,
 	if (pcmd->sc_data_direction == DMA_TO_DEVICE)
 		arcmsr_cdb->Flags |= ARCMSR_CDB_FLAG_WRITE;
 	ccb->arc_cdb_size = arccdbsize;
+
+	if (timeout) {
+		pcmd->request->deadline = jiffies + timeout * HZ;
+		if (pcmd->device->request_queue->timeout.function)
+			mod_timer(&pcmd->device->request_queue->timeout,
+			          pcmd->request->deadline);
+	}
+
 	return SUCCESS;
 }
 
-- 
1.9.1

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

end of thread, other threads:[~2014-08-19 18:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-02 19:42 [PATCH] scsi/arcmsr: Add timeout module parameter Ari Sundholm
2014-08-04 11:15 ` Christoph Hellwig
2014-08-05 13:10   ` Ari Sundholm
2014-08-19 18:07     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).