Message ID | SIXPR06MB0559BA3B149F002AE534F8C5D8AD0@SIXPR06MB0559.apcprd06.prod.outlook.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Hi Shimoda-san Thanks for your patch. We will apply your patch and retest this issue on v4.9-rc2 then report you again. Thanks and best regards JINSO/Truong On 2016年10月28日 17:14, Yoshihiro Shimoda wrote: > Hi Geert-san, Xuan-san, > >> From: linux-renesas-soc-owner@vger.kernel.org [mailto:linux-renesas-soc-owner@vger.kernel.org] On Behalf Of Geert >> Uytterhoeven >> Sent: Monday, October 24, 2016 6:21 PM >> >> On Mon, Oct 24, 2016 at 11:13 AM, Xuan Truong Nguyen >> <nx-truong@jinso.co.jp> wrote: >>>> This is with shmobile_defconfig? >>> yes. we also attach the configs file we used >>> (lager-scif-pio-v4.9-rc2.config) >>> >>>> Does it work better if you enable CONFIG_SERIAL_SH_SCI_DMA? >>> yes, it's better a little bit. the kernel does not hangs up, but the warning >>> message is output. >>> please refer lager-scif-dma.log. >>> >>> we tested on v4.9-rc2. the issue is the same. >>> >>> if you need any information, please let us know. >>> WARNING: CPU: 0 PID: 2249 at drivers/dma/sh/rcar-dmac.c:1257 rcar_dmac_tx_status+0x128/0x4 >>> No descriptor for cookie! >>> [<c03419e8>] (rcar_dmac_tx_status) from [<c0371e04>] (rx_timer_fn+0x48/0x148) >>> [<c0371dbc>] (rx_timer_fn) from [<c016dedc>] (call_timer_fn+0x2c/0xa0) >> That looks like a race condition between timeout handling and actual completion >> of the DMA? > I found an issue in sh-sci.c and made a patch to resolve it. > But, I'm not sure this is correct way. > If this is correct way, we also have to fix dev_dbg() in some functions. > > Best regards, > Yoshihiro Shimoda > > Since I send this email using Outlook, the patch format may be not good. > --- > From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > Date: Fri, 28 Oct 2016 16:52:36 +0900 > Subject: [PATCH] serial: sh-sci: remove dev_warn() to avoid double spin lock > held > > If we use serial console and CONFIG_SERIAL_SH_SCI_DMA=y, since > sci_dma_rx_push() is called with port->lock held and dev_warn() will > call serial_console_write() finally, this is possible to call > spin_lock{_irqsave}() twice. > To avoid this, this patch remove dev_warn() in sci_dma_rx_push(). > > Reported-by: Xuan Truong Nguyen <nx-truong@jinso.co.jp> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > --- > drivers/tty/serial/sh-sci.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c > index 4b26252..380b5d7 100644 > --- a/drivers/tty/serial/sh-sci.c > +++ b/drivers/tty/serial/sh-sci.c > @@ -1142,11 +1142,8 @@ static int sci_dma_rx_push(struct sci_port *s, void *buf, size_t count) > int copied; > > copied = tty_insert_flip_string(tport, buf, count); > - if (copied < count) { > - dev_warn(port->dev, "Rx overrun: dropping %zu bytes\n", > - count - copied); > + if (copied < count) > port->icount.buf_overrun++; > - } > > port->icount.rx += copied; >
Hi. I confirm that the patch from Shimoda-san works ok on V4.9-rc2 with CONFIG_SERIAL_SH_SCI_DMA enabled. On 2016年10月28日 17:14, Yoshihiro Shimoda wrote: > Hi Geert-san, Xuan-san, > >> From: linux-renesas-soc-owner@vger.kernel.org [mailto:linux-renesas-soc-owner@vger.kernel.org] On Behalf Of Geert >> Uytterhoeven >> Sent: Monday, October 24, 2016 6:21 PM >> >> On Mon, Oct 24, 2016 at 11:13 AM, Xuan Truong Nguyen >> <nx-truong@jinso.co.jp> wrote: >>>> This is with shmobile_defconfig? >>> yes. we also attach the configs file we used >>> (lager-scif-pio-v4.9-rc2.config) >>> >>>> Does it work better if you enable CONFIG_SERIAL_SH_SCI_DMA? >>> yes, it's better a little bit. the kernel does not hangs up, but the warning >>> message is output. >>> please refer lager-scif-dma.log. >>> >>> we tested on v4.9-rc2. the issue is the same. >>> >>> if you need any information, please let us know. >>> WARNING: CPU: 0 PID: 2249 at drivers/dma/sh/rcar-dmac.c:1257 rcar_dmac_tx_status+0x128/0x4 >>> No descriptor for cookie! >>> [<c03419e8>] (rcar_dmac_tx_status) from [<c0371e04>] (rx_timer_fn+0x48/0x148) >>> [<c0371dbc>] (rx_timer_fn) from [<c016dedc>] (call_timer_fn+0x2c/0xa0) >> That looks like a race condition between timeout handling and actual completion >> of the DMA? > I found an issue in sh-sci.c and made a patch to resolve it. > But, I'm not sure this is correct way. > If this is correct way, we also have to fix dev_dbg() in some functions. > > Best regards, > Yoshihiro Shimoda > > Since I send this email using Outlook, the patch format may be not good. > --- > From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > Date: Fri, 28 Oct 2016 16:52:36 +0900 > Subject: [PATCH] serial: sh-sci: remove dev_warn() to avoid double spin lock > held-- > > さん > > おはいようございます。ベトナムのチュオンです。 > いつもお世話になっております。 > > では、よろしくお願い致します。 > > チュオン > nx-truong > > > If we use serial console and CONFIG_SERIAL_SH_SCI_DMA=y, since > sci_dma_rx_push() is called with port->lock held and dev_warn() will > call serial_console_write() finally, this is possible to call > spin_lock{_irqsave}() twice. > To avoid this, this patch remove dev_warn() in sci_dma_rx_push(). > > Reported-by: Xuan Truong Nguyen <nx-truong@jinso.co.jp> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > --- > drivers/tty/serial/sh-sci.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c > index 4b26252..380b5d7 100644 > --- a/drivers/tty/serial/sh-sci.c > +++ b/drivers/tty/serial/sh-sci.c > @@ -1142,11 +1142,8 @@ static int sci_dma_rx_push(struct sci_port *s, void *buf, size_t count) > int copied; > > copied = tty_insert_flip_string(tport, buf, count); > - if (copied < count) { > - dev_warn(port->dev, "Rx overrun: dropping %zu bytes\n", > - count - copied); > + if (copied < count) > port->icount.buf_overrun++; > - } > > port->icount.rx += copied; >
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 4b26252..380b5d7 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1142,11 +1142,8 @@ static int sci_dma_rx_push(struct sci_port *s, void *buf, size_t count) int copied; copied = tty_insert_flip_string(tport, buf, count); - if (copied < count) { - dev_warn(port->dev, "Rx overrun: dropping %zu bytes\n", - count - copied); + if (copied < count) port->icount.buf_overrun++; - } port->icount.rx += copied;