kernel_samsung_a53x/drivers/mmc/core
Ivan Semenov 19388cb3a2 mmc: core: Fix eMMC initialization with 1-bit bus connection
commit ff3206d2186d84e4f77e1378ba1d225633f17b9b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 23:18:29 +01:00
..
block.c mmc: core: Use mrq.sbc in close-ended ffu 2024-11-18 12:12:58 +01:00
block.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
card.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core.c mmc: block: Be sure to wait while busy in CQE error recovery 2024-11-18 12:11:47 +01:00
core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
host.c mmc: core: Cancel delayed work before releasing host 2024-11-18 12:12:08 +01:00
host.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc.c mmc: core: Fix eMMC initialization with 1-bit bus connection 2024-11-18 23:18:29 +01:00
mmc_ops.c mmc: block: Be sure to wait while busy in CQE error recovery 2024-11-18 12:11:47 +01:00
mmc_ops.h mmc: block: Be sure to wait while busy in CQE error recovery 2024-11-18 12:11:47 +01:00
mmc_test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pwrseq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pwrseq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pwrseq_emmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pwrseq_sd8787.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pwrseq_simple.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
queue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
queue.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
quirks.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regulator.c mmc: core: add helpers mmc_regulator_enable/disable_vqmmc 2024-11-18 12:11:17 +01:00
sd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sd_ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sd_ops.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio.c mmc: core: sdio: hold retuning if sdio in 1-bit mode 2024-11-08 11:26:18 +01:00
sdio_bus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_bus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_cis.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_cis.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_io.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_irq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_ops.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdio_uart.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
slot-gpio.c mmc: slot-gpio: Allow non-sleeping GPIO ro 2024-11-18 12:13:32 +01:00
slot-gpio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00