1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-24 09:13:20 -05:00
linux/drivers/mmc/core
Jiong Wu d4721339dc mmc:fix a bug when max_discard is 0
The original purpose of the code I fix is to replace max_discard with
max_trim if max_trim is less than max_discard. When max_discard is 0
we should replace max_discard with max_trim as well, because
max_discard equals 0 happens only when the max_do_calc_max_discard
process is overflowed, so if mmc_can_trim(card) is true, max_discard
should be replaced by an available max_trim.
However, in the original code, there are two lines of code interfere
the right process.
1) if (max_discard && mmc_can_trim(card))
when max_discard is 0, it skips the process checking if max_discard
needs to be replaced with max_trim.
2) if (max_trim < max_discard)
the condition is false when max_discard is 0. it also skips the process
that replaces max_discard with max_trim, in fact, we should replace the
0-valued max_discard with max_trim.

Signed-off-by: Jiong Wu <Lohengrin1024@gmail.com>
Fixes: b305882fbc (mmc: core: optimize mmc_calc_max_discard)
Cc: stable@vger.kernel.org # v4.17+
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2019-03-01 09:50:10 +01:00
..
block.c Merge branch 'fixes' into next 2019-02-28 09:16:18 +01:00
block.h
bus.c
bus.h
card.h
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
host.c mmc: core: Move mmc_of_parse_voltage() to host.c 2019-02-25 15:20:58 +01:00
host.h
Kconfig
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: do not retry CMD6 in __mmc_switch() 2019-02-28 09:16:12 +01:00
mmc_ops.h
mmc_test.c
pwrseq.c
pwrseq.h
pwrseq_emmc.c
pwrseq_sd8787.c
pwrseq_simple.c
queue.c mmc: core: align max segment size with logical block size 2019-02-27 18:01:25 +01:00
queue.h
quirks.h
regulator.c mmc: core: Convert mmc_regulator_get_ocrmask() to static 2019-02-25 15:20:58 +01:00
sd.c mmc: core: Add a debug print when the card may have been replaced 2019-02-28 09:28:27 +01:00
sd.h
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
sdio_cis.c
sdio_cis.h
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
sdio_ops.c
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
slot-gpio.c mmc: slot-gpio: Remove override_active_level on WP 2019-02-25 08:40:58 +01:00
slot-gpio.h