linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg
@ 2019-10-18  9:39 Sascha Hauer
  2019-10-18 13:25 ` Fabio Estevam
  2019-10-21 14:59 ` Ulf Hansson
  0 siblings, 2 replies; 5+ messages in thread
From: Sascha Hauer @ 2019-10-18  9:39 UTC (permalink / raw)
  To: linux-mmc; +Cc: Ulf Hansson, Sascha Hauer, Fabio Estevam, Bruno Thomsen, stable

Since ceeeb99cd821 we no longer abuse the DMA_CTRL_ACK flag for custom
driver use and introduced the MXS_DMA_CTRL_WAIT4END instead. We have not
changed all users to this flag though. This patch fixes it for the
mxs-mmc driver.

Fixes: ceeeb99cd821 ("dmaengine: mxs: rename custom flag")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Fabio Estevam <festevam@gmail.com>
Reported-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Tested-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Cc: stable@vger.kernel.org
---
 drivers/mmc/host/mxs-mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 78e7e350655c..4031217d21c3 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -17,6 +17,7 @@
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
+#include <linux/dma/mxs-dma.h>
 #include <linux/highmem.h>
 #include <linux/clk.h>
 #include <linux/err.h>
@@ -266,7 +267,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host)
 	ssp->ssp_pio_words[2] = cmd1;
 	ssp->dma_dir = DMA_NONE;
 	ssp->slave_dirn = DMA_TRANS_NONE;
-	desc = mxs_mmc_prep_dma(host, DMA_CTRL_ACK);
+	desc = mxs_mmc_prep_dma(host, MXS_DMA_CTRL_WAIT4END);
 	if (!desc)
 		goto out;
 
@@ -311,7 +312,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host)
 	ssp->ssp_pio_words[2] = cmd1;
 	ssp->dma_dir = DMA_NONE;
 	ssp->slave_dirn = DMA_TRANS_NONE;
-	desc = mxs_mmc_prep_dma(host, DMA_CTRL_ACK);
+	desc = mxs_mmc_prep_dma(host, MXS_DMA_CTRL_WAIT4END);
 	if (!desc)
 		goto out;
 
@@ -441,7 +442,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 	host->data = data;
 	ssp->dma_dir = dma_data_dir;
 	ssp->slave_dirn = slave_dirn;
-	desc = mxs_mmc_prep_dma(host, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+	desc = mxs_mmc_prep_dma(host, DMA_PREP_INTERRUPT | MXS_DMA_CTRL_WAIT4END);
 	if (!desc)
 		goto out;
 
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg
  2019-10-18  9:39 [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg Sascha Hauer
@ 2019-10-18 13:25 ` Fabio Estevam
  2019-10-18 13:34   ` Sascha Hauer
  2019-10-21 14:59 ` Ulf Hansson
  1 sibling, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2019-10-18 13:25 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: linux-mmc, Ulf Hansson, Bruno Thomsen, stable

Hi Sascha,

On Fri, Oct 18, 2019 at 6:39 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> Since ceeeb99cd821 we no longer abuse the DMA_CTRL_ACK flag for custom
> driver use and introduced the MXS_DMA_CTRL_WAIT4END instead. We have not
> changed all users to this flag though. This patch fixes it for the
> mxs-mmc driver.

If I read this correctly, this patch is not the complete fix for all users.

Wouldn't it be better to revert the offending commit instead?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg
  2019-10-18 13:25 ` Fabio Estevam
@ 2019-10-18 13:34   ` Sascha Hauer
  2019-10-18 15:58     ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2019-10-18 13:34 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-mmc, Ulf Hansson, Bruno Thomsen, stable

On Fri, Oct 18, 2019 at 10:25:21AM -0300, Fabio Estevam wrote:
> Hi Sascha,
> 
> On Fri, Oct 18, 2019 at 6:39 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >
> > Since ceeeb99cd821 we no longer abuse the DMA_CTRL_ACK flag for custom
> > driver use and introduced the MXS_DMA_CTRL_WAIT4END instead. We have not
> > changed all users to this flag though. This patch fixes it for the
> > mxs-mmc driver.
> 
> If I read this correctly, this patch is not the complete fix for all users.
> 
> Wouldn't it be better to revert the offending commit instead?

We would probably also have to revert the exec_op conversion of the gpmi
NAND driver, something which I'd rather not do.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg
  2019-10-18 13:34   ` Sascha Hauer
@ 2019-10-18 15:58     ` Fabio Estevam
  0 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2019-10-18 15:58 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: linux-mmc, Ulf Hansson, Bruno Thomsen, stable

On Fri, Oct 18, 2019 at 10:34 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:

> We would probably also have to revert the exec_op conversion of the gpmi
> NAND driver, something which I'd rather not do.

Ok, understood. Thanks for the clarification.

Better go with your patch then.

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg
  2019-10-18  9:39 [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg Sascha Hauer
  2019-10-18 13:25 ` Fabio Estevam
@ 2019-10-21 14:59 ` Ulf Hansson
  1 sibling, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2019-10-21 14:59 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: linux-mmc, Fabio Estevam, Bruno Thomsen, # 4.0+

On Fri, 18 Oct 2019 at 11:39, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> Since ceeeb99cd821 we no longer abuse the DMA_CTRL_ACK flag for custom
> driver use and introduced the MXS_DMA_CTRL_WAIT4END instead. We have not
> changed all users to this flag though. This patch fixes it for the
> mxs-mmc driver.
>
> Fixes: ceeeb99cd821 ("dmaengine: mxs: rename custom flag")
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Tested-by: Fabio Estevam <festevam@gmail.com>
> Reported-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> Tested-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> Cc: stable@vger.kernel.org

Applied for fixes, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mxs-mmc.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 78e7e350655c..4031217d21c3 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -17,6 +17,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/dmaengine.h>
> +#include <linux/dma/mxs-dma.h>
>  #include <linux/highmem.h>
>  #include <linux/clk.h>
>  #include <linux/err.h>
> @@ -266,7 +267,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host)
>         ssp->ssp_pio_words[2] = cmd1;
>         ssp->dma_dir = DMA_NONE;
>         ssp->slave_dirn = DMA_TRANS_NONE;
> -       desc = mxs_mmc_prep_dma(host, DMA_CTRL_ACK);
> +       desc = mxs_mmc_prep_dma(host, MXS_DMA_CTRL_WAIT4END);
>         if (!desc)
>                 goto out;
>
> @@ -311,7 +312,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host)
>         ssp->ssp_pio_words[2] = cmd1;
>         ssp->dma_dir = DMA_NONE;
>         ssp->slave_dirn = DMA_TRANS_NONE;
> -       desc = mxs_mmc_prep_dma(host, DMA_CTRL_ACK);
> +       desc = mxs_mmc_prep_dma(host, MXS_DMA_CTRL_WAIT4END);
>         if (!desc)
>                 goto out;
>
> @@ -441,7 +442,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
>         host->data = data;
>         ssp->dma_dir = dma_data_dir;
>         ssp->slave_dirn = slave_dirn;
> -       desc = mxs_mmc_prep_dma(host, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> +       desc = mxs_mmc_prep_dma(host, DMA_PREP_INTERRUPT | MXS_DMA_CTRL_WAIT4END);
>         if (!desc)
>                 goto out;
>
> --
> 2.23.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-21 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18  9:39 [PATCH] mmc: mxs: fix flags passed to dmaengine_prep_slave_sg Sascha Hauer
2019-10-18 13:25 ` Fabio Estevam
2019-10-18 13:34   ` Sascha Hauer
2019-10-18 15:58     ` Fabio Estevam
2019-10-21 14:59 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).