linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: sh-sci: Fix length of scatterlist
@ 2015-10-20 12:18 Yoshihiro Shimoda
  2015-10-20 12:22 ` Geert Uytterhoeven
  2015-10-20 13:15 ` kbuild test robot
  0 siblings, 2 replies; 8+ messages in thread
From: Yoshihiro Shimoda @ 2015-10-20 12:18 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, linux-kernel; +Cc: linux-sh, Yoshihiro Shimoda

This patch fixes an issue that the "length" of scatterlist should be
set using sh_dma_length(). Otherwise, a dmaengine driver cannot work
correctly if CONFIG_NEED_SG_DMA_LENGTH=y.

Fixes: 7b39d90184 (serial: sh-sci: Fix NULL pointer dereference if HIGHMEM is enabled)
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/tty/serial/sh-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 960e50a..284a872 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1437,7 +1437,7 @@ static void sci_request_dma(struct uart_port *port)
 			sg_init_table(sg, 1);
 			s->rx_buf[i] = buf;
 			sg_dma_address(sg) = dma;
-			sg->length = s->buf_len_rx;
+			sg_dma_length(sg) = s->buf_len_rx;
 
 			buf += s->buf_len_rx;
 			dma += s->buf_len_rx;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] serial: sh-sci: Fix length of scatterlist
@ 2015-10-22  6:41 Yoshihiro Shimoda
  2015-10-22 11:06 ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Yoshihiro Shimoda @ 2015-10-22  6:41 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, linux-kernel; +Cc: linux-sh, Yoshihiro Shimoda

This patch fixes an issue that the "length" of scatterlist should be
set using sg_dma_len(). Otherwise, a dmaengine driver cannot work
correctly if CONFIG_NEED_SG_DMA_LENGTH=y.

Fixes: 7b39d90184 (serial: sh-sci: Fix NULL pointer dereference if HIGHMEM is enabled)
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 Changes from v1:
  - Fix using implicit declaration of function "sg_dma_length".

 drivers/tty/serial/sh-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 960e50a..51c7507 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1437,7 +1437,7 @@ static void sci_request_dma(struct uart_port *port)
 			sg_init_table(sg, 1);
 			s->rx_buf[i] = buf;
 			sg_dma_address(sg) = dma;
-			sg->length = s->buf_len_rx;
+			sg_dma_len(sg) = s->buf_len_rx;
 
 			buf += s->buf_len_rx;
 			dma += s->buf_len_rx;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] serial: sh-sci: Fix length of scatterlist
@ 2015-12-04 14:21 Geert Uytterhoeven
  2015-12-07  6:27 ` Simon Horman
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2015-12-04 14:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-serial, linux-sh, Yoshihiro Shimoda, Geert Uytterhoeven

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

This patch fixes an issue that the "length" of scatterlist should be
set using sg_dma_len(). Otherwise, a dmaengine driver cannot work
correctly if CONFIG_NEED_SG_DMA_LENGTH=y.

Fixes: 7b39d90184 (serial: sh-sci: Fix NULL pointer dereference if HIGHMEM is enabled)
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/tty/serial/sh-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 960e50a97558cff5..51c7507b0444957b 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1437,7 +1437,7 @@ static void sci_request_dma(struct uart_port *port)
 			sg_init_table(sg, 1);
 			s->rx_buf[i] = buf;
 			sg_dma_address(sg) = dma;
-			sg->length = s->buf_len_rx;
+			sg_dma_len(sg) = s->buf_len_rx;
 
 			buf += s->buf_len_rx;
 			dma += s->buf_len_rx;
-- 
1.9.1


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

end of thread, other threads:[~2015-12-07  6:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 12:18 [PATCH] serial: sh-sci: Fix length of scatterlist Yoshihiro Shimoda
2015-10-20 12:22 ` Geert Uytterhoeven
2015-10-22  6:36   ` Yoshihiro Shimoda
2015-10-20 13:15 ` kbuild test robot
  -- strict thread matches above, loose matches on Subject: below --
2015-10-22  6:41 Yoshihiro Shimoda
2015-10-22 11:06 ` Geert Uytterhoeven
2015-12-04 14:21 Geert Uytterhoeven
2015-12-07  6:27 ` Simon Horman

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).