rootwait regression in linux-next

From: Fabio Estevam
Date: Tue Jun 06 2023 - 13:10:01 EST


Hi Christoph,

I observe the following boot regression in linux-next 20230606:

[ 1.757719] ALSA device list:
[ 1.760705] No soundcards found.
[ 1.774453] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using ADMA
[ 1.786190] Disabling rootwait; root= is invalid.
[ 1.792548] /dev/root: Can't open blockdev
[ 1.796689] VFS: Cannot open root device "/dev/mmcblk1p1" or
unknown-block(0,0): error -6
[ 1.804886] Please append a correct "root=" boot option; here are
the available partitions:
[ 1.813270] 1f00 32768 mtdblock0

Kernel command line: root=/dev/mmcblk1p1 rw rootwait

If I try an ugly hack like this:

--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -412,7 +412,7 @@ static dev_t __init parse_root_device(char
*root_device_name)
return Root_RAM0;

error = early_lookup_bdev(root_device_name, &dev);
- if (error) {
+ if (0) {
if (error == -EINVAL && root_wait) {
pr_err("Disabling rootwait; root= is invalid.\n");
root_wait = 0;

Then the board boots fine:

[ 1.790845] Waiting for root device /dev/mmcblk1p1...
[ 2.058169] mmc1: host does not support reading read-only switch,
assuming write-enable
[ 2.097079] mmc1: new ultra high speed SDR104 SDHC card at address aaaa
[ 2.104925] mmcblk1: mmc1:aaaa SP32G 29.7 GiB
[ 2.113269] mmcblk1: p1 p2 p3
[ 2.154538] EXT4-fs (mmcblk1p1): recovery complete
[ 2.160651] EXT4-fs (mmcblk1p1): mounted filesystem
3e7994a8-04cb-45d2-a6f5-64462aa0ea05 r/w with ordered data mode. Quota
mode: none.
[ 2.172828] VFS: Mounted root (ext4 filesystem) on device 179:97.

What is the appropriate fix for this issue?

Thanks