All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Schiffer <mschiffer@universe-factory.net>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	gregkh@linuxfoundation.org, jslaby@suse.com,
	linux-mips@linux-mips.org, linux-serial@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Nonterministic hang during bootconsole/console handover on ath79
Date: Tue, 22 Mar 2016 14:07:52 +0100	[thread overview]
Message-ID: <56F143A8.6020601@universe-factory.net> (raw)
In-Reply-To: <56F0B189.2080206@hurleysoftware.com>


[-- Attachment #1.1: Type: text/plain, Size: 2786 bytes --]

>> My theory is the following:
>>
>> As soon as ttyS0 is detected and installed as the console, there are two
>> console drivers active on the serial port at the same time: early0 and
>> ttyS0. I suspect that the hang occurs when the primitive early0
>> implementation prom_putchar_ar71xx waits indefinitely on THRE, but the real
>> driver has just reset the serial controller in a way that makes THRE never
>> come.
> 
> Doubtful.
> 
> console writes are performed with ints disabled, as is the 8250 driver's
> autoconfig probing. Since this is a UP platform, as long as you're not
> using the DEBUG_AUTOCONF switch in the 8250 driver, I don't think there's
> a way for the boot console to be outputting while the 8250 driver is
> configuring.

I see.

> 
>> When the boot is successful, I also sometimes see just garbage
>> instead of the message "serial8250.0: ttyS0 at MMIO 0x18020000...", which
>> supports my idea that the kernel is trying to use the serial console while
>> it is not correctly setup.
>>

> 
> I wonder if autoconfig probing (that's what discovers the uart port type)
> is broken.
> 
> You could test this hypothesis by setting the port type directly and
> set UPF_FIXED_TYPE; ie., in arch/mips/ath79/dev-common.c
> 
> diff --git a/arch/mips/ath79/dev-common.c b/arch/mips/ath79/dev-common.c
> index 516225d..3814a42 100644
> --- a/arch/mips/ath79/dev-common.c
> +++ b/arch/mips/ath79/dev-common.c
> @@ -36,7 +36,8 @@ static struct plat_serial8250_port ath79_uart_data[] = {
>  	{
>  		.mapbase	= AR71XX_UART_BASE,
>  		.irq		= ATH79_MISC_IRQ(3),
> -		.flags		= AR71XX_UART_FLAGS,
> +		.flags		= AR71XX_UART_FLAGS | UPF_FIXED_TYPE,
> +		.type		= PORT_16550A,
>  		.iotype		= UPIO_MEM32,
>  		.regshift	= 2,
>  	}, {
> 
> 
> Regards,
> Peter Hurley

I've tried your patch and I can't reproduce the issue anymore with it; I
have no idea if this actually has to do something with the issue, or the
change of the code path just hid the bug again.

Regarding your other mail: with "small change", I was not talking about
adding an additional printk; as mentioned, even changing the numbers in
UTS_VERSION can hide the issue. I diffed a working and a broken kernel
image, and the UTS_VERSION is really the only difference. I have no idea
how to explain this. (OpenWrt uses an LZMA-compressed kernel image, so
after compression, the differences are much greater; but how these
differences would affect the kernel after decompression eludes me)

I'll continue searching for a board with accessible JTAG which exhibits
this issue. Given the heisenbuggy nature of the issue, getting to the root
cause is probably impossible without JTAG unless someone has an obvious
explanation...

Thanks,
Matthias


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-03-22 13:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 23:02 Nonterministic hang during bootconsole/console handover on ath79 Matthias Schiffer
2016-03-21 23:08 ` Greg KH
2016-03-22  0:52   ` Matthias Schiffer
2016-03-22  2:51     ` Peter Hurley
2016-03-22  2:44 ` Peter Hurley
2016-03-22 13:07   ` Matthias Schiffer [this message]
2016-03-22 15:38     ` Peter Hurley
2016-03-23 17:40       ` Matthias Schiffer
2016-03-24  0:44         ` Peter Hurley
2016-03-24  2:09           ` Matthias Schiffer
2016-03-24  3:17             ` Peter Hurley
2016-03-25 12:59               ` Gabor Juhos
2016-03-25 15:24                 ` Peter Hurley
2016-03-22  5:40 ` Antony Pavlov
2016-03-22  9:50   ` Matthias Schiffer

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=56F143A8.6020601@universe-factory.net \
    --to=mschiffer@universe-factory.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.