Commit 8c9b7a7b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI / video: Do not bind to device objects with a scan handler

With the introduction of ACPI scan handlers, ACPI device objects
with an ACPI scan handler attached to them must not be bound to
by ACPI drivers any more.  Unfortunately, however, the ACPI video
driver attempts to do just that if there is a _ROM ACPI control
method defined under a device object with an ACPI scan handler.

Prevent that from happening by making the video driver's "add"
routine check if the device object already has an ACPI scan handler
attached to it and return an error code in that case.

That is not sufficient, though, because acpi_bus_driver_init() would
then clear the device object's driver_data that may be set by its
scan handler, so for the fix to work acpi_bus_driver_init() has to be
modified to leave driver_data as is on errors.

References: https://bugzilla.kernel.org/show_bug.cgi?id=58091Bisected-and-tested-by: default avatarDmitry S. Demin <dmitryy.demin@gmail.com>
Reported-and-tested-by: default avatarJason Cassell <bluesloth600@gmail.com>
Tracked-down-by: default avatarAaron Lu <aaron.lu@intel.com>
Cc: 3.9+ <stable@kernel.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarAaron Lu <aaron.lu@intel.com>
parent 317ddd25
...@@ -1017,11 +1017,8 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver) ...@@ -1017,11 +1017,8 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
return -ENOSYS; return -ENOSYS;
result = driver->ops.add(device); result = driver->ops.add(device);
if (result) { if (result)
device->driver = NULL;
device->driver_data = NULL;
return result; return result;
}
device->driver = driver; device->driver = driver;
......
...@@ -1722,6 +1722,9 @@ static int acpi_video_bus_add(struct acpi_device *device) ...@@ -1722,6 +1722,9 @@ static int acpi_video_bus_add(struct acpi_device *device)
int error; int error;
acpi_status status; acpi_status status;
if (device->handler)
return -EINVAL;
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, status = acpi_walk_namespace(ACPI_TYPE_DEVICE,
device->parent->handle, 1, device->parent->handle, 1,
acpi_video_bus_match, NULL, acpi_video_bus_match, NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment