From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>, linux-acpi@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH] ACPI / LPSS: set first resuming device as a 'proxy'
Date: Thu, 15 Jan 2015 13:10:44 +0200 [thread overview]
Message-ID: <1421320244-3490-1-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
We can't rely on the first enumerated device since it might be not probed yet
when DMA driver wants to resume the device. This patch changes the place where
we assign the 'proxy' device. From now on the first resumed device will be
recognized as a 'proxy' because it is probed.
Reported-by: Jerome Blin <jerome.blin@intel.com>
Fixes: 6c17ee44d524 (ACPI / LPSS: introduce a 'proxy' device to power on LPSS for DMA)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/acpi/acpi_lpss.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 4f3febf..d851290 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -374,8 +374,6 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
adev->driver_data = pdata;
pdev = acpi_create_platform_device(adev);
if (!IS_ERR_OR_NULL(pdev)) {
- if (!proxy_device && dev_desc->flags & LPSS_DEV_PROXY)
- proxy_device = &pdev->dev;
return 1;
}
@@ -615,10 +613,17 @@ static int acpi_lpss_runtime_resume(struct device *dev)
struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
int ret;
- if (pdata->dev_desc->flags & LPSS_PROXY_REQ && proxy_device) {
- ret = pm_runtime_get_sync(proxy_device);
- if (ret)
- return ret;
+ if (!proxy_device && pdata->dev_desc->flags & LPSS_DEV_PROXY)
+ proxy_device = dev;
+
+ if (pdata->dev_desc->flags & LPSS_PROXY_REQ) {
+ if (proxy_device) {
+ ret = pm_runtime_get_sync(proxy_device);
+ if (ret)
+ return ret;
+ } else {
+ return -EPROBE_DEFER;
+ }
}
ret = acpi_dev_runtime_resume(dev);
--
2.1.4
next reply other threads:[~2015-01-15 11:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 11:10 Andy Shevchenko [this message]
2015-01-20 14:45 ` [PATCH] ACPI / LPSS: set first resuming device as a 'proxy' Rafael J. Wysocki
2015-01-21 2:37 ` Rafael J. Wysocki
2015-01-21 15:03 ` Rafael J. Wysocki
2015-01-22 15:16 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421320244-3490-1-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).