Skip to content

Commit

Permalink
Merge tag 'pm+acpi-3.12-rc1' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/rafael/linux-pm

Pull ACPI and power management updates from Rafael Wysocki:

 1) ACPI-based PCI hotplug (ACPIPHP) subsystem rework and introduction
    of Intel Thunderbolt support on systems that use ACPI for signalling
    Thunderbolt hotplug events.  This also should make ACPIPHP work in
    some cases in which it was known to have problems.  From
    Rafael J Wysocki, Mika Westerberg and Kirill A Shutemov.

 2) ACPI core code cleanups and dock station support cleanups from
    Jiang Liu and Rafael J Wysocki.

 3) Fixes for locking problems related to ACPI device hotplug from
    Rafael J Wysocki.

 4) ACPICA update to version 20130725 includig fixes, cleanups, support
    for more than 256 GPEs per GPE block and a change to make the ACPI
    PM Timer optional (we've seen systems without the PM Timer in the
    field already).  One of the fixes, related to the DeRefOf operator,
    is necessary to prevent some Windows 8 oriented AML from causing
    problems to happen.  From Bob Moore, Lv Zheng, and Jung-uk Kim.

 5) Removal of the old and long deprecated /proc/acpi/event interface
    and related driver changes from Thomas Renninger.

 6) ACPI and Xen changes to make the reduced hardware sleep work with
    the latter from Ben Guthro.

 7) ACPI video driver cleanups and a blacklist of systems that should
    not tell the BIOS that they are compatible with Windows 8 (or ACPI
    backlight and possibly other things will not work on them).  From
    Felipe Contreras.

 8) Assorted ACPI fixes and cleanups from Aaron Lu, Hanjun Guo,
    Kuppuswamy Sathyanarayanan, Lan Tianyu, Sachin Kamat, Tang Chen,
    Toshi Kani, and Wei Yongjun.

 9) cpufreq ondemand governor target frequency selection change to
    reduce oscillations between min and max frequencies (essentially,
    it causes the governor to choose target frequencies proportional
    to load) from Stratos Karafotis.

10) cpufreq fixes allowing sysfs attributes file permissions to be
    preserved over suspend/resume cycles Srivatsa S Bhat.

11) Removal of Device Tree parsing for CPU device nodes from multiple
    cpufreq drivers that required some changes related to
    of_get_cpu_node() to be made in a few architectures and in the
    driver core.  From Sudeep KarkadaNagesha.

12) cpufreq core fixes and cleanups related to mutual exclusion and
    driver module references from Viresh Kumar, Lukasz Majewski and
    Rafael J Wysocki.

13) Assorted cpufreq fixes and cleanups from Amit Daniel Kachhap,
    Bartlomiej Zolnierkiewicz, Hanjun Guo, Jingoo Han, Joseph Lo,
    Julia Lawall, Li Zhong, Mark Brown, Sascha Hauer, Stephen Boyd,
    Stratos Karafotis, and Viresh Kumar.

14) Fixes to prevent race conditions in coupled cpuidle from happening
    from Colin Cross.

15) cpuidle core fixes and cleanups from Daniel Lezcano and
    Tuukka Tikkanen.

16) Assorted cpuidle fixes and cleanups from Daniel Lezcano,
    Geert Uytterhoeven, Jingoo Han, Julia Lawall, Linus Walleij,
    and Sahara.

17) System sleep tracing changes from Todd E Brandt and Shuah Khan.

18) PNP subsystem conversion to using struct dev_pm_ops for power
    management from Shuah Khan.

