Fixing USB HDD I/O errors on my Raspberry Pi 5
After a routine apt update && apt upgrade and reboot, my Pi 5 stopped seeing the USB HDD I keep /mnt/hd mounted on. It showed up fine on lsusb, but blkid had nothing. First boot attempt, dmesg showed the drive just never finishing spin-up:
sd 0:0:0:0: [sda] Spinning up disk...
..................................................................................................not responding...
sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x00 driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] Sense Key : 0x2 [current]
sd 0:0:0:0: [sda] ASC=0x4 ASCQ=0x1
sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
...
sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=DRIVER_OK cmd_age=0s
sd 0:0:0:0: [sda] tag#0 Sense Key : 0xb [current]
sd 0:0:0:0: [sda] tag#0 ASC=0x47 ASCQ=0x3
I/O error, dev sda, sector 4096 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
What did fix it: adding pcie_aspm=off to /boot/firmware/cmdline.txt and rebooting.
I am pretty sure the system update broke things, not sure exactly why.
These other issues (1, 2) were the closest - but not exactly same - I came across and that is why I decided to try the pice_aspm change.
The price to set this config off is related to power management savings on the periferals on the pcie bus.