Switching glamo-mci to threaded IRQs

Lars-Peter Clausen lars at metafoo.de
Wed Jun 9 19:34:59 CEST 2010

Hash: SHA1

Thibaut Girka wrote:
> Hi,
> During a little talk with Lars on #openmoko-cdevel about the state of
> the OM drivers, one of the "issues" of the glamo driver was the use of
> workqueues instead of threaded IRQs for IRQ handling in glamo-mci.
> Here is a patch trying to fix that.
> It seems to work fine, however, I'm new to this kind of things, and
> discovered the glamo code today :)
> So, I may have missed something important, but anyway, here is the
> patch.
> Best Regards,
> Thibaut Girka

Looks almost good to me. Two issues:

>@@ -306,6 +303,7 @@ static void glamo_mci_irq_worker(struct work_struct
> done:
>     host->mrq = NULL;
>     glamo_mci_request_done(host, cmd->mrq);
>+    return IRQ_HANDLED;
> }

If there is an interrupt while there was no pending request the
function returns early in line 269. You should return IRQ_HANDLED
there as well.

> [...]
>@@ -959,8 +948,6 @@ static int glamo_mci_suspend(struct device *dev)
>     struct glamo_mci_host *host = mmc_priv(mmc);
>     int ret;
>-    cancel_work_sync(&host->irq_work);
>     ret = mmc_suspend_host(mmc, PMSG_SUSPEND);
>     return ret;

I you need to make sure that irq thread is not running here. Best
would probably to use disable_irq and then enable it again during resume.
synchronize_irq might work as well though, since we don't do anything
in the irq handler if no request is pending.

It would be nice if you could create further patches with `git
format-patch` so I can easily `git am` them into the tree(With correct
author information and everything).

Thanks for your help :)
- - Lars
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the openmoko-kernel mailing list