* tag 'pm+acpi-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (217 commits)
  cpufreq: Don't use smp_processor_id() in preemptible context
  cpuidle: coupled: fix race condition between pokes and safe state
  cpuidle: coupled: abort idle if pokes are pending
  cpuidle: coupled: disable interrupts after entering safe state
  ACPI / hotplug: Remove containers synchronously
  driver core / ACPI: Avoid device hot remove locking issues
  cpufreq: governor: Fix typos in comments
  cpufreq: governors: Remove duplicate check of target freq in supported range
  cpufreq: Fix timer/workqueue corruption due to double queueing
  ACPI / EC: Add ASUSTEK L4R to quirk list in order to validate ECDT
  ACPI / thermal: Add check of "_TZD" availability and evaluating result
  cpufreq: imx6q: Fix clock enable balance
  ACPI: blacklist win8 OSI for buggy laptops
  cpufreq: tegra: fix the wrong clock name
  cpuidle: Change struct menu_device field types
  cpuidle: Add a comment warning about possible overflow
  cpuidle: Fix variable domains in get_typical_interval()
  cpuidle: Fix menu_device->intervals type
  cpuidle: CodingStyle: Break up multiple assignments on single line
  cpuidle: Check called function parameter in get_typical_interval()
  ...
  • Loading branch information
Linus Torvalds committed Sep 3, 2013
2 parents dcaaaea + f41b831 commit 40031da
Show file tree
Hide file tree
Showing 188 changed files with 2,986 additions and 3,495 deletions.
2 changes: 0 additions & 2 deletions Documentation/cpu-freq/cpu-drivers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ What shall this struct cpufreq_driver contain?

cpufreq_driver.name - The name of this driver.

cpufreq_driver.owner - THIS_MODULE;

cpufreq_driver.init - A pointer to the per-CPU initialization
function.

Expand Down
55 changes: 53 additions & 2 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,61 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Format: To spoof as Windows 98: ="Microsoft Windows"

acpi_osi= [HW,ACPI] Modify list of supported OS interface strings
acpi_osi="string1" # add string1 -- only one string
acpi_osi="!string2" # remove built-in string2
acpi_osi="string1" # add string1
acpi_osi="!string2" # remove string2
acpi_osi=!* # remove all strings
acpi_osi=! # disable all built-in OS vendor
strings
acpi_osi= # disable all strings

'acpi_osi=!' can be used in combination with single or
multiple 'acpi_osi="string1"' to support specific OS
vendor string(s). Note that such command can only
affect the default state of the OS vendor strings, thus
it cannot affect the default state of the feature group
strings and the current state of the OS vendor strings,
specifying it multiple times through kernel command line
is meaningless. This command is useful when one do not
care about the state of the feature group strings which
should be controlled by the OSPM.
Examples:
1. 'acpi_osi=! acpi_osi="Windows 2000"' is equivalent
to 'acpi_osi="Windows 2000" acpi_osi=!', they all
can make '_OSI("Windows 2000")' TRUE.

'acpi_osi=' cannot be used in combination with other
'acpi_osi=' command lines, the _OSI method will not
exist in the ACPI namespace. NOTE that such command can
only affect the _OSI support state, thus specifying it
multiple times through kernel command line is also
meaningless.
Examples:
1. 'acpi_osi=' can make 'CondRefOf(_OSI, Local1)'
FALSE.

'acpi_osi=!*' can be used in combination with single or
multiple 'acpi_osi="string1"' to support specific
string(s). Note that such command can affect the
current state of both the OS vendor strings and the
feature group strings, thus specifying it multiple times
through kernel command line is meaningful. But it may
still not able to affect the final state of a string if
there are quirks related to this string. This command
is useful when one want to control the state of the
feature group strings to debug BIOS issues related to
the OSPM features.
Examples:
1. 'acpi_osi="Module Device" acpi_osi=!*' can make
'_OSI("Module Device")' FALSE.
2. 'acpi_osi=!* acpi_osi="Module Device"' can make
'_OSI("Module Device")' TRUE.
3. 'acpi_osi=! acpi_osi=!* acpi_osi="Windows 2000"' is
equivalent to
'acpi_osi=!* acpi_osi=! acpi_osi="Windows 2000"'
and
'acpi_osi=!* acpi_osi="Windows 2000" acpi_osi=!',
they all will make '_OSI("Windows 2000")' TRUE.

