narmstrong changed the topic of #linux-amlogic to: Amlogic mainline kernel development discussion - our wiki http://linux-meson.com/ - ml linux-amlogic@lists.infradead.org - Publicly Logged on https://irclog.whitequark.org/linux-amlogic
sputnik_ has joined #linux-amlogic
buzzmarshall has joined #linux-amlogic
camus1 has joined #linux-amlogic
kaspter has quit [Ping timeout: 264 seconds]
camus1 is now known as kaspter
buzzmarshall has quit [Remote host closed the connection]
chewitt has quit [Quit: Zzz..]
Barada has joined #linux-amlogic
kaspter has quit [Ping timeout: 256 seconds]
kaspter has joined #linux-amlogic
sputnik_ has quit [Remote host closed the connection]
sputnik_ has joined #linux-amlogic
cmeerw has joined #linux-amlogic
ldevulder_ is now known as ldevulder
chewitt has joined #linux-amlogic
brads has quit [Remote host closed the connection]
chewitt has quit [Quit: Zzz..]
Darkmatter66_ has joined #linux-amlogic
Darkmatter66 has quit [Ping timeout: 258 seconds]
vicencb has joined #linux-amlogic
chewitt has joined #linux-amlogic
chewitt has quit [Client Quit]
brads has joined #linux-amlogic
yann has quit [Ping timeout: 240 seconds]
warpme_ has joined #linux-amlogic
camus1 has joined #linux-amlogic
kaspter has quit [Ping timeout: 240 seconds]
camus1 is now known as kaspter
Barada has quit [Quit: Barada]
yann has joined #linux-amlogic
Barada has joined #linux-amlogic
sputnik_ has quit [Read error: Connection reset by peer]
sputnik_ has joined #linux-amlogic
sputnik__ has joined #linux-amlogic
sputnik_ has quit [Read error: Connection reset by peer]
sputnik_ has joined #linux-amlogic
sputnik__ has quit [Read error: Connection reset by peer]
sputnik__ has joined #linux-amlogic
sputnik_ has quit [Ping timeout: 240 seconds]
sputnik__ has quit [Read error: Connection reset by peer]
sputnik__ has joined #linux-amlogic
Barada has quit [Quit: Barada]
sputnik__ has quit [Ping timeout: 256 seconds]
kaspter has quit [Ping timeout: 260 seconds]
kaspter has joined #linux-amlogic
xypron_ has joined #linux-amlogic
<xypron_> narmstrong: a user cottsay asked for help on #u-boot concerning trouble he has with U-Boot on Odroid-N2, Odroid-C4 due to the RNG driver. I think you discussed this yesterday on this channel.
<narmstrong> xypron_: exact
<xypron_> narmstrong: has there any more analysis been done? How can I reach cottsay?
<narmstrong> xypron_: no idea where this could come from, seems to be related to the rng driver
<xypron_> narmstrong: in U-Boot we added patches to enable the RNG driver for all meson boards.
<narmstrong> xypron_: he’s on this channel, he doesn’t seen to be available right now
<narmstrong> ˋ6:35 PM <cottsay> narmstrong: Sorry for the delay. The error comes just after GRUB tries to boot the kernel: `EFI stub: ERROR: Unable to construct new device tree.`
<narmstrong> ’10:11 AM <cottsay> Hi again. In reference to the u-boot issue I brought up a couple of hours ago with the ODROID-N2, I pulled out my ODROID-C4 and I can see the same problem. Same workaround: reverting 6da749d8b3 allows the system to boot, so it's likely the same regression is affecting both systems.´
<xypron_> narmstrong: cottsay: I would need the a dump of the device tree from U-Boot (command 'fdt print' and the full kernel output per email to xypron.glpk@gmx.de.
<rtp> fwiw, 2020.10-rc4 is working fine on my potato (uboot->grub-efi->linux). I've checked the uboot tree I used. looks like I've ported linux commit 95ca6f06dd4827ff63be5154120c7a8511cd9a41 to uboot, but I don't remember why ...
<rtp> uboot 2020.10-rc4 has 6da749d8b3 I guess
<rtp> oh, and I'm running mainline atf, in case it matters
Barada has joined #linux-amlogic
camus1 has joined #linux-amlogic
kaspter has quit [Ping timeout: 260 seconds]
camus1 is now known as kaspter
buzzmarshall has joined #linux-amlogic
Barada has quit [Quit: Barada]
Darkmatter66 has joined #linux-amlogic
Darkmatter66_ has quit [Ping timeout: 264 seconds]
ldevulder_ has joined #linux-amlogic
ldevulder has quit [Ping timeout: 240 seconds]
drieschel has joined #linux-amlogic
drieschel has quit [Client Quit]
drieschel has joined #linux-amlogic
yann has quit [Ping timeout: 246 seconds]
vagrantc has joined #linux-amlogic
kaspter has quit [Remote host closed the connection]
kaspter has joined #linux-amlogic
vicencb has quit [Quit: Leaving.]
drieschel has quit [Quit: drieschel]
<cottsay> xypron_: I'll get you that device tree dump. I'm using kernel 5.8.10, but 5.6.6 acts the same way. I haven't tried any others.
<xypron_> cottsay: the message comes from a part of the Linux EFI stub that updates the device tree by adding new nodes.
<xypron_> The maintainer for this code is Ard Biesheuvel.
<xypron_> What was the last message before EFI stub: ERROR: Unable to construct new device tree
<cottsay> xypron_: FWIW, I also get this message unless I disable KASLR: `EFI stub: ERROR: efi_get_random_bytes() failed`
<xypron_> cottsay: In U-Boot we have have a rng command (see CONFIG_CMD_RNG) to test the random number generator.
<xypron_> cottsay: let's start there. Does it output random output?
<cottsay> xypron_: Ooh, interesting, I'll give that a shot.
<xypron_> cottsay: We also have command 'bootefi selftest' (CONFIG_EFI_SELFTEST) which will emulate an EFI payload a do a few tests.
<xypron_> cottsay: the kernel code I mentioned is in drivers/firmware/efi/libstub/fdt.c.
<xypron_> cottsay: but I would really want to see the whole kernel output.
<cottsay> xypron_: I'll get all of this to you. Just re-compiling now.
<rtp> cottsay: maybe it has nothing to do with your problem, and I'm only producing noise, but maybe you can try this linux change (https://paste.debian.net/1164566/) in uboot ?
<cottsay> rtp: xypron_: Not noise, that fixed the problem for me. I applied that patch to arch/arm/dts/meson-sm1.dtsi and the C4 could boot - no nasty messages about the RNG coming from the stub, either.
<cottsay> xypron_: I can still send you the selftest and fdt print if you like.
<cottsay> So I'd suppose that the RNG was present in the device tree, but wasn't properly configured, and when u-boot tried to use it, it failed.
<cottsay> rtp: xypron_: Thanks for your help! I'm not familiar with u-boot's development model - what is the next step to getting this fixed? Does the change need to land in the kernel first?
<xypron_> cottsay: Did I read you right: U-Boot origin/master does not show random output using the RNG command. Applying the Debian patch to U-Boot fixes the problem?
<cottsay> xypron_: Correct. The `rng` command reports that there is no RNG without applying that patch to meson-sm1.dtsi.
<cottsay> It is interesting that u-boot knows that the rng isn't working, and yet fails to boot correctly because of it unless it is either fixed or specifically disabled.
<xypron_> cottsay: git commit ; git format-patch; scripts/get_maintainer.pl; git send-email
<xypron_> cottsay: use subject prefix as in the history of the file
<xypron_> when committing
<cottsay> This process is new to me. Can you clarify "use subject prefix as in the history of the file"?
<xypron_> cottsay: git log arch/arm/dts/amlogic/meson-gxl.dtsi
<xypron_> cottsay: shows that all patches start with something like: arm: dts:
<xypron_> cottsay: just do the same
<xypron_> cottsay: scripts/get_maintainer.pl arch/arm/dts/meson-gxl.dtsi shows you who should receive the email.
<rtp> cottsay: this commit is coming from mainline kernel, so no need to apply it there first. Just send a patch the way xypron_ told you
<xypron_> cottsay: rtp: the kernel patch was applied in the 5.7 cycle to Linux
<xypron_> cottsay: for sending the command will look like git send-email --to="Neil Armstrong <narmstrong@baylibre.com>" --cc="..." 0001-arm...patch Just add all the CCs indicated by the script.
<xypron_> cottsay: the commit message should describe from where you took the change and what it fixes.
sputnik__ has joined #linux-amlogic
<narmstrong> cottsay: xypron_: rtp: ok but how a gxl.dtsi change can fix the Odroid-C4 and Odroid-N2 not using this dtsi at all ?
<narmstrong> The rng may be broken on recent SoCs, I honestly haven’t tested
<cottsay> narmstrong: I applied that gxl change to meson-sm1.dtsi to get things to work.
<cottsay> So the patch to meson-sm1.dtsi isn't in mainline, which is why I asked if I should submit it there first.
<narmstrong> cottsay: ok, so yes fix meson-g12-common.dtsi in Linux the I will backport it to u-boot
<cottsay> Sounds good.
<xypron_> narmstrong: odroid-n2_defconfig does not build without meson-gxl.dtsi
<narmstrong> ?
<narmstrong> Yes, because we build all the meson dt for all amlogic boards
<xypron_> narmstrong: you said the dtsi is not involved
<narmstrong> It’s not, it’s not included in the odroid c4/n2 dts
trem has joined #linux-amlogic
<rtp> narmstrong: oh, I didnt notice that c4 and n2 were not using gxl dtsi /o\
<xypron_> narmstrong: cottsay: in the thread two different observations were reported: RNG failing on some boards in U-Boot, Linux EFI stub having some problem. Both may need a fix.
<rtp> narmstrong: still, the change is needed on gxl. Can you please backport to uboot the commit I mentionned please ?
<narmstrong> xypron_: i didn’t test efi for a long time, do you have a usual test flow ?
<narmstrong> rtp: I’ll have a look
<rtp> thanks :)
<xypron_> narmstrong: load mmc 0:2 $fdt_addr_r dtb; load mmc 0:1 $kernel_addr_r EFI/debian/grubaa64.efi; bootefi $kernel_addr_r $fdt_addr_r
<xypron_> narmstrong: assuming that you installed GRUB on your system.
<xypron_> narmstrong: cf. ps://u-boot.readthedocs.io/en/latest/uefi/uefi.html
<rtp> distro_bootcmd stuff should be able to boot it too
<narmstrong> xypron_: thx for the pointers
<xypron_> narmstrong: rtp: cottsay: One thing I should change in U-Boot is that we should only install the EFI_RNG_PROTOCOL if we find a RNG device.
<xypron_> cottsay: If you provide me an email address I will put you on copy once the patch is ready.
<cottsay> xypron_: logans@cottsay.net
yann has joined #linux-amlogic
cmeerw has quit [Ping timeout: 240 seconds]
kaspter has quit [Ping timeout: 256 seconds]
kaspter has joined #linux-amlogic
trem has quit [Quit: Leaving]
niceplace has quit [Ping timeout: 256 seconds]
niceplace has joined #linux-amlogic
TheAssassin has quit [Ping timeout: 240 seconds]
niceplaces has joined #linux-amlogic
niceplace has quit [Ping timeout: 260 seconds]
TheAssassin has joined #linux-amlogic