With the addition of following patch:
fcf8058 cpufreq: Simplify cpufreq_add_dev()
cpufreq driver's .init() routine must initialize policy->cpus with mask of all
possible cpus (Online + Offline) that share the clock. Then the core would copy
this mask onto policy->related_cpus and will reset policy->cpus to carry only
online cpus.
acpi-cpufreq driver wasn't updated with this assumption and so sometimes when
we try to hot[un]plug cpus at run time, sysfs directories gets corrupted.
This patch fixes acpi-cpufreq driver against this corruption.
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
Tested-by: Maciej Rutecki <maciej.rutecki(a)gmail.com>
---
drivers/cpufreq/acpi-cpufreq.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index afbef9c..11b8b4b 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -723,7 +723,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) {
cpumask_copy(policy->cpus, perf->shared_cpu_map);
}
- cpumask_copy(policy->related_cpus, perf->shared_cpu_map);
#ifdef CONFIG_SMP
dmi_check_system(sw_any_bug_dmi_table);
@@ -735,7 +734,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
if (check_amd_hwpstate_cpu(cpu) && !acpi_pstate_strict) {
cpumask_clear(policy->cpus);
cpumask_set_cpu(cpu, policy->cpus);
- cpumask_copy(policy->related_cpus, cpu_sibling_mask(cpu));
policy->shared_type = CPUFREQ_SHARED_TYPE_HW;
pr_info_once(PFX "overriding BIOS provided _PSD data\n");
}
--
1.7.12.rc2.18.g61b472e
On Sat 23 Mar 2013 06:52:36 AM CST,
linaro-kernel-request(a)lists.linaro.org wrote:
> Send linaro-kernel mailing list submissions to
> linaro-kernel(a)lists.linaro.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.linaro.org/mailman/listinfo/linaro-kernel
> or, via email, send a message with subject or body 'help' to
> linaro-kernel-request(a)lists.linaro.org
>
> You can reach the person managing the list at
> linaro-kernel-owner(a)lists.linaro.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of linaro-kernel digest..."
>
>
> Today's Topics:
>
> 1. Re: [PATCH V3 5/7] mmc: queue work on any cpu (Viresh Kumar)
> 2. Re: [PATCH V3 5/7] mmc: queue work on any cpu (Chris Ball)
> 3. Re: [PATCH V3 5/7] mmc: queue work on any cpu (Chris Ball)
> 4. Re: [PATCH V3 5/7] mmc: queue work on any cpu (Chris Ball)
> 5. Re: [PATCH 2/2] PM / devfreq: tie suspend/resume to
> runtime-pm (Kevin Hilman)
> 6. [ACTIVITY] (Linus Walleij) 2013-02-22 - 2013-03-22 (Linus Walleij)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 22 Mar 2013 22:57:49 +0530
> From: Viresh Kumar <viresh.kumar(a)linaro.org>
> To: Chris Ball <cjb(a)laptop.org>
> Cc: venki(a)google.com, linaro-kernel(a)lists.linaro.org,
> suresh.b.siddha(a)intel.com, peterz(a)infradead.org, Liviu.Dudau(a)arm.com,
> robin.randhawa(a)arm.com, linux-kernel(a)vger.kernel.org,
> rostedt(a)goodmis.org, mingo(a)redhat.com, Steve.Bannister(a)arm.com,
> tj(a)kernel.org, linux-mmc(a)vger.kernel.org, Arvind.Chauhan(a)arm.com,
> pjt(a)google.com, linux-rt-users(a)vger.kernel.org,
> charles.garcia-tobin(a)arm.com
> Subject: Re: [PATCH V3 5/7] mmc: queue work on any cpu
> Message-ID:
> <CAKohpomqkYeMgvTpjrUjGs3md=vzguW5Ae6Snf4hzsqtQxNDOw(a)mail.gmail.com>
> Content-Type: text/plain; charset=windows-1252
>
> On 22 March 2013 22:56, Chris Ball <cjb(a)laptop.org> wrote:
>> On Mon, Mar 18 2013, Viresh Kumar wrote:
>>
>> /home/cjb/git/mmc/drivers/mmc/core/core.c: In function ?mmc_schedule_delayed_work?:
>> /home/cjb/git/mmc/drivers/mmc/core/core.c:88:2: error: implicit declaration of function ?queue_delayed_work_on_any_cpu? [-Werror=implicit-function-declaration]
>>
>> I've dropped this patch for now. This function doesn't seem to be
>> defined in linux-next either.
>
> Hi chris,
>
> This patch was part of a bigger patchset which also adds this API. I
> don't want you to
> apply this one but just Ack here. Probably Tejun or some scheduler
> maintainer will
> apply it later (if they like all patches).
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 22 Mar 2013 13:09:13 -0400
> From: Chris Ball <cjb(a)laptop.org>
> To: Viresh Kumar <viresh.kumar(a)linaro.org>
> Cc: venki(a)google.com, linaro-kernel(a)lists.linaro.org,
> suresh.b.siddha(a)intel.com, peterz(a)infradead.org, Liviu.Dudau(a)arm.com,
> robin.randhawa(a)arm.com, linux-kernel(a)vger.kernel.org,
> rostedt(a)goodmis.org, mingo(a)redhat.com, Steve.Bannister(a)arm.com,
> tj(a)kernel.org, linux-mmc(a)vger.kernel.org, Arvind.Chauhan(a)arm.com,
> pjt(a)google.com, linux-rt-users(a)vger.kernel.org,
> charles.garcia-tobin(a)arm.com
> Subject: Re: [PATCH V3 5/7] mmc: queue work on any cpu
> Message-ID: <87sj3nl5ty.fsf(a)octavius.laptop.org>
> Content-Type: text/plain
>
> Hi,
>
> On Mon, Mar 18 2013, Viresh Kumar wrote:
>> mmc uses workqueues for running mmc_rescan(). There is no real dependency of
>> scheduling these on the cpu which scheduled them.
>>
>> On a idle system, it is observed that and idle cpu wakes up many times just to
>> service this work. It would be better if we can schedule it on a cpu which isn't
>> idle to save on power.
>>
>> By idle cpu (from scheduler's perspective) we mean:
>> - Current task is idle task
>> - nr_running == 0
>> - wake_list is empty
>>
>> This patch replaces the queue_delayed_work() with
>> queue_delayed_work_on_any_cpu() siblings.
>>
>> This routine would look for the closest (via scheduling domains) non-idle cpu
>> (non-idle from schedulers perspective). If the current cpu is not idle or all
>> cpus are idle, work will be scheduled on local cpu.
>>
>> Cc: Chris Ball <cjb(a)laptop.org>
>> Cc: linux-mmc(a)vger.kernel.org
>> Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
>> ---
>> drivers/mmc/core/core.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index 9290bb5..adf331a 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -85,7 +85,7 @@ MODULE_PARM_DESC(
>> static int mmc_schedule_delayed_work(struct delayed_work *work,
>> unsigned long delay)
>> {
>> - return queue_delayed_work(workqueue, work, delay);
>> + return queue_delayed_work_on_any_cpu(workqueue, work, delay);
>> }
>>
>> /*
>
> Thanks, pushed to mmc-next for 3.10.
>
> - Chris.
where can i find the kernel source for pandaboard es ?
=== Highlights ===
* Tixy reported issue with the linaro.android-3.9-experimental branch,
and I patched it up.
* Sent Tixy's issue along with other fixups I had for the
linaro.android-3.9 branch to AOSP via gerrit. Arve reviewed and picked
them up, so AOSP now matches our tree.
* Talked with Jakub about Jira card process
* Prepped and did interview #1 for the week, wrote up my summary afterwards
* Did a few iterations of review with Serban on his binder patches.
* Provided MikeL w/ Timezone coverage info (Linaro covers 71% of
timezones, missing only 7!)
* Reviewed blueprints and did weekly Android upstreaming subteam email.
* Prepped, interviewed and summarized interview #2 this week.
* Started reviewing and testing Minchan's latest vrange patches. Sent
some questions and a small cleanup fix his way.
* Took a second pass at NTP changes required for timekeeping lock hold
reductions & sent to Thomas.
=== Plans ===
* Still need to sort out Linaro Connect expense reporting.
* Probably more interviews, although hopefully not too much more, as
they're taking up a big chunk of my time.
* Send out timekeeping lock hold time reductions.
* Send pull request to tglx for my 3.10 queue.
* Still need to work on earlysuspend blog post.
* Focus on volatile range work in prep for lsf-mm
=== Issues ===
* NA
== Linus Walleij linusw ==
=== Highlights ===
* First activity report since Linaro Connect!
* Sent first batch of multiplatform patches after finally getting
a few cycles to actually fix this. After that Arnd saw that there
was not much left and completed the series. (Yay!)
We now have ux500 booting in multiplatform config, but the
exact format of the patches need to be discussed and
finalized. Some guys working on the PRCMU, CPUidle
and suspend drivers need to be coordinated.
* Collected pinctrl fixes and new patches.
* Started to churn through some of the GPIO review backlog.
* Initiated a discussion on PCI and VGA consoles, which really
took off. This is one of those open items, ARM PCI needs some
work for sure.
=== Plans ===
* A short paternity leave 6/5->9/5 in may.
* Finalize the multiplatform series, coordinate with stakeholders
and send a pull request.
* Convert Nomadik pinctrl driver to register GPIO ranges
from the gpiochip side.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Get hands dirty with regmap.
=== Issues ===
* Things have been hectic internally at ST-Ericsson diverting me
from Linaro work.
Thanks,
Linus Walleij
== Ulf Hansson ==
=== Highlights ===
Storage:
* Reviewing patches on mmc-list. Pushed a patch related to polling card detect.
* Discussing sent patchset to enable runtime pm support for mmc/sd block device.
* Rework parts of the HS200 and SDR104 support in the mmc protocol
layer. First part for tuning sequence done, patch will be pushed to
mmc-list shortly.
Clk:
* Preparing patchset for upstreaming patches that will add support for
abx500 clocks.
* Preparing patchset to update different driver's clk support used by ux500.
* Resent patches for clk_set_parent fixup.
* Patches disable unprepared clocks at late init merged by Mike.
* Diving into discussion around doing DVFS through the clock API.
Reviewing related patches.
=== Plans ===
Storage:
* Continue the work for the next item in the mmc power management blueprint.
* Push patches for mmci host driver, to support UHS cards/HS200, CMD23.
* Push patches for mmci host driver to extend the power management
support. Context save/restore are for example missing.
* Push patches for mmci host driver to add support for new STE 8540 variant.
Clk:
* Optimizations and bug fixes for ux500 clk implementations.
=== Issues ===
* None.
In of_dma_controller_register() routine we are calling of_get_property() as an
parameter to be32_to_cpup(). In case the property doesn't exist we will get a
crash.
This patch changes this code to check if we got a valid property first and then
runs be32_to_cpup() on it.
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
My mails are broken, i have pushed this patch here:
http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/h…
drivers/dma/of-dma.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index 69d04d2..09c7ad1 100644
--- a/drivers/dma/of-dma.c
+++ b/drivers/dma/of-dma.c
@@ -93,6 +93,7 @@ int of_dma_controller_register(struct device_node *np,
{
struct of_dma *ofdma;
int nbcells;
+ const __be32 *prop;
if (!np || !of_dma_xlate) {
pr_err("%s: not enough information provided\n", __func__);
@@ -103,8 +104,11 @@ int of_dma_controller_register(struct device_node *np,
if (!ofdma)
return -ENOMEM;
- nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL));
- if (!nbcells) {
+ prop = of_get_property(np, "#dma-cells", NULL);
+ if (prop)
+ nbcells = be32_to_cpup(prop);
+
+ if (!prop || !nbcells) {
pr_err("%s: #dma-cells property is missing or invalid\n",
__func__);
kfree(ofdma);
--
1.7.12.rc2.18.g61b472e
When a cpu enters a deep idle state, the local timers are stopped and
the time framework falls back to the timer device used as a broadcast
timer.
The different cpuidle drivers are calling clockevents_notify ENTER/EXIT
when the idle state stops the local timer.
The proposed patch introduces a new flag CPUIDLE_FLAG_TIMER_STOP to let
the cpuidle framework to call clockevents_notify instead of duplicating
again and again these lines in all the cpuidle drivers.
Signed-off-by: Daniel Lezcano <daniel.lezcano(a)linaro.org>
---
drivers/cpuidle/cpuidle.c | 9 +++++++++
include/linux/cpuidle.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index eba6929..c500370 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -8,6 +8,7 @@
* This code is licenced under the GPL.
*/
+#include <linux/clockchips.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/sched.h>
@@ -146,12 +147,20 @@ int cpuidle_idle_call(void)
trace_cpu_idle_rcuidle(next_state, dev->cpu);
+ if (drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP)
+ clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
+ &dev->cpu);
+
if (cpuidle_state_is_coupled(dev, drv, next_state))
entered_state = cpuidle_enter_state_coupled(dev, drv,
next_state);
else
entered_state = cpuidle_enter_state(dev, drv, next_state);
+ if (drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP)
+ clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
+ &dev->cpu);
+
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
/* give the governor an opportunity to reflect on the outcome */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 480c14d..a837b33 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -57,6 +57,7 @@ struct cpuidle_state {
/* Idle State Flags */
#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
#define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */
+#define CPUIDLE_FLAG_TIMER_STOP (0x04) /* timer is stopped on this state */
#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
--
1.7.9.5