aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-18 23:28:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-18 23:28:33 -0500
commitc0f486fde3f353232c1cc2fd4d62783ac782a467 (patch)
tree600d222f6d9e975d88ab774aa9d8e5ea9109b08f /drivers/acpi
parent385336e321c41b5174055c0194b60c19a27cc5c5 (diff)
parent2ec1c17cadd0b994732f292d4bc49fc3a05d85a4 (diff)
Merge tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI and power management updates from Rafael Wysocki: "These are regression fixes (leds-gpio, ACPI backlight driver, operating performance points library, ACPI device enumeration messages, cpupower tool), other bug fixes (ACPI EC driver, ACPI device PM), some cleanups in the operating performance points (OPP) framework, continuation of CONFIG_PM_RUNTIME elimination, a couple of minor intel_pstate driver changes, a new MAINTAINERS entry for it and an ACPI fan driver change needed for better support of thermal management in user space. Specifics: - Fix a regression in leds-gpio introduced by a recent commit that inadvertently changed the name of one of the properties used by the driver (Fabio Estevam). - Fix a regression in the ACPI backlight driver introduced by a recent fix that missed one special case that had to be taken into account (Aaron Lu). - Drop the level of some new kernel messages from the ACPI core introduced by a recent commit to KERN_DEBUG which they should have used from the start and drop some other unuseful KERN_ERR messages printed by ACPI (Rafael J Wysocki). - Revert an incorrect commit modifying the cpupower tool (Prarit Bhargava). - Fix two regressions introduced by recent commits in the OPP library and clean up some existing minor issues in that code (Viresh Kumar). - Continue to replace CONFIG_PM_RUNTIME with CONFIG_PM throughout the tree (or drop it where that can be done) in order to make it possible to eliminate CONFIG_PM_RUNTIME (Rafael J Wysocki, Ulf Hansson, Ludovic Desroches). There will be one more "CONFIG_PM_RUNTIME removal" batch after this one, because some new uses of it have been introduced during the current merge window, but that should be sufficient to finally get rid of it. - Make the ACPI EC driver more robust against race conditions related to GPE handler installation failures (Lv Zheng). - Prevent the ACPI device PM core code from attempting to disable GPEs that it has not enabled which confuses ACPICA and makes it report errors unnecessarily (Rafael J Wysocki). - Add a "force" command line switch to the intel_pstate driver to make it possible to override the blacklisting of some systems in that driver if needed (Ethan Zhao). - Improve intel_pstate code documentation and add a MAINTAINERS entry for it (Kristen Carlson Accardi). - Make the ACPI fan driver create cooling device interfaces witn names that reflect the IDs of the ACPI device objects they are associated with, except for "generic" ACPI fans (PNP ID "PNP0C0B"). That's necessary for user space thermal management tools to be able to connect the fans with the parts of the system they are supposed to be cooling properly. From Srinivas Pandruvada" * tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits) MAINTAINERS: add entry for intel_pstate ACPI / video: update the skip case for acpi_video_device_in_dod() power / PM: Eliminate CONFIG_PM_RUNTIME NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM ACPI / EC: Fix unexpected ec_remove_handlers() invocations Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()" tracing / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM x86 / PM: Replace CONFIG_PM_RUNTIME in io_apic.c PM: Remove the SET_PM_RUNTIME_PM_OPS() macro mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macro PM / Kconfig: Replace PM_RUNTIME with PM in dependencies ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM phy / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM video / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM tty / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM spi: Replace CONFIG_PM_RUNTIME with CONFIG_PM ACPI / PM: Do not disable wakeup GPEs that have not been enabled ACPI / utils: Drop error messages from acpi_evaluate_reference() ...
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/device_pm.c12
-rw-r--r--drivers/acpi/ec.c2
-rw-r--r--drivers/acpi/fan.c8
-rw-r--r--drivers/acpi/scan.c4
-rw-r--r--drivers/acpi/utils.c12
-rw-r--r--drivers/acpi/video.c10
6 files changed, 30 insertions, 18 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 897640188acd..c2daa85fc9f7 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -680,13 +680,21 @@ static int acpi_device_wakeup(struct acpi_device *adev, u32 target_state,
680 if (error) 680 if (error)
681 return error; 681 return error;
682 682
683 if (adev->wakeup.flags.enabled)
684 return 0;
685
683 res = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number); 686 res = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number);
684 if (ACPI_FAILURE(res)) { 687 if (ACPI_SUCCESS(res)) {
688 adev->wakeup.flags.enabled = 1;
689 } else {
685 acpi_disable_wakeup_device_power(adev); 690 acpi_disable_wakeup_device_power(adev);
686 return -EIO; 691 return -EIO;
687 } 692 }
688 } else { 693 } else {
689 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number); 694 if (adev->wakeup.flags.enabled) {
695 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
696 adev->wakeup.flags.enabled = 0;
697 }
690 acpi_disable_wakeup_device_power(adev); 698 acpi_disable_wakeup_device_power(adev);
691 } 699 }
692 return 0; 700 return 0;
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)
844 844
845static void ec_remove_handlers(struct acpi_ec *ec) 845static void ec_remove_handlers(struct acpi_ec *ec)
846{ 846{
847 if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
848 return;
847 acpi_disable_gpe(NULL, ec->gpe); 849 acpi_disable_gpe(NULL, ec->gpe);
848 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, 850 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
849 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) 851 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
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)
325 struct thermal_cooling_device *cdev; 325 struct thermal_cooling_device *cdev;
326 struct acpi_fan *fan; 326 struct acpi_fan *fan;
327 struct acpi_device *device = ACPI_COMPANION(&pdev->dev); 327 struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
328 char *name;
328 329
329 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); 330 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
330 if (!fan) { 331 if (!fan) {
@@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev)
346 } 347 }
347 } 348 }
348 349
349 cdev = thermal_cooling_device_register("Fan", device, 350 if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
351 name = "Fan";
352 else
353 name = acpi_device_bid(device);
354
355 cdev = thermal_cooling_device_register(name, device,
350 &fan_cooling_ops); 356 &fan_cooling_ops);
351 if (IS_ERR(cdev)) { 357 if (IS_ERR(cdev)) {
352 result = PTR_ERR(cdev); 358 result = PTR_ERR(cdev);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 1b1cf558d3d3..16914cc30882 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2214,7 +2214,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev)
2214 status = acpi_evaluate_reference(adev->handle, "_DEP", NULL, 2214 status = acpi_evaluate_reference(adev->handle, "_DEP", NULL,
2215 &dep_devices); 2215 &dep_devices);
2216 if (ACPI_FAILURE(status)) { 2216 if (ACPI_FAILURE(status)) {
2217 dev_err(&adev->dev, "Failed to evaluate _DEP.\n"); 2217 dev_dbg(&adev->dev, "Failed to evaluate _DEP.\n");
2218 return; 2218 return;
2219 } 2219 }
2220 2220
@@ -2224,7 +2224,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev)
2224 2224
2225 status = acpi_get_object_info(dep_devices.handles[i], &info); 2225 status = acpi_get_object_info(dep_devices.handles[i], &info);
2226 if (ACPI_FAILURE(status)) { 2226 if (ACPI_FAILURE(status)) {
2227 dev_err(&adev->dev, "Error reading device info\n"); 2227 dev_dbg(&adev->dev, "Error reading _DEP device info\n");
2228 continue; 2228 continue;
2229 } 2229 }
2230 2230
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index dd8ff63ee2b4..cd49a3982b6a 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -346,22 +346,16 @@ acpi_evaluate_reference(acpi_handle handle,
346 package = buffer.pointer; 346 package = buffer.pointer;
347 347
348 if ((buffer.length == 0) || !package) { 348 if ((buffer.length == 0) || !package) {
349 printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n",
350 (unsigned)buffer.length, package);
351 status = AE_BAD_DATA; 349 status = AE_BAD_DATA;
352 acpi_util_eval_error(handle, pathname, status); 350 acpi_util_eval_error(handle, pathname, status);
353 goto end; 351 goto end;
354 } 352 }
355 if (package->type != ACPI_TYPE_PACKAGE) { 353 if (package->type != ACPI_TYPE_PACKAGE) {
356 printk(KERN_ERR PREFIX "Expecting a [Package], found type %X\n",
357 package->type);
358 status = AE_BAD_DATA; 354 status = AE_BAD_DATA;
359 acpi_util_eval_error(handle, pathname, status); 355 acpi_util_eval_error(handle, pathname, status);
360 goto end; 356 goto end;
361 } 357 }
362 if (!package->package.count) { 358 if (!package->package.count) {
363 printk(KERN_ERR PREFIX "[Package] has zero elements (%p)\n",
364 package);
365 status = AE_BAD_DATA; 359 status = AE_BAD_DATA;
366 acpi_util_eval_error(handle, pathname, status); 360 acpi_util_eval_error(handle, pathname, status);
367 goto end; 361 goto end;
@@ -380,17 +374,13 @@ acpi_evaluate_reference(acpi_handle handle,
380 374
381 if (element->type != ACPI_TYPE_LOCAL_REFERENCE) { 375 if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
382 status = AE_BAD_DATA; 376 status = AE_BAD_DATA;
383 printk(KERN_ERR PREFIX
384 "Expecting a [Reference] package element, found type %X\n",
385 element->type);
386 acpi_util_eval_error(handle, pathname, status); 377 acpi_util_eval_error(handle, pathname, status);
387 break; 378 break;
388 } 379 }
389 380
390 if (!element->reference.handle) { 381 if (!element->reference.handle) {
391 printk(KERN_WARNING PREFIX "Invalid reference in"
392 " package %s\n", pathname);
393 status = AE_NULL_ENTRY; 382 status = AE_NULL_ENTRY;
383 acpi_util_eval_error(handle, pathname, status);
394 break; 384 break;
395 } 385 }
396 /* Get the acpi_handle. */ 386 /* Get the acpi_handle. */
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 {
155 u8 dos_setting; 155 u8 dos_setting;
156 struct acpi_video_enumerated_device *attached_array; 156 struct acpi_video_enumerated_device *attached_array;
157 u8 attached_count; 157 u8 attached_count;
158 u8 child_count;
158 struct acpi_video_bus_cap cap; 159 struct acpi_video_bus_cap cap;
159 struct acpi_video_bus_flags flags; 160 struct acpi_video_bus_flags flags;
160 struct list_head video_device_list; 161 struct list_head video_device_list;
@@ -1159,8 +1160,12 @@ static bool acpi_video_device_in_dod(struct acpi_video_device *device)
1159 struct acpi_video_bus *video = device->video; 1160 struct acpi_video_bus *video = device->video;
1160 int i; 1161 int i;
1161 1162
1162 /* If we have a broken _DOD, no need to test */ 1163 /*
1163 if (!video->attached_count) 1164 * If we have a broken _DOD or we have more than 8 output devices
1165 * under the graphics controller node that we can't proper deal with
1166 * in the operation region code currently, no need to test.
1167 */
1168 if (!video->attached_count || video->child_count > 8)
1164 return true; 1169 return true;
1165 1170
1166 for (i = 0; i < video->attached_count; i++) { 1171 for (i = 0; i < video->attached_count; i++) {
@@ -1413,6 +1418,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
1413 dev_err(&dev->dev, "Can't attach device\n"); 1418 dev_err(&dev->dev, "Can't attach device\n");
1414 break; 1419 break;
1415 } 1420 }
1421 video->child_count++;
1416 } 1422 }
1417 return status; 1423 return status;
1418} 1424}