diff mbox

[2/2] spi: sh-msiof: Fix transmit-only DMA transfers

Message ID 1407413263-20177-2-git-send-email-geert+renesas@glider.be (mailing list archive)
State Accepted
Commit cdcd565fa0925edf9b80c875fcc84a231c75bd1d
Headers show

Commit Message

Geert Uytterhoeven Aug. 7, 2014, 12:07 p.m. UTC
Fix tx/rx mixup, which broke transmit-only transfers.

Introduced by commit 4240305f7cbdc7782aa8bc40cc702775d9ac0839
("spi: sh-msiof: Fix leaking of unused DMA descriptors").

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Feel free to fold into commit 4240305f7cbdc7782aa8bc40cc702775d9ac0839
("spi: sh-msiof: Fix leaking of unused DMA descriptors")
---
 drivers/spi/spi-sh-msiof.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Aug. 7, 2014, 12:51 p.m. UTC | #1
Hi Geert,

On Thursday 07 August 2014 14:07:43 Geert Uytterhoeven wrote:
> Fix tx/rx mixup, which broke transmit-only transfers.
> 
> Introduced by commit 4240305f7cbdc7782aa8bc40cc702775d9ac0839
> ("spi: sh-msiof: Fix leaking of unused DMA descriptors").
> 
> Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Feel free to fold into commit 4240305f7cbdc7782aa8bc40cc702775d9ac0839
> ("spi: sh-msiof: Fix leaking of unused DMA descriptors")
> ---
>  drivers/spi/spi-sh-msiof.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
> index 0d9ccd0953de..5ee13a2d93df 100644
> --- a/drivers/spi/spi-sh-msiof.c
> +++ b/drivers/spi/spi-sh-msiof.c
> @@ -689,9 +689,9 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv
> *p, const void *tx, reinit_completion(&p->done);
> 
>  	/* Now start DMA */
> -	if (tx)
> -		dma_async_issue_pending(p->master->dma_rx);
>  	if (rx)
> +		dma_async_issue_pending(p->master->dma_rx);
> +	if (tx)
>  		dma_async_issue_pending(p->master->dma_tx);
> 
>  	ret = sh_msiof_spi_start(p, rx);
diff mbox

Patch

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 0d9ccd0953de..5ee13a2d93df 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -689,9 +689,9 @@  static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
 	reinit_completion(&p->done);
 
 	/* Now start DMA */
-	if (tx)
-		dma_async_issue_pending(p->master->dma_rx);
 	if (rx)
+		dma_async_issue_pending(p->master->dma_rx);
+	if (tx)
 		dma_async_issue_pending(p->master->dma_tx);
 
 	ret = sh_msiof_spi_start(p, rx);