Thread (6 messages) 6 messages, 3 authors, 2017-02-02

Re: [PATCH] PM / Domains: Correct comment in irq_safe_dev_in_no_sleep_domain()

From: Ulf Hansson <hidden>
Date: 2017-01-31 16:41:42

On 31 January 2017 at 17:17, Geert Uytterhoeven [off-list ref] wrote:
Hi Ulf,

On Tue, Jan 31, 2017 at 5:01 PM, Ulf Hansson [off-list ref] wrote:
quoted
The earlier comment stated that the dev_warn_once() was going to be printed
once per device. Let's fix that, as dev_warn_once() is printed only once,
no matter of the device.
While I agree this makes the comment match the code, I think we would serve
the users better by printing the warning once per PM domain.
Currently the user cannot know if two or more PM domains cannot be powered
off due to IRQ safe devices.
Right.
Perhaps a flag can be added to generic_pm_domain.flags to remember
that the warning has been printed before?
That seems like a reasonable adjustment. Allow me to cook a patch on
top of this one.

Moreover, I was thinking of considering to check for always on domains
and perhaps skip printing this message in such cases. Would that make
sense as well?

Kind regards
Uffe
quoted
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Ulf Hansson <redacted>
---
 drivers/base/power/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 6b23d82..271e208 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -130,7 +130,7 @@ static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev,

        ret = pm_runtime_is_irq_safe(dev) && !genpd_is_irq_safe(genpd);

-       /* Warn once for each IRQ safe dev in no sleep domain */
+       /* Warn once if IRQ safe dev in no sleep domain */
        if (ret)
                dev_warn_once(dev, "PM domain %s will not be powered off\n",
                                genpd->name);
Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help