linux-hardened/drivers/mmc/core
Raul E Rangel 9e4be8d03f mmc: core: Verify SD bus width
The SD Physical Layer Spec says the following: Since the SD Memory Card
shall support at least the two bus modes 1-bit or 4-bit width, then any SD
Card shall set at least bits 0 and 2 (SD_BUS_WIDTH="0101").

This change verifies the card has specified a bus width.

AMD SDHC Device 7806 can get into a bad state after a card disconnect
where anything transferred via the DATA lines will always result in a
zero filled buffer. Currently the driver will continue without error if
the HC is in this condition. A block device will be created, but reading
from it will result in a zero buffer. This makes it seem like the SD
device has been erased, when in actuality the data is never getting
copied from the DATA lines to the data buffer.

SCR is the first command in the SD initialization sequence that uses the
DATA lines. By checking that the response was invalid, we can abort
mounting the card.

Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2019-05-06 12:33:03 +02:00
..
block.c Merge branch 'fixes' into next 2019-02-28 09:16:18 +01:00
block.h mmc: block: Remove code no longer needed after the switch to blk-mq 2017-12-11 13:02:22 +01:00
bus.c mmc: core: Remove code no longer needed after the switch to blk-mq 2017-12-11 13:05:58 +01:00
bus.h mmc: core: Move public functions from card.h to private headers 2017-02-13 13:20:24 +01:00
card.h mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
core.c mmc:fix a bug when max_discard is 0 2019-03-01 09:50:10 +01:00
core.h mmc: core: Move regulator helpers to separate file 2019-02-25 15:20:58 +01:00
debugfs.c mmc: Export host capabilities to debugfs. 2018-03-22 10:36:27 +01:00
host.c mmc: core: fix possible use after free of host 2019-05-06 11:55:39 +02:00
host.h mmc: core: Don't try UHS-I mode if 4-bit mode isn't supported 2018-03-15 09:30:39 +01:00
Kconfig mmc: core: Allow building PWRSEQ_SD8787 with LIBERTAS_SDIO 2018-10-08 11:40:43 +02:00
Makefile mmc: core: Move regulator helpers to separate file 2019-02-25 15:20:58 +01:00
mmc.c mmc: core: Add a debug print when the card may have been replaced 2019-02-28 09:28:27 +01:00
mmc_ops.c mmc: core: retry CMD1 in mmc_send_op_cond() even if the ocr = 0 2019-04-29 12:37:11 +02:00
mmc_ops.h mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
mmc_test.c mmc: convert to DEFINE_SHOW_ATTRIBUTE 2018-12-17 08:26:24 +01:00
pwrseq.c mmc: pwrseq: Add reset callback to the struct mmc_pwrseq_ops 2017-06-20 10:30:09 +02:00
pwrseq.h mmc: pwrseq: Add reset callback to the struct mmc_pwrseq_ops 2017-06-20 10:30:09 +02:00
pwrseq_emmc.c mmc: core: make pwrseq_emmc (partially) support sleepy GPIO controllers 2019-04-15 11:55:54 +02:00
pwrseq_sd8787.c mmc: pwrseq: add support for Marvell SD8787 chip 2017-02-13 13:20:33 +01:00
pwrseq_simple.c mmc: pwrseq_simple: Fix incorrect handling of GPIO bitmap 2018-10-15 16:26:00 +02:00
queue.c for-5.1/block-20190302 2019-03-08 14:12:17 -08:00
queue.h mmc: stop abusing the request queue_lock pointer 2018-11-17 07:20:45 -07:00
quirks.h mmc: core: sdio: Set SDIO clock of SDR104 to 150MHz for Marvell 8887 chip 2018-05-02 15:08:39 +02:00
regulator.c mmc: core: Convert mmc_regulator_get_ocrmask() to static 2019-02-25 15:20:58 +01:00
sd.c mmc: core: Verify SD bus width 2019-05-06 12:33:03 +02:00
sd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sd_ops.c mmc: core: Drop retries as in-parameter to mmc_wait_for_app_cmd() 2019-02-25 15:20:58 +01:00
sd_ops.h mmc: core: Convert mmc_wait_for_app_cmd() to static 2019-02-25 15:20:58 +01:00
sdio.c mmc: core: Add a debug print when the card may have been replaced 2019-02-28 09:28:27 +01:00
sdio_bus.c mmc:sdio: Remove unneeded variable ret 2019-02-25 08:40:58 +01:00
sdio_bus.h mmc: core: First step in cleaning up private mmc header files 2017-02-13 13:20:20 +01:00
sdio_cis.c mmc: core: remove BUG_ONs from sdio 2016-12-05 10:31:08 +01:00
sdio_cis.h mmc: core: First step in cleaning up private mmc header files 2017-02-13 13:20:20 +01:00
sdio_io.c mmc: core: Convert mmc_align_data_size() into an SDIO specific function 2019-02-25 17:20:21 +01:00
sdio_irq.c mmc: update sdio_claim_irq documentation 2018-03-22 10:50:24 +01:00
sdio_ops.c mmc: sdio: improve mmc_io_rw_extended 2017-04-24 21:41:42 +02:00
sdio_ops.h mmc: core: Convert mmc_align_data_size() into an SDIO specific function 2019-02-25 17:20:21 +01:00
sdio_uart.c tty: replace ->proc_fops with ->proc_show 2018-05-16 07:24:30 +02:00
slot-gpio.c mmc: slot-gpio: Remove override_active_level on WP 2019-02-25 08:40:58 +01:00
slot-gpio.h mmc: core: First step in cleaning up private mmc header files 2017-02-13 13:20:20 +01:00