RE: [PATCH 2/4] mmc: dw_mmc: fix the IDMAC sw reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Will Newton <will.newton@xxxxxxxxx> wrote:
> On Sun, May 20, 2012 at 5:27 AM, Seungwon Jeon <tgih.jun@xxxxxxxxxxx> wrote:
> > IDMAC may not be cleaned in driver probe if it has
> > been already used in boot time. So IDMAC needs sw
> > reset newly. And DMA interface reset precedes the
> > internal DMAC reset. Additionally SDMMC_IDMAC_SWRESET
> > is replaced with magic code.
> >
> > Signed-off-by: Seungwon Jeon <tgih.jun@xxxxxxxxxxx>
> > ---
> >  drivers/mmc/host/dw_mmc.c |   18 ++++++++++--------
> >  1 files changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> > index b46faf0..44aa292 100644
> > --- a/drivers/mmc/host/dw_mmc.c
> > +++ b/drivers/mmc/host/dw_mmc.c
> > @@ -418,6 +418,8 @@ static int dw_mci_idmac_init(struct dw_mci *host)
> >        p->des3 = host->sg_dma;
> >        p->des0 = IDMAC_DES0_ER;
> >
> > +       mci_writel(host, BMOD, SDMMC_IDMAC_SWRESET);
> > +
> >        /* Mask out interrupts - get Tx & Rx complete only */
> >        mci_writel(host, IDINTEN, SDMMC_IDMAC_INT_NI | SDMMC_IDMAC_INT_RI |
> >                   SDMMC_IDMAC_INT_TI);
> > @@ -1724,7 +1726,8 @@ static void dw_mci_work_routine_card(struct work_struct *work)
> >
> >  #ifdef CONFIG_MMC_DW_IDMAC
> >                                ctrl = mci_readl(host, BMOD);
> > -                               ctrl |= 0x01; /* Software reset of DMA */
> > +                               /* Software reset of DMA */
> > +                               ctrl |= SDMMC_IDMAC_SWRESET;
> >                                mci_writel(host, BMOD, ctrl);
> >  #endif
> >
> > @@ -1949,10 +1952,6 @@ int dw_mci_probe(struct dw_mci *host)
> >        spin_lock_init(&host->lock);
> >        INIT_LIST_HEAD(&host->queue);
> >
> > -
> > -       host->dma_ops = host->pdata->dma_ops;
> > -       dw_mci_init_dma(host);
> > -
> >        /*
> >         * Get the host data width - this assumes that HCON has been set with
> >         * the correct values.
> > @@ -1985,6 +1984,9 @@ int dw_mci_probe(struct dw_mci *host)
> >                goto err_dmaunmap;
> >        }
> >
> > +       host->dma_ops = host->pdata->dma_ops;
> > +       dw_mci_init_dma(host);
> > +
> 
> I think this change may break the error handling. The error label
> err_dmaunmap jumped to above expects
> that host->dma_ops is non-NULL. Please check that the error handling is ok.
Right. I'll apply it.

Thanks,
Seungwon Jeon
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux