linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] thermal/core: Disable uevent messages for cooling devices
@ 2022-07-10 16:40 Roman Stratiienko
  2024-04-08 18:48 ` John Stultz
  0 siblings, 1 reply; 5+ messages in thread
From: Roman Stratiienko @ 2022-07-10 16:40 UTC (permalink / raw)
  To: linux-pm
  Cc: rafael, daniel.lezcano, amitk, rui.zhang, linux-kernel, megi,
	Roman Stratiienko

During suspend, the big CPU cluster is turned off first while a little
is still running. This forcibly unregisters the cooling device which
sends a "REMOVE" uevent to all subscribers [1].

In case userspace netlink subscriber has set the EPOLLWAKEUP flag, a
wakeup event is triggered that causes suspend to be aborted.

Without this change, suspend doesn't work on PinePhone PRO with AOSP
userland.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5c238a8b599f1ae25eaeb08ad0e9e13e2b9eb023
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
---
 drivers/thermal/thermal_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index cdc0552e8c42e..e6b21f2792a85 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -925,6 +925,7 @@ __thermal_cooling_device_register(struct device_node *np,
 	cdev->device.class = &thermal_class;
 	cdev->devdata = devdata;
 	thermal_cooling_device_setup_sysfs(cdev);
+	dev_set_uevent_suppress(&cdev->device, true);
 	ret = device_register(&cdev->device);
 	if (ret)
 		goto out_kfree_type;
-- 
2.34.1


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

* Re: [RFC] thermal/core: Disable uevent messages for cooling devices
  2022-07-10 16:40 [RFC] thermal/core: Disable uevent messages for cooling devices Roman Stratiienko
@ 2024-04-08 18:48 ` John Stultz
  2024-04-08 18:59   ` Roman Stratiienko
  0 siblings, 1 reply; 5+ messages in thread
From: John Stultz @ 2024-04-08 18:48 UTC (permalink / raw)
  To: Roman Stratiienko
  Cc: linux-pm, rafael, daniel.lezcano, amitk, rui.zhang, linux-kernel, megi

On Sun, Jul 10, 2022 at 9:40 AM Roman Stratiienko
<r.stratiienko@gmail.com> wrote:
>
> During suspend, the big CPU cluster is turned off first while a little
> is still running. This forcibly unregisters the cooling device which
> sends a "REMOVE" uevent to all subscribers [1].
>
> In case userspace netlink subscriber has set the EPOLLWAKEUP flag, a
> wakeup event is triggered that causes suspend to be aborted.
>
> Without this change, suspend doesn't work on PinePhone PRO with AOSP
> userland.
>
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5c238a8b599f1ae25eaeb08ad0e9e13e2b9eb023
> Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>

Hey Roman,
  I wanted to drudge this patch up, to ask what the current status of
it was?  Is there an alternative solution that you've been using since
this was last sent out?
I've heard of some vendors working around something similar, so I
wanted to see if we could get a common fix upstream.

thanks
-john

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

* Re: [RFC] thermal/core: Disable uevent messages for cooling devices
  2024-04-08 18:48 ` John Stultz
@ 2024-04-08 18:59   ` Roman Stratiienko
  2024-04-08 19:03     ` John Stultz
  0 siblings, 1 reply; 5+ messages in thread
From: Roman Stratiienko @ 2024-04-08 18:59 UTC (permalink / raw)
  To: John Stultz
  Cc: linux-pm, rafael, daniel.lezcano, amitk, rui.zhang, linux-kernel, megi

Hi John,

I haven't worked on it since I posted it initially. But it looks like
there's an alternative patch already upstreamed and backported into
stable:

https://lore.kernel.org/linux-kernel/CAJZ5v0hHTuEXmQA=0D90eR_KUsOsfcxYbTS=zQYDTXuY6o_K_Q@mail.gmail.com/T/

BR,
Roman

