lkml.org 
[lkml]   [2014]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: BUG: sleeping function called from invalid context at drivers/cpufreq/cpufreq.c:370
    Date
    On Friday, September 26, 2014 09:54:00 AM Mike Galbraith wrote:
    > On Fri, 2014-09-26 at 08:24 +0200, Mike Galbraith wrote:
    > > (the hazards of multitasking.. post escaped early, and went to mostly
    > > the wrong folks)
    > >
    > >
    > > While testing some scheduler patches, the below pcc-cpufreq
    > > might_sleep() gripe fell out.
    >
    > Because the bits below from 8fec051e didn't make the lock go away first.
    > Reverting only pcc-cpufreq back to notifier.. works.
    >
    > --------------------- drivers/cpufreq/integrator-cpufreq.c ---------------------

    Are you sure this is the right file?

    Shouldn't that be pcc-cpufreq.c rather?

    Also moving the spin_lock(&pcc_lock) after the cpufreq_freq_transition_begin()
    should fix the problem too (like the below). Have you tried that?


    ---
    drivers/cpufreq/pcc-cpufreq.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    Index: linux-pm/drivers/cpufreq/pcc-cpufreq.c
    ===================================================================
    --- linux-pm.orig/drivers/cpufreq/pcc-cpufreq.c
    +++ linux-pm/drivers/cpufreq/pcc-cpufreq.c
    @@ -204,7 +204,6 @@ static int pcc_cpufreq_target(struct cpu
    u32 input_buffer;
    int cpu;

    - spin_lock(&pcc_lock);
    cpu = policy->cpu;
    pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu);

    @@ -216,6 +215,7 @@ static int pcc_cpufreq_target(struct cpu
    freqs.old = policy->cur;
    freqs.new = target_freq;
    cpufreq_freq_transition_begin(policy, &freqs);
    + spin_lock(&pcc_lock);

    input_buffer = 0x1 | (((target_freq * 100)
    / (ioread32(&pcch_hdr->nominal) * 1000)) << 8);


    \
     
     \ /
      Last update: 2014-09-27 00:41    [W:5.586 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site