Skip to content

Commit 7a02444

Browse files
Ulf Hanssonrafaeljw
authored andcommitted
PM: domains: Rename irq_safe_dev_in_no_sleep_domain() in genpd
The name "irq_safe_dev_in_no_sleep_domain", doesn't really match the conditions that are being checked in the function, hence the code becomes a bit confusing to read. Let's clarify this by renaming it into "irq_safe_dev_in_sleep_domain" and let's also take the opportunity to clarify a corresponding comment in the code. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 3f9ee7d commit 7a02444

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/base/power/domain.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,17 @@ static const struct genpd_lock_ops genpd_spin_ops = {
131131
#define genpd_is_cpu_domain(genpd) (genpd->flags & GENPD_FLAG_CPU_DOMAIN)
132132
#define genpd_is_rpm_always_on(genpd) (genpd->flags & GENPD_FLAG_RPM_ALWAYS_ON)
133133

134-
static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev,
134+
static inline bool irq_safe_dev_in_sleep_domain(struct device *dev,
135135
const struct generic_pm_domain *genpd)
136136
{
137137
bool ret;
138138

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

141141
/*
142-
* Warn once if an IRQ safe device is attached to a no sleep domain, as
143-
* to indicate a suboptimal configuration for PM. For an always on
144-
* domain this isn't case, thus don't warn.
142+
* Warn once if an IRQ safe device is attached to a domain, which
143+
* callbacks are allowed to sleep. This indicates a suboptimal
144+
* configuration for PM, but it doesn't matter for an always on domain.
145145
*/
146146
if (ret && !genpd_is_always_on(genpd))
147147
dev_warn_once(dev, "PM domain %s will not be powered off\n",
@@ -653,7 +653,7 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
653653
* device is part of a non-IRQ safe domain.
654654
*/
655655
if (!pm_runtime_suspended(pdd->dev) ||
656-
irq_safe_dev_in_no_sleep_domain(pdd->dev, genpd))
656+
irq_safe_dev_in_sleep_domain(pdd->dev, genpd))
657657
not_suspended++;
658658
}
659659

@@ -925,7 +925,7 @@ static int genpd_runtime_suspend(struct device *dev)
925925
* If power.irq_safe is set, this routine may be run with
926926
* IRQs disabled, so suspend only if the PM domain also is irq_safe.
927927
*/
928-
if (irq_safe_dev_in_no_sleep_domain(dev, genpd))
928+
if (irq_safe_dev_in_sleep_domain(dev, genpd))
929929
return 0;
930930

931931
genpd_lock(genpd);
@@ -965,7 +965,7 @@ static int genpd_runtime_resume(struct device *dev)
965965
* As we don't power off a non IRQ safe domain, which holds
966966
* an IRQ safe device, we don't need to restore power to it.
967967
*/
968-
if (irq_safe_dev_in_no_sleep_domain(dev, genpd)) {
968+
if (irq_safe_dev_in_sleep_domain(dev, genpd)) {
969969
timed = false;
970970
goto out;
971971
}

0 commit comments

Comments
 (0)