Bug#1030853: armv5tel + uboot: update-initramfs triggers flash-kernel to always write latest kernel version

2023-02-08 Thread Peter Nagel

Package: initramfs-tools
Version: 0.140
Severity: normal
X-Debbugs-Cc: peter.na...@kit.edu

Dear Maintainer,

when using uboot ... update-initramfs triggers flash-kernel to _always_ 
write latest kernel version into flash-memory.
Even if this might be helpful in many cases ... there are situations 
where this behavior is unexpected.


Assume that a user want to do a quick test with the latest kernel 
version from backports.
Using apt to install the new kernel version will trigger flash-kernel 
which writes the latest kernel version into flash memory which is most 
likely the expected behavior.
After reboot the system will boot the new kernel and the user can 
perform some tests.


How to get back to the original (stable) kernel?
1) Using 'apt remove linux-image-6.0.0-0.deb11.6-marvell' will will 
through a warning and actually does not work (at least not on my system).


2) Using 'update-initramfs -u -k 5.10.0-21-marvell' triggers 
flash-kernel but refuses to write kernel 5.10.0-21-marvell to flash 
memory - instead the latest kernel version 6.0.0-0.deb11.6-marvell is 
used (see output below). Interestingly, the output suggest to use the 
--force option ... however, this option is not available for 
update-initramfs.


3) Using 'flash-kernel --force 5.10.0-21-marvell' is working fine - it 
just writes the stable kernel back into flash memory (which will be 
started after reboot). However, whenever update-initramfs is 
(automatically) triggered it will rewrite the unstable kernel version 
into flash memory which is not really expected.


4) A workaround (after using method 3) would be to remove kernel 6.0 via 
apt which works fine - however, this will again trigger flash-kernel to 
rewrite kernel 5.10 into flash memory which would not have been 
necessary (since it was already written into flash memory).


Additional information:
Writing into flash memory can take quite some time (e.g. 15 minutes in 
my case). Unexpected flashing or flashing the 'wrong' kernel should 
therefore be avoided.



Possible solutions for this problem:
  * update-initramfs is asking if flash-kernel should be triggered or not
  * update-initramfs allows to select the kernel version which is 
written to flash memory
  * update-initramfs provides (while running) a menu to select the 
kernel version (including default) which is written to flash memory.

  * other solutions ...


Output of 'update-initramfs -u -k 5.10.0-21-marvell':
update-initramfs: Generating /boot/initrd.img-5.10.0-21-marvell
kirkwood-qnap: machine: QNAP TS419 family
Using DTB: kirkwood-ts419-6282.dtb
Installing 
/usr/lib/linux-image-5.10.0-21-marvell/kirkwood-ts419-6282.dtb into 
/boot/dtbs/5.10.0-21-marvell/./kirkwood-ts419-6282.dtb

Taking backup of kirkwood-ts419-6282.dtb.
Installing new kirkwood-ts419-6282.dtb.
Ignoring old or unknown version 5.10.0-21-marvell (latest is 
6.0.0-0.deb11.6-marvell)

Use --force if you want version 5.10.0-21-marvell.
Installing 
/usr/lib/linux-image-6.0.0-0.deb11.6-marvell/kirkwood-ts419-6282.dtb 
into /boot/dtbs/6.0.0-0.deb11.6-marvell/./kirkwood-ts419-6282.dtb

Taking backup of kirkwood-ts419-6282.dtb.
Installing new kirkwood-ts419-6282.dtb.
flash-kernel: installing version 6.0.0-0.deb11.6-marvell
flash-kernel: appending 
/usr/lib/linux-image-6.0.0-0.deb11.6-marvell/kirkwood-ts419-6282.dtb to 
kernel

Generating kernel u-boot image... done.
Flashing kernel (using 2609102/3145728 bytes)... done.
Flashing initramfs (using 6465055/12582912 bytes)... done.



-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 6.2M Jan 17 18:30 /boot/initrd.img-5.10.0-20-marvell
-rw-r--r-- 1 root root 6.2M Feb 8 10:52 /boot/initrd.img-5.10.0-21-marvell
-- /proc/cmdline
console=ttyS0,115200 root=/dev/ram initrd=0xb0,0xc0 
ramdisk=34816 mem=768M 
cmdlinepart.mtdparts=spi0.0:512k@0(uboot)ro,3M@0x10(Kernel),12M@0x40(RootFS1),2M@0x20(Kernel_legacy),256k@0x8(U-Boot_Config),256k@0xc(NAS_Config) 
mtdparts=spi0.0:512k@0(uboot)ro,3M@0x10(Kernel),12M@0x40(RootFS1),2M@0x20(Kernel_legacy),256k@0x8(U-Boot_Config),256k@0xc(NAS_Config)


