Skip to content
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

v6.7 gpio is not work #10

Closed
RevySR opened this issue Jan 8, 2024 · 3 comments
Closed

v6.7 gpio is not work #10

RevySR opened this issue Jan 8, 2024 · 3 comments

Comments

@RevySR
Copy link
Member

RevySR commented Jan 8, 2024

Environment

kernel

https://github.com/revyos/th1520-linux-kernel/tree/th1520-master
5a29c643e516d5ca33a46ca958ac26e471223f66

uboot

https://github.com/revyos/thead-u-boot/tree/update/sdk1.4.2
8f5be5f60c81a0902b7de614e76e10452752f0e1

opensbi

https://github.com/revyos/opensbi/tree/th1520-v1.4
9896d65afeec606d9a1b51bb51db864faeef5c74
@RevySR
Copy link
Member Author

RevySR commented Jan 8, 2024

Problem1 uart

U_BOOT_PARAMETERS="console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused loglevel=7 eth= rootrwoptions=rw,noatime rootrwreset=yes"

[    9.085713] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    9.093328] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    9.100813] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    9.108246] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    9.115612] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    9.123005] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    9.130522] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    9.137982] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    9.145598] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    9.153109] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    9.160496] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    9.167893] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    9.175690] light rpmsg: Ready for cross core communication!
[    9.181396] light rpmsg: rproc_name = m4
[    9.182388] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    9.193778] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    9.194691] virtio_rpmsg_bus virtio0: msg received with no recipient
[    9.201288] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    9.214782] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    9.222154] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    9.229559] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    9.713434] virtio_rpmsg_bus virtio0: rpmsg host is online
[    9.719093] light rpmsg: driver is registered.
[    9.723798] clk: Not disabling unused clocks
[    9.723911] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    9.735321] Warning: unable to open an initial console.
[    9.735617] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
...
[    9.793468] Run /init as init process
[   15.111763] EXT4-fs (mmcblk0p3): mounted filesystem 919ff2d8-efd8-4609-893d-2206a2a04fb7 r/w with ordered data mode. Quota mode: none
.
[   15.160270] light-event soc:light-event: set rebootmode:0x22
[   15.166121] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200
[   15.173773] CPU: 3 PID: 1 Comm: init Tainted: G        W          6.7.0+ #30
[   15.180816] Hardware name: Sipeed Lichee Pi 4A (DT)
[   15.185687] Call Trace:
[   15.188133] [<ffffffff8000618c>] dump_backtrace+0x28/0x30
[   15.193544] [<ffffffff809a9bb0>] show_stack+0x38/0x44
[   15.198593] [<ffffffff809b7192>] dump_stack_lvl+0x44/0x5c
[   15.203999] [<ffffffff809b71c2>] dump_stack+0x18/0x20
[   15.209045] [<ffffffff809a9f38>] panic+0x136/0x31a
[   15.213833] [<ffffffff80022212>] do_exit+0x8de/0x8e4
[   15.218792] [<ffffffff80022378>] do_group_exit+0x0/0x80
[   15.224011] [<ffffffff809b7cb6>] do_trap_ecall_u+0xe4/0xf6
[   15.229495] [<ffffffff809c2af4>] ret_from_other_exception+0x0/0xc
[   15.235586] SMP: stopping secondary CPUs
[   15.239539] enter panic_cpufreq_notifier_call
[   15.244039] finish to execute cpufreq notifier callback on panic
[   15.250693] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200 ]---

systemd requires that the serial port be initialized before initrd, which the current kernel cannot do.

This can be bypassed by adding console=tty0.

@RevySR
Copy link
Member Author

RevySR commented Jan 8, 2024

Problem2 gpio failed to register gpiochip

U_BOOT_PARAMETERS="console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused loglevel=7 eth= rootrwoptions=rw,noatime rootrwreset=yes console=tty0"

Light LPI4A# boot
## Error: "findpart" not defined
39976 bytes read in 1 ms (38.1 MiB/s)
6117904 bytes read in 20 ms (291.7 MiB/s)
271104 bytes read in 2 ms (129.3 MiB/s)
Retrieving file: /extlinux/extlinux.conf
1478 bytes read in 1 ms (1.4 MiB/s)
U-Boot menu
1:      RevyOS GNU/Linux 6.7.0+
2:      RevyOS GNU/Linux 6.7.0+ (rescue target)
3:      RevyOS GNU/Linux 5.10.113-lpi4a
4:      RevyOS GNU/Linux 5.10.113-lpi4a (rescue target)
Enter choice: 1
1:      RevyOS GNU/Linux 6.7.0+
Retrieving file: /initrd.img-6.7.0+
69758885 bytes read in 217 ms (306.6 MiB/s)
Retrieving file: /vmlinux-6.7.0+
26912768 bytes read in 83 ms (309.2 MiB/s)
append: root=/dev/mmcblk0p3 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused loglevel=7 eth= rootrwoptions=rw,noatime rootrwr
eset=yes console=tty0
Retrieving file: /th1520-lichee-pi-4a.dtb
28509 bytes read in 1 ms (27.2 MiB/s)
## Flattened Device Tree blob at 03800000
   Booting using the fdt blob at 0x3800000
   Loading Ramdisk to 1bd79000, end 1fffffa5 ... OK
ERROR: reserving fdt memory region failed (addr=1e000000 size=10000)
   Using Device Tree in place at 0000000003800000, end 0000000003809f5c

Starting kernel ...

## fdt has no reset_sample

OpenSBI v1.4
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

core:2 thead_generic_final_init: line:206 enter. cold_boot:1
Platform Name             : Sipeed Lichee Pi 4A
Platform Features         : medeleg
Platform HART Count       : 4
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 3000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : light-ppu
Platform PMU Device       : thead,c900-pmu
Platform Reboot Device    : thead_reset
Platform Shutdown Device  : thead_reset
Platform Suspend Device   : ---
Platform CPPC Device      : ---
Firmware Base             : 0x0
Firmware Size             : 357 KB
Firmware RW Offset        : 0x40000
Firmware RW Size          : 101 KB
Firmware Heap Offset      : 0x4f000
Firmware Heap Size        : 41 KB (total), 2 KB (reserved), 9 KB (used), 29 KB (free)
Firmware Scratch Size     : 4096 B (total), 328 B (used), 3768 B (free)
Runtime SBI Version       : 2.0

Domain0 Name              : root
Domain0 Boot HART         : 2
Domain0 HARTs             : 0*,1*,2*,3*
Domain0 Region00          : 0x000000ffe7014000-0x000000ffe7014fff M: (I,R,W) S/U: (R,W)
Domain0 Region01          : 0x000000ffdc008000-0x000000ffdc00bfff M: (I,R,W) S/U: ()
Domain0 Region02          : 0x000000ffdc000000-0x000000ffdc007fff M: (I,R,W) S/U: ()
Domain0 Region03          : 0x0000000000040000-0x000000000005ffff M: (R,W) S/U: ()
Domain0 Region04          : 0x0000000000000000-0x000000000003ffff M: (R,X) S/U: ()
Domain0 Region05          : 0x000000ffd8000000-0x000000ffd8ffffff M: (I,R,W) S/U: (R,W)
Domain0 Region06          : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
Domain0 Next Address      : 0x0000000000200000
Domain0 Next Arg1         : 0x0000000003800000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes

Boot HART ID              : 2
Boot HART Domain          : root
Boot HART Priv Version    : v1.11
Boot HART Base ISA        : rv64imafdcvx
Boot HART ISA Extensions  : zicntr,zihpm
Boot HART PMP Count       : 0
Boot HART PMP Granularity : 0 bits
Boot HART PMP Address Bits: 0
Boot HART MHPM Info       : 16 (0x0007fff8)
Boot HART MIDELEG         : 0x0000000000020222
Boot HART MEDELEG         : 0x000000000000b109
[    0.000000] Linux version 6.7.0+ (revy@revy-lenovo) (riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.8
.0 B-20231018) 10.4.0, GNU ld (GNU Binutils) 2.35) #30 SMP Mon Jan  8 11:01:20 CST 2024
[    0.000000] random: crng init done
[    0.000000] Machine model: Sipeed Lichee Pi 4A
[    0.000000] SBI specification v2.0 detected
[    0.000000] SBI implementation ID=0x1 Version=0x10004
[    0.000000] SBI TIME extension detected
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] earlycon: uart0 at MMIO32 0x000000ffe7014000 (options '115200n8')
[    0.000000] printk: legacy bootconsole [uart0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] OF: reserved mem: 0x0000000000000000..0x000000000003ffff (256 KiB) nomap non-reusable mmode_resv1@0
[    0.000000] OF: reserved mem: 0x0000000000040000..0x000000000005ffff (128 KiB) nomap non-reusable mmode_resv0@40000
[    0.000000] OF: reserved mem: 0x000000001e000000..0x000000001e00ffff (64 KiB) map non-reusable memory@1E000000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x1ffdc7600-0x1ffdc8fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000000000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000005ffff]
[    0.000000]   node   0: [mem 0x0000000000060000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] SBI HSM extension detected
[    0.000000] riscv: base ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: cpu 0 has no node -1 or node-local memory
[    0.000000] percpu: Embedded 29 pages/cpu s80680 r8192 d29912 u118784
[    0.000000] Kernel command line: root=/dev/mmcblk0p3 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused loglevel=7 eth= root
rwoptions=rw,noatime rootrwreset=yes console=tty0
[    0.000000] Unknown kernel command line parameters "eth= rootrwoptions=rw,noatime rootrwreset=yes", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] Fallback order for Node 0: 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2064384
[    0.000000] Policy zone: Normal
[    0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000] software IO TLB: area num 4.
[    0.000000] software IO TLB: mapped [mem 0x00000000fbfff000-0x00000000fffff000] (64MB)
[    0.000000] Memory: 4162624K/8388608K available (9987K kernel code, 5287K rwdata, 8192K rodata, 2562K init, 506K bss, 342660K reserve
d, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 37306 entries in 146 pages
[    0.000000] ftrace: allocated 146 pages with 3 groups
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[    0.000000]  Rude variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@ffd8000000: mapped 240 interrupts with 4 handlers for 8 contexts.
[    0.000000] riscv: providing IPIs using SBI IPI extension
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1623fa770, max_idle_ns: 881590404476 ns
[    0.000001] sched_clock: 64 bits at 3000kHz, resolution 333ns, wraps every 4398046511097ns
[    0.009720] Console: colour dummy device 80x25
[    0.014456] printk: legacy console [tty0] enabled
[    0.019423] printk: legacy bootconsole [uart0] disabled
[    0.000000] Linux version 6.7.0+ (revy@revy-lenovo) (riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.8
.0 B-20231018) 10.4.0, GNU ld (GNU Binutils) 2.35) #30 SMP Mon Jan  8 11:01:20 CST 2024
[    0.000000] random: crng init done
[    0.000000] Machine model: Sipeed Lichee Pi 4A
[    0.000000] SBI specification v2.0 detected
[    0.000000] SBI implementation ID=0x1 Version=0x10004
[    0.000000] SBI TIME extension detected
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] earlycon: uart0 at MMIO32 0x000000ffe7014000 (options '115200n8')
[    0.000000] printk: legacy bootconsole [uart0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] OF: reserved mem: 0x0000000000000000..0x000000000003ffff (256 KiB) nomap non-reusable mmode_resv1@0
[    0.000000] OF: reserved mem: 0x0000000000040000..0x000000000005ffff (128 KiB) nomap non-reusable mmode_resv0@40000
[    0.000000] OF: reserved mem: 0x000000001e000000..0x000000001e00ffff (64 KiB) map non-reusable memory@1E000000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x1ffdc7600-0x1ffdc8fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000000000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000005ffff]
[    0.000000]   node   0: [mem 0x0000000000060000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] SBI HSM extension detected
[    0.000000] riscv: base ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: cpu 0 has no node -1 or node-local memory
[    0.000000] percpu: Embedded 29 pages/cpu s80680 r8192 d29912 u118784
[    0.000000] Kernel command line: root=/dev/mmcblk0p3 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused loglevel=7 eth= root
rwoptions=rw,noatime rootrwreset=yes console=tty0
[    0.000000] Unknown kernel command line parameters "eth= rootrwoptions=rw,noatime rootrwreset=yes", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] Fallback order for Node 0: 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2064384
[    0.000000] Policy zone: Normal
[    0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000] software IO TLB: area num 4.
[    0.000000] software IO TLB: mapped [mem 0x00000000fbfff000-0x00000000fffff000] (64MB)
[    0.000000] Memory: 4162624K/8388608K available (9987K kernel code, 5287K rwdata, 8192K rodata, 2562K init, 506K bss, 342660K reserve
d, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 37306 entries in 146 pages
[    0.000000] ftrace: allocated 146 pages with 3 groups
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[    0.000000]  Rude variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@ffd8000000: mapped 240 interrupts with 4 handlers for 8 contexts.
[    0.000000] riscv: providing IPIs using SBI IPI extension
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1623fa770, max_idle_ns: 881590404476 ns
[    0.000001] sched_clock: 64 bits at 3000kHz, resolution 333ns, wraps every 4398046511097ns
[    0.009720] Console: colour dummy device 80x25
[    0.014456] printk: legacy console [tty0] enabled
[    0.019423] printk: legacy bootconsole [uart0] disabled
[    0.025242] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=12000)
[    0.025297] pid_max: default: 32768 minimum: 301
[    0.025658] LSM: initializing lsm=capability,landlock,yama,apparmor,tomoyo,bpf,integrity
[    0.025781] landlock: Up and running.
[    0.025802] Yama: becoming mindful.
[    0.025954] AppArmor: AppArmor initialized
[    0.025989] TOMOYO Linux initialized
[    0.026043] LSM support for eBPF active
[    0.026299] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.026368] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.030504] RCU Tasks Rude: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[    0.030722] RCU Tasks Trace: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[    0.030935] riscv: ELF compat mode unsupported
[    0.031350] ASID allocator using 16 bits (65536 entries)
[    0.031674] rcu: Hierarchical SRCU implementation.
[    0.031706] rcu:     Max phase no-delay instances is 1000.
[    0.032805] EFI services will not be available.
[    0.033574] smp: Bringing up secondary CPUs ...
[    0.038195] smp: Brought up 1 node, 4 CPUs
[    0.200445] node 0 deferred pages initialised in 160ms
[    0.203843] devtmpfs: initialized
[    0.219017] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.219112] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.219544] pinctrl core: initialized pinctrl subsystem
[    0.221090] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.222505] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.223264] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.223552] audit: initializing netlink subsys (disabled)
[    0.223971] audit: type=2000 audit(0.208:1): state=initialized audit_enabled=0 res=1
[    0.224799] thermal_sys: Registered thermal governor 'fair_share'
[    0.224816] thermal_sys: Registered thermal governor 'bang_bang'
[    0.224850] thermal_sys: Registered thermal governor 'step_wise'
[    0.224880] thermal_sys: Registered thermal governor 'user_space'
[    0.224909] thermal_sys: Registered thermal governor 'power_allocator'
[    0.225034] cpuidle: using governor ladder
[    0.225123] cpuidle: using governor menu
[    0.247127] cpu3: Ratio of byte access time to unaligned word access is 6.14, unaligned accesses are fast
[    0.247128] cpu2: Ratio of byte access time to unaligned word access is 6.14, unaligned accesses are fast
[    0.247128] cpu1: Ratio of byte access time to unaligned word access is 6.14, unaligned accesses are fast
[    0.271278] cpu0: Ratio of byte access time to unaligned word access is 6.14, unaligned accesses are fast
[    0.276454] platform soc: Fixed dependency cycle(s) with /soc/interrupt-controller@ffd8000000
[    0.300801] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[    0.300851] HugeTLB: 28 KiB vmemmap can be freed for a 2.00 MiB page
[    0.308510] pps_core: LinuxPPS API ver. 1 registered
[    0.308553] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.308612] PTP clock support registered
[    0.311199] NetLabel: Initializing
[    0.311238] NetLabel:  domain hash size = 128
[    0.311263] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.311415] NetLabel:  unlabeled traffic allowed by default
[    0.315965] vgaarb: loaded
[    0.317025] clocksource: Switched to clocksource riscv_clocksource
[    0.318026] VFS: Disk quotas dquot_6.6.0
[    0.318161] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.319763] AppArmor: AppArmor Filesystem Enabled
[    0.339197] NET: Registered PF_INET protocol family
[    0.339633] IP idents hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.352930] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.353264] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.353516] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.354335] TCP bind hash table entries: 65536 (order: 9, 2097152 bytes, linear)
[    0.357165] TCP: Hash tables configured (established 65536 bind 65536)
[    0.357641] MPTCP token hash table entries: 8192 (order: 5, 196608 bytes, linear)
[    0.357980] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.358109] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.358491] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.358576] NET: Registered PF_XDP protocol family
[    0.358620] PCI: CLS 0 bytes, default 64
[    0.360906] Trying to unpack rootfs image as initramfs...
[    0.361481] Initialise system trusted keyrings
[    0.361569] Key type blacklist registered
[    0.362184] workingset: timestamp_bits=44 max_order=21 bucket_order=0
[    0.364726] integrity: Platform Keyring initialized
[    0.364802] integrity: Machine keyring initialized
[    0.364832] Key type asymmetric registered
[    0.364858] Asymmetric key parser 'x509' registered
[    5.936190] Freeing initrd memory: 68120K
[    6.007912] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    6.008395] io scheduler mq-deadline registered
[    6.018165] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    6.018796] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    6.019493] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    6.020201] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    6.020801] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    6.021596] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    6.043995] light-fm-clk ffef010000.clock-controller: succeed to register light fullmask clock driver
[    6.046778] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    6.055762] mousedev: PS/2 mouse device common for all mice
[    6.057452] Watchdog module: light-wdt loaded
[    6.058140] sdhci: Secure Digital Host Controller Interface driver
[    6.058175] sdhci: Copyright(c) Pierre Ossman
[    6.058262] sdhci-pltfm: SDHCI platform and OF driver helper
[    6.060592] ledtrig-cpu: registered to indicate activity on CPUs
[    6.063232] thead,light-mbox-client soc:mbox_910t_client2: Successfully registered
[    6.064121] riscv-pmu-sbi: SBI PMU extension is available
[    6.064418] riscv-pmu-sbi: 16 firmware and 18 hardware counters
[    6.089776] mmc0: SDHCI controller on ffe7080000.mmc [ffe7080000.mmc] using ADMA 64-bit
[    6.129433] NET: Registered PF_INET6 protocol family
[    6.132909] mmc0: new HS400 MMC card at address 0001
[    6.134571] mmcblk0: mmc0:0001 Y2P128 116 GiB
[    6.141600]  mmcblk0: p1 p2 p3
[    6.143605] mmcblk0boot0: mmc0:0001 Y2P128 4.00 MiB
[    6.146660] mmcblk0boot1: mmc0:0001 Y2P128 4.00 MiB
[    6.149764] mmcblk0rpmb: mmc0:0001 Y2P128 16.0 MiB, chardev (245:0)
[    6.167769] Segment Routing with IPv6
[    6.167889] In-situ OAM (IOAM) with IPv6
[    6.168059] mip6: Mobile IPv6
[    6.168105] NET: Registered PF_PACKET protocol family
[    6.168467] mpls_gso: MPLS GSO support
[    6.182102] registered taskstats version 1
[    6.182692] Loading compiled-in X.509 certificates
[    6.208247] Key type .fscrypt registered
[    6.208293] Key type fscrypt-provisioning registered
[    6.340292] Key type encrypted registered
[    6.340351] AppArmor: AppArmor sha1 policy hashing enabled
[    6.340434] ima: No TPM chip found, activating TPM-bypass!
[    6.340471] ima: Allocated hash algorithm: sha256
[    6.340555] ima: No architecture policies found
[    6.340677] evm: Initialising EVM extended attributes:
[    6.340704] evm: security.selinux
[    6.340728] evm: security.SMACK64 (disabled)
[    6.340750] evm: security.SMACK64EXEC (disabled)
[    6.340774] evm: security.SMACK64TRANSMUTE (disabled)
[    6.340798] evm: security.SMACK64MMAP (disabled)
[    6.340821] evm: security.apparmor
[    6.340845] evm: security.ima
[    6.340863] evm: security.capability
[    6.340883] evm: HMAC attrs: 0x1
[    7.404378] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.405221] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.405948] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.406682] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.407260] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.407889] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.409480] succeed to create power domain debugfs direntry
[    7.462154] ------------[ cut here ]------------
[    7.462206] cpu_pll1_foutpostdiv already disabled
[    7.462272] WARNING: CPU: 2 PID: 58 at drivers/clk/clk.c:1090 clk_core_disable+0x114/0x118
[    7.462316] Modules linked in:
[    7.462328] CPU: 2 PID: 58 Comm: kworker/u11:1 Not tainted 6.7.0+ #30
[    7.462343] Hardware name: Sipeed Lichee Pi 4A (DT)
[    7.462353] Workqueue: events_unbound deferred_probe_work_func
[    7.462372] epc : clk_core_disable+0x114/0x118
[    7.462388]  ra : clk_core_disable+0x114/0x118
[    7.462405] epc : ffffffff805f3a0a ra : ffffffff805f3a0a sp : ffffffc800403430
[    7.462415]  gp : ffffffff819a86f0 tp : ffffffd900a45280 t0 : ffffffff809a9390
[    7.462424]  t1 : 0000000000000000 t2 : 5f316c6c705f7570 s0 : ffffffc800403450
[    7.462432]  s1 : ffffffd900c4fc00 a0 : 0000000000000025 a1 : ffffffff818954d0
[    7.462441]  a2 : 0000000000000010 a3 : 00000000000000c8 a4 : f938884c4b3e0200
[    7.462449]  a5 : f938884c4b3e0200 a6 : c0000000ffffefff a7 : ffffffff819e8438
[    7.462457]  s2 : ffffffd900c4fc00 s3 : 0000000000000001 s4 : ffffffff80c6d6c8
[    7.462466]  s5 : ffffffff819ad4e0 s6 : ffffffff819e8428 s7 : 00000000000c3500
[    7.462474]  s8 : 00000000000aae60 s9 : 00000000000b71b0 s10: ffffffff819ab0b0
[    7.462483]  s11: ffffffff819ad4f8 t3 : ffffffd90014bf00 t4 : ffffffd90014bf00
[    7.462492]  t5 : ffffffd90014b000 t6 : ffffffc800403228
[    7.462499] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
[    7.462510] [<ffffffff805f3a0a>] clk_core_disable+0x114/0x118
[    7.462528] [<ffffffff805f3a42>] clk_disable+0x34/0x4c
[    7.462546] [<ffffffff8073c54c>] light_set_target+0x318/0x6a6
[    7.462569] [<ffffffff80737f44>] __cpufreq_driver_target+0x194/0x2a8
[    7.462585] [<ffffffff80739b24>] cpufreq_online+0x9c4/0xa4a
[    7.462601] [<ffffffff80739c78>] cpufreq_add_dev+0xac/0xbc
[    7.462613] [<ffffffff806600ea>] subsys_interface_register+0xf6/0x108
[    7.462633] [<ffffffff807364a6>] cpufreq_register_driver+0x150/0x2b8
[    7.462646] [<ffffffff8073be72>] light_cpufreq_probe+0x31a/0x4f6
[    7.462659] [<ffffffff80664e42>] platform_probe+0x5e/0xaa
[    7.462677] [<ffffffff80661ef2>] really_probe+0x9e/0x33e
[    7.462688] [<ffffffff80662210>] __driver_probe_device+0x7e/0x136
[    7.462700] [<ffffffff80662300>] driver_probe_device+0x38/0xc4
[    7.462713] [<ffffffff8066240e>] __device_attach_driver+0x82/0xe4
[    7.462727] [<ffffffff8065fe28>] bus_for_each_drv+0x70/0xc4
[    7.462744] [<ffffffff80662830>] __device_attach+0xb2/0x1ce
[    7.462756] [<ffffffff80662b50>] device_initial_probe+0x1a/0x22
[    7.462770] [<ffffffff80660db0>] bus_probe_device+0x96/0x98
[    7.462781] [<ffffffff8065e3ea>] device_add+0x558/0x70c
[    7.462796] [<ffffffff8077abf8>] of_device_add+0x3c/0x4c
[    7.462820] [<ffffffff8077acba>] of_platform_device_create_pdata+0x80/0xb6
[    7.462837] [<ffffffff8077afd8>] of_platform_bus_create+0x186/0x2b4
[    7.462853] [<ffffffff8077b296>] of_platform_populate+0x5a/0x10c
[    7.462868] [<ffffffff8077b3c6>] devm_of_platform_populate+0x52/0x98
[    7.462885] [<ffffffff80775e96>] light_aon_probe+0xfa/0x150
[    7.462900] [<ffffffff80664e42>] platform_probe+0x5e/0xaa
[    7.462914] [<ffffffff80661ef2>] really_probe+0x9e/0x33e
[    7.462926] [<ffffffff80662210>] __driver_probe_device+0x7e/0x136
[    7.462939] [<ffffffff80662300>] driver_probe_device+0x38/0xc4
[    7.462951] [<ffffffff8066240e>] __device_attach_driver+0x82/0xe4
[    7.462963] [<ffffffff8065fe28>] bus_for_each_drv+0x70/0xc4
[    7.462979] [<ffffffff80662830>] __device_attach+0xb2/0x1ce
[    7.462992] [<ffffffff80662b50>] device_initial_probe+0x1a/0x22
[    7.463003] [<ffffffff80660db0>] bus_probe_device+0x96/0x98
[    7.463014] [<ffffffff80661b22>] deferred_probe_work_func+0xb2/0x102
[    7.463026] [<ffffffff80039412>] process_one_work+0x17c/0x304
[    7.463042] [<ffffffff80039858>] worker_thread+0x2be/0x3f8
[    7.463056] [<ffffffff80042b08>] kthread+0xc4/0xe4
[    7.463067] [<ffffffff809c2c0a>] ret_from_fork+0xe/0x20
[    7.463086] ---[ end trace 0000000000000000 ]---
[    7.463095] ------------[ cut here ]------------
[    7.463904] cpu_pll1_foutpostdiv already unprepared
[    7.463955] WARNING: CPU: 2 PID: 58 at drivers/clk/clk.c:949 clk_core_unprepare+0x156/0x170
[    7.463979] Modules linked in:
[    7.463988] CPU: 2 PID: 58 Comm: kworker/u11:1 Tainted: G        W          6.7.0+ #30
[    7.464002] Hardware name: Sipeed Lichee Pi 4A (DT)
[    7.464009] Workqueue: events_unbound deferred_probe_work_func
[    7.464023] epc : clk_core_unprepare+0x156/0x170
[    7.464037]  ra : clk_core_unprepare+0x156/0x170
[    7.464048] epc : ffffffff805f389a ra : ffffffff805f389a sp : ffffffc800403430
[    7.464057]  gp : ffffffff819a86f0 tp : ffffffd900a45280 t0 : ffffffff809a9390
[    7.464065]  t1 : 0000000000000000 t2 : 5f316c6c705f7570 s0 : ffffffc800403450
[    7.464073]  s1 : ffffffd900c4fc00 a0 : 0000000000000027 a1 : ffffffff818954d0
[    7.464081]  a2 : 0000000000000010 a3 : 0000000000000105 a4 : f938884c4b3e0200
[    7.464089]  a5 : f938884c4b3e0200 a6 : c0000000ffffefff a7 : ffffffff819e8438
[    7.464097]  s2 : 000000002faf0800 s3 : 0000000000000001 s4 : ffffffff80c6d6c8
[    7.464105]  s5 : ffffffff819ad4e0 s6 : ffffffff819e8428 s7 : 00000000000c3500
[    7.464113]  s8 : 00000000000aae60 s9 : 00000000000b71b0 s10: ffffffff819ab0b0
[    7.464121]  s11: ffffffff819ad4f8 t3 : ffffffd90014bf00 t4 : ffffffd90014bf00
[    7.464129]  t5 : ffffffd90014b000 t6 : ffffffc800403228
[    7.464136] status: 0000000200000120 badaddr: 0000000000000000 cause: 0000000000000003
[    7.464144] [<ffffffff805f389a>] clk_core_unprepare+0x156/0x170
[    7.464158] [<ffffffff805f38e2>] clk_unprepare+0x2e/0x42
[    7.464172] [<ffffffff8073c558>] light_set_target+0x324/0x6a6
[    7.464187] [<ffffffff80737f44>] __cpufreq_driver_target+0x194/0x2a8
[    7.464199] [<ffffffff80739b24>] cpufreq_online+0x9c4/0xa4a
[    7.464211] [<ffffffff80739c78>] cpufreq_add_dev+0xac/0xbc
[    7.464222] [<ffffffff806600ea>] subsys_interface_register+0xf6/0x108
[    7.464236] [<ffffffff807364a6>] cpufreq_register_driver+0x150/0x2b8
[    7.464248] [<ffffffff8073be72>] light_cpufreq_probe+0x31a/0x4f6
[    7.464260] [<ffffffff80664e42>] platform_probe+0x5e/0xaa
[    7.464273] [<ffffffff80661ef2>] really_probe+0x9e/0x33e
[    7.464283] [<ffffffff80662210>] __driver_probe_device+0x7e/0x136
[    7.464294] [<ffffffff80662300>] driver_probe_device+0x38/0xc4
[    7.464305] [<ffffffff8066240e>] __device_attach_driver+0x82/0xe4
[    7.464317] [<ffffffff8065fe28>] bus_for_each_drv+0x70/0xc4
[    7.464330] [<ffffffff80662830>] __device_attach+0xb2/0x1ce
[    7.464341] [<ffffffff80662b50>] device_initial_probe+0x1a/0x22
[    7.464351] [<ffffffff80660db0>] bus_probe_device+0x96/0x98
[    7.464361] [<ffffffff8065e3ea>] device_add+0x558/0x70c
[    7.464374] [<ffffffff8077abf8>] of_device_add+0x3c/0x4c
[    7.464389] [<ffffffff8077acba>] of_platform_device_create_pdata+0x80/0xb6
[    7.464406] [<ffffffff8077afd8>] of_platform_bus_create+0x186/0x2b4
[    7.464420] [<ffffffff8077b296>] of_platform_populate+0x5a/0x10c
[    7.464432] [<ffffffff8077b3c6>] devm_of_platform_populate+0x52/0x98
[    7.464447] [<ffffffff80775e96>] light_aon_probe+0xfa/0x150
[    7.464459] [<ffffffff80664e42>] platform_probe+0x5e/0xaa
[    7.464470] [<ffffffff80661ef2>] really_probe+0x9e/0x33e
[    7.464480] [<ffffffff80662210>] __driver_probe_device+0x7e/0x136
[    7.464490] [<ffffffff80662300>] driver_probe_device+0x38/0xc4
[    7.464502] [<ffffffff8066240e>] __device_attach_driver+0x82/0xe4
[    7.464512] [<ffffffff8065fe28>] bus_for_each_drv+0x70/0xc4
[    7.464527] [<ffffffff80662830>] __device_attach+0xb2/0x1ce
[    7.464539] [<ffffffff80662b50>] device_initial_probe+0x1a/0x22
[    7.464549] [<ffffffff80660db0>] bus_probe_device+0x96/0x98
[    7.464561] [<ffffffff80661b22>] deferred_probe_work_func+0xb2/0x102
[    7.464573] [<ffffffff80039412>] process_one_work+0x17c/0x304
[    7.464584] [<ffffffff80039858>] worker_thread+0x2be/0x3f8
[    7.464596] [<ffffffff80042b08>] kthread+0xc4/0xe4
[    7.464606] [<ffffffff809c2c0a>] ret_from_fork+0xe/0x20
[    7.464620] ---[ end trace 0000000000000000 ]---
[    7.464646] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 750000 KHz, changing to: 800000 KHz
[    7.485985] cpu cpu0: finish to register cpufreq driver
[    7.486291] thead,light-aon-test aon:light-aon-test: Successfully registered
[    7.486679] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.486966] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.487263] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.487558] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.487785] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.488039] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.496274] light-event soc:light-event: magicnum:0x9e8d9b8b mode:0xe16ead82
[    7.496299] light-event soc:light-event: set rebootmode:0x2
[    7.496313] light-event soc:light-event: light-event driver init successfully
[    7.499121] [light_wdt_probe,329] register power off callback
[    7.499146] succeed to register light pmic watchdog
[    7.499505] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.499777] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.500070] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.500359] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.500586] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.500834] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.501680] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.501999] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.502307] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.502598] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.502826] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.503083] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.503855] light rpmsg: Ready for cross core communication!
[    7.503876] light rpmsg: rproc_name = m4
[    7.504814] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.505184] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.505484] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.505771] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.506000] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.506257] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.520832] virtio_rpmsg_bus virtio0: msg received with no recipient
[    8.013056] virtio_rpmsg_bus virtio0: rpmsg host is online
[    8.013220] light rpmsg: driver is registered.
[    8.013451] clk: Not disabling unused clocks
[    8.013793] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.014130] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.014432] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    8.014722] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    8.014953] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.015214] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.016444] Freeing unused kernel image (initmem) memory: 2560K
[    8.029116] Run /init as init process
[    8.254529] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.254935] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.255471] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    8.255939] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    8.256262] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.257398] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.303519] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.304327] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.309426] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.309831] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.311649] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.312038] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.313863] soc_vbus_en GPIO handle specifies active low - ignored
[    8.313905] reg-fixed-voltage aon:soc_vbus_en: nonexclusive access to GPIO for (null)
[    8.317659] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.318411] soc_vdd_3v3_en GPIO handle specifies active low - ignored
[    8.323572] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.324305] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.324691] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.345935] pca953x 0-0018: supply vcc not found, using dummy regulator
[    8.373088] mmc1: SDHCI controller on ffe7090000.mmc [ffe7090000.mmc] using ADMA 64-bit
[    8.376686] pca953x 0-0018: using no AI
[    8.388577] printk: legacy console [ttyS0] disabled
[    8.392602] ffe7014000.serial: ttyS0 at MMIO 0xffe7014000 (irq = 23, base_baud = 6250000) is a 16550A
[    8.392688] printk: legacy console [ttyS0] enabled
[    8.393923] pca953x 1-0018: supply vcc not found, using dummy regulator
[    8.416740] thead-dwmac ffe7070000.ethernet: IRQ eth_wake_irq not found
[    8.422453] pca953x 1-0018: using no AI
[    8.424660] thead-dwmac ffe7070000.ethernet: IRQ eth_lpi not found
[    8.450052] pca953x 3-0018: supply vcc not found, using dummy regulator
[    8.453922] thead-dwmac ffe7070000.ethernet: PTP uses main clock
[    8.457335] pca953x 3-0018: using no AI
[    8.467636] thead-dwmac ffe7070000.ethernet: User ID: 0x10, Synopsys ID: 0x37
[    8.551413] usbcore: registered new interface driver usbfs
[    8.551786] thead-dwmac ffe7070000.ethernet:         DWMAC1000
[    8.556289] usbcore: registered new interface driver hub
[    8.560262] thead-dwmac ffe7070000.ethernet: DMA HW capability register supported
[    8.560269] thead-dwmac ffe7070000.ethernet: RX Checksum Offload Engine supported
[    8.560274] thead-dwmac ffe7070000.ethernet: COE Type 2
[    8.560279] thead-dwmac ffe7070000.ethernet: TX Checksum insertion supported
[    8.560283] thead-dwmac ffe7070000.ethernet: Enhanced/Alternate descriptors
[    8.560418] usbcore: registered new device driver usb
[    8.566068] thead-dwmac ffe7070000.ethernet: Enabled extended descriptors
[    8.566075] thead-dwmac ffe7070000.ethernet: Ring mode enabled
[    8.566079] thead-dwmac ffe7070000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    8.593940] thead-dwmac ffe7060000.ethernet: IRQ eth_wake_irq not found
[    8.654683] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    8.662877] thead-dwmac ffe7060000.ethernet: IRQ eth_lpi not found
[    8.669441] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    8.670192] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220fe65 hci version 0x110 quirks 0x0000000000000810
[    8.673227] thead-dwmac ffe7070000.ethernet end0: renamed from eth0
[    8.675047] thead-dwmac ffe7060000.ethernet: PTP uses main clock
[    8.680236] xhci-hcd xhci-hcd.0.auto: irq 27, io mem 0xffe7040000
[    8.685296] thead-dwmac ffe7060000.ethernet: User ID: 0x10, Synopsys ID: 0x37
[    8.689766] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    8.696358] thead-dwmac ffe7060000.ethernet:         DWMAC1000
[    8.700814] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    8.700834] thead-dwmac ffe7060000.ethernet: DMA HW capability register supported
[    8.705670] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    8.713234] thead-dwmac ffe7060000.ethernet: RX Checksum Offload Engine supported
[    8.713416] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.07
[    8.719965] thead-dwmac ffe7060000.ethernet: COE Type 2
[    8.719974] thead-dwmac ffe7060000.ethernet: TX Checksum insertion supported
[    8.719978] thead-dwmac ffe7060000.ethernet: Enhanced/Alternate descriptors
[    8.719984] thead-dwmac ffe7060000.ethernet: Enabled extended descriptors
[    8.719988] thead-dwmac ffe7060000.ethernet: Ring mode enabled
[    8.719994] thead-dwmac ffe7060000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[   11.035532] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   11.042784] usb usb1: Product: xHCI Host Controller
[   11.047681] usb usb1: Manufacturer: Linux 6.7.0+ xhci-hcd
[   11.053098] usb usb1: SerialNumber: xhci-hcd.0.auto
[   11.058727] hub 1-0:1.0: USB hub found
[   11.062629] hub 1-0:1.0: 1 port detected
[   11.067824] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.07
[   11.071670] soc_lcd0_vdd33_en GPIO handle specifies active low - ignored
[   11.076175] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   11.076186] usb usb2: Product: xHCI Host Controller
[   11.076404] soc_lcd0_vdd18_en GPIO handle specifies active low - ignored
[   11.082943] usb usb2: Manufacturer: Linux 6.7.0+ xhci-hcd
[   11.082951] usb usb2: SerialNumber: xhci-hcd.0.auto
[   11.083602] hub 2-0:1.0: USB hub found
[   11.091284] soc_vdd5v_se_en GPIO handle specifies active low - ignored
[   11.096331] hub 2-0:1.0: 1 port detected
[   11.098009] soc_avdd28_rgb GPIO handle specifies active low - ignored
[   11.104353] soc_wcn33_en GPIO handle specifies active low - ignored
[   11.116608] soc_dovdd18_rgb GPIO handle specifies active low - ignored
[   11.118799] soc_avdd25_ir GPIO handle specifies active low - ignored
[   11.118863] soc_dvdd12_rgb GPIO handle specifies active low - ignored
[   11.120585] soc_dovdd18_ir GPIO handle specifies active low - ignored
[   11.126115] soc_dvdd12_ir GPIO handle specifies active low - ignored
[   11.127511] reg-fixed-voltage aon:soc_avdd25_ir: nonexclusive access to GPIO for (null)
[   11.129196] thead-dwmac ffe7060000.ethernet end1: renamed from eth0
[   11.135061] soc_cam2_avdd25_ir GPIO handle specifies active low - ignored
[   11.140741] soc_cam2_dovdd18_ir GPIO handle specifies active low - ignored
[   11.147091] soc_cam2_dvdd12_ir GPIO handle specifies active low - ignored
[   11.153240] reg-fixed-voltage aon:soc_cam2_dovdd18_ir: nonexclusive access to GPIO for (null)
[   11.160086] reg-fixed-voltage aon:soc_cam2_dvdd12_ir: nonexclusive access to GPIO for (null)
[   11.665505] EXT4-fs (mmcblk0p3): mounted filesystem 919ff2d8-efd8-4609-893d-2206a2a04fb7 r/w with ordered data mode. Quota mode: none
.
[   11.930199] Not activating Mandatory Access Control as /sbin/tomoyo-init does not exist.
[   11.985117] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[   12.092152] systemd[1]: System time before build time, advancing clock.
[   12.126834] systemd[1]: Inserted module 'autofs4'
[   12.151180] usb 1-1: New USB device found, idVendor=2109, idProduct=2817, bcdDevice= 7.00
[   12.159482] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   12.166677] usb 1-1: Product: USB2.0 Hub
[   12.171775] usb 1-1: Manufacturer: VIA Labs, Inc.
[   12.193797] systemd[1]: systemd 252.6-1 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +
OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZ
IP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[   12.225920] systemd[1]: Detected architecture riscv64.
[   12.230295] hub 1-1:1.0: USB hub found
[   12.235188] hub 1-1:1.0: 5 ports detected
[   12.241821] systemd[1]: Hostname set to <lpi4a>.
[   12.294662] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[   12.349893] dw-apb-uart ffe7014000.serial: forbid DMA for kernel console
[   12.451277] usb 2-1: New USB device found, idVendor=2109, idProduct=0817, bcdDevice= 7.00
[   12.459560] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   12.466745] usb 2-1: Product: USB3.0 Hub
[   12.471822] usb 2-1: Manufacturer: VIA Labs, Inc.
[   12.533500] hub 2-1:1.0: USB hub found
[   12.537732] hub 2-1:1.0: 4 ports detected
[   12.585865] systemd[1]: Configuration file /etc/systemd/system/rtk-hciattach.service is marked executable. Please remove executable p
ermission bits. Proceeding anyway.
[   12.634937] systemd[1]: Configuration file /etc/systemd/system/firstboot.service is marked executable. Please remove executable permi
ssion bits. Proceeding anyway.
[   12.801768] systemd[1]: Queued start job for default target graphical.target.
[   12.829411] systemd[1]: Created slice system-getty.slice - Slice /system/getty.
[   12.839032] systemd[1]: Created slice system-modprobe.slice - Slice /system/modprobe.
[   12.848945] systemd[1]: Created slice system-serial\x2dgetty.slice - Slice /system/serial-getty.
[   12.859411] systemd[1]: Created slice user.slice - User and Session Slice.
[   12.867024] systemd[1]: Started systemd-ask-password-console.path - Dispatch Password Requests to Console Directory Watch.
[   12.878660] systemd[1]: Started systemd-ask-password-wall.path - Forward Password Requests to Wall Directory Watch.
[   12.890182] systemd[1]: Set up automount proc-sys-fs-binfmt_misc.automount - Arbitrary Executable File Formats File System Automount
Point.
[   12.903240] systemd[1]: Reached target cryptsetup.target - Local Encrypted Volumes.
[   12.911327] systemd[1]: Reached target integritysetup.target - Local Integrity Protected Volumes.
[   12.920676] systemd[1]: Reached target paths.target - Path Units.
[   12.927157] systemd[1]: Reached target remote-cryptsetup.target - Remote Encrypted Volumes.
[   12.935873] systemd[1]: Reached target remote-fs.target - Remote File Systems.
[   12.943417] systemd[1]: Reached target remote-veritysetup.target - Remote Verity Protected Volumes.
[   12.952755] systemd[1]: Reached target slices.target - Slice Units.
[   12.959355] systemd[1]: Reached target swap.target - Swaps.
[   12.965265] systemd[1]: Reached target veritysetup.target - Local Verity Protected Volumes.
[   12.974503] systemd[1]: Listening on systemd-fsckd.socket - fsck to fsckd communication Socket.
[   12.983870] systemd[1]: Listening on systemd-initctl.socket - initctl Compatibility Named Pipe.
[   12.993686] systemd[1]: Listening on systemd-journald-audit.socket - Journal Audit Socket.
[   12.997086] usb 1-1.5: new high-speed USB device number 3 using xhci-hcd
[   13.009805] systemd[1]: Listening on systemd-journald-dev-log.socket - Journal Socket (/dev/log).
[   13.019795] systemd[1]: Listening on systemd-journald.socket - Journal Socket.
[   13.028153] systemd[1]: Listening on systemd-networkd.socket - Network Service Netlink Socket.
[   13.042628] systemd[1]: Listening on systemd-udevd-control.socket - udev Control Socket.
[   13.051661] systemd[1]: Listening on systemd-udevd-kernel.socket - udev Kernel Socket.
[   13.081524] systemd[1]: Mounting dev-hugepages.mount - Huge Pages File System...
[   13.093776] systemd[1]: Mounting dev-mqueue.mount - POSIX Message Queue File System...
[   13.107024] systemd[1]: Mounting sys-kernel-debug.mount - Kernel Debug File System...
[   13.114157] usb 1-1.5: New USB device found, idVendor=2109, idProduct=8817, bcdDevice= 0.01
[   13.123302] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   13.123309] usb 1-1.5: Product: USB Billboard Device
[   13.123314] usb 1-1.5: Manufacturer: VIA Labs, Inc.
[   13.123319] usb 1-1.5: SerialNumber: 0000000000000001
[   13.151220] systemd[1]: Mounting sys-kernel-tracing.mount - Kernel Trace File System...
[   13.164639] systemd[1]: Starting kmod-static-nodes.service - Create List of Static Device Nodes...
[   13.178637] systemd[1]: Starting modprobe@configfs.service - Load Kernel Module configfs...
[   13.192885] systemd[1]: Starting modprobe@dm_mod.service - Load Kernel Module dm_mod...
[   13.206284] systemd[1]: Starting modprobe@drm.service - Load Kernel Module drm...
[   13.219358] systemd[1]: Starting modprobe@efi_pstore.service - Load Kernel Module efi_pstore...
[   13.235405] systemd[1]: Starting modprobe@fuse.service - Load Kernel Module fuse...
[   13.256640] systemd[1]: Starting modprobe@loop.service - Load Kernel Module loop...
[   13.257702] device-mapper: core: CONFIG_IMA_DISABLE_HTABLE is disabled. Duplicate IMA measurements will not be recorded in the IMA lo
g.
[   13.276955] device-mapper: uevent: version 1.0.3
[   13.288078] systemd[1]: Starting nftables.service - nftables...
[   13.295877] systemd[1]: systemd-fsck-root.service - File System Check on Root Device was skipped because of an unmet condition check
(ConditionPathExists=!/run/initramfs/fsck-root).
[   13.325173] fuse: init (API version 7.39)
[   13.329149] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[   13.332161] systemd[1]: Starting systemd-journald.service - Journal Service...
[   13.367756] loop: module loaded
[   13.378913] systemd[1]: Starting systemd-modules-load.service - Load Kernel Modules...
[   13.400653] systemd[1]: Starting systemd-network-generator.service - Generate network units from Kernel command line...
[   13.419058] systemd[1]: Starting systemd-remount-fs.service - Remount Root and Kernel File Systems...
[   13.442131] systemd[1]: Starting systemd-udev-trigger.service - Coldplug All udev Devices...
[   13.486186] systemd[1]: Mounted dev-hugepages.mount - Huge Pages File System.
[   13.494467] systemd[1]: Mounted dev-mqueue.mount - POSIX Message Queue File System.
[   13.503419] systemd[1]: Mounted sys-kernel-debug.mount - Kernel Debug File System.
[   13.512518] systemd[1]: Mounted sys-kernel-tracing.mount - Kernel Trace File System.
[   13.522915] systemd[1]: Finished kmod-static-nodes.service - Create List of Static Device Nodes.
[   13.534691] EXT4-fs (mmcblk0p3): re-mounted 919ff2d8-efd8-4609-893d-2206a2a04fb7 r/w. Quota mode: none.
[   13.535687] systemd[1]: modprobe@configfs.service: Deactivated successfully.
[   13.554184] systemd[1]: Finished modprobe@configfs.service - Load Kernel Module configfs.
[   13.569715] systemd[1]: modprobe@dm_mod.service: Deactivated successfully.
[   13.578294] systemd[1]: Finished modprobe@dm_mod.service - Load Kernel Module dm_mod.
[   13.588919] systemd[1]: modprobe@drm.service: Deactivated successfully.
[   13.596847] systemd[1]: Finished modprobe@drm.service - Load Kernel Module drm.
[   13.607132] systemd[1]: modprobe@efi_pstore.service: Deactivated successfully.
[   13.615777] systemd[1]: Finished modprobe@efi_pstore.service - Load Kernel Module efi_pstore.
[   13.626877] systemd[1]: modprobe@fuse.service: Deactivated successfully.
[   13.635593] systemd[1]: Finished modprobe@fuse.service - Load Kernel Module fuse.
[   13.645813] systemd[1]: modprobe@loop.service: Deactivated successfully.
[   13.653751] systemd[1]: Finished modprobe@loop.service - Load Kernel Module loop.
[   13.671156] systemd[1]: Finished systemd-modules-load.service - Load Kernel Modules.
[   13.680383] systemd[1]: Started systemd-journald.service - Journal Service.
[   13.790840] systemd-journald[242]: Received client request to flush runtime journal.
[   13.810195] systemd-journald[242]: File /var/log/journal/902e160f44ac4b4191e3dd8b3375dfe3/system.journal corrupted or uncleanly shut
down, renaming and replacing.
[   14.676908] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   14.710516] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   14.717122] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[   14.732435] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
[   14.855892] EXT4-fs (mmcblk0p2): mounted filesystem d7a15bd4-c3c4-44cf-8e9c-47f5e315cf40 r/w with ordered data mode. Quota mode: none
.
[   14.887966] hwmon hwmon1: temp2_input not attached to any thermal zone
[   14.912204] usbcore: registered new device driver onboard-usb-hub
[   14.918788] usb 1-1.5: USB disconnect, device number 3
[   15.161970] hub 1-1:1.0: USB hub found
[   15.166118] hub 1-1:1.0: 5 ports detected
[   15.251863] systemd-journald[242]: Oldest entry in /var/log/journal/902e160f44ac4b4191e3dd8b3375dfe3/system.journal is older than the
 configured file retention duration (1month), suggesting rotation.
[   15.269750] systemd-journald[242]: /var/log/journal/902e160f44ac4b4191e3dd8b3375dfe3/system.journal: Journal header limits reached or
 header out-of-date, rotating.
[   15.418344] hub 1-1:1.0: USB hub found
[   15.423159] hub 1-1:1.0: 5 ports detected
[   15.706274] hub 1-1:1.0: USB hub found
[   15.710749] hub 1-1:1.0: 5 ports detected
[   15.738768] hub 2-1:1.0: USB hub found
[   15.744253] hub 2-1:1.0: 4 ports detected
[   16.137752] hub 2-1:1.0: USB hub found
[   16.142417] hub 2-1:1.0: 4 ports detected
[   16.445108] usb 1-1.5: new high-speed USB device number 4 using xhci-hcd
[   16.562455] usb 1-1.5: New USB device found, idVendor=2109, idProduct=8817, bcdDevice= 0.01
[   16.570953] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   16.578394] usb 1-1.5: Product: USB Billboard Device
[   16.583691] usb 1-1.5: Manufacturer: VIA Labs, Inc.
[   16.589446] usb 1-1.5: SerialNumber: 0000000000000001
[   16.694283] thead-dwmac ffe7070000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   16.789146] thead-dwmac ffe7070000.ethernet end0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
[   16.809596] dwmac1000: Master AXI performs fixed burst length
[   16.815442] thead-dwmac ffe7070000.ethernet end0: No Safety Features support found
[   17.021563] thead-dwmac ffe7070000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
[   17.030504] thead-dwmac ffe7070000.ethernet end0: registered PTP clock
[   17.040583] thead-dwmac ffe7070000.ethernet end0: configuring for phy/rgmii-id link mode
[   17.095250] thead-dwmac ffe7060000.ethernet end1: Register MEM_TYPE_PAGE_POOL RxQ-0
[   17.173310] thead-dwmac ffe7060000.ethernet end1: PHY [stmmac-0:02] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
[   17.193722] dwmac1000: Master AXI performs fixed burst length
[   17.199583] thead-dwmac ffe7060000.ethernet end1: No Safety Features support found
[   17.397418] thead-dwmac ffe7060000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
[   17.406331] thead-dwmac ffe7060000.ethernet end1: registered PTP clock
[   17.419176] thead-dwmac ffe7060000.ethernet end1: configuring for phy/rgmii-id link mode

Debian GNU/Linux 12 lpi4a ttyS0

lpi4a login: [   39.917206] soc_dovdd18_scan: disabling
[   39.921769] soc_dvdd12_scan: disabling
[   39.926238] soc_avdd28_scan_en: disabling
debian@lpi4a:~$ sudo dmesg | grep port0
[    6.018165] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    6.018796] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    6.019493] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    6.020201] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    6.020801] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    6.021596] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.404378] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.405221] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.405948] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.406682] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.407260] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.407889] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.486679] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.486966] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.487263] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.487558] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.487785] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.488039] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.499505] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.499777] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.500070] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.500359] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.500586] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.500834] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.501680] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.501999] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.502307] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.502598] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.502826] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.503083] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    7.504814] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    7.505184] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    7.505484] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    7.505771] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    7.506000] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    7.506257] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.013793] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.014130] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.014432] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    8.014722] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    8.014953] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.015214] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.254529] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.254935] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.255471] gpio-dwapb ffec005000.gpio: failed to register gpiochip for port0
[    8.255939] gpio-dwapb ffec006000.gpio: failed to register gpiochip for port0
[    8.256262] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.257398] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.303519] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.304327] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.309426] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.309831] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.311649] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.312038] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0
[    8.317659] gpio-dwapb fffff41000.gpio: failed to register gpiochip for port0
[    8.323572] gpio-dwapb fffff52000.gpio: failed to register gpiochip for port0
[    8.324305] gpio-dwapb ffe7f34000.gpio: failed to register gpiochip for port0
[    8.324691] gpio-dwapb ffe7f38000.gpio: failed to register gpiochip for port0

