From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux PM list <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI / PM: Fix PM initialization for devices that are not present
Date: Mon, 5 Jan 2015 15:40:10 +0200 [thread overview]
Message-ID: <20150105134010.GF1386@lahna.fi.intel.com> (raw)
In-Reply-To: <4453924.d7c5RYZUJi@vostro.rjw.lan>
On Thu, Jan 01, 2015 at 11:38:28PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> If an ACPI device object whose _STA returns 0 (not present and not
> functional) has _PR0 or _PS0, its power_manageable flag will be set
> and acpi_bus_init_power() will return 0 for it. Consequently, if
> such a device object is passed to the ACPI device PM functions, they
> will attempt to carry out the requested operation on the device,
> although they should not do that for devices that are not present.
>
> To fix that problem make acpi_bus_init_power() return an error code
> for devices that are not present which will cause power_manageable to
> be cleared for them as appropriate in acpi_bus_get_power_flags().
> However, the lists of power resources should not be freed for the
> device in that case, so modify acpi_bus_get_power_flags() to keep
> those lists even if acpi_bus_init_power() returns an error.
> Accordingly, when deciding whether or not the lists of power
> resources need to be freed, acpi_free_power_resources_lists()
> should check the power.flags.power_resources flag instead of
> flags.power_manageable, so make that change too.
>
> Furthermore, if acpi_bus_attach() sees that flags.initialized is
> unset for the given device, it should reset the power management
> settings of the device and re-initialize them from scratch instead
> of relying on the previous settings (the device may have appeared
> after being not present previously, for example), so make it use
> the 'valid' flag of the D0 power state as the initial value of
> flags.power_manageable for it and call acpi_bus_init_power() to
> discover its current power state.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
prev parent reply other threads:[~2015-01-05 13:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-01 22:38 [PATCH] ACPI / PM: Fix PM initialization for devices that are not present Rafael J. Wysocki
2015-01-05 13:40 ` Mika Westerberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150105134010.GF1386@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.