From e0cb3af529f3c97942ceb911ca9a1a1cb1d417a1 Mon Sep 17 00:00:00 2001 From: sos Date: Sun, 12 Oct 2003 12:37:11 +0000 Subject: [PATCH] Put devices into sleep mode (ie spin down) on detach. --- sys/dev/ata/ata-all.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 64bf50a575ff..bc39b103ac84 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -197,12 +197,14 @@ ata_detach(device_t dev) if (ch->device[MASTER].param) { if (ch->device[MASTER].param->support.command2 & ATA_SUPPORT_FLUSHCACHE) ata_controlcmd(&ch->device[MASTER], ATA_FLUSHCACHE, 0, 0, 0); + ata_controlcmd(&ch->device[MASTER], ATA_SLEEP, 0, 0, 0); free(ch->device[MASTER].param, M_ATA); ch->device[MASTER].param = NULL; } if (ch->device[SLAVE].param) { if (ch->device[SLAVE].param->support.command2 & ATA_SUPPORT_FLUSHCACHE) ata_controlcmd(&ch->device[SLAVE], ATA_FLUSHCACHE, 0, 0, 0); + ata_controlcmd(&ch->device[SLAVE], ATA_SLEEP, 0, 0, 0); free(ch->device[SLAVE].param, M_ATA); ch->device[SLAVE].param = NULL; }