lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170111070921.GB24787@kroah.com>
Date:   Wed, 11 Jan 2017 08:09:21 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Richard Genoud <richard.genoud@...il.com>
Cc:     Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        Nicolas Ferre <nicolas.ferre@...el.com>,
        Cyrille Pitchen <cyrille.pitchen@...el.com>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "beware, this won't apply before 4.3" <stable@...r.kernel.org>
Subject: Re: [PATCH] tty/serial: atmel_serial: BUG: stop DMA from
 transmitting in stop_tx

On Mon, Jan 02, 2017 at 03:16:46PM +0100, Richard Genoud wrote:
> 2017-01-02 12:13 GMT+01:00 Nicolas Ferre <nicolas.ferre@...el.com>:
> > Le 13/12/2016 à 17:27, Richard Genoud a écrit :
> >> If we don't disable the transmitter in atmel_stop_tx, the DMA buffer
> >> continues to send data until it is emptied.
> >> This cause problems with the flow control (CTS is asserted and data are
> >> still sent).
> >>
> >> So, disabling the transmitter in atmel_stop_tx is a sane thing to do.
> >>
> >> Tested on at91sam9g35-cm(DMA)
> >> Tested for regressions on sama5d2-xplained(Fifo) and at91sam9g20ek(PDC)
> >>
> >> Cc: <stable@...r.kernel.org> (beware, this won't apply before 4.3)
> >> Signed-off-by: Richard Genoud <richard.genoud@...il.com>
> >
> > Acked-by: Nicolas Ferre <nicolas.ferre@...el.com>
> >
> >> ---
> >>  drivers/tty/serial/atmel_serial.c | 11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >> NB: this is not for the 4.10 merge window, I'm just sending it now to
> >> have some comments if someone is againts it.
> >>
> >> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> >> index 168b10cad47b..f9d42de5ab2d 100644
> >> --- a/drivers/tty/serial/atmel_serial.c
> >> +++ b/drivers/tty/serial/atmel_serial.c
> >> @@ -481,6 +481,14 @@ static void atmel_stop_tx(struct uart_port *port)
> >>               /* disable PDC transmit */
> >>               atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS);
> >>       }
> >> +
> >> +     /*
> >> +      * Disable the transmitter.
> >> +      * This is mandatory when DMA is used, otherwise the DMA buffer
> >> +      * is fully transmitted.
> >> +      */
> >> +     atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS);
> >> +
> >>       /* Disable interrupts */
> >>       atmel_uart_writel(port, ATMEL_US_IDR, atmel_port->tx_done_mask);
> >>
> >> @@ -513,6 +521,9 @@ static void atmel_start_tx(struct uart_port *port)
> >>
> >>       /* Enable interrupts */
> >>       atmel_uart_writel(port, ATMEL_US_IER, atmel_port->tx_done_mask);
> >> +
> >> +     /* re-enable the transmitter */
> >> +     atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);
> >>  }
> >>
> >>  /*
> >>
> >
> >
> > --
> > Nicolas Ferre
> 
> Greg, could you also take this patch in your tree ?

Yup!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