linux icon indicating copy to clipboard operation
linux copied to clipboard

mmc: Speed up reboot with an absent card

Open pelwell opened this issue 9 months ago • 4 comments

On devices with no card detect mechanism, the host ends up polling for the insertion of a card. This polling happens at multiple frequencies and with many steps (SDIO, SD, MMC), some of which involve timeouts. If a reboot is requested during one of those scans, it will stall, pointlessly, for up to a minute while it completes.

Attempt to short circuit the rescan if the MMC interface is being removed.

See: https://github.com/raspberrypi/linux/issues/6647

pelwell avatar Mar 28 '25 16:03 pelwell

N.B.:

  1. This is Friday afternoon patch, posted so that people can take a look at it.
  2. Even with this patch there can be stalls of up to 10 seconds - however long it takes for the current outstanding command to timeout.

pelwell avatar Mar 28 '25 17:03 pelwell

Testing with cm5 during startup still getting stuck on systemd-journald.socket for 30-60 seconds and dtparam=sd=off is not detected. seems to be unsuccessfully halting/rebooting without sd card present. still gets stuck for amount a minute. And twice encountering a error like this:

Afbeelding van WhatsApp op 2025-03-31 om 10 07 15_bb5dab3d

Problem could have occured from the system being unstable and hanging often even when using simple commands like dmesg.

hasan-akbulak avatar Mar 31 '25 08:03 hasan-akbulak

That looks like a new crash - I've added a fix for that and another one to this PR, as well as hopefully reducing the maximum stall to 5 seconds.

Wait another 40 minutes before trying to update.

pelwell avatar Mar 31 '25 10:03 pelwell

still stalling on systemd-journal.socket when booting

ssh takes about 30 seconds to connect.

however when booted stalls are less than 5 seconds for commands and halting and when actually halting/rebooting no stalls after disabling wifi bt and sd card ofc.

still sometimes small hangs with commands for 2 seconds during halt/shutdown for example trigger happy when pressing power button

hasan-akbulak avatar Mar 31 '25 12:03 hasan-akbulak