diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-09-14 12:57:42 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-14 16:59:03 -0400 |
commit | 59897dad98d63ac15e1e36fcc3a107c892b1826c (patch) | |
tree | 42e65c1e3e99ab12ab484b0311c4487ae7a76148 /drivers/scsi/scsi_lib.c | |
parent | d39a942c3f4061d2218dcadf79ce10010dbcdb3c (diff) |
[SCSI] fix sym scsi boot hang
On Wed, 2005-09-14 at 18:06 +1000, Anton Blanchard wrote:
> And in particular it looks like the scsi_unprep_request in
> scsi_queue_insert is causing it. The following patch fixes the boot
> problems on the vscsi machine:
OK, my fault. Your fix is almost correct .. I was going to do this
eventually, honest, because there's no need to unprep and reprep a
command that comes in through scsi_queue_insert().
However, I decided to leave it in to exercise the scsi_unprep_request()
path just to make sure it was working. What's happening, I think, is
that we also use this path for retries. Since we kill and reget the
command each time, the retries decrement is never seen, so we're
retrying forever.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f9026d08532a..0c6924eecf59 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -140,14 +140,12 @@ static void scsi_unprep_request(struct request *req) | |||
140 | * commands. | 140 | * commands. |
141 | * Notes: This could be called either from an interrupt context or a | 141 | * Notes: This could be called either from an interrupt context or a |
142 | * normal process context. | 142 | * normal process context. |
143 | * Notes: Upon return, cmd is a stale pointer. | ||
144 | */ | 143 | */ |
145 | int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) | 144 | int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) |
146 | { | 145 | { |
147 | struct Scsi_Host *host = cmd->device->host; | 146 | struct Scsi_Host *host = cmd->device->host; |
148 | struct scsi_device *device = cmd->device; | 147 | struct scsi_device *device = cmd->device; |
149 | struct request_queue *q = device->request_queue; | 148 | struct request_queue *q = device->request_queue; |
150 | struct request *req = cmd->request; | ||
151 | unsigned long flags; | 149 | unsigned long flags; |
152 | 150 | ||
153 | SCSI_LOG_MLQUEUE(1, | 151 | SCSI_LOG_MLQUEUE(1, |
@@ -188,9 +186,8 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) | |||
188 | * function. The SCSI request function detects the blocked condition | 186 | * function. The SCSI request function detects the blocked condition |
189 | * and plugs the queue appropriately. | 187 | * and plugs the queue appropriately. |
190 | */ | 188 | */ |
191 | scsi_unprep_request(req); | ||
192 | spin_lock_irqsave(q->queue_lock, flags); | 189 | spin_lock_irqsave(q->queue_lock, flags); |
193 | blk_requeue_request(q, req); | 190 | blk_requeue_request(q, cmd->request); |
194 | spin_unlock_irqrestore(q->queue_lock, flags); | 191 | spin_unlock_irqrestore(q->queue_lock, flags); |
195 | 192 | ||
196 | scsi_run_queue(q); | 193 | scsi_run_queue(q); |