[PATCH] SMU LED driver

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Jan 15 08:48:59 EST 2007

On Sun, 2007-01-14 at 14:31 +0100, Michael Hanselmann wrote:
> On Mon, Jan 08, 2007 at 12:02:45PM +1100, Benjamin Herrenschmidt wrote:
> > Just have 1 request allocated once for all. Then, have a global set to
> > what status you want the LED at. Once the completion of any request
> > arrives, if the new status is different from what you want, send a new
> > one to fix it up :-)
> Implemented that. See below.
> There's a race condition between setting the LED value and unloading the
> module. smu_led_exit can't return an error. Is it possible to prevent
> unloading the module while an SMU request is still running, and if yes,
> how?

No, you have to deal with it in the unload. You can for example wait for
the SMU request to complete after setting wanted to -1, that sort of

Also, use spin_lock_irqsave/restore or you'll deadlock if the SMU
completion interrupt happens to interrupt your request function.


More information about the Linuxppc-dev mailing list