Re: [PATCH v2 04/16] mmc: meson-gx: use _irqsave variant of spinlock
From: Jerome Brunet
Date: Tue Aug 22 2017 - 07:41:40 EST
On Tue, 2017-08-22 at 13:08 +0200, Ulf Hansson wrote:
> On 21 August 2017 at 18:02, Jerome Brunet <jbrunet@xxxxxxxxxxxx> wrote:
> > spinlock used in interrupt handler should use the _irqsave variant
>
> Exactly why is that needed?
That's a mistake left over from a debugging session. Thx for pointing it out.
I'll respin w/o it
>
> >
> > Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms")
> > Reviewed-by: Kevin Hilman <khilman@xxxxxxxxxxxx>
> > Signed-off-by: Jerome Brunet <jbrunet@xxxxxxxxxxxx>
> > ---
> > Âdrivers/mmc/host/meson-gx-mmc.c | 5 +++--
> > Â1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-
> > mmc.c
> > index 8a74a048db88..a399fbd415f4 100644
> > --- a/drivers/mmc/host/meson-gx-mmc.c
> > +++ b/drivers/mmc/host/meson-gx-mmc.c
> > @@ -727,6 +727,7 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
> > ÂÂÂÂÂÂÂÂstruct mmc_command *cmd;
> > ÂÂÂÂÂÂÂÂstruct mmc_data *data;
> > ÂÂÂÂÂÂÂÂu32 irq_en, status, raw_status;
> > +ÂÂÂÂÂÂÂunsigned long flag;
> > ÂÂÂÂÂÂÂÂirqreturn_t ret = IRQ_HANDLED;
> >
> > ÂÂÂÂÂÂÂÂif (WARN_ON(!host))
> > @@ -739,7 +740,7 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
> >
> > ÂÂÂÂÂÂÂÂdata = cmd->data;
> >
> > -ÂÂÂÂÂÂÂspin_lock(&host->lock);
> > +ÂÂÂÂÂÂÂspin_lock_irqsave(&host->lock, flag);
> > ÂÂÂÂÂÂÂÂirq_en = readl(host->regs + SD_EMMC_IRQ_EN);
> > ÂÂÂÂÂÂÂÂraw_status = readl(host->regs + SD_EMMC_STATUS);
> > ÂÂÂÂÂÂÂÂstatus = raw_status & irq_en;
> > @@ -806,7 +807,7 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
> > ÂÂÂÂÂÂÂÂif (ret == IRQ_HANDLED)
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmeson_mmc_request_done(host->mmc, cmd->mrq);
> >
> > -ÂÂÂÂÂÂÂspin_unlock(&host->lock);
> > +ÂÂÂÂÂÂÂspin_unlock_irqrestore(&host->lock, flag);
> > ÂÂÂÂÂÂÂÂreturn ret;
> > Â}
> >
> > --
> > 2.9.5
> >
>
> Kind regards
> Uffe