linux-stable/drivers/mmc/core
Dominique Martinet 14db3446d2 mmc: core: Fix switch on gp3 partition
[ Upstream commit 4af59a8df5 ]

Commit e7794c14fd ("mmc: rpmb: fixes pause retune on all RPMB
partitions.") added a mask check for 'part_type', but the mask used was
wrong leading to the code intended for rpmb also being executed for GP3.

On some MMCs (but not all) this would make gp3 partition inaccessible:
armadillo:~# head -c 1 < /dev/mmcblk2gp3
head: standard input: I/O error
armadillo:~# dmesg -c
[  422.976583] mmc2: running CQE recovery
[  423.058182] mmc2: running CQE recovery
[  423.137607] mmc2: running CQE recovery
[  423.137802] blk_update_request: I/O error, dev mmcblk2gp3, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
[  423.237125] mmc2: running CQE recovery
[  423.318206] mmc2: running CQE recovery
[  423.397680] mmc2: running CQE recovery
[  423.397837] blk_update_request: I/O error, dev mmcblk2gp3, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[  423.408287] Buffer I/O error on dev mmcblk2gp3, logical block 0, async page read

the part_type values of interest here are defined as follow:
main  0
boot0 1
boot1 2
rpmb  3
gp0   4
gp1   5
gp2   6
gp3   7

so mask with EXT_CSD_PART_CONFIG_ACC_MASK (7) to correctly identify rpmb

Fixes: e7794c14fd ("mmc: rpmb: fixes pause retune on all RPMB partitions.")
Cc: stable@vger.kernel.org
Cc: Jorge Ramirez-Ortiz <jorge@foundries.io>
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240306-mmc-partswitch-v1-1-bf116985d950@codewreck.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 12:50:06 +02:00
..
Kconfig
Makefile
block.c mmc: core: Fix switch on gp3 partition 2024-04-13 12:50:06 +02:00
block.h
bus.c mmc: cqhci: Fix random crash when remove mmc module/card 2021-03-17 16:43:47 +01:00
bus.h
card.h mmc: core: Cleanup BKOPS support 2022-05-25 09:10:38 +02:00
core.c mmc: block: Be sure to wait while busy in CQE error recovery 2023-12-20 15:38:04 +01:00
core.h mmc: block: Issue a cache flush only when it's enabled 2021-05-22 10:59:13 +02:00
debugfs.c
host.c mmc: core: Cancel delayed work before releasing host 2024-01-15 18:23:43 +01:00
host.h
mmc.c mmc: core: Fix eMMC initialization with 1-bit bus connection 2024-03-06 14:35:23 +00:00
mmc_ops.c mmc: block: Be sure to wait while busy in CQE error recovery 2023-12-20 15:38:04 +01:00
mmc_ops.h mmc: block: Be sure to wait while busy in CQE error recovery 2023-12-20 15:38:04 +01:00
mmc_test.c
pwrseq.c
pwrseq.h
pwrseq_emmc.c
pwrseq_sd8787.c
pwrseq_simple.c
queue.c
queue.h
quirks.h mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M 2023-08-11 11:45:15 +02:00
sd.c mmc: core: Terminate infinite loop in SD-UHS voltage switch 2022-10-26 13:19:17 +02:00
sd.h
sd_ops.c
sd_ops.h
sdio.c mmc: core: sdio: hold retuning if sdio in 1-bit mode 2023-11-08 11:22:14 +01:00
sdio_bus.c mmc: sdio: fix possible resource leaks in some error paths 2023-02-22 12:47:20 +01:00
sdio_bus.h
sdio_cis.c mmc: sdio: fix possible resource leaks in some error paths 2023-02-22 12:47:20 +01:00
sdio_cis.h
sdio_io.c
sdio_irq.c
sdio_ops.c
sdio_ops.h
sdio_uart.c
slot-gpio.c
slot-gpio.h