mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-19 23:03:55 +00:00
Put devices into sleep mode (ie spin down) on detach.
This commit is contained in:
parent
f27b8b8ad4
commit
c4c8a3e041
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121035
|
@ -197,12 +197,14 @@ ata_detach(device_t dev)
|
||||||
if (ch->device[MASTER].param) {
|
if (ch->device[MASTER].param) {
|
||||||
if (ch->device[MASTER].param->support.command2 & ATA_SUPPORT_FLUSHCACHE)
|
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_FLUSHCACHE, 0, 0, 0);
|
||||||
|
ata_controlcmd(&ch->device[MASTER], ATA_SLEEP, 0, 0, 0);
|
||||||
free(ch->device[MASTER].param, M_ATA);
|
free(ch->device[MASTER].param, M_ATA);
|
||||||
ch->device[MASTER].param = NULL;
|
ch->device[MASTER].param = NULL;
|
||||||
}
|
}
|
||||||
if (ch->device[SLAVE].param) {
|
if (ch->device[SLAVE].param) {
|
||||||
if (ch->device[SLAVE].param->support.command2 & ATA_SUPPORT_FLUSHCACHE)
|
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_FLUSHCACHE, 0, 0, 0);
|
||||||
|
ata_controlcmd(&ch->device[SLAVE], ATA_SLEEP, 0, 0, 0);
|
||||||
free(ch->device[SLAVE].param, M_ATA);
|
free(ch->device[SLAVE].param, M_ATA);
|
||||||
ch->device[SLAVE].param = NULL;
|
ch->device[SLAVE].param = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue