[PATCH V3] PM / Domains: Remove intermediate states from the power off sequence
ulf.hansson at linaro.org
Thu Jun 18 00:02:10 PDT 2015
>> @@ -671,32 +475,29 @@ static int pm_genpd_runtime_suspend(struct device
>> if (IS_ERR(genpd))
>> return -EINVAL;
>> + /*
>> + * We can't allow to power off the PM domain if it holds an
>> + * device. That's because we use mutexes to protect data while
>> + * off and on the PM domain, thus we can't execute in atomic
>> + */
>> + if (dev->power.irq_safe)
>> + return -EBUSY;
> This check will prevent the device from being saved/stopped. This should
> be allowed. Its the mutex_lock(&genpd->lock) below that would be a
> problem, if the device is IRQ safe. But that happens only after the
> device is stopped.
Yes, as we discussed around your patch in .
Earlier we could invoke the ->stop|start() callbacks for an IRQ
safe device. This version of $subject patch prevents that.
I am working on a v4, that brings back that functionality, but we can
actually do more. As from the changes in $subject patch, we don't need
to hold the mutex while invoking the runtime PM callbacks for a
device. This enables us to invoke them for IRQ safe devices, yet
another positive side effect.
> I am inclined to think that the existing check below is the correct
> place to check. Let me know if I am missing something.
You are correct.
Still, as I intend to invoke the runtime PM callbacks for IRQ safe
devices some minor change is also needed in pm_genpd_runtime_resume().
More information about the linux-arm-kernel