From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH v2 1/5] ACPI: Enable driver and firmware hints to control power at probe time
Date: Mon, 26 Aug 2019 13:29:07 +0300 [thread overview]
Message-ID: <20190826102907.GP31967@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20190826084634.GB1095@kroah.com>
Hi Greg,
Thanks for the comments.
On Mon, Aug 26, 2019 at 10:46:34AM +0200, Greg Kroah-Hartman wrote:
> On Mon, Aug 26, 2019 at 11:31:08AM +0300, Sakari Ailus wrote:
> > Allow drivers and firmware tell ACPI that there's no need to power on a
> > device for probe. This requires both a hint from the firmware as well as
> > an indication from a driver to leave the device off.
> >
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> > drivers/acpi/device_pm.c | 15 +++++++++++++--
> > include/linux/device.h | 7 +++++++
> > 2 files changed, 20 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
> > index f616b16c1f0be..adcdf78ce4de8 100644
> > --- a/drivers/acpi/device_pm.c
> > +++ b/drivers/acpi/device_pm.c
> > @@ -1276,7 +1276,12 @@ static void acpi_dev_pm_detach(struct device *dev, bool power_off)
> > if (adev && dev->pm_domain == &acpi_general_pm_domain) {
> > dev_pm_domain_set(dev, NULL);
> > acpi_remove_pm_notifier(adev);
> > - if (power_off) {
> > + if (power_off
> > +#ifdef CONFIG_PM
> > + && !(dev->driver->probe_low_power &&
> > + device_property_present(dev, "probe-low-power"))
> > +#endif
>
> As proof of the "only a bus-specific thing", why is probe_low_power even
> needed? Why not just always trigger off of this crazy device_property?
> That makes the driver changes less.
That's an option, too, but firmware having this property for a device the
driver of which doesn't expect it will fail to power on the device for
probe. This leaves some room for unexpected failures that admittedly are
easy to fix, but could be harder to debug.
>
> Also, is this #ifdef really needed?
I thought it was but it seems if CONFIG_PM is disabled,
dev_pm_domain_attach() has a nop implementation. So I agree it is not.
--
Regards,
Sakari Ailus
sakari.ailus@linux.intel.com
next prev parent reply other threads:[~2019-08-26 10:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 8:31 [PATCH v2 0/5] Support running driver's probe for a device powered off Sakari Ailus
2019-08-26 8:31 ` [PATCH v2 1/5] ACPI: Enable driver and firmware hints to control power at probe time Sakari Ailus
2019-08-26 8:43 ` Greg Kroah-Hartman
2019-08-26 10:32 ` Sakari Ailus
2019-08-26 13:34 ` Greg Kroah-Hartman
2019-08-26 13:51 ` Sakari Ailus
2019-08-28 8:55 ` Rafael J. Wysocki
2019-08-28 9:57 ` Sakari Ailus
2019-08-28 12:35 ` Rafael J. Wysocki
2019-08-26 8:46 ` Greg Kroah-Hartman
2019-08-26 10:29 ` Sakari Ailus [this message]
2019-08-26 8:31 ` [PATCH v2 2/5] ACPI: Add a convenience function to tell a device is suspended in probe Sakari Ailus
2019-08-26 8:31 ` [PATCH v2 3/5] ov5670: Support probe whilst the device is in a low power state Sakari Ailus
2019-08-26 8:31 ` [PATCH v2 4/5] media: i2c: imx319: Support probe while the device is off Sakari Ailus
2019-08-26 8:31 ` [PATCH v2 5/5] at24: Support probing while off Sakari Ailus
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=20190826102907.GP31967@paasikivi.fi.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox