New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FS#3540 - ip6806x serial console is mute once kernel takes control (r15355-19d7e73ecc) #8587
Comments
hnyman: The faulty build r15355-19d7e73ecc sets kernel console to a non-existent tty:
Kernel command line: console=ttyHSL1,115200n8
In the previous working r15254-1302bee12a the tty is ignored: More context: From working r15254-1302bee12a: |
hnyman: Compiling r15355-19d7e73ecc with that CONFIG_CMDLINE_OVERRIDE=y reverted fixes R7800.
Fixed bootlog:
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.83 (perus@ub2010) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r15237-fca0eb2d92)) #0 SMP Tue Dec 22 16:08:44 2020
[ 0.000000] CPU: ARMv7 Processor [512f04d0] revision 0 (ARMv7), cr=10c5787d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] OF: fdt: Machine model: Netgear Nighthawk X4S R7800
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] percpu: Embedded 15 pages/cpu s30156 r8192 d23092 u61440
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 121800
[ 0.000000] Kernel command line:
[ 0.000000] Bootloader command line (ignored): console=ttyHSL1,115200n8
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 474836K/491520K available (6042K kernel code, 193K rwdata, 1528K rodata, 1024K init, 231K bss, 16684K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Note that also these lines that appeared on the faulty build, have disappeared: Fix applied:
--- a/target/linux/ipq806x/config-5.4
+++ b/target/linux/ipq806x/config-5.4
@@ -78,7 +78,7 @@ CONFIG_CC_HAS_KASAN_GENERIC=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLKSRC_QCOM=y
CONFIG_CLONE_BACKWARDS=y
-CONFIG_CMDLINE_OVERRIDE=y
+# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_COMMON_CLK=y
CONFIG_COMMON_CLK_QCOM=y
CONFIG_COMPAT_32BIT_TIME=y
|
ricsc: Additional Info. Linksys EA8500 is also affected by this bug. |
rbpp: I can confirm that Archer C2600 is also affected and using CONFIG_CMDLINE_OVERRIDE is not setfixes things. |
hnyman: I did some further debugging, and noticed something: I compared the kernel build log with the working code (without CONFIG_CMDLINE_OVERRIDE=y) to log with the faulty code, and there is only a small difference: In the faulty version, there is a one-line warning: context: So, the new option changes something else. I looked at build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.4.85/arch/arm/Kconfig and noticed that the new definition of CONFIG_CMDLINE_OVERRIDE has been placed into end of a multi-option choice block. Enabling this option may now change the selected value of the choice of ARM_ATAG_DTB_COMPAT_CMDLINE... options.
choice
prompt "Kernel command line type" if ARM_ATAG_DTB_COMPAT
default ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER
Apparently the new selected option in the block changes the selection of the existing options, causing bugs to other devices depending on those selections. Asrock router apparently is not affected by that change, Likely the new code should be after the "endchoice" line, so that ARM_ATAG_DTB_COMPAT_CMDLINE... things do not change. Or possibly it should be inside the next choice block about CMDLINE:
config CMDLINE
string "Default kernel command string"
default ""
help
On some architectures (EBSA110 and CATS), there is currently no way
for the boot loader to pass arguments to the kernel. For these
architectures, you should supply some command-line options at build
time by entering them here. As a minimum, you should specify the
memory size and the root device (e.g., mem=64M root=/dev/nfs).
Kernel & bootloader option specialists may take a closed look, but I think that this might well be the reason. |
hnyman: One more observation: The faulty Asrock commit's commit messages says:
But looking at shows that there the code there is apparently placed outside any choice block, just before "config EXTRA_TARGETS" So, looks like the author has accidentally placed the new definition into inside a choice block and it has worked for him. |
CHKDSK88: Guys with the problem, please test my PR with fix: |
hnyman:
Background: I noticed with ipq806x R7800 build r15355-19d7e73ecc that I am unable to sysupgrade back to r15254-1302bee12a. (I had just upgraded from r15254-1302bee12a to r15355-19d7e73ecc, so sysupgrade used to work a few days ago.)
Alarming is that while trying to debug that sysupgrade, I noticed to my surprise that with r15355-19d7e73ecc the serial console access to R7800 works only during the u-boot phase, but once control is passed to Linux kernel, the serial console gets turned off. Output stops at:
The firmware runs ok, SSH console works ok. But serial cable does not produce any output.
Rebooting the device causes the normal u-boot message to be shown ok, but the output stops when kernel takes over.
That makes me to suspect that something has changed in the kernel parameters.
commit 98b8629 is pretty much the only one to touch the ipq806x config in the last few days.
(other possibility is 77575d4 but that does not look likely.
This commit 98b8629 made this change:
CONFIG_CMDLINE_OVERRIDE=y
I suspect that it affects the normal booting of the other normal ipq806x devices by changing kernel cmdline and somehow disables serial access.
I will debug further by turning that off, but thought to highlight my suspicions already now.
Ps. Debugging sysupgrade is now impossible as serial console is mute. :-(
Pps.
The option is also mentioned in a forum discussion starting here
https://forum.openwrt.org/t/ipq806x-nss-build-netgear-r7800-tp-link-c2600-linksys-ea8500/82525/44
The text was updated successfully, but these errors were encountered: