lkml.org 
[lkml]   [2009]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pcf50633: use a dedicated workqueue for irq processing
On Thu, Jul 30, 2009 at 03:34:25PM -0700, Andrew Morton wrote:
> On Tue, 28 Jul 2009 00:41:15 +0400
> Paul Fertser <fercerpav@gmail.com> wrote:
>
> > Using the default kernel "events" workqueue causes problems with
> > synchronous adc readings if initiated from some task on the same
> > workqueue.
> >
> > I had a deadlock trying to use pcf50633_adc_sync_read from a
> > power_supply class driver because the reading was initiated from the
> > workqueue and it waited for the irq processing to complete (to get the
> > result) and that was put on the same workqueue.
>
> I don't get it.
>
> Do you meant that pcf50633_adc_sync_read() was called via a
> schedule_work() handler? If so, wasn't that a bug?

Andrew, i think it is called this way:

power_supply_changed -> schedule_work(&psy->changed_work) ->
power_supply_changed_work -> kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE)
-> power_supply_uevent -> power_supply_show_property -> get_property ->
bat->pdata->get_voltage -> pcf50633_adc_sync_read

I assumed that since power_supply class is well-established and widely used
that's an intended behaviour. CCing relevant maintainers to get their
opinions.

A bit of background: we sometimes want to use dumb batteries with our
openmoko devices (for gta01 aka Neo1973 there's no alternative even), so
power_class driver needs to be able to obtain battery voltage measured by
PMU.

--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com


\
 
 \ /
  Last update: 2009-07-31 11:27    [W:0.046 / U:1.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site