Skip to contentSkip to conversation

SYNCHRONIZE_CACHE command used fixed value

PATCH New Bernd Schubert 1 participant 1 message Feb 6, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 SYNCHRONIZE_CACHE command used fixed value

Switch to adjustable timeout value for scsi SYNCHRONIZE_CACHE commands. We have been running into problems with fixed values on troublesome devices.

---
 drivers/scsi/sd.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/sd.c +3 -2
Index: linux-2.6/drivers/scsi/sd.c
===================================================================
@@ -884,7 +884,8 @@ static int sd_sync_cache(struct scsi_dis
 		 * flush everything.
 		 */
 		res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
-				       SD_TIMEOUT, SD_MAX_RETRIES);
+				       sdp->request_queue->rq_timeout,
+				       SD_MAX_RETRIES);
 		if (res == 0)
 			break;
 	}
@@ -903,7 +904,7 @@ static int sd_sync_cache(struct scsi_dis
 static void sd_prepare_flush(struct request_queue *q, struct request *rq)
 {
 	rq->cmd_type = REQ_TYPE_BLOCK_PC;
-	rq->timeout = SD_TIMEOUT;
+	rq->timeout = q->rq_timeout;
 	rq->cmd[0] = SYNCHRONIZE_CACHE;
 	rq->cmd_len = 10;
 }
Signature · 2 lines
Bernd Schubert
Q-Leap Networks GmbH