]> www.infradead.org Git - users/dwmw2/linux.git/commit
mmc: core: Add SD card quirk for broken discard
authorAvri Altman <avri.altman@wdc.com>
Wed, 28 Sep 2022 09:57:44 +0000 (12:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Oct 2022 08:41:19 +0000 (09:41 +0100)
commite2f9b62ead9a69f5f605bb8777be5c97f292972d
treef000410c02636403af0d0c9d202019ec3e1a8d9a
parent3a260e9844c97c220603696b0bc225a8acf44d9c
mmc: core: Add SD card quirk for broken discard

commit 07d2872bf4c864eb83d034263c155746a2fb7a3b upstream.

Some SD-cards from Sandisk that are SDA-6.0 compliant reports they supports
discard, while they actually don't. This might cause mk2fs to fail while
trying to format the card and revert it to a read-only mode.

To fix this problem, let's add a card quirk (MMC_QUIRK_BROKEN_SD_DISCARD)
to indicate that we shall fall-back to use the legacy erase command
instead.

Signed-off-by: Avri Altman <avri.altman@wdc.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220928095744.16455-1-avri.altman@wdc.com
[Ulf: Updated the commit message]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/core/block.c
drivers/mmc/core/card.h
drivers/mmc/core/quirks.h
include/linux/mmc/card.h