Ivan Semenov ff3206d218 mmc: core: Fix eMMC initialization with 1-bit bus connection
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: 577fb13199b1 ("mmc: rework selection of bus speed mode")
Cc: stable@vger.kernel.org
Signed-off-by: Ivan Semenov <ivan@semenov.dev>
Link: https://lore.kernel.org/r/20240206172845.34316-1-ivan@semenov.dev
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2024-02-13 23:45:44 +01:00
..
2024-01-12 11:32:19 -08:00
2024-01-18 17:25:39 -08:00
2024-02-10 08:02:48 -08:00
2024-01-18 11:37:24 -08:00
2024-02-09 10:40:50 -08:00
2024-01-10 08:45:22 -08:00
2024-01-18 09:48:40 -08:00
2024-02-09 10:40:50 -08:00
2024-01-18 11:37:24 -08:00
2024-01-18 11:37:24 -08:00
2024-01-09 16:32:11 -08:00
2024-01-18 11:37:24 -08:00
2024-01-12 13:52:21 -08:00
2024-02-02 12:52:44 -08:00
2024-01-18 11:37:24 -08:00
2024-01-10 16:43:55 -08:00
2024-01-17 15:25:27 -08:00
2024-02-02 12:33:50 -05:00
2024-01-18 15:16:57 -08:00
2024-01-18 11:37:24 -08:00
2024-02-08 12:03:02 +01:00
2024-01-18 16:44:03 -08:00
2024-01-18 15:16:57 -08:00
2024-01-05 15:55:41 +05:30
2024-02-09 10:37:59 -08:00
2024-01-09 16:12:44 -08:00
2024-01-17 14:37:40 -08:00
2024-01-11 11:31:46 -08:00
2024-01-18 17:08:31 -08:00
2024-01-20 09:42:32 -08:00
2024-01-04 17:03:47 +01:00
2024-02-02 08:36:38 -08:00
2024-01-18 16:44:03 -08:00
2024-01-18 15:57:25 -08:00
2024-01-18 16:44:03 -08:00
2024-01-18 16:44:03 -08:00
2024-01-12 13:32:30 -08:00
2024-01-17 13:41:38 -08:00
2024-01-12 12:38:37 +01:00