linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm
@ 2025-08-28 10:55 Rafael J. Wysocki
  2025-08-28 10:56 ` [PATCH v1 1/2] driver core: faux: Set power.no_pm for faux devices Rafael J. Wysocki
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2025-08-28 10:55 UTC (permalink / raw)
  To: Linux PM; +Cc: Greg Kroah-Hartman, LKML, Sudeep Holla, Danilo Krummrich

Hi All,

Applying this series will cause power.no_pm to be set for faux devices (so they
don't get processed unnecessarily during system-wide suspend/resume transitions)
and power.no_callbacks to be set along with power.no_pm (for consistency).

Thanks!




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v1 1/2] driver core: faux: Set power.no_pm for faux devices
  2025-08-28 10:55 [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Rafael J. Wysocki
@ 2025-08-28 10:56 ` Rafael J. Wysocki
  2025-08-28 10:59 ` [PATCH v1 2/2] driver core/PM: Set power.no_callbacks along with power.no_pm Rafael J. Wysocki
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2025-08-28 10:56 UTC (permalink / raw)
  To: Linux PM; +Cc: Greg Kroah-Hartman, LKML, Sudeep Holla, Danilo Krummrich

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Since faux devices are not supposed to be involved in any kind of
power management, set the no_pm flag for all of them.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/base/faux.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/base/faux.c
+++ b/drivers/base/faux.c
@@ -155,6 +155,7 @@
 		dev->parent = &faux_bus_root;
 	dev->bus = &faux_bus_type;
 	dev_set_name(dev, "%s", name);
+	device_set_pm_not_required(dev);
 
 	ret = device_add(dev);
 	if (ret) {




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v1 2/2] driver core/PM: Set power.no_callbacks along with power.no_pm
  2025-08-28 10:55 [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Rafael J. Wysocki
  2025-08-28 10:56 ` [PATCH v1 1/2] driver core: faux: Set power.no_pm for faux devices Rafael J. Wysocki
