From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Zhang Rui <rui.zhang@intel.com>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Gabriele Mazzotta <gabriele.mzt@gmail.com>,
Dirk Griesbach <spamthis@freenet.de>,
Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [PATCH] ACPI / scan: Allow ACPI drivers to bind to PNP device objects
Date: Tue, 26 Aug 2014 00:25:09 +0200 [thread overview]
Message-ID: <1493252.guStSdlKdN@vostro.rjw.lan> (raw)
In-Reply-To: <1408864010.3315.47.camel@rzhang1-toshiba>
On Sunday, August 24, 2014 03:06:50 PM Zhang Rui wrote:
> On Thu, 2014-08-21 at 06:04 +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[cut]
> > 3 files changed, 7 insertions(+), 1 deletion(-)
> >
> > Index: linux-pm/drivers/acpi/acpi_pnp.c
> > ===================================================================
> > --- linux-pm.orig/drivers/acpi/acpi_pnp.c
> > +++ linux-pm/drivers/acpi/acpi_pnp.c
> > @@ -396,3 +396,8 @@ void __init acpi_pnp_init(void)
> > {
> > acpi_scan_add_handler(&acpi_pnp_handler);
> > }
> > +
> > +bool is_acpi_pnp_device(struct acpi_device *adev)
> > +{
> > + return adev->handler == &acpi_pnp_handler;
> > +}
>
> can we reuse acpi_is_pnp_device()?
> The only difference is that acpi_is_pnp_device() returns true for
> RTC_CMOS devices, which is not a problem IMO because RTC CMOS devices
> have PNP driver only.
Yes, we can. Overlooked that.
Updated patch is appended.
Rafael
---
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Subject: [PATCH] ACPI / scan: Allow ACPI drivers to bind to PNP device objects
We generally don't allow ACPI drivers to bind to ACPI device objects
that companion "physical" device objects are created for to avoid
situations in which two different drivers may attempt to handle one
device at the same time. Recent ACPI device enumeration rework
extended that approach to ACPI PNP devices by starting to use a scan
handler for enumerating them. However, we previously allowed ACPI
drivers to bind to ACPI device objects with existing PNP device
companions and changing that led to functional regressions on some
systems.
For this reason, add a special check for PNP devices in
acpi_device_probe() so that ACPI drivers can bind to ACPI device
objects having existing PNP device companions as before.
Fixes: eec15edbb0e1 (ACPI / PNP: use device ID list for PNPACPI device enumeration)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=81511
Link: https://bugzilla.kernel.org/show_bug.cgi?id=81971
Reported-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Reported-by: Dirk Griesbach <spamthis@freenet.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -975,7 +975,7 @@ static int acpi_device_probe(struct devi
struct acpi_driver *acpi_drv = to_acpi_driver(dev->driver);
int ret;
- if (acpi_dev->handler)
+ if (acpi_dev->handler && !acpi_is_pnp_device(acpi_dev))
return -EINVAL;
if (!acpi_drv->ops.add)
prev parent reply other threads:[~2014-08-25 22:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-21 4:04 [PATCH] ACPI / scan: Allow ACPI drivers to bind to PNP device objects Rafael J. Wysocki
2014-08-21 12:08 ` Zhang Rui
2014-08-21 16:36 ` Rafael J. Wysocki
2014-08-21 17:10 ` Rafael J. Wysocki
2014-08-22 2:00 ` Zhang Rui
2014-08-22 17:53 ` Rafael J. Wysocki
2014-08-23 15:21 ` Zhang Rui
2014-09-08 22:14 ` Rafael J. Wysocki
2014-09-08 22:32 ` Darren Hart
2014-08-24 7:06 ` Zhang Rui
2014-08-25 22:25 ` Rafael J. Wysocki [this message]
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=1493252.guStSdlKdN@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=gabriele.mzt@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=rui.zhang@intel.com \
--cc=spamthis@freenet.de \
/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