>Why do we bother with the "acpi_bus_get_power" at all?  The problem
>Matthew is seeing wouldn't happen at all if we just deleted everything
>in the force_power_state block.
>
>Then we could execute _ON, _PS0, etc for a device that is already on.
>Does that cause bad things to happen?  I assume the fan probably works
>as desired under Windows, so they probably do something like this.

This would work for _PSx (if device power states are controlled via _PSx
methods, we should only execute method, defined for desired power
state), but if power states are controlled via power resources, we
should execute _ON method of power resource, assigned for desired state
AND _OFF method of power resource, assigned for the current power state,
so we cannot just ignore the current device power state.


Regards.
Konstantin.

>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:linux-acpi-
>[EMAIL PROTECTED] On Behalf Of Bjorn Helgaas
>Sent: Tuesday, January 16, 2007 7:54 PM
>To: Karasyov, Konstantin A
>Cc: Alexey Starikovskiy; Matthew Brett; Salatiel Filho; linux-
>[EMAIL PROTECTED]
>Subject: Re: PROBLEM: CPU fan shuts down on load of fan.ko in kernel
2.6.18
>and later
>
>On Monday 15 January 2007 06:33, Karasyov, Konstantin A wrote:
>> The fan device FAN1 defines object FN01 as its power resource. _STA
>> method of FN01 always return 0x01, i.e. resource is on. So the fan
>> driver is unable to turn the fan on, because it thinks that it is
>> already in that state.
>
>The code looks like this:
>
>    int acpi_bus_set_power(acpi_handle handle, int state)
>    {
>       ...
>       if (!device->flags.force_power_state) {
>               if (device->power.state == ACPI_STATE_UNKNOWN)
>                       acpi_bus_get_power(device->handle,
&device->power.state)
>               if (state == device->power.state) {
>                       return 0;       /* already at desired state */
>       }
>       ...
>       acpi_power_transition(device, state);
>
>Why do we bother with the "acpi_bus_get_power" at all?  The problem
>Matthew is seeing wouldn't happen at all if we just deleted everything
>in the force_power_state block.
>
>Then we could execute _ON, _PS0, etc for a device that is already on.
>Does that cause bad things to happen?  I assume the fan probably works
>as desired under Windows, so they probably do something like this.
>
>Bjorn
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-acpi"
in
>the body of a message to [EMAIL PROTECTED]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to