From bbb16fef19122ec9f20fb865c45375e12f85d2a1 Mon Sep 17 00:00:00 2001 From: Srinivas Pandruvada Date: Tue, 9 Dec 2014 16:15:40 -0800 Subject: [PATCH 1/3] ACPI / Fan: Use bus id as the name for non PNP0C0B (Fan) devices The _ART (Active Cooling Relationship Table), specifies relationship among heat generating sources to a target active cooling device like fan. The _ART table refers to actual bus id name for specifying relationship. Naming "Fan" is not enough as name in the _ART table can change on every platform, to establish relationship for user space thermal controllers. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki --- drivers/acpi/fan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index caf9b76b7ef8..7a36f02598a6 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c @@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev) struct thermal_cooling_device *cdev; struct acpi_fan *fan; struct acpi_device *device = ACPI_COMPANION(&pdev->dev); + char *name; fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); if (!fan) { @@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev) } } - cdev = thermal_cooling_device_register("Fan", device, + if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B"))) + name = "Fan"; + else + name = acpi_device_bid(device); + + cdev = thermal_cooling_device_register(name, device, &fan_cooling_ops); if (IS_ERR(cdev)) { result = PTR_ERR(cdev); From 1741acea75ea51ce709304a26baf72e1e99b8f3a Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Mon, 15 Dec 2014 08:47:52 +0800 Subject: [PATCH 2/3] ACPI / EC: Fix unexpected ec_remove_handlers() invocations The ec_remove_handlers() is invoked without checking EC_FLAGS_HANDLERS_INSTALLED, this patch enhances this check to avoid issues that acpi_disable_gpe() is invoked unexpectedly to reduce the GPE runtime count. This may happen when the EC handler installation failed on some platforms. Reported-by: Venkat Raghavulu Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/ec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 5f9b74b9b71f..1b5853f384e2 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec) static void ec_remove_handlers(struct acpi_ec *ec) { + if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags)) + return; acpi_disable_gpe(NULL, ec->gpe); if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) From b4df463678fb9c6dae9548dbb7545993779fd416 Mon Sep 17 00:00:00 2001 From: Aaron Lu Date: Mon, 15 Dec 2014 16:01:29 +0800 Subject: [PATCH 3/3] ACPI / video: update the skip case for acpi_video_device_in_dod() If the firmware has declared more than 8 video output devices, and the one that control the internal panel's backlight is listed after the first 8 output devices, the _DOD will not include it due to the current i915 operation region implementation. As a result, we will not create a backlight device for it while we should. Solve this problem by special case the firmware that has 8+ output devices in that if we see such a firmware, we do not test if the device is in _DOD list. The creation of the backlight device will also enable the firmware to emit events on backlight hotkey press when the acpi_osi= cmdline option is specified on those affected ASUS laptops. Link: https://bugzilla.kernel.org/show_bug.cgi?id=70241 Reported-and-tested-by: Oleksij Rempel Reported-and-tested-by: Dmitry Tunin Reported-and-tested-by: Jimbo Cc: 3.18+ # 3.18+ Signed-off-by: Aaron Lu Acked-by: Jani Nikula Signed-off-by: Rafael J. Wysocki --- drivers/acpi/video.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 185a57d13723..1eaadff2e198 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -155,6 +155,7 @@ struct acpi_video_bus { u8 dos_setting; struct acpi_video_enumerated_device *attached_array; u8 attached_count; + u8 child_count; struct acpi_video_bus_cap cap; struct acpi_video_bus_flags flags; struct list_head video_device_list; @@ -1159,8 +1160,12 @@ static bool acpi_video_device_in_dod(struct acpi_video_device *device) struct acpi_video_bus *video = device->video; int i; - /* If we have a broken _DOD, no need to test */ - if (!video->attached_count) + /* + * If we have a broken _DOD or we have more than 8 output devices + * under the graphics controller node that we can't proper deal with + * in the operation region code currently, no need to test. + */ + if (!video->attached_count || video->child_count > 8) return true; for (i = 0; i < video->attached_count; i++) { @@ -1413,6 +1418,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video, dev_err(&dev->dev, "Can't attach device\n"); break; } + video->child_count++; } return status; }