Re: [rtc-linux] Re: [PATCH] rtc: Make rtc_update_irq callable withirqs enabled

From: Alessandro Zummo
Date: Fri Apr 24 2009 - 06:01:20 EST


On Fri, 24 Apr 2009 02:31:12 -0700
David Brownell <david-b@xxxxxxxxxxx> wrote:


> >  and
> >  acquired with the standard spinlock calls in the irq
> >  handler.
>
> Which "standard" call? "spin_lock", "spin_lock_irqsave",
> and "spin_lock_irq" are all standard calls.

sorry, I mean the no irq version of the call.


> Recall that it's not the IRQ handler that's directly
> grabbing the lock; it's code called by that handler.


> >  would it work?
>
> The patch I saw -- switching rtc_update_irq() to use
> spin_lock_irqsave() -- would work, but it's incomplete.
> It left the doc broken, and didn't clean up the drivers
> which did the real work to obey the current call spec.

that patch is a no go. period. I'm not talking about it.


> It'd be much nicer if lockdep would just do the right
> thing and report when IRQ handlers do stupid things,
> instead of covering up that class of bugs. But I'm told
> it will not get fixed; sigh.

I'm not tying to fix call issues or lockdep politics,
just to understand if it's possible to avoid disabling the IRQs.

i.e.,

use spin_lock() in the IRQ handler and spin_lock_irq/irq_save
in the setup functions.




--

Best regards,

Alessandro Zummo,
Tower Technologies - Torino, Italy

http://www.towertech.it

--
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/