Commit 59897dad authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

[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: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent d39a942c
...@@ -140,14 +140,12 @@ static void scsi_unprep_request(struct request *req) ...@@ -140,14 +140,12 @@ static void scsi_unprep_request(struct request *req)
* commands. * commands.
* Notes: This could be called either from an interrupt context or a * Notes: This could be called either from an interrupt context or a
* normal process context. * normal process context.
* Notes: Upon return, cmd is a stale pointer.
*/ */
int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) int scsi_queue_insert(struct scsi_cmnd *cmd, int reason)
{ {
struct Scsi_Host *host = cmd->device->host; struct Scsi_Host *host = cmd->device->host;
struct scsi_device *device = cmd->device; struct scsi_device *device = cmd->device;
struct request_queue *q = device->request_queue; struct request_queue *q = device->request_queue;
struct request *req = cmd->request;
unsigned long flags; unsigned long flags;
SCSI_LOG_MLQUEUE(1, SCSI_LOG_MLQUEUE(1,
...@@ -188,9 +186,8 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) ...@@ -188,9 +186,8 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason)
* function. The SCSI request function detects the blocked condition * function. The SCSI request function detects the blocked condition
* and plugs the queue appropriately. * and plugs the queue appropriately.
*/ */
scsi_unprep_request(req);
spin_lock_irqsave(q->queue_lock, flags); spin_lock_irqsave(q->queue_lock, flags);
blk_requeue_request(q, req); blk_requeue_request(q, cmd->request);
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
scsi_run_queue(q); scsi_run_queue(q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment