From 3559734ceeb3176b949ac185ec2a5f4656172be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Fri, 14 Apr 2006 16:25:42 +0000 Subject: [PATCH] Dont poll for ATA_IDLE on a detached channel in suspend. --- sys/dev/ata/ata-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index b68cbe95922..e9cffe173a7 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -277,8 +277,8 @@ ata_suspend(device_t dev) if (!dev || !(ch = device_get_softc(dev))) return ENXIO; - /* wait for the channel to be IDLE before entering suspend mode */ - while (1) { + /* wait for the channel to be IDLE or detached before suspending */ + while (ch->r_irq) { mtx_lock(&ch->state_mtx); if (ch->state == ATA_IDLE) { ch->state = ATA_ACTIVE;