<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/platforms/pseries/processor_idle.c, branch linux-3.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-04-23T11:45:22Z</updated>
<entry>
<title>cpuidle: remove en_core_tk_irqen flag</title>
<updated>2013-04-23T11:45:22Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2013-04-23T08:54:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=554c06ba3ee29cf453fca17e9e61120b75aa476d'/>
<id>urn:sha1:554c06ba3ee29cf453fca17e9e61120b75aa476d</id>
<content type='text'>
The en_core_tk_irqen flag is set in all the cpuidle driver which
means it is not necessary to specify this flag.

Remove the flag and the code related to it.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Kevin Hilman &lt;khilman@linaro.org&gt;  # for mach-omap2/*
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>POWERPC: pseries: cpuidle: use time keeping flag</title>
<updated>2013-04-08T20:20:06Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2013-04-03T12:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1ca8094403ae5553c6a0f404842be3075b302c70'/>
<id>urn:sha1:1ca8094403ae5553c6a0f404842be3075b302c70</id>
<content type='text'>
The current code computes the idle time but that can be handled
by the cpuidle framework if we enable the .en_core_tk_irqen flag.

Set the flag and remove the code related to the time computation.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Deepthi Dharwar &lt;deepthi@linux.vnet.ibm.com&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>
</author>
<published>2012-11-27T13:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
<entry>
<title>cpuidle/powerpc: Fix snooze state problem in the cpuidle design on pseries.</title>
<updated>2012-10-17T23:57:25Z</updated>
<author>
<name>Deepthi Dharwar</name>
</author>
<published>2012-10-03T18:42:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83dac59409387789b88bed40b1be86a8abc572be'/>
<id>urn:sha1:83dac59409387789b88bed40b1be86a8abc572be</id>
<content type='text'>
Earlier without cpuidle framework on pseries, the native arch
idle routine comprised of both snooze and nap
states.  smt_snooze_delay variable was used to delay
the idle process entry to deeper idle state like  nap.
With the coming of cpuidle, this arch specific idle was replaced
by two different idle routines, one for supporting snooze and other
for nap. This enabled addition of more
low level idle states on pseries in the future.

On adopting the generic cpuidle framework for POWER systems,
the decision of which idle state to choose from,  given a predicted
idle time is taken by the menu governor based on
target_residency and  exit_latency of the idle states.
target_residency is the minimum time to be resident in that idle state.
Exit_latency is time taken to exit out of idle state.
Deeper the idle state, both the target residency and exit latency
would be higher.

In the current design, smt_snooze_delay is used as target_residency
for the  snooze state which is incorrect, as it is not the
minimum but the maximum duration to be in snooze state.
This would  result in the governor in taking bad decision,
as presently target_residency of nap &lt; target_residency of snooze
inspite of nap being deeper idle state.

This patch aims to fix this problem by replacing the smt_snooze_delay loop
in snooze state, with the need_resched()  as the governor is aware of
entry and exit of various idle transitions based on which
next idle time prediction.

The governor is intelligent enough to determine the idle state the needs to
be transitioned to and maintains a whole of heuristics including
io load, previous idle states predictions etc for the same, based on
which idle state entry decision is taken.

With this fix, of setting target_residency of snooze to 0
					     nap to smt_snooze_delay
if the predicted idle time is less
than smt_snooze_delay (target_residency of nap)
value governor would pick snooze state, else nap. This adhers to the
previous native idle design.

Signed-off-by: Deepthi Dharwar &lt;deepthi@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>cpuidle/powerpc: Fix smt_snooze_delay functionality.</title>
<updated>2012-10-17T23:57:24Z</updated>
<author>
<name>Deepthi Dharwar</name>
</author>
<published>2012-10-03T18:42:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ea959a17fe6e27f7954dddad5b17b0e33f0d7ee'/>
<id>urn:sha1:8ea959a17fe6e27f7954dddad5b17b0e33f0d7ee</id>
<content type='text'>
smt_snooze_delay was designed to  delay idle loop's nap entry
in the native idle code before it got  ported over to use as part of
the cpuidle framework.

A -ve value  assigned to smt_snooze_delay should result in
busy looping, in other words disabling the entry to nap state.

	- https://lists.ozlabs.org/pipermail/linuxppc-dev/2010-May/082450.html

This particular functionality can be achieved currently by
echo 1 &gt; /sys/devices/system/cpu/cpu*/state1/disable
but it is broken when one assigns -ve value to  the smt_snooze_delay
variable either via sysfs entry or ppc64_cpu util.

This patch aims to fix this, by disabling nap state when smt_snooze_delay
variable is set to -ve value.