failed to register gpiochip for port0

@RevySR
Copy link
Member Author

RevySR commented Jan 8, 2024

pinctrl-th1520 driver needs builtin kernel

@RevySR RevySR closed this as completed Jan 8, 2024
RevySR pushed a commit that referenced this issue Mar 29, 2024
[ Upstream commit c957280 ]

From commit a304e1b ("[PATCH] Debug shared irqs"), there is a test
to make sure the shared irq handler should be able to handle the unexpected
event after deregistration. For this case, let's apply MT76_REMOVED flag to
indicate the device was removed and do not run into the resource access
anymore.

BUG: KASAN: use-after-free in mt7921_irq_handler+0xd8/0x100 [mt7921e]
Read of size 8 at addr ffff88824a7d3b78 by task rmmod/11115
CPU: 28 PID: 11115 Comm: rmmod Tainted: G        W    L    5.17.0 #10
Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I
EDGE WIFI (MS-7D73), BIOS 1.81 01/05/2024
Call Trace:
 <TASK>
 dump_stack_lvl+0x6f/0xa0
 print_address_description.constprop.0+0x1f/0x190
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 kasan_report.cold+0x7f/0x11b
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 mt7921_irq_handler+0xd8/0x100 [mt7921e]
 free_irq+0x627/0xaa0
 devm_free_irq+0x94/0xd0
 ? devm_request_any_context_irq+0x160/0x160
 ? kobject_put+0x18d/0x4a0
 mt7921_pci_remove+0x153/0x190 [mt7921e]
 pci_device_remove+0xa2/0x1d0
 __device_release_driver+0x346/0x6e0
 driver_detach+0x1ef/0x2c0
 bus_remove_driver+0xe7/0x2d0
 ? __check_object_size+0x57/0x310
 pci_unregister_driver+0x26/0x250
 __do_sys_delete_module+0x307/0x510
 ? free_module+0x6a0/0x6a0
 ? fpregs_assert_state_consistent+0x4b/0xb0
 ? rcu_read_lock_sched_held+0x10/0x70
 ? syscall_enter_from_user_mode+0x20/0x70
 ? trace_hardirqs_on+0x1c/0x130
 do_syscall_64+0x5c/0x80
 ? trace_hardirqs_on_prepare+0x72/0x160
 ? do_syscall_64+0x68/0x80
 ? trace_hardirqs_on_prepare+0x72/0x160
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/CABXGCsOdvVwdLmSsC8TZ1jF0UOg_F_W3wqLECWX620PUkvNk=A@mail.gmail.com/
Fixes: 9270270 ("wifi: mt76: mt7921: fix PCI DMA hang after reboot")
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
RevySR pushed a commit that referenced this issue Mar 29, 2024
[ Upstream commit fd5860a ]

The loop inside nfs_netfs_issue_read() currently does not disable
interrupts while iterating through pages in the xarray to submit
for NFS read.  This is not safe though since after taking xa_lock,
another page in the mapping could be processed for writeback inside
an interrupt, and deadlock can occur.  The fix is simple and clean
if we use xa_for_each_range(), which handles the iteration with RCU
while reducing code complexity.

The problem is easily reproduced with the following test:
 mount -o vers=3,fsc 127.0.0.1:/export /mnt/nfs
 dd if=/dev/zero of=/mnt/nfs/file1.bin bs=4096 count=1
 echo 3 > /proc/sys/vm/drop_caches
 dd if=/mnt/nfs/file1.bin of=/dev/null
 umount /mnt/nfs

On the console with a lockdep-enabled kernel a message similar to
the following will be seen:

 ================================
 WARNING: inconsistent lock state
 6.7.0-lockdbg+ #10 Not tainted
 --------------------------------
 inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
 test5/1708 [HC0[0]:SC0[0]:HE1:SE1] takes:
 ffff888127baa598 (&xa->xa_lock#4){+.?.}-{3:3}, at:
nfs_netfs_issue_read+0x1b2/0x4b0 [nfs]
 {IN-SOFTIRQ-W} state was registered at:
   lock_acquire+0x144/0x380
   _raw_spin_lock_irqsave+0x4e/0xa0
   __folio_end_writeback+0x17e/0x5c0
   folio_end_writeback+0x93/0x1b0
   iomap_finish_ioend+0xeb/0x6a0
   blk_update_request+0x204/0x7f0
   blk_mq_end_request+0x30/0x1c0
   blk_complete_reqs+0x7e/0xa0
   __do_softirq+0x113/0x544
   __irq_exit_rcu+0xfe/0x120
   irq_exit_rcu+0xe/0x20
   sysvec_call_function_single+0x6f/0x90
   asm_sysvec_call_function_single+0x1a/0x20
   pv_native_safe_halt+0xf/0x20
   default_idle+0x9/0x20
   default_idle_call+0x67/0xa0
   do_idle+0x2b5/0x300
   cpu_startup_entry+0x34/0x40
   start_secondary+0x19d/0x1c0
   secondary_startup_64_no_verify+0x18f/0x19b
 irq event stamp: 176891
 hardirqs last  enabled at (176891): [<ffffffffa67a0be4>]
_raw_spin_unlock_irqrestore+0x44/0x60
 hardirqs last disabled at (176890): [<ffffffffa67a0899>]
_raw_spin_lock_irqsave+0x79/0xa0
 softirqs last  enabled at (176646): [<ffffffffa515d91e>]
__irq_exit_rcu+0xfe/0x120
 softirqs last disabled at (176633): [<ffffffffa515d91e>]
__irq_exit_rcu+0xfe/0x120

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&xa->xa_lock#4);
   <Interrupt>
     lock(&xa->xa_lock#4);

  *** DEADLOCK ***

 2 locks held by test5/1708:
  #0: ffff888127baa498 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at:
      nfs_start_io_read+0x28/0x90 [nfs]
  #1: ffff888127baa650 (mapping.invalidate_lock#3){.+.+}-{4:4}, at:
      page_cache_ra_unbounded+0xa4/0x280

 stack backtrace:
 CPU: 6 PID: 1708 Comm: test5 Kdump: loaded Not tainted 6.7.0-lockdbg+
 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-1.fc39
04/01/2014
 Call Trace:
  dump_stack_lvl+0x5b/0x90
  mark_lock+0xb3f/0xd20
  __lock_acquire+0x77b/0x3360
  _raw_spin_lock+0x34/0x80
  nfs_netfs_issue_read+0x1b2/0x4b0 [nfs]
  netfs_begin_read+0x77f/0x980 [netfs]
  nfs_netfs_readahead+0x45/0x60 [nfs]
  nfs_readahead+0x323/0x5a0 [nfs]
  read_pages+0xf3/0x5c0
  page_cache_ra_unbounded+0x1c8/0x280
  filemap_get_pages+0x38c/0xae0
  filemap_read+0x206/0x5e0
  nfs_file_read+0xb7/0x140 [nfs]
  vfs_read+0x2a9/0x460
  ksys_read+0xb7/0x140

Fixes: 000dbe0 ("NFS: Convert buffered read paths to use netfs when fscache is enabled")
Suggested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
RevySR pushed a commit that referenced this issue Mar 29, 2024
[ Upstream commit c957280 ]

From commit a304e1b ("[PATCH] Debug shared irqs"), there is a test
to make sure the shared irq handler should be able to handle the unexpected
event after deregistration. For this case, let's apply MT76_REMOVED flag to
indicate the device was removed and do not run into the resource access
anymore.

BUG: KASAN: use-after-free in mt7921_irq_handler+0xd8/0x100 [mt7921e]
Read of size 8 at addr ffff88824a7d3b78 by task rmmod/11115
CPU: 28 PID: 11115 Comm: rmmod Tainted: G        W    L    5.17.0 #10
Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I
EDGE WIFI (MS-7D73), BIOS 1.81 01/05/2024
Call Trace:
 <TASK>
 dump_stack_lvl+0x6f/0xa0
 print_address_description.constprop.0+0x1f/0x190
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 kasan_report.cold+0x7f/0x11b
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 mt7921_irq_handler+0xd8/0x100 [mt7921e]
 free_irq+0x627/0xaa0
 devm_free_irq+0x94/0xd0
 ? devm_request_any_context_irq+0x160/0x160
 ? kobject_put+0x18d/0x4a0
 mt7921_pci_remove+0x153/0x190 [mt7921e]
 pci_device_remove+0xa2/0x1d0
 __device_release_driver+0x346/0x6e0
 driver_detach+0x1ef/0x2c0
 bus_remove_driver+0xe7/0x2d0
 ? __check_object_size+0x57/0x310
 pci_unregister_driver+0x26/0x250
 __do_sys_delete_module+0x307/0x510
 ? free_module+0x6a0/0x6a0
 ? fpregs_assert_state_consistent+0x4b/0xb0
 ? rcu_read_lock_sched_held+0x10/0x70
 ? syscall_enter_from_user_mode+0x20/0x70
 ? trace_hardirqs_on+0x1c/0x130
 do_syscall_64+0x5c/0x80
 ? trace_hardirqs_on_prepare+0x72/0x160
 ? do_syscall_64+0x68/0x80
 ? trace_hardirqs_on_prepare+0x72/0x160
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/CABXGCsOdvVwdLmSsC8TZ1jF0UOg_F_W3wqLECWX620PUkvNk=A@mail.gmail.com/
Fixes: 9270270 ("wifi: mt76: mt7921: fix PCI DMA hang after reboot")
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
RevySR pushed a commit that referenced this issue Mar 29, 2024
[ Upstream commit fd5860a ]

The loop inside nfs_netfs_issue_read() currently does not disable
interrupts while iterating through pages in the xarray to submit
for NFS read.  This is not safe though since after taking xa_lock,
another page in the mapping could be processed for writeback inside
an interrupt, and deadlock can occur.  The fix is simple and clean
if we use xa_for_each_range(), which handles the iteration with RCU
while reducing code complexity.

The problem is easily reproduced with the following test:
 mount -o vers=3,fsc 127.0.0.1:/export /mnt/nfs
 dd if=/dev/zero of=/mnt/nfs/file1.bin bs=4096 count=1
 echo 3 > /proc/sys/vm/drop_caches
 dd if=/mnt/nfs/file1.bin of=/dev/null
 umount /mnt/nfs

On the console with a lockdep-enabled kernel a message similar to
the following will be seen:

 ================================
 WARNING: inconsistent lock state
 6.7.0-lockdbg+ #10 Not tainted
 --------------------------------
 inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
 test5/1708 [HC0[0]:SC0[0]:HE1:SE1] takes:
 ffff888127baa598 (&xa->xa_lock#4){+.?.}-{3:3}, at:
nfs_netfs_issue_read+0x1b2/0x4b0 [nfs]
 {IN-SOFTIRQ-W} state was registered at:
   lock_acquire+0x144/0x380
   _raw_spin_lock_irqsave+0x4e/0xa0
   __folio_end_writeback+0x17e/0x5c0
   folio_end_writeback+0x93/0x1b0
   iomap_finish_ioend+0xeb/0x6a0
   blk_update_request+0x204/0x7f0
   blk_mq_end_request+0x30/0x1c0
   blk_complete_reqs+0x7e/0xa0
   __do_softirq+0x113/0x544
   __irq_exit_rcu+0xfe/0x120
   irq_exit_rcu+0xe/0x20
   sysvec_call_function_single+0x6f/0x90
   asm_sysvec_call_function_single+0x1a/0x20
   pv_native_safe_halt+0xf/0x20
   default_idle+0x9/0x20
   default_idle_call+0x67/0xa0
   do_idle+0x2b5/0x300
   cpu_startup_entry+0x34/0x40
   start_secondary+0x19d/0x1c0
   secondary_startup_64_no_verify+0x18f/0x19b
 irq event stamp: 176891
 hardirqs last  enabled at (176891): [<ffffffffa67a0be4>]
_raw_spin_unlock_irqrestore+0x44/0x60
 hardirqs last disabled at (176890): [<ffffffffa67a0899>]
_raw_spin_lock_irqsave+0x79/0xa0
 softirqs last  enabled at (176646): [<ffffffffa515d91e>]
__irq_exit_rcu+0xfe/0x120
 softirqs last disabled at (176633): [<ffffffffa515d91e>]
__irq_exit_rcu+0xfe/0x120

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&xa->xa_lock#4);
   <Interrupt>
     lock(&xa->xa_lock#4);

  *** DEADLOCK ***

 2 locks held by test5/1708:
  #0: ffff888127baa498 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at:
      nfs_start_io_read+0x28/0x90 [nfs]
  #1: ffff888127baa650 (mapping.invalidate_lock#3){.+.+}-{4:4}, at:
      page_cache_ra_unbounded+0xa4/0x280

 stack backtrace:
 CPU: 6 PID: 1708 Comm: test5 Kdump: loaded Not tainted 6.7.0-lockdbg+
 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-1.fc39
04/01/2014
 Call Trace:
  dump_stack_lvl+0x5b/0x90
  mark_lock+0xb3f/0xd20
  __lock_acquire+0x77b/0x3360
  _raw_spin_lock+0x34/0x80
  nfs_netfs_issue_read+0x1b2/0x4b0 [nfs]
  netfs_begin_read+0x77f/0x980 [netfs]
  nfs_netfs_readahead+0x45/0x60 [nfs]
  nfs_readahead+0x323/0x5a0 [nfs]
  read_pages+0xf3/0x5c0
  page_cache_ra_unbounded+0x1c8/0x280
  filemap_get_pages+0x38c/0xae0
  filemap_read+0x206/0x5e0
  nfs_file_read+0xb7/0x140 [nfs]
  vfs_read+0x2a9/0x460
  ksys_read+0xb7/0x140

Fixes: 000dbe0 ("NFS: Convert buffered read paths to use netfs when fscache is enabled")
Suggested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
RevySR pushed a commit that referenced this issue Apr 2, 2024
…ables.c

syzkaller started to report a warning below [0] after consuming the
commit 4654467 ("netfilter: arptables: allow xtables-nft only
builds").

The change accidentally removed the dependency on NETFILTER_FAMILY_ARP
from IP_NF_ARPTABLES.

If NF_TABLES_ARP is not enabled on Kconfig, NETFILTER_FAMILY_ARP will
be removed and some code necessary for arptables will not be compiled.

  $ grep -E "(NETFILTER_FAMILY_ARP|IP_NF_ARPTABLES|NF_TABLES_ARP)" .config
  CONFIG_NETFILTER_FAMILY_ARP=y
  # CONFIG_NF_TABLES_ARP is not set
  CONFIG_IP_NF_ARPTABLES=y

  $ make olddefconfig

  $ grep -E "(NETFILTER_FAMILY_ARP|IP_NF_ARPTABLES|NF_TABLES_ARP)" .config
  # CONFIG_NF_TABLES_ARP is not set
  CONFIG_IP_NF_ARPTABLES=y

So, when nf_register_net_hooks() is called for arptables, it will
trigger the splat below.

Now IP_NF_ARPTABLES is only enabled by IP_NF_ARPFILTER, so let's
restore the dependency on NETFILTER_FAMILY_ARP in IP_NF_ARPFILTER.

[0]:
WARNING: CPU: 0 PID: 242 at net/netfilter/core.c:316 nf_hook_entry_head+0x1e1/0x2c0 net/netfilter/core.c:316
Modules linked in:
CPU: 0 PID: 242 Comm: syz-executor.0 Not tainted 6.8.0-12821-g537c2e91d354 #10
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
RIP: 0010:nf_hook_entry_head+0x1e1/0x2c0 net/netfilter/core.c:316
Code: 83 fd 04 0f 87 bc 00 00 00 e8 5b 84 83 fd 4d 8d ac ec a8 0b 00 00 e8 4e 84 83 fd 4c 89 e8 5b 5d 41 5c 41 5d c3 e8 3f 84 83 fd <0f> 0b e8 38 84 83 fd 45 31 ed 5b 5d 4c 89 e8 41 5c 41 5d c3 e8 26
RSP: 0018:ffffc90000b8f6e8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000003 RCX: ffffffff83c42164
RDX: ffff888106851180 RSI: ffffffff83c42321 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000005 R09: 000000000000000a
R10: 0000000000000003 R11: ffff8881055c2f00 R12: ffff888112b78000
R13: 0000000000000000 R14: ffff8881055c2f00 R15: ffff8881055c2f00
FS:  00007f377bd78800(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000496068 CR3: 000000011298b003 CR4: 0000000000770ef0
PKRU: 55555554
Call Trace:
 <TASK>
 __nf_register_net_hook+0xcd/0x7a0 net/netfilter/core.c:428
 nf_register_net_hook+0x116/0x170 net/netfilter/core.c:578
 nf_register_net_hooks+0x5d/0xc0 net/netfilter/core.c:594
 arpt_register_table+0x250/0x420 net/ipv4/netfilter/arp_tables.c:1553
 arptable_filter_table_init+0x41/0x60 net/ipv4/netfilter/arptable_filter.c:39
 xt_find_table_lock+0x2e9/0x4b0 net/netfilter/x_tables.c:1260
 xt_request_find_table_lock+0x2b/0xe0 net/netfilter/x_tables.c:1285
 get_info+0x169/0x5c0 net/ipv4/netfilter/arp_tables.c:808
 do_arpt_get_ctl+0x3f9/0x830 net/ipv4/netfilter/arp_tables.c:1444
 nf_getsockopt+0x76/0xd0 net/netfilter/nf_sockopt.c:116
 ip_getsockopt+0x17d/0x1c0 net/ipv4/ip_sockglue.c:1777
 tcp_getsockopt+0x99/0x100 net/ipv4/tcp.c:4373
 do_sock_getsockopt+0x279/0x360 net/socket.c:2373
 __sys_getsockopt+0x115/0x1e0 net/socket.c:2402
 __do_sys_getsockopt net/socket.c:2412 [inline]
 __se_sys_getsockopt net/socket.c:2409 [inline]
 __x64_sys_getsockopt+0xbd/0x150 net/socket.c:2409
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x4f/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x46/0x4e
RIP: 0033:0x7f377beca6fe
Code: 1f 44 00 00 48 8b 15 01 97 0a 00 f7 d8 64 89 02 b8 ff ff ff ff eb b8 0f 1f 44 00 00 f3 0f 1e fa 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 0a c3 66 0f 1f 84 00 00 00 00 00 48 8b 15 c9
RSP: 002b:00000000005df728 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00000000004966e0 RCX: 00007f377beca6fe
RDX: 0000000000000060 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 000000000042938a R08: 00000000005df73c R09: 00000000005df800
R10: 00000000004966e8 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000496068 R14: 0000000000000003 R15: 00000000004bc9d8
 </TASK>

Fixes: 4654467 ("netfilter: arptables: allow xtables-nft only builds")
Reported-by: syzkaller <syzkaller@googlegroups.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
RevySR pushed a commit that referenced this issue May 16, 2024
vhost_worker will call tun call backs to receive packets. If too many
illegal packets arrives, tun_do_read will keep dumping packet contents.
When console is enabled, it will costs much more cpu time to dump
packet and soft lockup will be detected.

net_ratelimit mechanism can be used to limit the dumping rate.

PID: 33036    TASK: ffff949da6f20000  CPU: 23   COMMAND: "vhost-32980"
 #0 [fffffe00003fce50] crash_nmi_callback at ffffffff89249253
 #1 [fffffe00003fce58] nmi_handle at ffffffff89225fa3
 #2 [fffffe00003fceb0] default_do_nmi at ffffffff8922642e
 #3 [fffffe00003fced0] do_nmi at ffffffff8922660d
 #4 [fffffe00003fcef0] end_repeat_nmi at ffffffff89c01663
    [exception RIP: io_serial_in+20]
    RIP: ffffffff89792594  RSP: ffffa655314979e8  RFLAGS: 00000002
    RAX: ffffffff89792500  RBX: ffffffff8af428a0  RCX: 0000000000000000
    RDX: 00000000000003fd  RSI: 0000000000000005  RDI: ffffffff8af428a0
    RBP: 0000000000002710   R8: 0000000000000004   R9: 000000000000000f
    R10: 0000000000000000  R11: ffffffff8acbf64f  R12: 0000000000000020
    R13: ffffffff8acbf698  R14: 0000000000000058  R15: 0000000000000000
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 #5 [ffffa655314979e8] io_serial_in at ffffffff89792594
 #6 [ffffa655314979e8] wait_for_xmitr at ffffffff89793470
 #7 [ffffa65531497a08] serial8250_console_putchar at ffffffff897934f6
 #8 [ffffa65531497a20] uart_console_write at ffffffff8978b605
 #9 [ffffa65531497a48] serial8250_console_write at ffffffff89796558
 #10 [ffffa65531497ac8] console_unlock at ffffffff89316124
 #11 [ffffa65531497b10] vprintk_emit at ffffffff89317c07
 #12 [ffffa65531497b68] printk at ffffffff89318306
 #13 [ffffa65531497bc8] print_hex_dump at ffffffff89650765
 torvalds#14 [ffffa65531497ca8] tun_do_read at ffffffffc0b06c27 [tun]
 torvalds#15 [ffffa65531497d38] tun_recvmsg at ffffffffc0b06e34 [tun]
 torvalds#16 [ffffa65531497d68] handle_rx at ffffffffc0c5d682 [vhost_net]
 torvalds#17 [ffffa65531497ed0] vhost_worker at ffffffffc0c644dc [vhost]
 torvalds#18 [ffffa65531497f10] kthread at ffffffff892d2e72
 torvalds#19 [ffffa65531497f50] ret_from_fork at ffffffff89c0022f

Fixes: ef3db4a ("tun: avoid BUG, dump packet on GSO errors")
Signed-off-by: Lei Chen <lei.chen@smartx.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/20240415020247.2207781-1-lei.chen@smartx.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
RevySR pushed a commit that referenced this issue Jul 29, 2024
commit be346c1 upstream.

The code in ocfs2_dio_end_io_write() estimates number of necessary
transaction credits using ocfs2_calc_extend_credits().  This however does
not take into account that the IO could be arbitrarily large and can
contain arbitrary number of extents.

Extent tree manipulations do often extend the current transaction but not
in all of the cases.  For example if we have only single block extents in
the tree, ocfs2_mark_extent_written() will end up calling
ocfs2_replace_extent_rec() all the time and we will never extend the
current transaction and eventually exhaust all the transaction credits if
the IO contains many single block extents.  Once that happens a
WARN_ON(jbd2_handle_buffer_credits(handle) <= 0) is triggered in
jbd2_journal_dirty_metadata() and subsequently OCFS2 aborts in response to
this error.  This was actually triggered by one of our customers on a
heavily fragmented OCFS2 filesystem.

To fix the issue make sure the transaction always has enough credits for
one extent insert before each call of ocfs2_mark_extent_written().

Heming Zhao said:

------
PANIC: "Kernel panic - not syncing: OCFS2: (device dm-1): panic forced after error"

PID: xxx  TASK: xxxx  CPU: 5  COMMAND: "SubmitThread-CA"
  #0 machine_kexec at ffffffff8c069932
  #1 __crash_kexec at ffffffff8c1338fa
  #2 panic at ffffffff8c1d69b9
  #3 ocfs2_handle_error at ffffffffc0c86c0c [ocfs2]
  #4 __ocfs2_abort at ffffffffc0c88387 [ocfs2]
  #5 ocfs2_journal_dirty at ffffffffc0c51e98 [ocfs2]
  #6 ocfs2_split_extent at ffffffffc0c27ea3 [ocfs2]
  #7 ocfs2_change_extent_flag at ffffffffc0c28053 [ocfs2]
  #8 ocfs2_mark_extent_written at ffffffffc0c28347 [ocfs2]
  #9 ocfs2_dio_end_io_write at ffffffffc0c2bef9 [ocfs2]
#10 ocfs2_dio_end_io at ffffffffc0c2c0f5 [ocfs2]
#11 dio_complete at ffffffff8c2b9fa7
#12 do_blockdev_direct_IO at ffffffff8c2bc09f
#13 ocfs2_direct_IO at ffffffffc0c2b653 [ocfs2]
torvalds#14 generic_file_direct_write at ffffffff8c1dcf14
torvalds#15 __generic_file_write_iter at ffffffff8c1dd07b
torvalds#16 ocfs2_file_write_iter at ffffffffc0c49f1f [ocfs2]
torvalds#17 aio_write at ffffffff8c2cc72e
torvalds#18 kmem_cache_alloc at ffffffff8c248dde
torvalds#19 do_io_submit at ffffffff8c2ccada
torvalds#20 do_syscall_64 at ffffffff8c004984
torvalds#21 entry_SYSCALL_64_after_hwframe at ffffffff8c8000ba

Link: https://lkml.kernel.org/r/20240617095543.6971-1-jack@suse.cz
Link: https://lkml.kernel.org/r/20240614145243.8837-1-jack@suse.cz
Fixes: c15471f ("ocfs2: fix sparse file & data ordering issue in direct io")
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
RevySR pushed a commit that referenced this issue Sep 21, 2024
[ Upstream commit a699781 ]

A sysfs reader can race with a device reset or removal, attempting to
read device state when the device is not actually present. eg:

     [exception RIP: qed_get_current_link+17]
  #8 [ffffb9e4f2907c48] qede_get_link_ksettings at ffffffffc07a994a [qede]
  #9 [ffffb9e4f2907cd8] __rh_call_get_link_ksettings at ffffffff992b01a3
 #10 [ffffb9e4f2907d38] __ethtool_get_link_ksettings at ffffffff992b04e4
 #11 [ffffb9e4f2907d90] duplex_show at ffffffff99260300
 #12 [ffffb9e4f2907e38] dev_attr_show at ffffffff9905a01c
 #13 [ffffb9e4f2907e50] sysfs_kf_seq_show at ffffffff98e0145b
 torvalds#14 [ffffb9e4f2907e68] seq_read at ffffffff98d902e3
 torvalds#15 [ffffb9e4f2907ec8] vfs_read at ffffffff98d657d1
 torvalds#16 [ffffb9e4f2907f00] ksys_read at ffffffff98d65c3f
 torvalds#17 [ffffb9e4f2907f38] do_syscall_64 at ffffffff98a052fb

 crash> struct net_device.state ffff9a9d21336000
    state = 5,

state 5 is __LINK_STATE_START (0b1) and __LINK_STATE_NOCARRIER (0b100).
The device is not present, note lack of __LINK_STATE_PRESENT (0b10).

This is the same sort of panic as observed in commit 4224cfd
("net-sysfs: add check for netdevice being present to speed_show").

There are many other callers of __ethtool_get_link_ksettings() which
don't have a device presence check.

Move this check into ethtool to protect all callers.

Fixes: d519e17 ("net: export device speed and duplex via sysfs")
Fixes: 4224cfd ("net-sysfs: add check for netdevice being present to speed_show")
Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Link: https://patch.msgid.link/8bae218864beaa44ed01628140475b9bf641c5b0.1724393671.git.jamie.bainbridge@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant