diff options
-rw-r--r-- | drivers/scsi/scsi_lib.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 88d1b5f44e5..fe77ccacf31 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1497,6 +1497,21 @@ static void scsi_request_fn(struct request_queue *q) | |||
1497 | } | 1497 | } |
1498 | spin_lock(shost->host_lock); | 1498 | spin_lock(shost->host_lock); |
1499 | 1499 | ||
1500 | /* | ||
1501 | * We hit this when the driver is using a host wide | ||
1502 | * tag map. For device level tag maps the queue_depth check | ||
1503 | * in the device ready fn would prevent us from trying | ||
1504 | * to allocate a tag. Since the map is a shared host resource | ||
1505 | * we add the dev to the starved list so it eventually gets | ||
1506 | * a run when a tag is freed. | ||
1507 | */ | ||
1508 | if (blk_queue_tagged(q) && (req->tag == -1)) { | ||
1509 | if (list_empty(&sdev->starved_entry)) | ||
1510 | list_add_tail(&sdev->starved_entry, | ||
1511 | &shost->starved_list); | ||
1512 | goto not_ready; | ||
1513 | } | ||
1514 | |||
1500 | if (!scsi_host_queue_ready(q, shost, sdev)) | 1515 | if (!scsi_host_queue_ready(q, shost, sdev)) |
1501 | goto not_ready; | 1516 | goto not_ready; |
1502 | if (scsi_target(sdev)->single_lun) { | 1517 | if (scsi_target(sdev)->single_lun) { |