linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: richard.genoud@gmail.com (Richard Genoud)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] tty/serial: atmel: fix TX path in atmel_console_write()
Date: Mon, 20 Mar 2017 11:33:30 +0100	[thread overview]
Message-ID: <05f5c67b-67d8-02b4-e170-52f2484d0927@gmail.com> (raw)
In-Reply-To: <20170315152948.10978-1-nicolas.ferre@microchip.com>

On 15/03/2017 16:29, Nicolas Ferre wrote:
> A side effect of 89d8232411a8 ("tty/serial: atmel_serial: BUG: stop DMA
> from transmitting in stop_tx") is that the console can be called with
> TX path disabled. Then the system would hang trying to push charecters
> out in atmel_console_putchar().
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Fixes: 89d8232411a8 ("tty/serial: atmel_serial: BUG: stop DMA from transmitting
> in stop_tx")
> Cc: stable <stable@vger.kernel.org> # 4.4+
> ---
> Hi Richard,
> 
> I found this to fix the problem with system hang in my linux-4.4-at91 branch
> (in the atmel_console_putchar() waiting loop actually). I'm open to more
> insignt.
> As we cannot figure out if this bit is set or not, I didn't preserve the
> current status...
> 
> Regards,
> 
>  drivers/tty/serial/atmel_serial.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index dcebb28ffbc4..7372dbdb7a4c 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -2483,6 +2483,9 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
>  	pdc_tx = atmel_uart_readl(port, ATMEL_PDC_PTSR) & ATMEL_PDC_TXTEN;
>  	atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS);
>  
> +	/* Make sure that tx path is actually able to send characters */
> +	atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);
> +
>  	uart_console_write(port, s, count, atmel_console_putchar);
>  
>  	/*
> 
Acked-by: Richard Genoud <richard.genoud@gmail.com>

      parent reply	other threads:[~2017-03-20 10:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13 16:27 [PATCH] tty/serial: atmel_serial: BUG: stop DMA from transmitting in stop_tx Richard Genoud
2017-01-02 11:13 ` Nicolas Ferre
2017-01-02 14:16   ` Richard Genoud
2017-01-11  7:09     ` Greg Kroah-Hartman
2017-03-15 11:37 ` Nicolas Ferre
2017-03-15 13:36   ` Richard Genoud
2017-03-15 15:29     ` [RFC PATCH] tty/serial: atmel: fix TX path in atmel_console_write() Nicolas Ferre
2017-03-15 16:19       ` Richard Genoud
2017-03-15 16:56         ` Nicolas Ferre
2017-03-17 15:11           ` Richard Genoud
2017-03-17 17:16             ` Nicolas Ferre
2017-03-20 10:33       ` Richard Genoud [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05f5c67b-67d8-02b4-e170-52f2484d0927@gmail.com \
    --to=richard.genoud@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).