mbox series

[GIT,PULL,1/2] bcm2835-dt-fixes-2017-10-06

Message ID 20171006220504.7776-1-eric@anholt.net
State New
Headers show
Series [GIT,PULL,1/2] bcm2835-dt-fixes-2017-10-06 | expand

Pull-request

git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06

Message

Eric Anholt Oct. 6, 2017, 10:05 p.m. UTC
Hi Florian.  Here's a patch that's gone through a couple of revisions
on the list, that seriously fixes up the default serial behavior --
previously, without the right config.txt/cmdline bits, you'd often end
up with a hang with no output before booting completed.  It would be
great to get it into 4.14.

The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:

  Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)

are available in the git repository at:

  git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06

for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:

  ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)

----------------------------------------------------------------
This pull request brings in a fix for default serial console setup on
RPi3, so it now comes up with no config.txt/cmdline.txt settings in
the firmware.

----------------------------------------------------------------
Loic Poulain (1):
      ARM: dts: bcm283x: Fix console path on RPi3

 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 9 +++------
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts    | 5 +++++
 arch/arm/boot/dts/bcm283x.dtsi           | 7 ++++++-
 3 files changed, 14 insertions(+), 7 deletions(-)

Comments

Matt Hart Oct. 31, 2017, 5 p.m. UTC | #1
On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
>
> On 10/06/2017 03:05 PM, Eric Anholt wrote:
> > Hi Florian.  Here's a patch that's gone through a couple of revisions
> > on the list, that seriously fixes up the default serial behavior --
> > previously, without the right config.txt/cmdline bits, you'd often end
> > up with a hang with no output before booting completed.  It would be
> > great to get it into 4.14.
> >
> > The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
> >
> >   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
> >
> > are available in the git repository at:
> >
> >   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
> >
> > for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
> >
> >   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
> >
> > ----------------------------------------------------------------
> > This pull request brings in a fix for default serial console setup on
> > RPi3, so it now comes up with no config.txt/cmdline.txt settings in
> > the firmware.
> >
> > ----------------------------------------------------------------
>
> Merged, thanks Eric
>
> --
> Florian

Hi all,

I realise this patch has been in mainline for a more than a week, but
I've only recently had time to bisect broken rpi-3 boots in kernelci
and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.

Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
line which now fails:
https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/

Is there an alias I can use for both before and after this patch?

Mainline boots fine if I use console=ttyS1 or drop the console arg
altogether, but as we don't currently support different boot args per
tree, and we don't have the manpower to track this patch in all the
trees we test, we will have to switch to only boot testing mainline
from now on.

It seems to me the patch is doing the right thing, so this is just an
FYI, though I can imagine a few users getting caught by this.

Cheers
Peter Robinson Nov. 1, 2017, 9:37 a.m. UTC | #2
On Tue, Oct 31, 2017 at 5:00 PM, Matt Hart <matt@mattface.org> wrote:
> On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>> On 10/06/2017 03:05 PM, Eric Anholt wrote:
>> > Hi Florian.  Here's a patch that's gone through a couple of revisions
>> > on the list, that seriously fixes up the default serial behavior --
>> > previously, without the right config.txt/cmdline bits, you'd often end
>> > up with a hang with no output before booting completed.  It would be
>> > great to get it into 4.14.
>> >
>> > The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
>> >
>> >   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
>> >
>> > are available in the git repository at:
>> >
>> >   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
>> >
>> > for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
>> >
>> >   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
>> >
>> > ----------------------------------------------------------------
>> > This pull request brings in a fix for default serial console setup on
>> > RPi3, so it now comes up with no config.txt/cmdline.txt settings in
>> > the firmware.
>> >
>> > ----------------------------------------------------------------
>>
>> Merged, thanks Eric
>>
>> --
>> Florian
>
> Hi all,
>
> I realise this patch has been in mainline for a more than a week, but
> I've only recently had time to bisect broken rpi-3 boots in kernelci
> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
>
> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
> line which now fails:
> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
>
> Is there an alias I can use for both before and after this patch?
>
> Mainline boots fine if I use console=ttyS1 or drop the console arg
> altogether, but as we don't currently support different boot args per
> tree, and we don't have the manpower to track this patch in all the
> trees we test, we will have to switch to only boot testing mainline
> from now on.