acpi_pm_good [X86]
Override the pmtimer bug detection: force the kernel
to assume that this machine's pmtimer latches its value
Expand Down
8 changes: 4 additions & 4 deletions Documentation/laptops/asus-laptop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ http://acpi4asus.sf.net/

This driver provides support for extra features of ACPI-compatible ASUS laptops.
It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or
VICTOR XP7210 for example). It makes all the extra buttons generate standard
ACPI events that go through /proc/acpi/events and input events (like keyboards).
VICTOR XP7210 for example). It makes all the extra buttons generate input
events (like keyboards).
On some models adds support for changing the display brightness and output,
switching the LCD backlight on and off, and most importantly, allows you to
blink those fancy LEDs intended for reporting mail and wireless status.
Expand Down Expand Up @@ -55,8 +55,8 @@ Usage
DSDT) to me.

That's all, now, all the events generated by the hotkeys of your laptop
should be reported in your /proc/acpi/event entry. You can check with
"acpi_listen".
should be reported via netlink events. You can check with
"acpi_genl monitor" (part of the acpica project).

Hotkeys are also reported as input keys (like keyboards) you can check
which key are supported using "xev" under X11.
Expand Down
8 changes: 4 additions & 4 deletions Documentation/laptops/sony-laptop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Fn keys (hotkeys):
------------------
Some models report hotkeys through the SNC or SPIC devices, such events are
reported both through the ACPI subsystem as acpi events and through the INPUT
subsystem. See the logs of acpid or /proc/acpi/event and
/proc/bus/input/devices to find out what those events are and which input
devices are created by the driver. Additionally, loading the driver with the
debug option will report all events in the kernel log.
subsystem. See the logs of /proc/bus/input/devices to find out what those
events are and which input devices are created by the driver.
Additionally, loading the driver with the debug option will report all events
in the kernel log.

The "scancodes" passed to the input system (that can be remapped with udev)
are indexes to the table "sony_laptop_input_keycode_map" in the sony-laptop.c
Expand Down
73 changes: 6 additions & 67 deletions Documentation/laptops/thinkpad-acpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -329,20 +329,6 @@ sysfs notes:

This attribute has poll()/select() support.

hotkey_report_mode:
Returns the state of the procfs ACPI event report mode
filter for hot keys. If it is set to 1 (the default),
all hot key presses are reported both through the input
layer and also as ACPI events through procfs (but not
through netlink). If it is set to 2, hot key presses
are reported only through the input layer.

This attribute is read-only in kernels 2.6.23 or later,
and read-write on earlier kernels.

May return -EPERM (write access locked out by module
parameter) or -EACCES (read-only).

wakeup_reason:
Set to 1 if the system is waking up because the user
requested a bay ejection. Set to 2 if the system is
Expand Down Expand Up @@ -518,24 +504,21 @@ SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A
Non hotkey ACPI HKEY event map:
-------------------------------

Events that are not propagated by the driver, except for legacy
compatibility purposes when hotkey_report_mode is set to 1:

0x5001 Lid closed
0x5002 Lid opened
0x5009 Tablet swivel: switched to tablet mode
0x500A Tablet swivel: switched to normal mode
0x7000 Radio Switch may have changed state

Events that are never propagated by the driver:

0x2304 System is waking up from suspend to undock
0x2305 System is waking up from suspend to eject bay
0x2404 System is waking up from hibernation to undock
0x2405 System is waking up from hibernation to eject bay
0x5001 Lid closed
0x5002 Lid opened
0x5009 Tablet swivel: switched to tablet mode
0x500A Tablet swivel: switched to normal mode
0x5010 Brightness level changed/control event
0x6000 KEYBOARD: Numlock key pressed
0x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED)
0x7000 Radio Switch may have changed state


Events that are propagated by the driver to userspace:

