ACPI S3 and S5 Problem with HDD on ThinkPad R40
Daniel Thiele
dthiele at gmx.net
Mon Feb 13 10:54:22 PST 2006
Daniel Thiele wrote:
> Daniel Thiele wrote:
>> Rechistov Grigory wrote:
>>> I've heard about some commands (atacontrol ?) which allow to spin
>>> down hard drive, so maybe we should just put them in shutdown script?
>>>
>>
>> You can use ataidle (sysutils/ataidle) to put a HDD into idle or standby
>> mode, but putting that command into /etc/rc.shutdown will AFAIK not work
>> since /etc/rc.shutdown is called before the kernel syncs the disks at
>> the end of its shutdown process. So if you put them into standby mode
>> before they will spin up again for this final syncing.
>>
>> I do not know if it is possible and/or reasonable to do all the things
>> that ataidle does to put a HDD into standby mode somewhere after the
>> disks are synced in the shutdown and suspend actions the kernel does.
>
>
> Hi,
>
> I have a solution for the problem or at least for the S5 power off
> problem to be precise. I simply looked at the ataidle source code and
> added the standby part from ataidle to the ata driver's shutdown
> function. To do this just change ad_shutdown() in
> /usr/src/sys/dev/ata/ata-disk.c from this:
>
>
> static void
> ad_shutdown(device_t dev)
> {
> struct ata_device *atadev = device_get_softc(dev);
>
> if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE)
> ata_controlcmd(dev, ATA_FLUSHCACHE, 0, 0, 0);
> }
>
>
> to this:
>
>
> static void
> ad_shutdown(device_t dev)
> {
> struct ata_device *atadev = device_get_softc(dev);
>
> if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE)
> ata_controlcmd(dev, ATA_FLUSHCACHE, 0, 0, 0);
>
> if (atadev->param.support.command2 & ATA_SUPPORT_STANDBY)
> ata_controlcmd(dev, ATA_STANDBY_IMMEDIATE, 0, 0, 0);
> }
>
>
And recompile and reinstall the kernel, of course. (sorry I forgot that
in my previous email)
More information about the freebsd-acpi
mailing list