пн, 8 апр. 2024 г. в 21:48, John Stultz <jstultz@google.com>:
>
> On Sun, Jul 10, 2022 at 9:40 AM Roman Stratiienko
> <r.stratiienko@gmail.com> wrote:
> >
> > During suspend, the big CPU cluster is turned off first while a little
> > is still running. This forcibly unregisters the cooling device which
> > sends a "REMOVE" uevent to all subscribers [1].
> >
> > In case userspace netlink subscriber has set the EPOLLWAKEUP flag, a
> > wakeup event is triggered that causes suspend to be aborted.
> >
> > Without this change, suspend doesn't work on PinePhone PRO with AOSP
> > userland.
> >
> > [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5c238a8b599f1ae25eaeb08ad0e9e13e2b9eb023
> > Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
>
> Hey Roman,
>   I wanted to drudge this patch up, to ask what the current status of
> it was?  Is there an alternative solution that you've been using since
> this was last sent out?
> I've heard of some vendors working around something similar, so I
> wanted to see if we could get a common fix upstream.
>
> thanks
> -john

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

* Re: [RFC] thermal/core: Disable uevent messages for cooling devices
  2024-04-08 18:59   ` Roman Stratiienko
@ 2024-04-08 19:03     ` John Stultz
  2024-04-08 19:38       ` John Stultz
  0 siblings, 1 reply; 5+ messages in thread
From: John Stultz @ 2024-04-08 19:03 UTC (permalink / raw)
  To: Roman Stratiienko
  Cc: linux-pm, rafael, daniel.lezcano, amitk, rui.zhang, linux-kernel, megi

On Mon, Apr 8, 2024 at 11:59 AM Roman Stratiienko
<r.stratiienko@gmail.com> wrote:
>
> I haven't worked on it since I posted it initially. But it looks like
> there's an alternative patch already upstreamed and backported into
> stable:
>
> https://lore.kernel.org/linux-kernel/CAJZ5v0hHTuEXmQA=0D90eR_KUsOsfcxYbTS=zQYDTXuY6o_K_Q@mail.gmail.com/T/

Ah! Many thanks for the link! I'll check in with folks to better
understand if there is a functionality gap between what you submitted
and what landed upstream.

Thanks again!
-john

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

* Re: [RFC] thermal/core: Disable uevent messages for cooling devices
  2024-04-08 19:03     ` John Stultz
@ 2024-04-08 19:38       ` John Stultz
  0 siblings, 0 replies; 5+ messages in thread
From: John Stultz @ 2024-04-08 19:38 UTC (permalink / raw)
  To: Roman Stratiienko
  Cc: linux-pm, rafael, daniel.lezcano, amitk, rui.zhang, linux-kernel, megi

On Mon, Apr 8, 2024 at 12:03 PM John Stultz <jstultz@google.com> wrote:
>
> On Mon, Apr 8, 2024 at 11:59 AM Roman Stratiienko
> <r.stratiienko@gmail.com> wrote:
> >
> > I haven't worked on it since I posted it initially. But it looks like
> > there's an alternative patch already upstreamed and backported into
> > stable:
> >
> > https://lore.kernel.org/linux-kernel/CAJZ5v0hHTuEXmQA=0D90eR_KUsOsfcxYbTS=zQYDTXuY6o_K_Q@mail.gmail.com/T/
>
> Ah! Many thanks for the link! I'll check in with folks to better
> understand if there is a functionality gap between what you submitted
> and what landed upstream.

Ah. Looks like it maybe hasn't landed in -stable yet.

Thanks again for the pointer!
-john

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

end of thread, other threads:[~2024-04-08 19:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-10 16:40 [RFC] thermal/core: Disable uevent messages for cooling devices Roman Stratiienko
2024-04-08 18:48 ` John Stultz
2024-04-08 18:59   ` Roman Stratiienko
2024-04-08 19:03     ` John Stultz
2024-04-08 19:38       ` John Stultz

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).