@ 2025-08-28 10:59 ` Rafael J. Wysocki
  2025-08-28 11:07 ` [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Greg Kroah-Hartman
  2025-08-28 12:41 ` Sudeep Holla
  3 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2025-08-28 10:59 UTC (permalink / raw)
  To: Linux PM; +Cc: Greg Kroah-Hartman, LKML, Sudeep Holla, Danilo Krummrich

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Devices with power.no_pm set are not expected to need any power
management at all, so modify device_set_pm_not_required() to set
power.no_callbacks for them too in case runtime PM will be enabled
for any of them (which in principle may be done for convenience if
such a device participates in a dependency chain).

Since device_set_pm_not_required() must be called before device_add()
or it would not have any effect, it can update power.no_callbacks
without locking, unlike pm_runtime_no_callbacks() that can be called
after registering the target device.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 include/linux/device.h |    3 +++
 1 file changed, 3 insertions(+)

--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -851,6 +851,9 @@
 static inline void device_set_pm_not_required(struct device *dev)
 {
 	dev->power.no_pm = true;
+#ifdef CONFIG_PM
+	dev->power.no_callbacks = true;
+#endif
 }
 
 static inline void dev_pm_syscore_device(struct device *dev, bool val)




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm
  2025-08-28 10:55 [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Rafael J. Wysocki
  2025-08-28 10:56 ` [PATCH v1 1/2] driver core: faux: Set power.no_pm for faux devices Rafael J. Wysocki
  2025-08-28 10:59 ` [PATCH v1 2/2] driver core/PM: Set power.no_callbacks along with power.no_pm Rafael J. Wysocki
@ 2025-08-28 11:07 ` Greg Kroah-Hartman
  2025-08-28 11:20   ` Rafael J. Wysocki
  2025-08-28 12:41 ` Sudeep Holla
  3 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2025-08-28 11:07 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux PM, LKML, Sudeep Holla, Danilo Krummrich

On Thu, Aug 28, 2025 at 12:55:50PM +0200, Rafael J. Wysocki wrote:
> Hi All,
> 
> Applying this series will cause power.no_pm to be set for faux devices (so they
> don't get processed unnecessarily during system-wide suspend/resume transitions)
> and power.no_callbacks to be set along with power.no_pm (for consistency).

Oh, nice!  I forgot about that entirely.  Should these be backported to
older kernels as well?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm
  2025-08-28 11:07 ` [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Greg Kroah-Hartman
@ 2025-08-28 11:20   ` Rafael J. Wysocki
  2025-08-29 19:09     ` Rafael J. Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2025-08-28 11:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Linux PM, LKML, Sudeep Holla, Danilo Krummrich

On Thu, Aug 28, 2025 at 1:07 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Thu, Aug 28, 2025 at 12:55:50PM +0200, Rafael J. Wysocki wrote:
> > Hi All,
> >
> > Applying this series will cause power.no_pm to be set for faux devices (so they
> > don't get processed unnecessarily during system-wide suspend/resume transitions)
> > and power.no_callbacks to be set along with power.no_pm (for consistency).
>
> Oh, nice!  I forgot about that entirely.  Should these be backported to
> older kernels as well?

Doing it shouldn't hurt.

Cheers, Rafael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm
  2025-08-28 10:55 [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Rafael J. Wysocki
                   ` (2 preceding siblings ...)
  2025-08-28 11:07 ` [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Greg Kroah-Hartman
@ 2025-08-28 12:41 ` Sudeep Holla
  3 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2025-08-28 12:41 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux PM, Greg Kroah-Hartman, LKML, Danilo Krummrich

On Thu, Aug 28, 2025 at 12:55:50PM +0200, Rafael J. Wysocki wrote:
> Hi All,
> 
> Applying this series will cause power.no_pm to be set for faux devices (so they
> don't get processed unnecessarily during system-wide suspend/resume transitions)
> and power.no_callbacks to be set along with power.no_pm (for consistency).
> 

Nice, even I hadn't noticed about these before. The changes looks good
to me.

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm
  2025-08-28 11:20   ` Rafael J. Wysocki
@ 2025-08-29 19:09     ` Rafael J. Wysocki
  2025-09-03 11:33       ` Rafael J. Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2025-08-29 19:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Linux PM, LKML, Sudeep Holla, Danilo Krummrich

On Thu, Aug 28, 2025 at 1:20 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Thu, Aug 28, 2025 at 1:07 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Thu, Aug 28, 2025 at 12:55:50PM +0200, Rafael J. Wysocki wrote:
> > > Hi All,
> > >
> > > Applying this series will cause power.no_pm to be set for faux devices (so they
> > > don't get processed unnecessarily during system-wide suspend/resume transitions)
> > > and power.no_callbacks to be set along with power.no_pm (for consistency).
> >
> > Oh, nice!  I forgot about that entirely.  Should these be backported to
> > older kernels as well?

So do you want me to resend these patches with suitable Cc: stable tags?

Alternatively, I can just apply them with the tags and route them
through my tree, whatever you prefer.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm
  2025-08-29 19:09     ` Rafael J. Wysocki
@ 2025-09-03 11:33       ` Rafael J. Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2025-09-03 11:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Linux PM, LKML, Sudeep Holla, Danilo Krummrich

On Fri, Aug 29, 2025 at 9:09 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Thu, Aug 28, 2025 at 1:20 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Thu, Aug 28, 2025 at 1:07 PM Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Thu, Aug 28, 2025 at 12:55:50PM +0200, Rafael J. Wysocki wrote:
> > > > Hi All,
> > > >
> > > > Applying this series will cause power.no_pm to be set for faux devices (so they
> > > > don't get processed unnecessarily during system-wide suspend/resume transitions)
> > > > and power.no_callbacks to be set along with power.no_pm (for consistency).
> > >
> > > Oh, nice!  I forgot about that entirely.  Should these be backported to
> > > older kernels as well?
>
> So do you want me to resend these patches with suitable Cc: stable tags?
>
> Alternatively, I can just apply them with the tags and route them
> through my tree, whatever you prefer.

In the absence of more feedback, this is what I'm going to do.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-09-03 11:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 10:55 [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Rafael J. Wysocki
2025-08-28 10:56 ` [PATCH v1 1/2] driver core: faux: Set power.no_pm for faux devices Rafael J. Wysocki
2025-08-28 10:59 ` [PATCH v1 2/2] driver core/PM: Set power.no_callbacks along with power.no_pm Rafael J. Wysocki
2025-08-28 11:07 ` [PATCH v1 0/2] driver core/PM: Two updates related to power.no_pm Greg Kroah-Hartman
2025-08-28 11:20   ` Rafael J. Wysocki
2025-08-29 19:09     ` Rafael J. Wysocki
2025-09-03 11:33       ` Rafael J. Wysocki
2025-08-28 12:41 ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).