[PATCH] the latest consensus libata resume fix
authorMark Lord <liml@rtr.ca>
Sun, 28 May 2006 15:28:00 +0000 (11:28 -0400)
committerJeff Garzik <jeff@garzik.org>
Sun, 28 May 2006 20:32:08 +0000 (16:32 -0400)
Okay, just to sum things up.

This forces libata to wait for up to 2 seconds for BUSY|DRQ to clear
on resume before continuing.

[jgarzik adds...]  During testing we never saw DRQ asserted, but
nonetheless (a) this works and (b) testing for DRQ won't hurt.

Signed-off-by: Mark Lord <liml@rtr.ca>
Acked-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/scsi/libata-core.c

index fa476e7e0a480c52f2808b721e3c465eb1ba5fc3..b046ffa22101ccb3c8cbc9c6d6453abd8ef20e4d 100644 (file)
@@ -4297,6 +4297,7 @@ static int ata_start_drive(struct ata_port *ap, struct ata_device *dev)
 int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
 {
        if (ap->flags & ATA_FLAG_SUSPENDED) {
+               ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000);
                ap->flags &= ~ATA_FLAG_SUSPENDED;
                ata_set_mode(ap);
        }