diff mbox series

[1/2] mmc: tmio: abort DMA before reset

Message ID 20210309092332.30705-2-wsa+renesas@sang-engineering.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series mmc: renesas_sdhi: reset via reset controller | expand

Commit Message

Wolfram Sang March 9, 2021, 9:23 a.m. UTC
We will soon allow resetting the whole IP core via a reset controller.
For this case, DMA must be terminated before the actual reset. For the
other cases, it is probably better, too.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/tmio_mmc_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Niklas Söderlund March 10, 2021, 10:34 a.m. UTC | #1
Hi Wolfram,

Thanks for your patch.

On 2021-03-09 10:23:31 +0100, Wolfram Sang wrote:
> We will soon allow resetting the whole IP core via a reset controller.
> For this case, DMA must be terminated before the actual reset. For the
> other cases, it is probably better, too.

I agree I think it makes more sens to abort dma before reseting the 
device.

> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/mmc/host/tmio_mmc_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
> index 5aa57640d0e6..eca767dcabba 100644
> --- a/drivers/mmc/host/tmio_mmc_core.c
> +++ b/drivers/mmc/host/tmio_mmc_core.c
> @@ -172,11 +172,11 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host)
>  	sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
>  	usleep_range(10000, 11000);
>  
> +	tmio_mmc_abort_dma(host);
> +
>  	if (host->reset)
>  		host->reset(host);
>  
> -	tmio_mmc_abort_dma(host);
> -
>  	if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) {
>  		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask);
>  		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
> -- 
> 2.30.0
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index 5aa57640d0e6..eca767dcabba 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -172,11 +172,11 @@  static void tmio_mmc_reset(struct tmio_mmc_host *host)
 	sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
 	usleep_range(10000, 11000);
 
+	tmio_mmc_abort_dma(host);
+
 	if (host->reset)
 		host->reset(host);
 
-	tmio_mmc_abort_dma(host);
-
 	if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) {
 		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask);
 		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);