* [PATCH] i2c: rcar: use correct length when unmapping DMA
@ 2017-05-28 7:52 Wolfram Sang
2017-05-29 9:11 ` Geert Uytterhoeven
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Wolfram Sang @ 2017-05-28 7:52 UTC (permalink / raw)
To: linux-i2c; +Cc: linux-renesas-soc, Niklas Söderlund, Wolfram Sang
Because we need to transfer some bytes with PIO, the msg length is not
the length of the DMA buffer. Use the correct value which we used when
doing the mapping.
Fixes: 73e8b0528346e8 ("i2c: rcar: add DMA support")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/busses/i2c-rcar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 214bf2835d1f95..8be3e6cb8fe686 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -319,7 +319,7 @@ static void rcar_i2c_dma_unmap(struct rcar_i2c_priv *priv)
rcar_i2c_write(priv, ICFBSCR, TCYC06);
dma_unmap_single(chan->device->dev, sg_dma_address(&priv->sg),
- priv->msg->len, priv->dma_direction);
+ sg_dma_len(&priv->sg), priv->dma_direction);
priv->dma_direction = DMA_NONE;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: rcar: use correct length when unmapping DMA
2017-05-28 7:52 [PATCH] i2c: rcar: use correct length when unmapping DMA Wolfram Sang
@ 2017-05-29 9:11 ` Geert Uytterhoeven
2017-05-30 4:49 ` Niklas Söderlund
2017-06-15 13:52 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2017-05-29 9:11 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux I2C, Linux-Renesas, Niklas Söderlund
On Sun, May 28, 2017 at 9:52 AM, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> Because we need to transfer some bytes with PIO, the msg length is not
> the length of the DMA buffer. Use the correct value which we used when
> doing the mapping.
>
> Fixes: 73e8b0528346e8 ("i2c: rcar: add DMA support")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: rcar: use correct length when unmapping DMA
2017-05-28 7:52 [PATCH] i2c: rcar: use correct length when unmapping DMA Wolfram Sang
2017-05-29 9:11 ` Geert Uytterhoeven
@ 2017-05-30 4:49 ` Niklas Söderlund
2017-06-15 13:52 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2017-05-30 4:49 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, linux-renesas-soc
On 2017-05-28 09:52:17 +0200, Wolfram Sang wrote:
> Because we need to transfer some bytes with PIO, the msg length is not
> the length of the DMA buffer. Use the correct value which we used when
> doing the mapping.
>
> Fixes: 73e8b0528346e8 ("i2c: rcar: add DMA support")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> drivers/i2c/busses/i2c-rcar.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index 214bf2835d1f95..8be3e6cb8fe686 100644
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -319,7 +319,7 @@ static void rcar_i2c_dma_unmap(struct rcar_i2c_priv *priv)
> rcar_i2c_write(priv, ICFBSCR, TCYC06);
>
> dma_unmap_single(chan->device->dev, sg_dma_address(&priv->sg),
> - priv->msg->len, priv->dma_direction);
> + sg_dma_len(&priv->sg), priv->dma_direction);
>
> priv->dma_direction = DMA_NONE;
> }
> --
> 2.11.0
>
--
Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: rcar: use correct length when unmapping DMA
2017-05-28 7:52 [PATCH] i2c: rcar: use correct length when unmapping DMA Wolfram Sang
2017-05-29 9:11 ` Geert Uytterhoeven
2017-05-30 4:49 ` Niklas Söderlund
@ 2017-06-15 13:52 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2017-06-15 13:52 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, linux-renesas-soc, Niklas Söderlund
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
On Sun, May 28, 2017 at 09:52:17AM +0200, Wolfram Sang wrote:
> Because we need to transfer some bytes with PIO, the msg length is not
> the length of the DMA buffer. Use the correct value which we used when
> doing the mapping.
>
> Fixes: 73e8b0528346e8 ("i2c: rcar: add DMA support")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-15 13:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-28 7:52 [PATCH] i2c: rcar: use correct length when unmapping DMA Wolfram Sang
2017-05-29 9:11 ` Geert Uytterhoeven
2017-05-30 4:49 ` Niklas Söderlund
2017-06-15 13:52 ` Wolfram Sang
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).