-- resume
RESUME=UUID=ab2b48ae-e256-4a0b-9de8-f811fb014c44
-- /proc/filesystems
ext3
ext2
ext4
fuseblk

-- lsmod
Module Size Used by
nf_log_ipv6 16384 1
nf_log_ipv4 16384 1
nf_log_common 16384 2 nf_log_ipv6,nf_log_ipv4
nft_limit 16384 2
nft_counter 16384 29
xt_LOG 20480 2
xt_limit 16384 0
xt_tcpudp 20480 1
xt_state 16384 0
xt_conntrack 16384 8
nf_conntrack 114688 2 xt_state,xt_conntrack
nf_defrag_ipv6 24576 1 nf_conntrack
nf_defrag_ipv4 16384 1 nf_conntrack
nft_compat 20480 16
nf_tables 163840 106 nft_limit,nft_compat,nft_counter
nfnetlink 16384 2 nft_compat,nf_tables
ofpart 20480 0
cmdlinepart 16384 0
spi_nor 61440 0
mtd 61440 9 spi_nor,ofpart,cmdlinepart
marvell 24576 2
ehci_orion 20480 0
mvmdio 16384 0
mv643xx_eth 36864 0
ehci_hcd 61440 1 ehci_orion
marvell_cesa 36864 0
libdes 28672 1 marvell_cesa
libaes 16384 1 marvell_cesa
orion_wdt 16384 0
watchdog 20480 1 

Bug#1029684: latest kernel version does not solve the problem

2023-02-06 Thread Peter Nagel

I also tried a newer kernel version e.g.

  *   5.19.0-0.deb11.2-marvell
  *   6.0.0-0.deb11.6-marvell

which does not solve the problem - kernel Warning during boot is still 
there.




Bug#1029684: disabling xhci prevents kernel warning

2023-02-03 Thread Peter Nagel
I found that the kernel warning disappears when I prevent the modules 
*xhci_pci* and *xhci_hcd* from being loaded during boot.


Bug#1029684: linux-5.10.0-21-marvell (armv5tel) -> WARNING: CPU: 0 at include/linux/msi.h:219

2023-01-26 Thread Peter Nagel

Package: src:linux
Version: 5.10.162-1
Severity: normal


Dear Maintainer,

after installtion of Debian bullsey on QNAP TS-420U the server is 
booting with a strange warning:


  WARNING: CPU: 0 PID: 230 at include/linux/msi.h:219  (see output of 
dmesg below).


It looks like the system is running fine.
However, even if this warning could savely be ignored, the warning (and 
following lines) looks like a serious problem.

Therefore I'm not sure if this is a bug nor not.


-- Package-specific info:
** Version:
Linux version 5.10.0-21-marvell (debian-kernel@lists.debian.org) (gcc-10 
(Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 
2.35.2) #1 Debian 5.10.162-1 (2023-01-21)



** Command line:
console=ttyS0,115200 root=/dev/ram initrd=0xb0,0xc0 
ramdisk=34816 mem=768M 
cmdlinepart.mtdparts=spi0.0:512k@0(uboot)ro,3M@0x10(Kernel),12M@0x40(RootFS1),2M@0x20(Kernel_legacy),256k@0x8(U-Boot_Config),256k@0xc(NAS_Config) 
mtdparts=spi0.0:512k@0(uboot)ro,3M@0x10(Kernel),12M@0x40(RootFS1),2M@0x20(Kernel_legacy),256k@0x8(U-Boot_Config),256k@0xc(NAS_Config)



** Tainted: W (512)
 * kernel issued warning


** Output of dmesg:
...
[   14.474034] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   14.487761] [ cut here ]
[   14.492437] WARNING: CPU: 0 PID: 238 at include/linux/msi.h:219 
pci_msi_setup_msi_irqs+0x60/0x70
[   14.501285] Modules linked in: ehci_hcd(+) libdes libaes orion_wdt(+) 
watchdog xhci_pci(+) xhci_hcd spi_orion kirkwood_thermal sg usbcore 
usb_common nls_base evdev gpio_keys fuse configfs ip_tables x_tables 
hmac ipv6 autofs4 ext4 crc16 mbcache jbd2 raid10 raid0 multipath linear 
raid456 libcrc32c crc32c_generic async_raid6_recov async_memcpy async_pq 
async_xor xor async_tx raid6_pq raid1 md_mod sd_mod t10_pi crc_t10dif 
crct10dif_generic crct10dif_common sata_mv libata rtc_s35390a scsi_mod
[   14.544822] CPU: 0 PID: 238 Comm: systemd-udevd Not tainted 
5.10.0-21-marvell #1 Debian 5.10.162-1