Signed-off-by: Deepthi Dharwar &lt;deepthi@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>cpuidle/powerpc: Fix target residency initialisation in pseries cpuidle</title>
<updated>2012-10-17T23:57:24Z</updated>
<author>
<name>Deepthi Dharwar</name>
</author>
<published>2012-10-03T18:42:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=817deb05df45577d4037230f2facee486c11d9df'/>
<id>urn:sha1:817deb05df45577d4037230f2facee486c11d9df</id>
<content type='text'>
Remove the redundant target residency initialisation in pseries_cpuidle_driver_init().
This is currently over-writing the residency time updated as part of the static
table, resulting in  all the idle states having the same target
residency of 100us which is incorrect. This may result in the menu governor making
wrong state decisions.

Signed-off-by: Deepthi Dharwar &lt;deepthi@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/cpuidle: Fixes for pseries_idle hotplug notifier</title>
<updated>2012-07-11T04:18:35Z</updated>
<author>
<name>Deepthi Dharwar</name>
</author>
<published>2012-07-03T20:07:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=852d8cb1ff7cc26e59a4bbb68e230d133b257098'/>
<id>urn:sha1:852d8cb1ff7cc26e59a4bbb68e230d133b257098</id>
<content type='text'>
Currently the call to pseries_notify_cpuidle_add_cpu(), that takes
action on the cpuidle front when a cpu is added/removed
is being made from smp_xics_setup_cpu().
This caused lockdep issues as
reported https://lkml.org/lkml/2012/5/17/2

On addition of each cpu,
resources were cleared and re-allocated each time, all in critical
section as part of start_secondary() call were interrupts are disabled.
To resolve this issue, the pseries_notify_cpuidle_add_cpu() call is
is being replaced by a hotplug notifier which
would prevent cpuidle resources from being
released and allocated each time cpu is onlined in the critical code path.
It was fixed in https://lkml.org/lkml/2012/5/18/174.

Also it is essential to call cpuidle_enable/disable_device
between  cpuidle_pause_and_lock()  and
cpuidle_resume_and_unlock()  when used externally
to avoid race conditions. Add support for CPU_ONLINE_FROZEN
and CPU_DEAD_FROZEN as part of hotplug notify event for
pseries_idle  and unregister hotplug notifier
while exiting out. The above mentioned issues
are fixed as part of this patch.

Signed-off-by: Deepthi Dharwar &lt;deepthi@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'merge' into next</title>
<updated>2012-07-10T09:16:43Z</updated>
<author>
<name>Benjamin Herrenschmidt</name>
</author>
<published>2012-07-10T09:16:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50bba07d6a16ce4a3b4f6abb44bfd3645c046ef6'/>
<id>urn:sha1:50bba07d6a16ce4a3b4f6abb44bfd3645c046ef6</id>
<content type='text'>
We want to bring in the latest IRQ fixes
</content>
</entry>
<entry>
<title>powerpc: More fixes for lazy IRQ vs. idle</title>
<updated>2012-07-10T09:16:07Z</updated>
<author>
<name>Benjamin Herrenschmidt</name>
</author>
<published>2012-07-10T08:36:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be2cf20a5ad31ebb13562c1c866ecc626fbd721e'/>
<id>urn:sha1:be2cf20a5ad31ebb13562c1c866ecc626fbd721e</id>
<content type='text'>
Looks like we still have issues with pSeries and Cell idle code
vs. the lazy irq state. In fact, the reset fixes that went upstream
are exposing the problem more by causing BUG_ON() to trigger (which
this patch turns into a WARN_ON instead).

We need to be careful when using a variant of low power state that
has the side effect of turning interrupts back on, to properly set
all the SW &amp; lazy state to look as if everything is enabled before
we enter the low power state with MSR:EE off as we will return with
MSR:EE on. If not, we have a discrepancy of state which can cause
things to go very wrong later on.

This patch moves the logic into a helper and uses it from the
pseries and cell idle code. The power4/970 idle code already got
things right (in assembly even !) so I'm not touching it. The power7
"bare metal" idle code is subtly different and correct. Remains PA6T
and some hypervisor based Cell platforms which have questionable
code in there, but they are mostly dead platforms so I'll fix them
when I manage to get final answers from the respective maintainers
about how the low power state actually works on them.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
CC: stable@vger.kernel.org [v3.4]
</content>
</entry>
<entry>
<title>powerpc/pseries/cpuidle: Replace pseries_notify_cpuidle_add call with notifier</title>
<updated>2012-07-03T04:14:40Z</updated>
<author>
<name>Deepthi Dharwar</name>
</author>
<published>2012-05-20T18:34:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16aaaff68440dd95de98adb075303355814be6e0'/>
<id>urn:sha1:16aaaff68440dd95de98adb075303355814be6e0</id>
<content type='text'>
The following patch is to remove the pseries_notify_add_cpu() call
and replace it by a hot plug notifier.

This would prevent cpuidle resources being released and allocated each
time cpu comes online on pseries.

The earlier design was causing a lockdep problem
in start_secondary as reported on this thread
	-https://lkml.org/lkml/2012/5/17/2

This applies on 3.4-rc7

Signed-off-by: Deepthi Dharwar &lt;deepthi@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
</feed>
