public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Richard Genoud <richard.genoud@gmail.com>,
	<linux-serial@vger.kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	"stable # 4 . 4+" <stable@vger.kernel.org>
Subject: Re: [RFC PATCH] tty/serial: atmel: fix TX path in atmel_console_write()
Date: Wed, 15 Mar 2017 17:56:11 +0100	[thread overview]
Message-ID: <d3abc5aa-b010-a6cc-4ab9-74078149a692@microchip.com> (raw)
In-Reply-To: <074d057e-4971-a325-e985-3f5046536225@gmail.com>

Le 15/03/2017 à 17:19, Richard Genoud a écrit :
> 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,
> 
> So, I'm guessing that you may see some lines/characters printed twice on
> the screen, don't you ?

Well, actually, I don't think so because the repetitions that I see are
probably due to open/close/open/close/re-open/... of the serial console
itself.

Same with the line "random: udevd: uninitialized urandom read (16 bytes
read, 21 bits of entropy available)", they happen at different moment in
time => the printk log timestamping seem to indicate that they are
different.

Here is my log:
http://code.bulix.org/bok23n-123056

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);
>>  
>>  	/*
>>
> 
> Richard.
> 


-- 
Nicolas Ferre

  reply	other threads:[~2017-03-15 17:06 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 [this message]
2017-03-17 15:11           ` Richard Genoud
2017-03-17 17:16             ` Nicolas Ferre
2017-03-20 10:33       ` Richard Genoud

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=d3abc5aa-b010-a6cc-4ab9-74078149a692@microchip.com \
    --to=nicolas.ferre@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=richard.genoud@gmail.com \
    --cc=stable@vger.kernel.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