<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/acpi/processor_idle.c, branch v3.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-04-02T13:31:28Z</updated>
<entry>
<title>cpuidle / ACPI: recover percpu ACPI processor cstate</title>
<updated>2013-04-02T13:31:28Z</updated>
<author>
<name>Alex Shi</name>
<email>alex.shi@intel.com</email>
</author>
<published>2013-04-01T23:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6240a10dc55a954ce05a86d2f4bc27e473b6352c'/>
<id>urn:sha1:6240a10dc55a954ce05a86d2f4bc27e473b6352c</id>
<content type='text'>
Commit ac3ebafa81af76d6 "ACPI / idle: remove usage of the statedata"
changed the percpu processor cstate to a unified cstate in ACPI idle.
That caused all our NHM boxes to boot hang or panic.

2178751 Task dump for CPU 1:
	2178752 swapper/1       R  running task     6736     0      1 0x00000000
	2178753  ffff8801e8029dc8 ffffffff8101cf96 ffff8801e8029e28 ffffffff813d294b
	2178754  0000000000000f99 0000000000000003 00000000003cf654 0000000025c17d03
	2178755  ffff8801e8029e38 ffff8801e74fc000 00000002590dc5c4 ffffffff8163cdb0
	2178756 Call Trace:
	2178757  [&lt;ffffffff8101cf96&gt;] ? acpi_processor_ffh_cstate_enter+0x2d/0x2f
	2178758  [&lt;ffffffff813d294b&gt;] acpi_idle_enter_bm+0x1b1/0x236
	2178759  [&lt;ffffffff8163cdb0&gt;] ? disable_cpuidle+0x10/0x10
	2178760  [&lt;ffffffff8163cdc2&gt;] cpuidle_enter+0x12/0x14
	2178761  [&lt;ffffffff8163d286&gt;] cpuidle_wrap_enter+0x2f/0x6d
	2178762  [&lt;ffffffff8163d2d4&gt;] cpuidle_enter_tk+0x10/0x12
	2178763  [&lt;ffffffff8163cdd6&gt;] cpuidle_enter_state+0x12/0x3a
	2178764  [&lt;ffffffff8163d4a7&gt;] cpuidle_idle_call+0xe8/0x161
	2178765  [&lt;ffffffff81008d99&gt;] cpu_idle+0x5e/0xa4
	2178766  [&lt;ffffffff8174c6c1&gt;] start_secondary+0x1a9/0x1ad
	2178767 Task dump for CPU 2:

In fact, the ACPI idle is based on the assumption of difference percpu
cstate structures that are necessary for the implementation to work
cprrectly.  A unique acpi_processor_cx is not sifficient by far.

This patch is just a quick fix re-introducing the percpu cstates.

If someone really wants to unify the ACPI cstates, please make sure
that the whole software infrastructure is changed and take hardware
as well as many different kinds of BIOS settings into account.

[rjw: Changelog]
Reported-by: LKP project &lt;lkp@linux.intel.com&gt;
Reported-by: Xie ChanglongX &lt;changlongx.xie@intel.com&gt;
Tested-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Alex Shi &lt;alex.shi@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'misc' into release</title>
<updated>2013-02-18T05:25:53Z</updated>
<author>
<name>Len Brown</name>
<email>len.brown@intel.com</email>
</author>
<published>2013-02-18T05:25:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ca62cf59ceef10ff2ebca0e7f764507186870270'/>
<id>urn:sha1:ca62cf59ceef10ff2ebca0e7f764507186870270</id>
<content type='text'>
Conflicts:
	arch/x86/kernel/process.c

Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>x86 idle: remove mwait_idle() and "idle=mwait" cmdline param</title>
<updated>2013-02-10T08:03:41Z</updated>
<author>
<name>Len Brown</name>
<email>len.brown@intel.com</email>
</author>
<published>2013-02-10T06:38:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=69fb3676df3329a7142803bb3502fa59dc0db2e3'/>
<id>urn:sha1:69fb3676df3329a7142803bb3502fa59dc0db2e3</id>
<content type='text'>
mwait_idle() is a C1-only idle loop intended to be more efficient
than HLT, starting on Pentium-4 HT-enabled processors.

But mwait_idle() has been replaced by the more general
mwait_idle_with_hints(), which handles both C1 and deeper C-states.
ACPI processor_idle and intel_idle use only mwait_idle_with_hints(),
and no longer use mwait_idle().

