Re: [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers

Magnus Damm
2011-08-19T03:09:51Z

On Fri, Aug 19, 2011 at 10:10 AM, Simon Horman <horms@verge.net.au> wrote:
> Provide separate interrupt handlers which may be used by platforms where
> SDHI has three interrupt sources.
>
> This patch also removes the commented-out handling of CRC and other errors.
>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
>
> ---

> +irqreturn_t tmio_mmc_irq(int irq, void *devid)
> +{
> +       struct tmio_mmc_host *host = devid;
> +       unsigned int ireg, status;
> +
> +       pr_debug("MMC IRQ begin\n");
> +
> +       tmio_mmc_card_irq_status(host, &ireg, &status);
> +       if (__tmio_mmc_card_detect_irq(host, ireg, status))
> +               return IRQ_HANDLED;
> +       if (__tmio_mmc_sdcard_irq(host, ireg, status))
> +               return IRQ_HANDLED;
> +
> +       tmio_mmc_sdio_irq(irq, devid);
>
> -out:
>        return IRQ_HANDLED;
>  }
>  EXPORT_SYMBOL(tmio_mmc_irq);

Is there any particular reason for returning early in this interrupt
handler? By returning early I mean the "if ... return IRQ_HANDLED"
cases above.

I realize the old ISR code in the driver does just this, so if the
goal is to stay compatible then I guess we should keep this behavior.
From my point of view it usually makes more sense to try to handle all
events that may be associated with the IRQ.

Thanks,

/ magnus