Yes, I've seen the same in Fedora with that patch.
Stefan Wahren Nov. 1, 2017, 12:05 p.m. UTC | #3
Hi Matt, hi Peter,

Am 01.11.2017 um 10:37 schrieb Peter Robinson:
> On Tue, Oct 31, 2017 at 5:00 PM, Matt Hart <matt@mattface.org> wrote:
>> On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>> On 10/06/2017 03:05 PM, Eric Anholt wrote:
>>>> Hi Florian.  Here's a patch that's gone through a couple of revisions
>>>> on the list, that seriously fixes up the default serial behavior --
>>>> previously, without the right config.txt/cmdline bits, you'd often end
>>>> up with a hang with no output before booting completed.  It would be
>>>> great to get it into 4.14.
>>>>
>>>> The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
>>>>
>>>>   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
>>>>
>>>> are available in the git repository at:
>>>>
>>>>   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
>>>>
>>>> for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
>>>>
>>>>   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
>>>>
>>>> ----------------------------------------------------------------
>>>> This pull request brings in a fix for default serial console setup on
>>>> RPi3, so it now comes up with no config.txt/cmdline.txt settings in
>>>> the firmware.
>>>>
>>>> ----------------------------------------------------------------
>>> Merged, thanks Eric
>>>
>>> --
>>> Florian
>> Hi all,
>>
>> I realise this patch has been in mainline for a more than a week, but
>> I've only recently had time to bisect broken rpi-3 boots in kernelci
>> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
>>
>> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
>> line which now fails:
>> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
>>
>> Is there an alias I can use for both before and after this patch?
>>
>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>> altogether, but as we don't currently support different boot args per
>> tree, and we don't have the manpower to track this patch in all the
>> trees we test, we will have to switch to only boot testing mainline
>> from now on.
> Yes, I've seen the same in Fedora with that patch.
>
>
could you please describe the issue more in detail.

Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
pinmux conflict?

Which u-boot version do you use?


Best regards

Stefan
Peter Robinson Nov. 1, 2017, 12:09 p.m. UTC | #4
On Wed, Nov 1, 2017 at 12:05 PM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi Matt, hi Peter,
>
> Am 01.11.2017 um 10:37 schrieb Peter Robinson:
>> On Tue, Oct 31, 2017 at 5:00 PM, Matt Hart <matt@mattface.org> wrote:
>>> On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>>> On 10/06/2017 03:05 PM, Eric Anholt wrote:
>>>>> Hi Florian.  Here's a patch that's gone through a couple of revisions
>>>>> on the list, that seriously fixes up the default serial behavior --
>>>>> previously, without the right config.txt/cmdline bits, you'd often end
>>>>> up with a hang with no output before booting completed.  It would be
>>>>> great to get it into 4.14.
>>>>>
>>>>> The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
>>>>>
>>>>>   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
>>>>>
>>>>> are available in the git repository at:
>>>>>
>>>>>   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
>>>>>
>>>>> for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
>>>>>
>>>>>   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
>>>>>
>>>>> ----------------------------------------------------------------
>>>>> This pull request brings in a fix for default serial console setup on
>>>>> RPi3, so it now comes up with no config.txt/cmdline.txt settings in
>>>>> the firmware.
>>>>>
>>>>> ----------------------------------------------------------------
>>>> Merged, thanks Eric
>>>>
>>>> --
>>>> Florian
>>> Hi all,
>>>
>>> I realise this patch has been in mainline for a more than a week, but
>>> I've only recently had time to bisect broken rpi-3 boots in kernelci
>>> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
>>>
>>> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
>>> line which now fails:
>>> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
>>>
>>> Is there an alias I can use for both before and after this patch?
>>>
>>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>>> altogether, but as we don't currently support different boot args per
>>> tree, and we don't have the manpower to track this patch in all the
>>> trees we test, we will have to switch to only boot testing mainline
>>> from now on.
>> Yes, I've seen the same in Fedora with that patch.
>>
>>
> could you please describe the issue more in detail.
>
> Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
> pinmux conflict?

Basically on the RPi3 you use to get ttyAMA0 and ttyS0 but now the
later is ttyS1

> Which u-boot version do you use?

