linux icon indicating copy to clipboard operation
linux copied to clipboard

CM5 Lite excessive reboot/shutdown delay if SD card is not present

Open mairas opened this issue 4 months ago • 2 comments

Describe the bug

Discussed on this forum post: https://forums.raspberrypi.com/viewtopic.php?t=383051

A device using a CM5 Lite (in my case, HALPI2) and an NVMe will have a delay of up to 80 seconds at shutdown or reboot if an SD card is not inserted. With an SD card inserted (doesn't need to be formatted, just present) shutdowns are immediate.

Steps to reproduce the behaviour

With a CM5 Lite inserted on a HALPI2 or (as reported in the forum thread) the standard CM5 IO Board:

  • Flash on OS on an NVMe drive
  • Ramp up the kernel logging: systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M enforcing=0 ignore_loglevel
  • Issue command: sudo reboot
  • The system will rapidly perform other reboot steps and then remain stuck in "Powering off" for a long time.

Device (s)

Raspberry Pi CM5 Lite

System

Raspinfo output attached.

raspinfo.log

Logs

Didn't have UART logging set up, so there's just a bad photo. The system is stuck here for 10-80 seconds or even more.

Image

Additional context

No response

mairas avatar Aug 25 '25 11:08 mairas

Related to / same as https://github.com/raspberrypi/linux/issues/6647 ?

nbuchwitz avatar Aug 25 '25 12:08 nbuchwitz

Related to / same as #6647 ?

Definitely related! In this case, the device just hangs waiting on mmc0 instead of mmc1. However, the required fix would be different. The SD card interface has valid uses even if it's not the boot disk. @pelwell's suggestion of reducing the kernel retry duration would be one possible approach, although I have no idea what side effects it might have.

Having said that, I have tried using dtparam=sd=off and that is a valid workaround for this issue. I will be enabling that for our pre-configured images - customers that want to use the SD card will have to manually enable the interface.

mairas avatar Aug 26 '25 08:08 mairas