8000 Merge tag 'pm+acpi-4.1-rc1-2' of git://git.kernel.org/pub/scm/linux/k… · bsd-unix/linux@c8b3fd0 · GitHub
[go: up one dir, main page]

Skip to content

Commit c8b3fd0

Browse files
committed
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
2 parents d89b3e1 + e0155a9 commit c8b3fd0

File tree

6 files changed

+51
-22
lines changed

6 files changed

+51
-22
lines changed

MAINTAINERS

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3278,12 +3278,6 @@ F: drivers/firmware/dmi-id.c
32783278
F: drivers/firmware/dmi_scan.c
32793279
F: include/linux/dmi.h
32803280

3281-
DOCKING STATION DRIVER
3282-
M: Shaohua Li <shaohua.li@intel.com>
3283-
L: linux-acpi@vger.kernel.org
3284-
S: Supported
3285-
F: drivers/acpi/dock.c
3286-
32873281
DOCUMENTATION
32883282
M: Jonathan Corbet <corbet@lwn.net>
32893283
L: linux-doc@vger.kernel.org

drivers/acpi/ec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
861861
}
862862
}
863863
mutex_unlock(&ec->mutex);
864-
list_for_each_entry(handler, &free_list, node)
864+
list_for_each_entry_safe(handler, tmp, &free_list, node)
865865
acpi_ec_put_query_handler(handler);
866866
}
867867
EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);

drivers/acpi/scan.c

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
375375
struct acpi_device_physical_node *pn;
376376
bool offline = true;
377377

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);
379383

380384
list_for_each_entry(pn, &adev->physical_node_list, node)
381385
if (device_supports_offline(pn->dev) && !pn->dev->offline) {
@@ -2388,9 +2392,6 @@ static void acpi_default_enumeration(struct acpi_device *device)
23882392
struct list_head resource_list;
23892393
bool is_spi_i2c_slave = false;
23902394

2391-
if (!device->pnp.type.platform_id || device->handler)
2392-
return;
2393-
23942395
/*
23952396
* Do not enemerate SPI/I2C slaves as they will be enuerated by their
23962397
* respective parents.
@@ -2403,6 +2404,29 @@ static void acpi_default_enumeration(struct acpi_device *device)
24032404
acpi_create_platform_device(device);
24042405
}
24052406

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+
24062430
static int acpi_scan_attach_handler(struct acpi_device *device)
24072431
{
24082432
struct acpi_hardware_id *hwid;
@@ -2428,8 +2452,6 @@ static int acpi_scan_attach_handler(struct acpi_device *device)
24282452
break;
24292453
}
24302454
}
2431-
if (!ret)
2432-
acpi_default_enumeration(device);
24332455

24342456
return ret;
24352457
}
@@ -2471,6 +2493,9 @@ static void acpi_bus_attach(struct acpi_device *device)
24712493
ret = device_attach(&device->dev);
24722494
if (ret < 0)
24732495
return;
2496+
2497+
if (!ret && device->pnp.type.platform_id)
2498+
acpi_default_enumeration(device);
24742499
}
24752500
device->flags.visited = true;
24762501

@@ -2629,6 +2654,8 @@ int __init acpi_scan_init(void)
26292654
acpi_pnp_init();
26302655
acpi_int340x_thermal_init();
26312656

2657+
acpi_scan_add_handler(&generic_device_handler);
2658+
26322659
mutex_lock(&acpi_scan_lock);
26332660
/*
26342661
* Enumerate devices in the ACPI namespace.

drivers/cpufreq/intel_pstate.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <asm/div64.h>
3232
#include <asm/msr.h>
3333
#include <asm/cpu_device_id.h>
34+
#include <asm/cpufeature.h>
3435

3536
#define BYT_RATIOS 0x66a
3637
#define BYT_VIDS 0x66b
@@ -649,7 +650,7 @@ static struct cpu_defaults byt_params = {
649650
.pid_policy = {
650651
.sample_rate_ms = 10,
651652
.deadband = 0,
652-
.setpoint = 97,
653+
.setpoint = 60,
653654
.p_gain_pct = 14,
654655
.d_gain_pct = 0,
655656
.i_gain_pct = 4,
@@ -1200,8 +1201,7 @@ static int __init intel_pstate_init(void)
12001201
{
12011202
int cpu, rc = 0;
12021203
const struct x86_cpu_id *id;
1203-
struct cpu_defaults *cpu_info;
1204-
struct cpuinfo_x86 *c = &boot_cpu_data;
1204+
struct cpu_defaults *cpu_def;
12051205

12061206
if (no_load)
12071207
return -ENODEV;
@@ -1217,10 +1217,10 @@ static int __init intel_pstate_init(void)
12171217
if (intel_pstate_platform_pwr_mgmt_exists())
12181218
return -ENODEV;
12191219

1220-
cpu_info = (struct cpu_defaults *)id->driver_data;
1220+
cpu_def = (struct cpu_defaults *)id->driver_data;
12211221

1222-
copy_pid_params(&cpu_info->pid_policy);
1223-
copy_cpu_funcs(&cpu_info->funcs);
1222+
copy_pid_params(&cpu_def->pid_policy);
1223+
copy_cpu_funcs(&cpu_def->funcs);
12241224

12251225
if (intel_pstate_msrs_not_valid())
12261226
return -ENODEV;
@@ -1231,7 +1231,7 @@ static int __init intel_pstate_init(void)
12311231
if (!all_cpu_data)
12321232
return -ENOMEM;
12331233

1234-
if (cpu_has(c,X86_FEATURE_HWP) && !no_hwp)
1234+
if (static_cpu_has_safe(X86_FEATURE_HWP) && !no_hwp)
12351235
intel_pstate_hwp_enable();
12361236

12371237
if (!hwp_active && hwp_only)

drivers/powercap/intel_rapl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = {
10641064
RAPL_CPU(0x3f, rapl_defaults_hsw_server),/* Haswell servers */
10651065
RAPL_CPU(0x4f, rapl_defaults_hsw_server),/* Broadwell servers */
10661066
RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */
1067+
RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */
10671068
RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */
10681069
RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */
10691070
RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */

tools/power/cpupower/utils/helpers/pci.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,21 @@
2525
struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus,
2626
int slot, int func, int vendor, int dev)
2727
{
28-
struct pci_filter filter_nb_link = { domain, bus, slot, func,
29-
vendor, dev };
28+
struct pci_filter filter_nb_link;
3029
struct pci_dev *device;
3130

3231
*pacc = pci_alloc();
3332
if (*pacc == NULL)
3433
return NULL;
3534

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+
3643
pci_init(*pacc);
3744
pci_scan_bus(*pacc);
3845

0 commit comments

Comments
 (0)
0