ide: fix suspend regression

On Monday 12 January 2009, Simon Holm Thøgersen wrote:
> commit 295f0004 ("ide: don't execute the next queued command from the
> hard-IRQ context (v2)") breaks suspend to disk for me. On
> 'echo disk > /sys/power/state' the systems hangs, letting me switch
> virtual consoles, but not responding to Alt+SysRq

Restart the request queue early for REQ_TYPE_PM_RESUME requests
(though there is only one resume request for the whole resume
sequence it stays in the queue until is fully completed and now
depends on kblockd for processing consequential resume states).
Reported-and-bisected-by: default avatarSimon Holm Thøgersen <odie@cs.aau.dk>
Tested-by: default avatarSimon Holm Thøgersen <odie@cs.aau.dk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent a294d977
...@@ -186,12 +186,10 @@ void ide_complete_pm_request(ide_drive_t *drive, struct request *rq) ...@@ -186,12 +186,10 @@ void ide_complete_pm_request(ide_drive_t *drive, struct request *rq)
blk_pm_suspend_request(rq) ? "suspend" : "resume"); blk_pm_suspend_request(rq) ? "suspend" : "resume");
#endif #endif
spin_lock_irqsave(q->queue_lock, flags); spin_lock_irqsave(q->queue_lock, flags);
if (blk_pm_suspend_request(rq)) { if (blk_pm_suspend_request(rq))
blk_stop_queue(q); blk_stop_queue(q);
} else { else
drive->dev_flags &= ~IDE_DFLAG_BLOCKED; drive->dev_flags &= ~IDE_DFLAG_BLOCKED;
blk_start_queue(q);
}
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
drive->hwif->rq = NULL; drive->hwif->rq = NULL;
...@@ -219,6 +217,8 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq) ...@@ -219,6 +217,8 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
* point. * point.
*/ */
ide_hwif_t *hwif = drive->hwif; ide_hwif_t *hwif = drive->hwif;
struct request_queue *q = drive->queue;
unsigned long flags;
int rc; int rc;
#ifdef DEBUG_PM #ifdef DEBUG_PM
printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name); printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name);
...@@ -231,5 +231,9 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq) ...@@ -231,5 +231,9 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
rc = ide_wait_not_busy(hwif, 100000); rc = ide_wait_not_busy(hwif, 100000);
if (rc) if (rc)
printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
spin_lock_irqsave(q->queue_lock, flags);
blk_start_queue(q);
spin_unlock_irqrestore(q->queue_lock, flags);
} }
} }
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