All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: ACPI Devel Mailing List <linux-acpi@vger.kernel.org>,
	Len Brown <lenb@kernel.org>, Aaron Lu <aaron.lwe@gmail.com>,
	Zhang Rui <rui.zhang@intel.com>
Subject: [PATCH] ACPI: do not match devices that have scan handler
Date: Tue, 04 Jun 2013 13:23:02 +0800	[thread overview]
Message-ID: <51AD79B6.6060902@intel.com> (raw)
In-Reply-To: <51AC9389.3050603@intel.com>

With the introduction of acpi scan handler, an acpi device that has acpi
scan handler does not need an acpi driver any more. For those devices,
there is no meaning to match them against a newly registered acpi driver
in acpi_bus_match.

This can also solve a regression caused by a broken BIOS table, where it
has defined a _ROM method under PCI root. The video module would think
devices that have _ROM defined under it is a display controller device
since only display devices would have _ROM method defined according to
the ACPI SPEC. As a resule, this method under PCI root would make video
module tries to drive PCI root acpi device and the pre-assigned
driver_data by PCI root's scan handler will be emptied, making subsequent
call to acpi_get_pci_dev fail.

Buglink:https://bugzilla.kernel.org/show_bug.cgi?id=58091
Reported-by: Jason Cassell <bluesloth600@gmail.com>
Reported-and-bisected-by: Dmitry S. Demin <dmitryy.demin@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
---
 drivers/acpi/scan.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 5e7e991..67ce501 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -553,6 +553,12 @@ static int acpi_bus_match(struct device *dev, struct device_driver *drv)
 	struct acpi_device *acpi_dev = to_acpi_device(dev);
 	struct acpi_driver *acpi_drv = to_acpi_driver(drv);
 
+	/* No need to bind driver for devices that have scan handler */
+	if (acpi_dev->handler)
+		return 0;
+
+	WARN_ON(acpi_dev->driver_data);
+
 	return acpi_dev->flags.match_driver
 		&& !acpi_match_device_ids(acpi_dev, acpi_drv->ids);
 }
-- 
1.8.3.3.gfada522


       reply	other threads:[~2013-06-04  5:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51AC9389.3050603@intel.com>
2013-06-04  5:23 ` Aaron Lu [this message]
2013-06-06  2:54   ` [PATCH v2] ACPI / scan: do not match drivers against objects having scan handlers Aaron Lu
2013-06-06 10:56     ` Rafael J. Wysocki

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=51AD79B6.6060902@intel.com \
    --to=aaron.lu@intel.com \
    --cc=aaron.lwe@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=rui.zhang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.