Message ID | 1413208930-26019-5-git-send-email-ulf.hansson@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Ulf Hansson <ulf.hansson@linaro.org> writes: > To sucessfully probe some devices their corresponding PM domains may > need to be powered. Isn't that what pm_runtime_get*() is supposed to be doing? Why isn't that working? Kevin -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Oct 30, 2014 at 01:47:27PM -0700, Kevin Hilman wrote: > Ulf Hansson <ulf.hansson@linaro.org> writes: > > > To sucessfully probe some devices their corresponding PM domains may > > need to be powered. > > Isn't that what pm_runtime_get*() is supposed to be doing? Why isn't > that working? Also, I do not understand why we placing device into a power domain only when we probe it. Why if I unbind device from its driver (or do not have a driver for it) it disappears from its power domain? To me power domain and having driver bound to a device are 2 orthogonal concepts. Thanks.
On 30 October 2014 21:47, Kevin Hilman <khilman@kernel.org> wrote: > Ulf Hansson <ulf.hansson@linaro.org> writes: > >> To sucessfully probe some devices their corresponding PM domains may >> need to be powered. > > Isn't that what pm_runtime_get*() is supposed to be doing? Why isn't > that working? Let stay at the discussion of the cover letter patch. I just replied to this there. Kind regards Uffe -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 31 October 2014 01:07, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote: > On Thu, Oct 30, 2014 at 01:47:27PM -0700, Kevin Hilman wrote: >> Ulf Hansson <ulf.hansson@linaro.org> writes: >> >> > To sucessfully probe some devices their corresponding PM domains may >> > need to be powered. >> >> Isn't that what pm_runtime_get*() is supposed to be doing? Why isn't >> that working? > > Also, I do not understand why we placing device into a power domain only > when we probe it. Why if I unbind device from its driver (or do not have > a driver for it) it disappears from its power domain? To me power domain > and having driver bound to a device are 2 orthogonal concepts. That's a different discussion, I don't think we want to go there within this context. Kind regards Uffe -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Friday, October 31, 2014 10:23:00 AM Ulf Hansson wrote: > On 31 October 2014 01:07, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote: > > On Thu, Oct 30, 2014 at 01:47:27PM -0700, Kevin Hilman wrote: > >> Ulf Hansson <ulf.hansson@linaro.org> writes: > >> > >> > To sucessfully probe some devices their corresponding PM domains may > >> > need to be powered. > >> > >> Isn't that what pm_runtime_get*() is supposed to be doing? Why isn't > >> that working? > > > > Also, I do not understand why we placing device into a power domain only > > when we probe it. Why if I unbind device from its driver (or do not have > > a driver for it) it disappears from its power domain? To me power domain > > and having driver bound to a device are 2 orthogonal concepts. > > That's a different discussion, I don't think we want to go there > within this context. Why don't we, exactly? Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index b2afc29..43897ad 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -509,7 +509,14 @@ static int platform_drv_probe(struct device *_dev) ret = dev_pm_domain_attach(_dev, true); if (ret != -EPROBE_DEFER) { + ret = dev_pm_domain_get(_dev->pm_domain); + if (ret) { + dev_pm_domain_detach(_dev, true); + return ret; + } + ret = drv->probe(dev); + dev_pm_domain_put(_dev->pm_domain); if (ret) dev_pm_domain_detach(_dev, true); }
To sucessfully probe some devices their corresponding PM domains may need to be powered. Use the dev_pm_domain_get|put() APIs, to control the behavior of the PM domain. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- drivers/base/platform.c | 7 +++++++ 1 file changed, 7 insertions(+)