linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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; 6+ 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] 6+ messages in thread

* Re: [PATCH] serial: sh-sci: Fix length of scatterlist
  2015-10-22  6:41 [PATCH] serial: sh-sci: Fix length of scatterlist Yoshihiro Shimoda
@ 2015-10-22 11:06 ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2015-10-22 11:06 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: Greg KH, jslaby, linux-serial, linux-kernel, Linux-sh list

On Thu, Oct 22, 2015 at 8:41 AM, Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> 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>

Acked-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] 6+ messages in thread

* RE: [PATCH] serial: sh-sci: Fix length of scatterlist
  2015-10-20 12:22 ` Geert Uytterhoeven
@ 2015-10-22  6:36   ` Yoshihiro Shimoda
  0 siblings, 0 replies; 6+ messages in thread
From: Yoshihiro Shimoda @ 2015-10-22  6:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg KH, jslaby, linux-serial, linux-kernel, Linux-sh list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1912 bytes --]

Hi Geert-san,

> Sent: Tuesday, October 20, 2015 9:22 PM
> 
> Hi Shimoda-san,
> 
> On Tue, Oct 20, 2015 at 2:18 PM, Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > This patch fixes an issue that the "length" of scatterlist should be
> > set using sh_dma_length(). Otherwise, a dmaengine driver cannot work
> 
> sg_dma_len()?

Thank you for the point. I will fix it.

> > 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;
> 
> There's no definition for "sg_dma_length" in my tree?? sg_dma_len()?

Oops! Thank you for the point. I will fix it.

Best regards,
Yoshihiro Shimoda

> 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
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [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
  1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2015-10-20 13:15 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: kbuild-all, gregkh, jslaby, linux-serial, linux-kernel, linux-sh,
	Yoshihiro Shimoda

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

Hi Yoshihiro,

[auto build test ERROR on tty/tty-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Yoshihiro-Shimoda/serial-sh-sci-Fix-length-of-scatterlist/20151020-201918
config: x86_64-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/tty/serial/sh-sci.c: In function 'sci_request_dma':
>> drivers/tty/serial/sh-sci.c:1440:4: error: implicit declaration of function 'sg_dma_length' [-Werror=implicit-function-declaration]
       sg_dma_length(sg) = s->buf_len_rx;
       ^
>> drivers/tty/serial/sh-sci.c:1440:22: error: lvalue required as left operand of assignment
       sg_dma_length(sg) = s->buf_len_rx;
                         ^
   cc1: some warnings being treated as errors

vim +/sg_dma_length +1440 drivers/tty/serial/sh-sci.c

  1434			for (i = 0; i < 2; i++) {
  1435				struct scatterlist *sg = &s->sg_rx[i];
  1436	
  1437				sg_init_table(sg, 1);
  1438				s->rx_buf[i] = buf;
  1439				sg_dma_address(sg) = dma;
> 1440				sg_dma_length(sg) = s->buf_len_rx;
  1441	
  1442				buf += s->buf_len_rx;
  1443				dma += s->buf_len_rx;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 50120 bytes --]

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

* Re: [PATCH] serial: sh-sci: Fix length of scatterlist
  2015-10-20 12:18 Yoshihiro Shimoda
@ 2015-10-20 12:22 ` Geert Uytterhoeven
  2015-10-22  6:36   ` Yoshihiro Shimoda
  2015-10-20 13:15 ` kbuild test robot
  1 sibling, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2015-10-20 12:22 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: Greg KH, jslaby, linux-serial, linux-kernel, Linux-sh list

Hi Shimoda-san,

On Tue, Oct 20, 2015 at 2:18 PM, Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> This patch fixes an issue that the "length" of scatterlist should be
> set using sh_dma_length(). Otherwise, a dmaengine driver cannot work

sg_dma_len()?

> 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;

There's no definition for "sg_dma_length" in my tree?? sg_dma_len()?

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] 6+ messages in thread

* [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; 6+ 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] 6+ messages in thread

end of thread, other threads:[~2015-10-22 11:06 UTC | newest]

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

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