linux/drivers/mmc/core
Peter Collingbourne b503087445 mmc: core: don't initialize block size from ext_csd if not present
If extended CSD was not available, the eMMC driver would incorrectly
set the block size to 0, as the data_sector_size field of ext_csd
was never initialized. This issue was exposed by commit 817046ecdd
("block: Align max_hw_sectors to logical blocksize") which caused
max_sectors and max_hw_sectors to be set to 0 after setting the block
size to 0, resulting in a kernel panic in bio_split when attempting
to read from the device. Fix it by only reading the block size from
ext_csd if it is available.

Fixes: a5075eb948 ("mmc: block: Allow disabling 512B sector size emulation")
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Link: https://linux-review.googlesource.com/id/If244d178da4d86b52034459438fec295b02d6e60
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210114201405.2934886-1-pcc@google.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-01-15 12:09:15 +01:00
..
block.c mmc: block: Fixup condition for CMD13 polling for RPMB requests 2020-12-04 15:02:27 +01:00
block.h
bus.c mmc: sdio: Export SDIO revision and info strings to userspace 2020-09-07 09:11:29 +02:00
bus.h
card.h
core.c mmc: core: Initial support for SD express card/host 2020-11-16 11:59:28 +01:00
core.h
debugfs.c
host.c mmc: core: Allow setting slot index via device tree alias 2020-09-07 09:11:32 +02:00
host.h mmc: core: Initial support for SD express card/host 2020-11-16 11:59:28 +01:00
Kconfig
Makefile
mmc_ops.c
mmc_ops.h
mmc_test.c mmc: test: remove ambiguity in test description 2020-09-07 09:11:29 +02:00
mmc.c mmc: core: clear 'doing_init_tune' also after failures 2020-09-14 13:57:59 +02:00
pwrseq_emmc.c
pwrseq_sd8787.c
pwrseq_simple.c
pwrseq.c
pwrseq.h
queue.c mmc: core: don't initialize block size from ext_csd if not present 2021-01-15 12:09:15 +01:00
queue.h
quirks.h mmc: core: Mark fixups as __maybe_unused 2020-07-13 12:18:25 +02:00
regulator.c mmc: core: Add missing documetation for 'mmc' and 'ios' 2020-07-13 12:18:25 +02:00
sd_ops.c mmc: core: Initial support for SD express card/host 2020-11-16 11:59:28 +01:00
sd_ops.h mmc: core: Initial support for SD express card/host 2020-11-16 11:59:28 +01:00
sd.c mmc: sd: Use kobj_to_dev() instead of container_of() 2020-09-07 09:11:30 +02:00
sd.h
sdio_bus.c mmc: sdio: Export SDIO revision and info strings to userspace 2020-09-07 09:11:29 +02:00
sdio_bus.h
sdio_cis.c mmc: sdio: Parse CISTPL_VERS_1 major and minor revision numbers 2020-09-07 09:11:28 +02:00
sdio_cis.h
sdio_io.c mmc: core: Provide description for sdio_set_host_pm_flags()'s 'flag' arg 2020-07-13 12:18:25 +02:00
sdio_irq.c
sdio_ops.c mmc: sdio: Use mmc_pre_req() / mmc_post_req() 2020-09-07 08:57:44 +02:00
sdio_ops.h
sdio_uart.c
sdio.c mmc: sdio: Export SDIO revision and info strings to userspace 2020-09-07 09:11:29 +02:00
slot-gpio.c
slot-gpio.h