Re: [PATCH 1/6] ACPI: D3cold state is always valid

From: huang ying
Date: Tue Apr 17 2012 - 02:04:10 EST


On Tue, Apr 17, 2012 at 1:47 PM, Lin Ming <ming.m.lin@xxxxxxxxx> wrote:
> ACPI_STATE_D3 actually means ACPI D3hot which is not always valid.
> Instead, ACPI D3cold is always valid.
>
> Signed-off-by: Lin Ming <ming.m.lin@xxxxxxxxx>
> ---
> Âdrivers/acpi/scan.c | Â 11 ++---------
> Â1 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 767e2dc..fb56388 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -884,13 +884,6 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âacpi_bus_add_power_resource(ps->resources.handles[j]);
> Â Â Â Â Â Â Â Â}
>
> - Â Â Â Â Â Â Â /* The exist of _PR3 indicates D3Cold support */
> - Â Â Â Â Â Â Â if (i == ACPI_STATE_D3) {
> - Â Â Â Â Â Â Â Â Â Â Â status = acpi_get_handle(device->handle, object_name, &handle);
> - Â Â Â Â Â Â Â Â Â Â Â if (ACPI_SUCCESS(status))
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
> - Â Â Â Â Â Â Â }
> -
> Â Â Â Â Â Â Â Â/* Evaluate "_PSx" to see if we can do explicit sets */
> Â Â Â Â Â Â Â Âobject_name[2] = 'S';
> Â Â Â Â Â Â Â Âstatus = acpi_get_handle(device->handle, object_name, &handle);
> @@ -908,8 +901,8 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
> Â Â Â Â/* Set defaults for D0 and D3 states (always valid) */
> Â Â Â Âdevice->power.states[ACPI_STATE_D0].flags.valid = 1;
> Â Â Â Âdevice->power.states[ACPI_STATE_D0].power = 100;
> - Â Â Â device->power.states[ACPI_STATE_D3].flags.valid = 1;
> - Â Â Â device->power.states[ACPI_STATE_D3].power = 0;
> + Â Â Â device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
> + Â Â Â device->power.states[ACPI_STATE_D3_COLD].power = 0;
>
> Â Â Â Âacpi_bus_init_power(device);

I think D3_HOT should be always valid, while D3_COLD should be valid
for some situation.

- has _PS3, no _PR3
- support D3_HOT, D3_COLD
- set state
- D3_HOT: do nothing in ACPI
- D3_COLD: _PS3

- has _PR3, no _PS3
- support D3_HOT, D3_COLD
- set state
- D3_HOT: _PR3 on, _PR0 off
- D3_COLD: _PR3 on, _PR0 off, _PR3 off

- has _PS3, has _PR3
- support D3_HOT, D3_COLD
- set state
- D3_HOT: _PS3, _PR3 on, _PR0 off
- D3_COLD: _PS3, _PR3 on, _PR0 off, _PR3 off

- no _PS3, no _PR3
- support D3_HOT
- set state
- D3_HOT: do nothing in ACPI

Best Regards,
Huang Ying
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/