diff options
| -rw-r--r-- | MAINTAINERS | 6 | ||||
| -rw-r--r-- | drivers/acpi/scan.c | 39 | ||||
| -rw-r--r-- | drivers/cpufreq/intel_pstate.c | 14 | ||||
| -rw-r--r-- | drivers/powercap/intel_rapl.c | 1 | ||||
| -rw-r--r-- | tools/power/cpupower/utils/helpers/pci.c | 11 |
5 files changed, 50 insertions, 21 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index f7bbaece5649..779d1df5fba9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -3272,12 +3272,6 @@ F: drivers/firmware/dmi-id.c | |||
| 3272 | F: drivers/firmware/dmi_scan.c | 3272 | F: drivers/firmware/dmi_scan.c |
| 3273 | F: include/linux/dmi.h | 3273 | F: include/linux/dmi.h |
| 3274 | 3274 | ||
| 3275 | DOCKING STATION DRIVER | ||
| 3276 | M: Shaohua Li <shaohua.li@intel.com> | ||
| 3277 | L: linux-acpi@vger.kernel.org | ||
| 3278 | S: Supported | ||
| 3279 | F: drivers/acpi/dock.c | ||
| 3280 | |||
| 3281 | DOCUMENTATION | 3275 | DOCUMENTATION |
| 3282 | M: Jonathan Corbet <corbet@lwn.net> | 3276 | M: Jonathan Corbet <corbet@lwn.net> |
| 3283 | L: linux-doc@vger.kernel.org | 3277 | L: linux-doc@vger.kernel.org |
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 | ||
| 2407 | static const struct acpi_device_id generic_device_ids[] = { | ||
| 2408 | {"PRP0001", }, | ||
| 2409 | {"", }, | ||
| 2410 | }; | ||
| 2411 | |||
| 2412 | static 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 | |||
| 2425 | static struct acpi_scan_handler generic_device_handler = { | ||
| 2426 | .ids = generic_device_ids, | ||
| 2427 | .attach = acpi_generic_device_attach, | ||
| 2428 | }; | ||
| 2429 | |||
| 2406 | static int acpi_scan_attach_handler(struct acpi_device *device) | 2430 | static 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. |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index c5b81beccc8e..6414661ac1c4 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <asm/div64.h> | 31 | #include <asm/div64.h> |
| 32 | #include <asm/msr.h> | 32 | #include <asm/msr.h> |
| 33 | #include <asm/cpu_device_id.h> | 33 | #include <asm/cpu_device_id.h> |
| 34 | #include <asm/cpufeature.h> | ||
| 34 | 35 | ||
| 35 | #define BYT_RATIOS 0x66a | 36 | #define BYT_RATIOS 0x66a |
| 36 | #define BYT_VIDS 0x66b | 37 | #define BYT_VIDS 0x66b |
| @@ -649,7 +650,7 @@ static struct cpu_defaults byt_params = { | |||
| 649 | .pid_policy = { | 650 | .pid_policy = { |
| 650 | .sample_rate_ms = 10, | 651 | .sample_rate_ms = 10, |
| 651 | .deadband = 0, | 652 | .deadband = 0, |
| 652 | .setpoint = 97, | 653 | .setpoint = 60, |
| 653 | .p_gain_pct = 14, | 654 | .p_gain_pct = 14, |
| 654 | .d_gain_pct = 0, | 655 | .d_gain_pct = 0, |
| 655 | .i_gain_pct = 4, | 656 | .i_gain_pct = 4, |
| @@ -1200,8 +1201,7 @@ static int __init intel_pstate_init(void) | |||
| 1200 | { | 1201 | { |
| 1201 | int cpu, rc = 0; | 1202 | int cpu, rc = 0; |
| 1202 | const struct x86_cpu_id *id; | 1203 | const struct x86_cpu_id *id; |
| 1203 | struct cpu_defaults *cpu_info; | 1204 | struct cpu_defaults *cpu_def; |
| 1204 | struct cpuinfo_x86 *c = &boot_cpu_data; | ||
| 1205 | 1205 | ||
| 1206 | if (no_load) | 1206 | if (no_load) |
| 1207 | return -ENODEV; | 1207 | return -ENODEV; |
| @@ -1217,10 +1217,10 @@ static int __init intel_pstate_init(void) | |||
| 1217 | if (intel_pstate_platform_pwr_mgmt_exists()) | 1217 | if (intel_pstate_platform_pwr_mgmt_exists()) |
| 1218 | return -ENODEV; | 1218 | return -ENODEV; |
| 1219 | 1219 | ||
| 1220 | cpu_info = (struct cpu_defaults *)id->driver_data; | 1220 | cpu_def = (struct cpu_defaults *)id->driver_data; |
| 1221 | 1221 | ||
| 1222 | copy_pid_params(&cpu_info->pid_policy); | 1222 | copy_pid_params(&cpu_def->pid_policy); |
| 1223 | copy_cpu_funcs(&cpu_info->funcs); | 1223 | copy_cpu_funcs(&cpu_def->funcs); |
| 1224 | 1224 | ||
| 1225 | if (intel_pstate_msrs_not_valid()) | 1225 | if (intel_pstate_msrs_not_valid()) |
| 1226 | return -ENODEV; | 1226 | return -ENODEV; |
| @@ -1231,7 +1231,7 @@ static int __init intel_pstate_init(void) | |||
| 1231 | if (!all_cpu_data) | 1231 | if (!all_cpu_data) |
| 1232 | return -ENOMEM; | 1232 | return -ENOMEM; |
| 1233 | 1233 | ||
| 1234 | if (cpu_has(c,X86_FEATURE_HWP) && !no_hwp) | 1234 | if (static_cpu_has_safe(X86_FEATURE_HWP) && !no_hwp) |
| 1235 | intel_pstate_hwp_enable(); | 1235 | intel_pstate_hwp_enable(); |
| 1236 | 1236 | ||
| 1237 | if (!hwp_active && hwp_only) | 1237 | if (!hwp_active && hwp_only) |
diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c index e03877c4b195..fd243231620a 100644 --- a/drivers/powercap/intel_rapl.c +++ b/drivers/powercap/intel_rapl.c | |||
| @@ -1064,6 +1064,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = { | |||
| 1064 | RAPL_CPU(0x3f, rapl_defaults_hsw_server),/* Haswell servers */ | 1064 | RAPL_CPU(0x3f, rapl_defaults_hsw_server),/* Haswell servers */ |
| 1065 | RAPL_CPU(0x4f, rapl_defaults_hsw_server),/* Broadwell servers */ | 1065 | RAPL_CPU(0x4f, rapl_defaults_hsw_server),/* Broadwell servers */ |
| 1066 | RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */ | 1066 | RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */ |
| 1067 | RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */ | ||
| 1067 | RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */ | 1068 | RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */ |
| 1068 | RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */ | 1069 | RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */ |
| 1069 | RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */ | 1070 | RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */ |
diff --git a/tools/power/cpupower/utils/helpers/pci.c b/tools/power/cpupower/utils/helpers/pci.c index 9690798e6446..8b278983cfc5 100644 --- a/tools/power/cpupower/utils/helpers/pci.c +++ b/tools/power/cpupower/utils/helpers/pci.c | |||
| @@ -25,14 +25,21 @@ | |||
| 25 | struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus, | 25 | struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus, |
| 26 | int slot, int func, int vendor, int dev) | 26 | int slot, int func, int vendor, int dev) |
| 27 | { | 27 | { |
| 28 | struct pci_filter filter_nb_link = { domain, bus, slot, func, | 28 | struct pci_filter filter_nb_link; |
| 29 | vendor, dev }; | ||
| 30 | struct pci_dev *device; | 29 | struct pci_dev *device; |
| 31 | 30 | ||
| 32 | *pacc = pci_alloc(); | 31 | *pacc = pci_alloc(); |
| 33 | if (*pacc == NULL) | 32 | if (*pacc == NULL) |
| 34 | return NULL; | 33 | return NULL; |
| 35 | 34 | ||
| 35 | pci_filter_init(*pacc, &filter_nb_link); | ||
| 36 | filter_nb_link.domain = domain; | ||
| 37 | filter_nb_link.bus = bus; | ||
| 38 | filter_nb_link.slot = slot; | ||
| 39 | filter_nb_link.func = func; | ||
| 40 | filter_nb_link.vendor = vendor; | ||
| 41 | filter_nb_link.device = dev; | ||
| 42 | |||
| 36 | pci_init(*pacc); | 43 | pci_init(*pacc); |
| 37 | pci_scan_bus(*pacc); | 44 | pci_scan_bus(*pacc); |
| 38 | 45 | ||
