With the original file I see this:
pcilib: sysfs_read_vpd: read failed: Input/output error
In the modified kernel I saw this instead:
lspci: Unable to load libkmod resources: error -12
The two are quite different. It looks like there is an i/o error in the original kernel, but you never get to see that on the modified kernel due to something in the module loading. The idea of modifying the kernel to get more debug output is correct, but something in the new build configuration and module content was incorrect.
Note that I am also assuming this code is not used during boot stages, and thus no module issue within an initrd is being considered; this is purely from once booted into the Linux kernel to your actual “persistent storage” (eMMC, NVMe, SD card, so on).
The writeb()
function does not have a return value. This just writes one byte to an address. If that address is for a hardware driver, then this would typically be a physical address; when an MMU is used, then this might go through the MMU, but the virtual address might map directly to the physical address. If you can modify the kernel to printk information before and after that point, and see if this is the specific failure point, then you are closer. You might need to add “printk.synchronous=1
” to the APPEND
key/value pair in “/boot/extlinux/extlinux.conf
” to force buffering to not run the printk
into the logs out of order (normally it is buffered and not synchronous). You would be interested in the printk
showing the address the write goes to (p + UART_EXAR_RXTRG
); the value being written is hard coded, the real question is what address is this failing to write to (if that is the failure point).
Some interesting reference pages:
https://kernelnewbies.org/IoMemoryAccess
https://linux.die.net/man/1/systasks (search for writeb
)