Here we simplify the x86 native idle code by removing mwait_idle(),
and the "idle=mwait" bootparam used to invoke it.

Since Linux 3.0 there has been a boot-time warning when "idle=mwait"
was invoked saying it would be removed in 2012.  This removal
was also noted in the (now removed:-) feature-removal-schedule.txt.

After this change, kernels configured with
(CONFIG_ACPI=n &amp;&amp; CONFIG_INTEL_IDLE=n) when run on hardware
that supports MWAIT will simply use HLT.  If MWAIT is desired
on those systems, cpuidle and the cpuidle drivers above
can be enabled.

Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
Cc: x86@kernel.org
</content>
</entry>
<entry>
<title>ACPI / idle: remove usage of the statedata</title>
<updated>2013-02-08T23:44:51Z</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2013-02-04T22:44:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac3ebafa81af76d65e4fb45c6388f08e90ddcc6d'/>
<id>urn:sha1:ac3ebafa81af76d65e4fb45c6388f08e90ddcc6d</id>
<content type='text'>
Len Brown sent a patch to remove this field in the intel_idle driver.
The other user of this field is the davinci cpuidle driver and a
patch has been sent to remove the usage of it.

This patch removes the last user of this field.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / idle: pass the cpuidle_device parameter</title>
<updated>2013-02-08T23:44:51Z</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2013-02-04T22:44:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ef0f086beafb3c7d81cd3de81d886d105ea25b2'/>
<id>urn:sha1:6ef0f086beafb3c7d81cd3de81d886d105ea25b2</id>
<content type='text'>
The cpuidle_device is retrieved in the function by using directly
the global variable. But the caller of this function already have
this device and it can be passed as a parameter. That is one small
step to encapsulate the code more.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / idle : remove pointless headers</title>
<updated>2013-02-08T23:44:51Z</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2013-02-04T22:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2668fb53ffd3e01c3116f65a9047a25e4c66399'/>
<id>urn:sha1:e2668fb53ffd3e01c3116f65a9047a25e4c66399</id>
<content type='text'>
These different headers are not needed.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / idle: remove unused definition</title>
<updated>2013-02-08T23:44:51Z</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2013-02-04T22:44:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=41cdb0efc42ed3c10f56e0740db28eff086af62b'/>
<id>urn:sha1:41cdb0efc42ed3c10f56e0740db28eff086af62b</id>
<content type='text'>
The different definitions are not used anywhere in the code.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / processor: Get power info before updating the C-states</title>
<updated>2013-01-18T23:28:22Z</updated>
<author>
<name>Thomas Schlichter</name>
<email>thomas.schlichter@web.de</email>
</author>
<published>2013-01-18T23:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f427e5f1cf75bba84cccdac1d8a90552d9ae1065'/>
<id>urn:sha1:f427e5f1cf75bba84cccdac1d8a90552d9ae1065</id>
<content type='text'>
acpi_processor_get_power_info() has to be called before
acpi_processor_setup_cpuidle_states() to have the latest
information available. This fixes the missing C-state information
after AC--&gt;DC transition.

Signed-off-by: Thomas Schlichter &lt;thomas.schlichter@web.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / cpuidle: Fix NULL pointer issues when cpuidle is disabled</title>
<updated>2013-01-18T12:43:43Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2013-01-16T22:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b88a634a903d9670aa5f2f785aa890628ce0dece'/>
<id>urn:sha1:b88a634a903d9670aa5f2f785aa890628ce0dece</id>
<content type='text'>
If cpuidle is disabled, that means that:

	per_cpu(acpi_cpuidle_device, pr-&gt;id)

is set to NULL as the acpi_processor_power_init ends up failing at

	 retval = cpuidle_register_driver(&amp;acpi_idle_driver)

(in acpi_processor_power_init) and never sets the per_cpu idle
device.  So when acpi_processor_hotplug on CPU online notification
tries to reference said device it crashes:

