Commit c8b3fd0c authored by Linus Torvalds's avatar Linus Torvalds

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
parents d89b3e19 e0155a99
...@@ -3278,12 +3278,6 @@ F: drivers/firmware/dmi-id.c ...@@ -3278,12 +3278,6 @@ F: drivers/firmware/dmi-id.c
F: drivers/firmware/dmi_scan.c F: drivers/firmware/dmi_scan.c
F: include/linux/dmi.h F: include/linux/dmi.h
DOCKING STATION DRIVER
M: Shaohua Li <shaohua.li@intel.com>
L: linux-acpi@vger.kernel.org
S: Supported
F: drivers/acpi/dock.c
DOCUMENTATION DOCUMENTATION
M: Jonathan Corbet <corbet@lwn.net> M: Jonathan Corbet <corbet@lwn.net>
L: linux-doc@vger.kernel.org L: linux-doc@vger.kernel.org
......
...@@ -861,7 +861,7 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) ...@@ -861,7 +861,7 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
} }
} }
mutex_unlock(&ec->mutex); mutex_unlock(&ec->mutex);
list_for_each_entry(handler, &free_list, node) list_for_each_entry_safe(handler, tmp, &free_list, node)
acpi_ec_put_query_handler(handler); acpi_ec_put_query_handler(handler);
} }
EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler); EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);
......
...@@ -375,7 +375,11 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent) ...@@ -375,7 +375,11 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
struct acpi_device_physical_node *pn; struct acpi_device_physical_node *pn;
bool offline = true; bool offline = true;
mutex_lock(&adev->physical_node_lock); /*
* acpi_container_offline() calls this for all of the container's
* children under the container's physical_node_lock lock.
*/
mutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING);
list_for_each_entry(pn, &adev->physical_node_list, node) list_for_each_entry(pn, &adev->physical_node_list, node)
if (device_supports_offline(pn->dev) && !pn->dev->offline) { if (device_supports_offline(pn->dev) && !pn->dev->offline) {
...@@ -2388,9 +2392,6 @@ static void acpi_default_enumeration(struct acpi_device *device) ...@@ -2388,9 +2392,6 @@ static void acpi_default_enumeration(struct acpi_device *device)
struct list_head resource_list; struct list_head resource_list;
bool is_spi_i2c_slave = false; bool is_spi_i2c_slave = false;
if (!device->pnp.type.platform_id || device->handler)
return;
/* /*
* Do not enemerate SPI/I2C slaves as they will be enuerated by their * Do not enemerate SPI/I2C slaves as they will be enuerated by their
* respective parents. * respective parents.
...@@ -2403,6 +2404,29 @@ static void acpi_default_enumeration(struct acpi_device *device) ...@@ -2403,6 +2404,29 @@ static void acpi_default_enumeration(struct acpi_device *device)
acpi_create_platform_device(device); acpi_create_platform_device(device);
} }
static const struct acpi_device_id generic_device_ids[] = {
{"PRP0001", },
{"", },
};
static int acpi_generic_device_attach(struct acpi_device *adev,
const struct acpi_device_id *not_used)
{
/*
* Since PRP0001 is the only ID handled here, the test below can be
* unconditional.
*/
if (adev->data.of_compatible)
acpi_default_enumeration(adev);
return 1;
}
static struct acpi_scan_handler generic_device_handler = {
.ids = generic_device_ids,
.attach = acpi_generic_device_attach,
};
static int acpi_scan_attach_handler(struct acpi_device *device) static int acpi_scan_attach_handler(struct acpi_device *device)
{ {
struct acpi_hardware_id *hwid; struct acpi_hardware_id *hwid;
...@@ -2428,8 +2452,6 @@ static int acpi_scan_attach_handler(struct acpi_device *device) ...@@ -2428,8 +2452,6 @@ static int acpi_scan_attach_handler(struct acpi_device *device)
break; break;
} }
} }
if (!ret)
acpi_default_enumeration(device);
return ret; return ret;
} }
...@@ -2471,6 +2493,9 @@ static void acpi_bus_attach(struct acpi_device *device) ...@@ -2471,6 +2493,9 @@ static void acpi_bus_attach(struct acpi_device *device)
ret = device_attach(&device->dev); ret = device_attach(&device->dev);
if (ret < 0) if (ret < 0)
return; return;
if (!ret && device->pnp.type.platform_id)
acpi_default_enumeration(device);
} }
device->flags.visited = true; device->flags.visited = true;
...@@ -2629,6 +2654,8 @@ int __init acpi_scan_init(void) ...@@ -2629,6 +2654,8 @@ int __init acpi_scan_init(void)
acpi_pnp_init(); acpi_pnp_init();
acpi_int340x_thermal_init(); acpi_int340x_thermal_init();
acpi_scan_add_handler(&generic_device_handler);
mutex_lock(&acpi_scan_lock); mutex_lock(&acpi_scan_lock);
/* /*
* Enumerate devices in the ACPI namespace. * Enumerate devices in the ACPI namespace.
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <asm/div64.h> #include <asm/div64.h>
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/cpu_device_id.h> #include <asm/cpu_device_id.h>
#include <asm/cpufeature.h>
#define BYT_RATIOS 0x66a #define BYT_RATIOS 0x66a
#define BYT_VIDS 0x66b #define BYT_VIDS 0x66b
...@@ -649,7 +650,7 @@ static struct cpu_defaults byt_params = { ...@@ -649,7 +650,7 @@ static struct cpu_defaults byt_params = {
.pid_policy = { .pid_policy = {
.sample_rate_ms = 10, .sample_rate_ms = 10,
.deadband = 0, .deadband = 0,
.setpoint = 97, .setpoint = 60,
.p_gain_pct = 14, .p_gain_pct = 14,
.d_gain_pct = 0, .d_gain_pct = 0,
.i_gain_pct = 4, .i_gain_pct = 4,
...@@ -1200,8 +1201,7 @@ static int __init intel_pstate_init(void) ...@@ -1200,8 +1201,7 @@ static int __init intel_pstate_init(void)
{ {
int cpu, rc = 0; int cpu, rc = 0;
const struct x86_cpu_id *id; const struct x86_cpu_id *id;
struct cpu_defaults *cpu_info; struct cpu_defaults *cpu_def;
struct cpuinfo_x86 *c = &boot_cpu_data;
if (no_load) if (no_load)
return -ENODEV; return -ENODEV;
...@@ -1217,10 +1217,10 @@ static int __init intel_pstate_init(void) ...@@ -1217,10 +1217,10 @@ static int __init intel_pstate_init(void)
if (intel_pstate_platform_pwr_mgmt_exists()) if (intel_pstate_platform_pwr_mgmt_exists())
return -ENODEV; return -ENODEV;
cpu_info = (struct cpu_defaults *)id->driver_data; cpu_def = (struct cpu_defaults *)id->driver_data;
copy_pid_params(&cpu_info->pid_policy); copy_pid_params(&cpu_def->pid_policy);
copy_cpu_funcs(&cpu_info->funcs); copy_cpu_funcs(&cpu_def->funcs);
if (intel_pstate_msrs_not_valid()) if (intel_pstate_msrs_not_valid())
return -ENODEV; return -ENODEV;
...@@ -1231,7 +1231,7 @@ static int __init intel_pstate_init(void) ...@@ -1231,7 +1231,7 @@ static int __init intel_pstate_init(void)
if (!all_cpu_data) if (!all_cpu_data)
return -ENOMEM; return -ENOMEM;
if (cpu_has(c,X86_FEATURE_HWP) && !no_hwp) if (static_cpu_has_safe(X86_FEATURE_HWP) && !no_hwp)
intel_pstate_hwp_enable(); intel_pstate_hwp_enable();
if (!hwp_active && hwp_only) if (!hwp_active && hwp_only)
......
...@@ -1064,6 +1064,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = { ...@@ -1064,6 +1064,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = {
RAPL_CPU(0x3f, rapl_defaults_hsw_server),/* Haswell servers */ RAPL_CPU(0x3f, rapl_defaults_hsw_server),/* Haswell servers */
RAPL_CPU(0x4f, rapl_defaults_hsw_server),/* Broadwell servers */ RAPL_CPU(0x4f, rapl_defaults_hsw_server),/* Broadwell servers */
RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */ RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */
RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */
RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */ RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */
RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */ RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */
RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */ RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */
......
...@@ -25,14 +25,21 @@ ...@@ -25,14 +25,21 @@
struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus, struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus,
int slot, int func, int vendor, int dev) int slot, int func, int vendor, int dev)
{ {
struct pci_filter filter_nb_link = { domain, bus, slot, func, struct pci_filter filter_nb_link;
vendor, dev };
struct pci_dev *device; struct pci_dev *device;
*pacc = pci_alloc(); *pacc = pci_alloc();
if (*pacc == NULL) if (*pacc == NULL)
return NULL; return NULL;
pci_filter_init(*pacc, &filter_nb_link);
filter_nb_link.domain = domain;
filter_nb_link.bus = bus;
filter_nb_link.slot = slot;
filter_nb_link.func = func;
filter_nb_link.vendor = vendor;
filter_nb_link.device = dev;
pci_init(*pacc); pci_init(*pacc);
pci_scan_bus(*pacc); pci_scan_bus(*pacc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment