• Ivan Semenov's avatar
    mmc: core: Fix eMMC initialization with 1-bit bus connection · ff3206d2
    Ivan Semenov authored
    Initializing an eMMC that's connected via a 1-bit bus is current failing,
    if the HW (DT) informs that 4-bit bus is supported. In fact this is a
    regression, as we were earlier capable of falling back to 1-bit mode, when
    switching to 4/8-bit bus failed. Therefore, let's restore the behaviour.
    
    Log for Samsung eMMC 5.1 chip connected via 1bit bus (only D0 pin)
    Before patch:
    [134509.044225] mmc0: switch to bus width 4 failed
    [134509.044509] mmc0: new high speed MMC card at address 0001
    [134509.054594] mmcblk0: mmc0:0001 BGUF4R 29.1 GiB
    [134509.281602] mmc0: switch to bus width 4 failed
    [134509.282638] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [134509.282657] Buffer I/O error on dev mmcblk0, logical block 0, async page read
    [134509.284598] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [134509.284602] Buffer I/O error on dev mmcblk0, logical block 0, async page read
    [134509.284609] ldm_validate_partition_table(): Disk read failed.
    [134509.286495] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [134509.286500] Buffer I/O error on dev mmcblk0, logical block 0, async page read
    [134509.288303] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [134509.288308] Buffer I/O error on dev mmcblk0, logical block 0, async page read
    [134509.289540] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [134509.289544] Buffer I/O error on dev mmcblk0, logical block 0, async page read
    [134509.289553]  mmcblk0: unable to read partition table
    [134509.289728] mmcblk0boot0: mmc0:0001 BGUF4R 31.9 MiB
    [134509.290283] mmcblk0boot1: mmc0:0001 BGUF4R 31.9 MiB
    [134509.294577] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
    [134509.295835] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
    [134509.295841] Buffer I/O error on dev mmcblk0, logical block 0, async page read
    
    After patch:
    
    [134551.089613] mmc0: switch to bus width 4 failed
    [134551.090377] mmc0: new high speed MMC card at address 0001
    [134551.102271] mmcblk0: mmc0:0001 BGUF4R 29.1 GiB
    [134551.113365]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21
    [134551.114262] mmcblk0boot0: mmc0:0001 BGUF4R 31.9 MiB
    [134551.114925] mmcblk0boot1: mmc0:0001 BGUF4R 31.9 MiB
    
    Fixes: 577fb131 ("mmc: rework selection of bus speed mode")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarIvan Semenov <ivan@semenov.dev>
    Link: https://lore.kernel.org/r/20240206172845.34316-1-ivan@semenov.devSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    ff3206d2
mmc.c 62.1 KB