Expand Down Expand Up @@ -574,50 +557,6 @@ operating system is to force either an immediate suspend or hibernate
cycle, or a system shutdown. Obviously, something is very wrong if this
happens.

Compatibility notes:

ibm-acpi and thinkpad-acpi 0.15 (mainline kernels before 2.6.23) never
supported the input layer, and sent events over the procfs ACPI event
interface.

To avoid sending duplicate events over the input layer and the ACPI
event interface, thinkpad-acpi 0.16 implements a module parameter
(hotkey_report_mode), and also a sysfs device attribute with the same
name.

Make no mistake here: userspace is expected to switch to using the input
layer interface of thinkpad-acpi, together with the ACPI netlink event
interface in kernels 2.6.23 and later, or with the ACPI procfs event
interface in kernels 2.6.22 and earlier.

If no hotkey_report_mode module parameter is specified (or it is set to
zero), the driver defaults to mode 1 (see below), and on kernels 2.6.22
and earlier, also allows one to change the hotkey_report_mode through
sysfs. In kernels 2.6.23 and later, where the netlink ACPI event
interface is available, hotkey_report_mode cannot be changed through
sysfs (it is read-only).

If the hotkey_report_mode module parameter is set to 1 or 2, it cannot
be changed later through sysfs (any writes will return -EPERM to signal
that hotkey_report_mode was locked. On 2.6.23 and later, where
hotkey_report_mode cannot be changed at all, writes will return -EACCES).

hotkey_report_mode set to 1 makes the driver export through the procfs
ACPI event interface all hot key presses (which are *also* sent to the
input layer). This is a legacy compatibility behaviour, and it is also
the default mode of operation for the driver.

hotkey_report_mode set to 2 makes the driver filter out the hot key
presses from the procfs ACPI event interface, so these events will only
be sent through the input layer. Userspace that has been updated to use
the thinkpad-acpi input layer interface should set hotkey_report_mode to
2.

Hot key press events are never sent to the ACPI netlink event interface.
Really up-to-date userspace under kernel 2.6.23 and later is to use the
netlink interface and the input layer interface, and don't bother at all
with hotkey_report_mode.


Brightness hotkey notes:

Expand Down
5 changes: 5 additions & 0 deletions arch/arm/kernel/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ void __init arm_dt_init_cpu_maps(void)
}
}

bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
{
return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
}

/**
* setup_machine_fdt - Machine setup when an dtb was passed to the kernel
* @dt_phys: physical address of dt blob
Expand Down
61 changes: 19 additions & 42 deletions arch/arm/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,8 @@ struct cpu_efficiency table_efficiency[] = {
{NULL, },
};

struct cpu_capacity {
unsigned long hwid;
unsigned long capacity;
};

struct cpu_capacity *cpu_capacity;
unsigned long *__cpu_capacity;
#define cpu_capacity(cpu) __cpu_capacity[cpu]

unsigned long middle_capacity = 1;

Expand All @@ -100,15 +96,19 @@ static void __init parse_dt_topology(void)
unsigned long capacity = 0;
int alloc_size, cpu = 0;

alloc_size = nr_cpu_ids * sizeof(struct cpu_capacity);
cpu_capacity = kzalloc(alloc_size, GFP_NOWAIT);
alloc_size = nr_cpu_ids * sizeof(*__cpu_capacity);
__cpu_capacity = kzalloc(alloc_size, GFP_NOWAIT);

while ((cn = of_find_node_by_type(cn, "cpu"))) {
const u32 *rate, *reg;
for_each_possible_cpu(cpu) {
const u32 *rate;
int len;

if (cpu >= num_possible_cpus())
break;
/* too early to use cpu->of_node */
cn = of_get_cpu_node(cpu, NULL);
if (!cn) {
pr_err("missing device node for CPU %d\n", cpu);
continue;
}

for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++)
if (of_device_is_compatible(cn, cpu_eff->compatible))
Expand All @@ -124,12 +124,6 @@ static void __init parse_dt_topology(void)
continue;
}