[   14.553833] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[   14.560159] [] (unwind_backtrace) from [] 
(show_stack+0x18/0x1c)
[   14.567960] [] (show_stack) from [] 
(__warn+0xc4/0xf0)
[   14.574890] [] (__warn) from [] 
(warn_slowpath_fmt+0x70/0x90)
[   14.582426] [] (warn_slowpath_fmt) from [] 
(pci_msi_setup_msi_irqs+0x60/0x70)
[   14.591363] [] (pci_msi_setup_msi_irqs) from [] 
(__pci_enable_msi_range+0x240/0x334)
[   14.600911] [] (__pci_enable_msi_range) from [] 
(pci_alloc_irq_vectors_affinity+0xc0/0x104)
[   14.611145] [] (pci_alloc_irq_vectors_affinity) from 
[] (xhci_run+0x16c/0x484 [xhci_hcd])
[   14.621269] [] (xhci_run [xhci_hcd]) from [] 
(usb_add_hcd+0x444/0x618 [usbcore])
[   14.630578] [] (usb_add_hcd [usbcore]) from [] 
(usb_hcd_pci_probe+0x32c/0x39c [usbcore])
[   14.640536] [] (usb_hcd_pci_probe [usbcore]) from 
[] (xhci_pci_probe+0x18/0xf4 [xhci_pci])
[   14.650622] [] (xhci_pci_probe [xhci_pci]) from 
[] (pci_device_probe+0x84/0xf4)
[   14.659729] [] (pci_device_probe) from [] 
(really_probe+0x274/0x488)
[   14.667880] [] (really_probe) from [] 
(device_driver_attach+0x4c/0x64)
[   14.676198] [] (device_driver_attach) from [] 
(__driver_attach+0x88/0x13c)
[   14.684864] [] (__driver_attach) from [] 
(bus_for_each_dev+0x5c/0x80)
[   14.693096] [] (bus_for_each_dev) from [] 
(bus_add_driver+0xd4/0x1f0)
[   14.701329] [] (bus_add_driver) from [] 
(driver_register+0xb4/0xf8)
[   14.709387] [] (driver_register) from [] 
(do_one_initcall+0x64/0x1a4)
[   14.717621] [] (do_one_initcall) from [] 
(do_init_module+0x44/0x1e0)
[   14.725772] [] (do_init_module) from [] 
(sys_finit_module+0xbc/0xd0)
[   14.733915] [] (sys_finit_module) from [] 
(__sys_trace_return+0x0/0x1c)

[   14.742313] Exception stack(0xc29b7fa8 to 0xc29b7ff0)
[   14.747401] 7fa0: b6fa513c 00d592e0 0012 b6fa3f38  b6fa4cb0
[   14.755636] 7fc0: b6fa513c 00d592e0 7c66f200 017b 00d3f620 
00593227 00593298 00d592e0

[   14.763862] 7fe0: be9936f0 be9936e0 b6f9bc64 b6e40160
[   14.768943] ---[ end trace b3c77c9a5fdd87b6 ]---
[   14.773591] [ cut here ]
[   14.778246] WARNING: CPU: 0 PID: 238 at include/linux/msi.h:225 
free_msi_irqs+0x17c/0x18c
[   14.786468] Modules linked in: ehci_hcd(+) libdes libaes orion_wdt(+) 
watchdog xhci_pci(+) xhci_hcd spi_orion kirkwood_thermal sg usbcore 
usb_common nls_base evdev gpio_keys fuse configfs ip_tables x_tables 
hmac ipv6 autofs4 ext4 crc16 mbcache jbd2 raid10 raid0 multipath linear 
raid456 libcrc32c crc32c_generic async_raid6_recov async_memcpy async_pq 
async_xor xor async_tx raid6_pq raid1 md_mod sd_mod t10_pi crc_t10dif 
crct10dif_generic crct10dif_common sata_mv libata rtc_s35390a scsi_mod
[   14.829979] CPU: 0 PID: 238 Comm: systemd-udevd Tainted: G    
W 5.10.0-21-marvell #1 Debian 5.10.162-1

[   14.840385] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[   14.846701] [] (unwind_backtrace) from []