Upstream
Marcel Holtmann Nov. 1, 2017, 12:16 p.m. UTC | #5
Hi Peter,

>>>>>> Hi Florian.  Here's a patch that's gone through a couple of revisions
>>>>>> on the list, that seriously fixes up the default serial behavior --
>>>>>> previously, without the right config.txt/cmdline bits, you'd often end
>>>>>> up with a hang with no output before booting completed.  It would be
>>>>>> great to get it into 4.14.
>>>>>> 
>>>>>> The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
>>>>>> 
>>>>>>  Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
>>>>>> 
>>>>>> are available in the git repository at:
>>>>>> 
>>>>>>  git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
>>>>>> 
>>>>>> for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
>>>>>> 
>>>>>>  ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
>>>>>> 
>>>>>> ----------------------------------------------------------------
>>>>>> This pull request brings in a fix for default serial console setup on
>>>>>> RPi3, so it now comes up with no config.txt/cmdline.txt settings in
>>>>>> the firmware.
>>>>>> 
>>>>>> ----------------------------------------------------------------
>>>>> Merged, thanks Eric
>>>>> 
>>>>> --
>>>>> Florian
>>>> Hi all,
>>>> 
>>>> I realise this patch has been in mainline for a more than a week, but
>>>> I've only recently had time to bisect broken rpi-3 boots in kernelci
>>>> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
>>>> 
>>>> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
>>>> line which now fails:
>>>> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
>>>> 
>>>> Is there an alias I can use for both before and after this patch?
>>>> 
>>>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>>>> altogether, but as we don't currently support different boot args per
>>>> tree, and we don't have the manpower to track this patch in all the
>>>> trees we test, we will have to switch to only boot testing mainline
>>>> from now on.
>>> Yes, I've seen the same in Fedora with that patch.
>>> 
>>> 
>> could you please describe the issue more in detail.
>> 
>> Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
>> pinmux conflict?
> 
> Basically on the RPi3 you use to get ttyAMA0 and ttyS0 but now the
> later is ttyS1

which UART is which now. It should expose the Bluetooth UART correctly now. And also more importantly usable. The only missing piece with 4.14 would be the DT assigned for serdev. While 4.14 would still require a call to btattach, starting with 4.15 that should no longer be needed.

Regards

Marcel
Matt Hart Nov. 1, 2017, 1:06 p.m. UTC | #6
On 1 November 2017 at 12:05, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi Matt, hi Peter,
>
> Am 01.11.2017 um 10:37 schrieb Peter Robinson:
>> On Tue, Oct 31, 2017 at 5:00 PM, Matt Hart <matt@mattface.org> wrote:
>>> On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>>> On 10/06/2017 03:05 PM, Eric Anholt wrote:
>>>>> Hi Florian.  Here's a patch that's gone through a couple of revisions
>>>>> on the list, that seriously fixes up the default serial behavior --
>>>>> previously, without the right config.txt/cmdline bits, you'd often end
>>>>> up with a hang with no output before booting completed.  It would be
>>>>> great to get it into 4.14.
>>>>>
>>>>> The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
>>>>>
>>>>>   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
>>>>>
>>>>> are available in the git repository at:
>>>>>
>>>>>   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
>>>>>
>>>>> for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
>>>>>
>>>>>   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
>>>>>
>>>>> ----------------------------------------------------------------
>>>>> This pull request brings in a fix for default serial console setup on
>>>>> RPi3, so it now comes up with no config.txt/cmdline.txt settings in
>>>>> the firmware.
>>>>>
>>>>> ----------------------------------------------------------------
>>>> Merged, thanks Eric
>>>>
>>>> --
>>>> Florian
>>> Hi all,
>>>
>>> I realise this patch has been in mainline for a more than a week, but
>>> I've only recently had time to bisect broken rpi-3 boots in kernelci
>>> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
>>>
>>> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
>>> line which now fails:
>>> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
>>>
>>> Is there an alias I can use for both before and after this patch?
>>>
>>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>>> altogether, but as we don't currently support different boot args per
>>> tree, and we don't have the manpower to track this patch in all the
>>> trees we test, we will have to switch to only boot testing mainline
>>> from now on.
>> Yes, I've seen the same in Fedora with that patch.
>>
>>
> could you please describe the issue more in detail.
>
> Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
> pinmux conflict?
Linux throws a kernel panic, "Warning: unable to open an initial console."
>
> Which u-boot version do you use?
These are the 2 boot reports from KernelCI, there some LAVA debug in
there but you can see the uboot version and boot commands used.

Working boot
https://storage.kernelci.org/mainline/master/v4.14-rc5-95-g1c9fec470b81/arm64/defconfig/lab-mhart/boot-bcm2837-rpi-3-b.html

Failing boot
https://storage.kernelci.org/mainline/master/v4.14-rc5-125-g9c323bff13f9/arm64/defconfig/lab-mhart/boot-bcm2837-rpi-3-b.html
>
>
> Best regards
>
> Stefan
>
Eric Anholt Nov. 1, 2017, 4:54 p.m. UTC | #7
Matt Hart <matt@mattface.org> writes:

> On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>> On 10/06/2017 03:05 PM, Eric Anholt wrote:
>> > Hi Florian.  Here's a patch that's gone through a couple of revisions
>> > on the list, that seriously fixes up the default serial behavior --
>> > previously, without the right config.txt/cmdline bits, you'd often end
>> > up with a hang with no output before booting completed.  It would be
>> > great to get it into 4.14.
>> >
>> > The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
>> >
>> >   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
>> >
>> > are available in the git repository at:
>> >
>> >   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
>> >
>> > for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
>> >
>> >   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
>> >
>> > ----------------------------------------------------------------
>> > This pull request brings in a fix for default serial console setup on
>> > RPi3, so it now comes up with no config.txt/cmdline.txt settings in
>> > the firmware.
>> >
>> > ----------------------------------------------------------------
>>
>> Merged, thanks Eric
>>
>> --
>> Florian
>
> Hi all,
>
> I realise this patch has been in mainline for a more than a week, but
> I've only recently had time to bisect broken rpi-3 boots in kernelci
> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
>
> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
> line which now fails:
> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
>
> Is there an alias I can use for both before and after this patch?
>
> Mainline boots fine if I use console=ttyS1 or drop the console arg
> altogether, but as we don't currently support different boot args per
> tree, and we don't have the manpower to track this patch in all the
> trees we test, we will have to switch to only boot testing mainline
> from now on.
>
> It seems to me the patch is doing the right thing, so this is just an
> FYI, though I can imagine a few users getting caught by this.

Yeah, this matches my experience basically.  As far as I can tell, we
were just doing things wrong before, thus needing these custom boot args
that we can all now get rid of.  I wish I had a better answer.
Stefan Wahren Nov. 1, 2017, 5:44 p.m. UTC | #8
Hi Matt,

> Matt Hart <matt@mattface.org> hat am 1. November 2017 um 14:06 geschrieben:
> 
> 
> On 1 November 2017 at 12:05, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> > Hi Matt, hi Peter,
> >
> > Am 01.11.2017 um 10:37 schrieb Peter Robinson:
> >> On Tue, Oct 31, 2017 at 5:00 PM, Matt Hart <matt@mattface.org> wrote:
> >>> On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
> >>>> On 10/06/2017 03:05 PM, Eric Anholt wrote:
> >>>>> Hi Florian.  Here's a patch that's gone through a couple of revisions
> >>>>> on the list, that seriously fixes up the default serial behavior --
> >>>>> previously, without the right config.txt/cmdline bits, you'd often end
> >>>>> up with a hang with no output before booting completed.  It would be
> >>>>> great to get it into 4.14.
> >>>>>
> >>>>> The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
> >>>>>
> >>>>>   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
> >>>>>
> >>>>> are available in the git repository at:
> >>>>>
> >>>>>   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
> >>>>>
> >>>>> for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
> >>>>>
> >>>>>   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
> >>>>>
> >>>>> ----------------------------------------------------------------
> >>>>> This pull request brings in a fix for default serial console setup on
> >>>>> RPi3, so it now comes up with no config.txt/cmdline.txt settings in
> >>>>> the firmware.
> >>>>>
> >>>>> ----------------------------------------------------------------
> >>>> Merged, thanks Eric
> >>>>
> >>>> --
> >>>> Florian
> >>> Hi all,
> >>>
> >>> I realise this patch has been in mainline for a more than a week, but
> >>> I've only recently had time to bisect broken rpi-3 boots in kernelci
> >>> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
> >>>
> >>> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
> >>> line which now fails:
> >>> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
> >>>
> >>> Is there an alias I can use for both before and after this patch?
> >>>
> >>> Mainline boots fine if I use console=ttyS1 or drop the console arg
> >>> altogether, but as we don't currently support different boot args per
> >>> tree, and we don't have the manpower to track this patch in all the
> >>> trees we test, we will have to switch to only boot testing mainline
> >>> from now on.
> >> Yes, I've seen the same in Fedora with that patch.
> >>
> >>
> > could you please describe the issue more in detail.
> >
> > Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
> > pinmux conflict?
> Linux throws a kernel panic, "Warning: unable to open an initial console."

what happens if you specify both?

console=ttyS0,115200n8 console=ttyS1,115200n8
Matt Hart Nov. 2, 2017, 8:33 a.m. UTC | #9
On 1 November 2017 at 17:44, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi Matt,
>
>> Matt Hart <matt@mattface.org> hat am 1. November 2017 um 14:06 geschrieben:
>>
>>
>> On 1 November 2017 at 12:05, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>> > Hi Matt, hi Peter,
>> >
>> > Am 01.11.2017 um 10:37 schrieb Peter Robinson:
>> >> On Tue, Oct 31, 2017 at 5:00 PM, Matt Hart <matt@mattface.org> wrote:
>> >>> On 6 October 2017 at 23:14, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> >>>> On 10/06/2017 03:05 PM, Eric Anholt wrote:
>> >>>>> Hi Florian.  Here's a patch that's gone through a couple of revisions
>> >>>>> on the list, that seriously fixes up the default serial behavior --
>> >>>>> previously, without the right config.txt/cmdline bits, you'd often end
>> >>>>> up with a hang with no output before booting completed.  It would be
>> >>>>> great to get it into 4.14.
>> >>>>>
>> >>>>> The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:
>> >>>>>
>> >>>>>   Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)
>> >>>>>
>> >>>>> are available in the git repository at:
>> >>>>>
>> >>>>>   git://github.com/anholt/linux tags/bcm2835-dt-fixes-2017-10-06
>> >>>>>
>> >>>>> for you to fetch changes up to f08f58a2bf68900a84e782b8c7ad701c0654173c:
>> >>>>>
>> >>>>>   ARM: dts: bcm283x: Fix console path on RPi3 (2017-10-06 13:04:56 -0700)
>> >>>>>
>> >>>>> ----------------------------------------------------------------
>> >>>>> This pull request brings in a fix for default serial console setup on
>> >>>>> RPi3, so it now comes up with no config.txt/cmdline.txt settings in
>> >>>>> the firmware.
>> >>>>>
>> >>>>> ----------------------------------------------------------------
>> >>>> Merged, thanks Eric
>> >>>>
>> >>>> --
>> >>>> Florian
>> >>> Hi all,
>> >>>
>> >>> I realise this patch has been in mainline for a more than a week, but
>> >>> I've only recently had time to bisect broken rpi-3 boots in kernelci
>> >>> and found f08f58a2bf68900a84e782b8c7ad701c0654173c as the cause.
>> >>>
>> >>> Kernelci boots the rpi3 using uboot, with console=ttyS0 in the command
>> >>> line which now fails:
>> >>> https://kernelci.org/boot/id/59f787f059b5147794ef1dcf/
>> >>>
>> >>> Is there an alias I can use for both before and after this patch?
>> >>>
>> >>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>> >>> altogether, but as we don't currently support different boot args per
>> >>> tree, and we don't have the manpower to track this patch in all the
>> >>> trees we test, we will have to switch to only boot testing mainline
>> >>> from now on.
>> >> Yes, I've seen the same in Fedora with that patch.
>> >>
>> >>
>> > could you please describe the issue more in detail.
>> >
>> > Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
>> > pinmux conflict?
>> Linux throws a kernel panic, "Warning: unable to open an initial console."
>
> what happens if you specify both?
>
> console=ttyS0,115200n8 console=ttyS1,115200n8

You can't do that, as per
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/serial-console.rst#n45

I tried it anyway, and new kernel with this patch failed with the same
error, I suspect it used the first console definition on the command
line.

Incidentally, on the old pre-patch kernel, it did boot to a prompt but
I got double kernel output as it setup 2 consoles both on ttyS0.
https://pastebin.com/raw/Uf09gUaP

I think Eric is right here, it was just wrong before and we'll have to
live with the legacy.
Peter Robinson Nov. 16, 2017, 4:44 p.m. UTC | #10
Hi Marcel,

Sorry for the late response.

>>>>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>>>>> altogether, but as we don't currently support different boot args per
>>>>> tree, and we don't have the manpower to track this patch in all the
>>>>> trees we test, we will have to switch to only boot testing mainline
>>>>> from now on.
>>>> Yes, I've seen the same in Fedora with that patch.
>>>>
>>>>
>>> could you please describe the issue more in detail.
>>>
>>> Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
>>> pinmux conflict?
>>
>> Basically on the RPi3 you use to get ttyAMA0 and ttyS0 but now the
>> later is ttyS1
>
> which UART is which now. It should expose the Bluetooth UART correctly now. And also more importantly usable. The only missing piece with 4.14 would be the DT assigned for serdev. While 4.14 would still require a call to btattach, starting with 4.15 that should no longer be needed.

Looks to be ttyAMA0

[    4.480469] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 72,
base_baud = 0) is a PL011 rev2
[    4.497401] serial serial0: tty port ttyAMA0 registered

With 4.14 I get the following, the address doesn't look right, do you
have a link to the serdev patch headed to 4.15?

# hciconfig
hci0:   Type: Primary  Bus: UART
        BD Address: AA:AA:AA:AA:AA:AA  ACL MTU: 1021:8  SCO MTU: 64:1
        DOWN
        RX bytes:542 acl:0 sco:0 events:11 errors:0
        TX bytes:77 acl:0 sco:0 commands:17 errors:0
Eric Anholt Nov. 16, 2017, 8:21 p.m. UTC | #11
Peter Robinson <pbrobinson@gmail.com> writes:

> Hi Marcel,
>
> Sorry for the late response.
>
>>>>>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>>>>>> altogether, but as we don't currently support different boot args per
>>>>>> tree, and we don't have the manpower to track this patch in all the
>>>>>> trees we test, we will have to switch to only boot testing mainline
>>>>>> from now on.
>>>>> Yes, I've seen the same in Fedora with that patch.
>>>>>
>>>>>
>>>> could you please describe the issue more in detail.
>>>>
>>>> Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
>>>> pinmux conflict?
>>>
>>> Basically on the RPi3 you use to get ttyAMA0 and ttyS0 but now the
>>> later is ttyS1
>>
>> which UART is which now. It should expose the Bluetooth UART correctly now. And also more importantly usable. The only missing piece with 4.14 would be the DT assigned for serdev. While 4.14 would still require a call to btattach, starting with 4.15 that should no longer be needed.
>
> Looks to be ttyAMA0
>
> [    4.480469] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 72,
> base_baud = 0) is a PL011 rev2
> [    4.497401] serial serial0: tty port ttyAMA0 registered
>
> With 4.14 I get the following, the address doesn't look right, do you
> have a link to the serdev patch headed to 4.15?

https://github.com/anholt/linux/commit/fd3372db18d3d44ae4579243a8eacb5247d8c03a
Peter Robinson Nov. 17, 2017, 12:16 p.m. UTC | #12
>>>>>>> Mainline boots fine if I use console=ttyS1 or drop the console arg
>>>>>>> altogether, but as we don't currently support different boot args per
>>>>>>> tree, and we don't have the manpower to track this patch in all the
>>>>>>> trees we test, we will have to switch to only boot testing mainline
>>>>>>> from now on.
>>>>>> Yes, I've seen the same in Fedora with that patch.
>>>>>>
>>>>>>
>>>>> could you please describe the issue more in detail.
>>>>>
>>>>> Does u-boot or Linux hang? Does u-boot select the wrong UART? Is there a
>>>>> pinmux conflict?
>>>>
>>>> Basically on the RPi3 you use to get ttyAMA0 and ttyS0 but now the
>>>> later is ttyS1
>>>
>>> which UART is which now. It should expose the Bluetooth UART correctly now. And also more importantly usable. The only missing piece with 4.14 would be the DT assigned for serdev. While 4.14 would still require a call to btattach, starting with 4.15 that should no longer be needed.
>>
>> Looks to be ttyAMA0
>>
>> [    4.480469] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 72,
>> base_baud = 0) is a PL011 rev2
>> [    4.497401] serial serial0: tty port ttyAMA0 registered
>>
>> With 4.14 I get the following, the address doesn't look right, do you
>> have a link to the serdev patch headed to 4.15?
>
> https://github.com/anholt/linux/commit/fd3372db18d3d44ae4579243a8eacb5247d8c03a