reg = of_get_property(cn, "reg", &len);
if (!reg || len != 4) {
pr_err("%s missing reg property\n", cn->full_name);
continue;
}

capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency;

/* Save min capacity of the system */
Expand All @@ -140,23 +134,17 @@ static void __init parse_dt_topology(void)
if (capacity > max_capacity)
max_capacity = capacity;

cpu_capacity[cpu].capacity = capacity;
cpu_capacity[cpu++].hwid = be32_to_cpup(reg);
cpu_capacity(cpu) = capacity;
}

if (cpu < num_possible_cpus())
cpu_capacity[cpu].hwid = (unsigned long)(-1);

/* If min and max capacities are equals, we bypass the update of the
* cpu_scale because all CPUs have the same capacity. Otherwise, we
* compute a middle_capacity factor that will ensure that the capacity
* of an 'average' CPU of the system will be as close as possible to
* SCHED_POWER_SCALE, which is the default value, but with the
* constraint explained near table_efficiency[].
*/
if (min_capacity == max_capacity)
cpu_capacity[0].hwid = (unsigned long)(-1);
else if (4*max_capacity < (3*(max_capacity + min_capacity)))
if (4*max_capacity < (3*(max_capacity + min_capacity)))
middle_capacity = (min_capacity + max_capacity)
>> (SCHED_POWER_SHIFT+1);
else
Expand All @@ -170,31 +158,20 @@ static void __init parse_dt_topology(void)
* boot. The update of all CPUs is in O(n^2) for heteregeneous system but the
* function returns directly for SMP system.
*/
void update_cpu_power(unsigned int cpu, unsigned long hwid)
void update_cpu_power(unsigned int cpu)
{
unsigned int idx = 0;

/* look for the cpu's hwid in the cpu capacity table */
for (idx = 0; idx < num_possible_cpus(); idx++) {
if (cpu_capacity[idx].hwid == hwid)
break;

if (cpu_capacity[idx].hwid == -1)
return;
}

if (idx == num_possible_cpus())
if (!cpu_capacity(cpu))
return;

set_power_scale(cpu, cpu_capacity[idx].capacity / middle_capacity);
set_power_scale(cpu, cpu_capacity(cpu) / middle_capacity);

printk(KERN_INFO "CPU%u: update cpu_power %lu\n",
cpu, arch_scale_freq_power(NULL, cpu));
}

#else
static inline void parse_dt_topology(void) {}
static inline void update_cpu_power(unsigned int cpuid, unsigned int mpidr) {}
static inline void update_cpu_power(unsigned int cpuid) {}
#endif

/*
Expand Down Expand Up @@ -281,7 +258,7 @@ void store_cpu_topology(unsigned int cpuid)

update_siblings_masks(cpuid);

update_cpu_power(cpuid, mpidr & MPIDR_HWID_BITMASK);
update_cpu_power(cpuid);

printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
cpuid, cpu_topology[cpuid].thread_id,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static struct cpuidle_driver davinci_idle_driver = {
.states[1] = {
.enter = davinci_enter_idle,
.exit_latency = 10,
.target_residency = 100000,
.target_residency = 10000,
.flags = CPUIDLE_FLAG_TIME_VALID,
.name = "DDR SR",
.desc = "WFI and DDR Self Refresh",
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-imx/mach-imx6q.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,12 @@ static void __init imx6q_opp_init(struct device *cpu_dev)
{
struct device_node *np;

np = of_find_node_by_path("/cpus/cpu@0");
np = of_node_get(cpu_dev->of_node);
if (!np) {
pr_warn("failed to find cpu0 node\n");
return;
}

cpu_dev->of_node = np;
if (of_init_opp_table(cpu_dev)) {
pr_warn("failed to init OPP table\n");
goto put_node;
Expand Down
Loading

0 comments on commit 40031da

Please sign in to comment.