Re: [BUG] cpufreq: sleeping function called from invalid context at kernel/workqueue.c:2811

From: Rafael J. Wysocki
Date: Fri Feb 08 2013 - 08:17:38 EST


On Friday, February 08, 2013 11:24:39 AM Viresh Kumar wrote:
> On 7 February 2013 06:11, Rafael J. Wysocki <rjw@xxxxxxx> wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> > Subject: cpufreq: Move sysfs_remove_link() from under a spinlock
> >
> > Commit 73bf0fc "cpufreq: Don't remove sysfs link for policy->cpu"
> > attempted to fix a bug in __cpufreq_remove_dev() by avoiding to
> > remove the link to the "cpufreq" directory for policy->cpu, but it
> > rearranged the code in such a way that sysfs_remove_link() ended up
> > under a spinlock, which caused complaints about sleeping in atomic
> > context to be emitted into the kernel log during system suspend.
> >
> > To fix this, revert commit 73bf0fc partially and move the
> > sysfs_remove_link() in question to a separate block executed for
> > cpus > 1 outside of the spinlock.
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> BTW, i have dropped this patch completely as i got another lock fixing
> patch :)

Sure, I suppose you can get a better fix. :-)

Thanks,
Rafael


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/