mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] PM: sleep: Fix bit masking operation
@ 2025-03-19 11:43 Colin Ian King
  2025-03-22 14:08 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-03-19 11:43 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, linux-pm
  Cc: kernel-janitors, Ulf Hansson, Bjorn Helgaas, linux-kernel

The mask operation link->flags | DL_FLAG_PM_RUNTIME is always true which
is incorrect. The mask operation should be using the bit-wise &
operator. Fix this.

Fixes: bca84a7b93fd ("PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/base/power/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index ad50018b8047..ac2a197c1234 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1836,7 +1836,7 @@ static bool device_prepare_smart_suspend(struct device *dev)
 	idx = device_links_read_lock();
 
 	list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) {
-		if (!(link->flags | DL_FLAG_PM_RUNTIME))
+		if (!(link->flags & DL_FLAG_PM_RUNTIME))
 			continue;
 
 		if (!dev_pm_smart_suspend(link->supplier) &&
-- 
2.49.0


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

* Re: [PATCH][next] PM: sleep: Fix bit masking operation
  2025-03-19 11:43 [PATCH][next] PM: sleep: Fix bit masking operation Colin Ian King
@ 2025-03-22 14:08 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-03-22 14:08 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Rafael J . Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, linux-pm, kernel-janitors, Ulf Hansson,
	Bjorn Helgaas, linux-kernel

On Wed, Mar 19, 2025 at 12:44 PM Colin Ian King <colin.i.king@gmail.com> wrote:
>
> The mask operation link->flags | DL_FLAG_PM_RUNTIME is always true which
> is incorrect. The mask operation should be using the bit-wise &
> operator. Fix this.
>
> Fixes: bca84a7b93fd ("PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/base/power/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index ad50018b8047..ac2a197c1234 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -1836,7 +1836,7 @@ static bool device_prepare_smart_suspend(struct device *dev)
>         idx = device_links_read_lock();
>
>         list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) {
> -               if (!(link->flags | DL_FLAG_PM_RUNTIME))
> +               if (!(link->flags & DL_FLAG_PM_RUNTIME))
>                         continue;
>
>                 if (!dev_pm_smart_suspend(link->supplier) &&
> --

Ouch, thanks for the fix!

Applied.

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

end of thread, other threads:[~2025-03-22 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-19 11:43 [PATCH][next] PM: sleep: Fix bit masking operation Colin Ian King
2025-03-22 14:08 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®