cpu 3 spinlock event irq 62
BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
IP: [&lt;ffffffff81381013&gt;] acpi_processor_setup_cpuidle_cx+0x3f/0x105
PGD a259b067 PUD ab38b067 PMD 0
Oops: 0002 [#1] SMP
odules linked in: dm_multipath dm_mod xen_evtchn iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi libcrc32c crc32c nouveau mxm_wmi wmi radeon ttm sg sr_mod sd_mod cdrom ata_generic ata_piix libata crc32c_intel scsi_mod atl1c i915 fbcon tileblit font bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf
CPU 1
Pid: 3047, comm: bash Not tainted 3.8.0-rc3upstream-00250-g165c029 #1 MSI MS-7680/H61M-P23 (MS-7680)
RIP: e030:[&lt;ffffffff81381013&gt;]  [&lt;ffffffff81381013&gt;] acpi_processor_setup_cpuidle_cx+0x3f/0x105
RSP: e02b:ffff88001742dca8  EFLAGS: 00010202
RAX: 0000000000010be9 RBX: ffff8800a0a61800 RCX: ffff880105380000
RDX: 0000000000000003 RSI: 0000000000000200 RDI: ffff8800a0a61800
RBP: ffff88001742dce8 R08: ffffffff81812360 R09: 0000000000000200
R10: aaaaaaaaaaaaaaaa R11: 0000000000000001 R12: ffff8800a0a61800
R13: 00000000ffffff01 R14: 0000000000000000 R15: ffffffff81a907a0
FS:  00007fd6942f7700(0000) GS:ffff880105280000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000004 CR3: 00000000a6773000 CR4: 0000000000042660
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process bash (pid: 3047, threadinfo ffff88001742c000, task ffff880017944000)
Stack:
 0000000000000150 ffff880100f59e00 ffff88001742dcd8 ffff8800a0a61800
 0000000000000000 00000000ffffff01 0000000000000000 ffffffff81a907a0
 ffff88001742dd18 ffffffff813815b1 ffff88001742dd08 ffffffff810ae336
Call Trace:
 [&lt;ffffffff813815b1&gt;] acpi_processor_hotplug+0x7c/0x9f
 [&lt;ffffffff810ae336&gt;] ? schedule_delayed_work_on+0x16/0x20
 [&lt;ffffffff8137ee8f&gt;] acpi_cpu_soft_notify+0x90/0xca
 [&lt;ffffffff8166023d&gt;] notifier_call_chain+0x4d/0x70
 [&lt;ffffffff810bc369&gt;] __raw_notifier_call_chain+0x9/0x10
 [&lt;ffffffff81094a4b&gt;] __cpu_notify+0x1b/0x30
 [&lt;ffffffff81652cf7&gt;] _cpu_up+0x103/0x14b
 [&lt;ffffffff81652e18&gt;] cpu_up+0xd9/0xec
 [&lt;ffffffff8164a254&gt;] store_online+0x94/0xd0
 [&lt;ffffffff814122fb&gt;] dev_attr_store+0x1b/0x20
 [&lt;ffffffff81216404&gt;] sysfs_write_file+0xf4/0x170

This patch fixes it.

Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpuidle: Measure idle state durations with monotonic clock</title>
<updated>2012-11-27T13:17:58Z</updated>
<author>
<name>Julius Werner</name>
<email>jwerner@chromium.org</email>
</author>
<published>2012-11-27T13:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a474a515497ef3566cfc17a2cab3d54d6d50ff1c'/>
<id>urn:sha1:a474a515497ef3566cfc17a2cab3d54d6d50ff1c</id>
<content type='text'>
Many cpuidle drivers measure their time spent in an idle state by
reading the wallclock time before and after idling and calculating the
difference. This leads to erroneous results when the wallclock time gets
updated by another processor in the meantime, adding that clock
adjustment to the idle state's time counter.

If the clock adjustment was negative, the result is even worse due to an
erroneous cast from int to unsigned long long of the last_residency
variable. The negative 32 bit integer will zero-extend and result in a
forward time jump of roughly four billion milliseconds or 1.3 hours on
the idle state residency counter.

This patch changes all affected cpuidle drivers to either use the
monotonic clock for their measurements or make use of the generic time
measurement wrapper in cpuidle.c, which was already working correctly.
Some superfluous CLIs/STIs in the ACPI code are removed (interrupts
should always already be disabled before entering the idle function, and
not get reenabled until the generic wrapper has performed its second
measurement). It also removes the erroneous cast, making sure that
negative residency values are applied correctly even though they should
not appear anymore.

Signed-off-by: Julius Werner &lt;jwerner@chromium.org&gt;
Reviewed-by: Preeti U Murthy &lt;preeti@linux.vnet.ibm.com&gt;
Tested-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Len Brown &lt;len.brown@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