We already have that one included in the Fedora kernel, I wonder what
else I'm doing wrong.
Peter Robinson Nov. 21, 2017, 10:03 a.m. UTC | #13
Hi Loic,

>> With 4.14 I get the following, the address doesn't look right, do you
>> have a link to the serdev patch headed to 4.15?
>>
>> # hciconfig
>> hci0:   Type: Primary  Bus: UART
>>         BD Address: AA:AA:AA:AA:AA:AA  ACL MTU: 1021:8  SCO MTU: 64:1
>>         DOWN
>>         RX bytes:542 acl:0 sco:0 events:11 errors:0
>>         TX bytes:77 acl:0 sco:0 commands:17 errors:0
>
>
> HCI link seems ok since you have some events/commands in the stats.
> It could be a firmware issue, missing or at the wrong place (BCM43xxx.hcd).
> Does the hci_bcm request firmware call fail ? (dev_info message).

So it seems it's actually working fine albeit the strange mac addr, no
idea what I was trying before, although there's an error about loading
firmware:

[   31.035291] Bluetooth: hci0: BCM: chip id 94
[   31.035801] Bluetooth: hci0: BCM: features 0x2e
[   31.037483] Bluetooth: hci0: BCM43430A1
[   31.037498] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[   31.037694] bluetooth hci0: Direct firmware load for
brcm/BCM43430A1.hcd failed with error -2
[   31.037704] Bluetooth: hci0: BCM: Patch brcm/BCM43430A1.hcd not found

By adding a firmware [1] to the location it actually now stops
working, although shows up with a hciconfig, and had the following
errors.

[   26.078038] Bluetooth: hci0: BCM: chip id 94
[   26.096797] Bluetooth: hci0: BCM: features 0x2e
[   28.130753] Bluetooth: hci0 command 0x0c14 tx timeout
[   36.322725] Bluetooth: hci0: BCM: Reading local name failed (-110)

Thanks,
Peter
Loic Poulain Nov. 22, 2017, 8:07 a.m. UTC | #14
Hi Peter,

> So it seems it's actually working fine albeit the strange mac addr, no
> idea what I was trying before, although there's an error about loading
> firmware:
>
> [   31.035291] Bluetooth: hci0: BCM: chip id 94
> [   31.035801] Bluetooth: hci0: BCM: features 0x2e
> [   31.037483] Bluetooth: hci0: BCM43430A1
> [   31.037498] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
> [   31.037694] bluetooth hci0: Direct firmware load for
> brcm/BCM43430A1.hcd failed with error -2
> [   31.037704] Bluetooth: hci0: BCM: Patch brcm/BCM43430A1.hcd not found

Ok, think that's why you have this kind of 'default' address, you should be able
to provision a valid address with btmgmt tool. The chip can work
without applying
patch file, original firmware is then executed, which is potentially
more or less buggy.


> By adding a firmware [1] to the location it actually now stops
> working, although shows up with a hciconfig, and had the following
> errors.
>
> [   26.078038] Bluetooth: hci0: BCM: chip id 94
> [   26.096797] Bluetooth: hci0: BCM: features 0x2e
> [   28.130753] Bluetooth: hci0 command 0x0c14 tx timeout
> [   36.322725] Bluetooth: hci0: BCM: Reading local name failed (-110)

Really weird, because these steps are prior firmware loading, moreover on HCI
command timeout, the HCI core is supposed to retry sending of the command,
here nothing happened between [28.13] and [36.32]....

Could you please try to load hci_uart.ko manually after boot to see if it could
be related to some init timings/concurrency.


Regards,
Loic