aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 16:56:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 16:56:35 -0400
commitc8b3fd0ce313443731e8fd6d5a541085eb465f99 (patch)
tree7d5da02ff8afbaa4804dab655c7d569753c98474 /drivers/acpi/scan.c
parentd89b3e19ef98a8d3b81a9f8a62c6ac89fd00412e (diff)
parente0155a99b28f63e007c0c74076ad8ae486a3c9d3 (diff)
Merge tag 'pm+acpi-4.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more power management and ACPI updates from Rafael Wysocki: "These are fixes mostly (intel_pstate, ACPI core, ACPI EC driver, cpupower tool), a new CPU ID for the Intel RAPL driver and one intel_pstate driver improvement that didn't make it to my previous pull requests due to timing. Specifics: - Fix a build warning in the intel_pstate driver showing up in non-SMP builds (Borislav Petkov) - Change one of the intel_pstate's P-state selection parameters for Baytrail and Cherrytrail CPUs to significantly improve performance at the cost of a small increase in energy consumption (Kristen Carlson Accardi) - Fix a NULL pointer dereference in the ACPI EC driver due to an unsafe list walk in the query handler removal routine (Chris Bainbridge) - Get rid of a false-positive lockdep warning in the ACPI container hot-remove code (Rafael J Wysocki) - Prevent the ACPI device enumeration code from creating device objects of a wrong type in some cases (Rafael J Wysocki) - Add Skylake processors support to the Intel RAPL power capping driver (Brian Bian) - Drop the stale MAINTAINERS entry for the ACPI dock driver that is regarded as part of the ACPI core and maintained along with it now (Chao Yu) - Fix cpupower tool breakage caused by a library API change in libpci 3.3.0 (Lucas Stach)" * tag 'pm+acpi-4.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / scan: Add a scan handler for PRP0001 ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline() ACPI / EC: fix NULL pointer dereference in acpi_ec_remove_query_handler() MAINTAINERS: remove maintainship entry of docking station driver powercap / RAPL: Add support for Intel Skylake processors cpufreq: intel_pstate: Fix an annoying !CONFIG_SMP warning intel_pstate: Change the setpoint for Atom params cpupower: fix breakage from libpci API change
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 69bc0d888c01..03141aa4ea95 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -375,7 +375,11 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
375 struct acpi_device_physical_node *pn; 375 struct acpi_device_physical_node *pn;
376 bool offline = true; 376 bool offline = true;
377 377
378 mutex_lock(&adev->physical_node_lock); 378 /*
379 * acpi_container_offline() calls this for all of the container's
380 * children under the container's physical_node_lock lock.
381 */
382 mutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING);
379 383
380 list_for_each_entry(pn, &adev->physical_node_list, node) 384 list_for_each_entry(pn, &adev->physical_node_list, node)
381 if (device_supports_offline(pn->dev) && !pn->dev->offline) { 385 if (device_supports_offline(pn->dev) && !pn->dev->offline) {
@@ -2388,9 +2392,6 @@ static void acpi_default_enumeration(struct acpi_device *device)
2388 struct list_head resource_list; 2392 struct list_head resource_list;
2389 bool is_spi_i2c_slave = false; 2393 bool is_spi_i2c_slave = false;
2390 2394
2391 if (!device->pnp.type.platform_id || device->handler)
2392 return;
2393
2394 /* 2395 /*
2395 * Do not enemerate SPI/I2C slaves as they will be enuerated by their 2396 * Do not enemerate SPI/I2C slaves as they will be enuerated by their
2396 * respective parents. 2397 * respective parents.
@@ -2403,6 +2404,29 @@ static void acpi_default_enumeration(struct acpi_device *device)
2403 acpi_create_platform_device(device); 2404 acpi_create_platform_device(device);
2404} 2405}
2405 2406
2407static const struct acpi_device_id generic_device_ids[] = {
2408 {"PRP0001", },
2409 {"", },
2410};
2411
2412static int acpi_generic_device_attach(struct acpi_device *adev,
2413 const struct acpi_device_id *not_used)
2414{
2415 /*
2416 * Since PRP0001 is the only ID handled here, the test below can be
2417 * unconditional.
2418 */
2419 if (adev->data.of_compatible)
2420 acpi_default_enumeration(adev);
2421
2422 return 1;
2423}
2424
2425static struct acpi_scan_handler generic_device_handler = {
2426 .ids = generic_device_ids,
2427 .attach = acpi_generic_device_attach,
2428};
2429
2406static int acpi_scan_attach_handler(struct acpi_device *device) 2430static int acpi_scan_attach_handler(struct acpi_device *device)
2407{ 2431{
2408 struct acpi_hardware_id *hwid; 2432 struct acpi_hardware_id *hwid;
@@ -2428,8 +2452,6 @@ static int acpi_scan_attach_handler(struct acpi_device *device)
2428 break; 2452 break;
2429 } 2453 }
2430 } 2454 }
2431 if (!ret)
2432 acpi_default_enumeration(device);
2433 2455
2434 return ret; 2456 return ret;
2435} 2457}
@@ -2471,6 +2493,9 @@ static void acpi_bus_attach(struct acpi_device *device)
2471 ret = device_attach(&device->dev); 2493 ret = device_attach(&device->dev);
2472 if (ret < 0) 2494 if (ret < 0)
2473 return; 2495 return;
2496
2497 if (!ret && device->pnp.type.platform_id)
2498 acpi_default_enumeration(device);
2474 } 2499 }
2475 device->flags.visited = true; 2500 device->flags.visited = true;
2476 2501
@@ -2629,6 +2654,8 @@ int __init acpi_scan_init(void)
2629 acpi_pnp_init(); 2654 acpi_pnp_init();
2630 acpi_int340x_thermal_init(); 2655 acpi_int340x_thermal_init();
2631 2656
2657 acpi_scan_add_handler(&generic_device_handler);
2658
2632 mutex_lock(&acpi_scan_lock); 2659 mutex_lock(&acpi_scan_lock);
2633 /* 2660 /*
2634 * Enumerate devices in the ACPI namespace. 2661 * Enumerate devices in the ACPI namespace.