mmc: Speed up reboot with an absent card
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
N.B.:
- This is Friday afternoon patch, posted so that people can take a look at it.
- Even with this patch there can be stalls of up to 10 seconds - however long it takes for the current outstanding command to timeout.
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:
Problem could have occured from the system being unstable and hanging often even when using simple commands like dmesg.
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.
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