aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-02 18:52:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-02 18:52:28 -0500
commit9a689bc4f09f8b89f88e65b1b0a2ea780b4f28de (patch)
treed1ab7273b725acb1b28091e7634a4ed2e9ba2f41 /drivers/scsi
parent1122b19b8f4da2ee6d6b21780f86bea7957f641e (diff)
parentdc5c49bff34e5b5a4334560dc7f7dfeae91d8962 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] stex: switch to block timeout [SCSI] make scsi_eh_try_stu use block timeout [SCSI] megaraid_sas: switch to block timeout [SCSI] ibmvscsi: switch to block timeout [SCSI] aacraid: switch to block timeout [SCSI] zfcp: prevent double decrement on host_busy while being busy [SCSI] zfcp: fix deadlock between wq triggered port scan and ERP [SCSI] zfcp: eliminate race between validation and locking [SCSI] zfcp: verify for correct rport state before scanning for SCSI devs [SCSI] zfcp: returning an ERR_PTR where a NULL value is expected [SCSI] zfcp: Fix opening of wka ports [SCSI] zfcp: fix remote port status check [SCSI] fc_transport: fix old bug on bitflag definitions [SCSI] Fix hang in starved list processing
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/aacraid/linit.c4
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c2
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c3
-rw-r--r--drivers/scsi/scsi_error.c3
-rw-r--r--drivers/scsi/scsi_lib.c23
-rw-r--r--drivers/scsi/stex.c2
6 files changed, 18 insertions, 19 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 9aa301c1ed07..162cd927d94b 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -427,8 +427,8 @@ static int aac_slave_configure(struct scsi_device *sdev)
427 * Firmware has an individual device recovery time typically 427 * Firmware has an individual device recovery time typically
428 * of 35 seconds, give us a margin. 428 * of 35 seconds, give us a margin.
429 */ 429 */
430 if (sdev->timeout < (45 * HZ)) 430 if (sdev->request_queue->rq_timeout < (45 * HZ))
431 sdev->timeout = 45 * HZ; 431 blk_queue_rq_timeout(sdev->request_queue, 45*HZ);
432 for (cid = 0; cid < aac->maximum_num_containers; ++cid) 432 for (cid = 0; cid < aac->maximum_num_containers; ++cid)
433 if (aac->fsa_dev[cid].valid) 433 if (aac->fsa_dev[cid].valid)
434 ++num_lsu; 434 ++num_lsu;
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 87e09f35d3d4..6cad1758243a 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -1442,7 +1442,7 @@ static int ibmvscsi_slave_configure(struct scsi_device *sdev)
1442 spin_lock_irqsave(shost->host_lock, lock_flags); 1442 spin_lock_irqsave(shost->host_lock, lock_flags);
1443 if (sdev->type == TYPE_DISK) { 1443 if (sdev->type == TYPE_DISK) {
1444 sdev->allow_restart = 1; 1444 sdev->allow_restart = 1;
1445 sdev->timeout = 60 * HZ; 1445 blk_queue_rq_timeout(sdev->request_queue, 60 * HZ);
1446 } 1446 }
1447 scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun); 1447 scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun);
1448 spin_unlock_irqrestore(shost->host_lock, lock_flags); 1448 spin_unlock_irqrestore(shost->host_lock, lock_flags);
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index a454f94623d7..17ce7abe17ee 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -1016,7 +1016,8 @@ static int megasas_slave_configure(struct scsi_device *sdev)
1016 * The RAID firmware may require extended timeouts. 1016 * The RAID firmware may require extended timeouts.
1017 */ 1017 */
1018 if (sdev->channel >= MEGASAS_MAX_PD_CHANNELS) 1018 if (sdev->channel >= MEGASAS_MAX_PD_CHANNELS)
1019 sdev->timeout = MEGASAS_DEFAULT_CMD_TIMEOUT * HZ; 1019 blk_queue_rq_timeout(sdev->request_queue,
1020 MEGASAS_DEFAULT_CMD_TIMEOUT * HZ);
1020 return 0; 1021 return 0;
1021} 1022}
1022 1023
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 386361778ebb..edfaf241c5ba 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -932,8 +932,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
932 int i, rtn = NEEDS_RETRY; 932 int i, rtn = NEEDS_RETRY;
933 933
934 for (i = 0; rtn == NEEDS_RETRY && i < 2; i++) 934 for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
935 rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, 935 rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
936 scmd->device->timeout, 0);
937 936
938 if (rtn == SUCCESS) 937 if (rtn == SUCCESS)
939 return 0; 938 return 0;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f5d3b96890dc..fa45a1a66867 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -567,15 +567,18 @@ static inline int scsi_host_is_busy(struct Scsi_Host *shost)
567 */ 567 */
568static void scsi_run_queue(struct request_queue *q) 568static void scsi_run_queue(struct request_queue *q)
569{ 569{
570 struct scsi_device *starved_head = NULL, *sdev = q->queuedata; 570 struct scsi_device *sdev = q->queuedata;
571 struct Scsi_Host *shost = sdev->host; 571 struct Scsi_Host *shost = sdev->host;
572 LIST_HEAD(starved_list);
572 unsigned long flags; 573 unsigned long flags;
573 574
574 if (scsi_target(sdev)->single_lun) 575 if (scsi_target(sdev)->single_lun)
575 scsi_single_lun_run(sdev); 576 scsi_single_lun_run(sdev);
576 577
577 spin_lock_irqsave(shost->host_lock, flags); 578 spin_lock_irqsave(shost->host_lock, flags);
578 while (!list_empty(&shost->starved_list) && !scsi_host_is_busy(shost)) { 579 list_splice_init(&shost->starved_list, &starved_list);
580
581 while (!list_empty(&starved_list)) {
579 int flagset; 582 int flagset;
580 583
581 /* 584 /*
@@ -588,24 +591,18 @@ static void scsi_run_queue(struct request_queue *q)
588 * scsi_request_fn must get the host_lock before checking 591 * scsi_request_fn must get the host_lock before checking
589 * or modifying starved_list or starved_entry. 592 * or modifying starved_list or starved_entry.
590 */ 593 */
591 sdev = list_entry(shost->starved_list.next, 594 if (scsi_host_is_busy(shost))
592 struct scsi_device, starved_entry);
593 /*
594 * The *queue_ready functions can add a device back onto the
595 * starved list's tail, so we must check for a infinite loop.
596 */
597 if (sdev == starved_head)
598 break; 595 break;
599 if (!starved_head)
600 starved_head = sdev;
601 596
597 sdev = list_entry(starved_list.next,
598 struct scsi_device, starved_entry);
599 list_del_init(&sdev->starved_entry);
602 if (scsi_target_is_busy(scsi_target(sdev))) { 600 if (scsi_target_is_busy(scsi_target(sdev))) {
603 list_move_tail(&sdev->starved_entry, 601 list_move_tail(&sdev->starved_entry,
604 &shost->starved_list); 602 &shost->starved_list);
605 continue; 603 continue;
606 } 604 }
607 605
608 list_del_init(&sdev->starved_entry);
609 spin_unlock(shost->host_lock); 606 spin_unlock(shost->host_lock);
610 607
611 spin_lock(sdev->request_queue->queue_lock); 608 spin_lock(sdev->request_queue->queue_lock);
@@ -621,6 +618,8 @@ static void scsi_run_queue(struct request_queue *q)
621 618
622 spin_lock(shost->host_lock); 619 spin_lock(shost->host_lock);
623 } 620 }
621 /* put any unprocessed entries back */
622 list_splice(&starved_list, &shost->starved_list);
624 spin_unlock_irqrestore(shost->host_lock, flags); 623 spin_unlock_irqrestore(shost->host_lock, flags);
625 624
626 blk_run_queue(q); 625 blk_run_queue(q);
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 3790906a77d1..2fa830c0be27 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -477,7 +477,7 @@ stex_slave_config(struct scsi_device *sdev)
477{ 477{
478 sdev->use_10_for_rw = 1; 478 sdev->use_10_for_rw = 1;
479 sdev->use_10_for_ms = 1; 479 sdev->use_10_for_ms = 1;
480 sdev->timeout = 60 * HZ; 480 blk_queue_rq_timeout(sdev->request_queue, 60 * HZ);
481 sdev->tagged_supported = 1; 481 sdev->tagged_supported = 1;
482 482
483 return 0; 483 return 0;