FAILED: patch "[PATCH] mmc: core: Fix ambiguous TRIM and DISCARD arg" failed to apply to 4.9-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Possible dependencies:
489d144563f2 ("mmc: core: Fix ambiguous TRIM and DISCARD arg")bc47e2f6f9e2 ("mmc: core: Add discard support to sd")01904ff77676 ("mmc: core: Calculate the discard arg only once") 06c9ccb78e68 ("mmc: core: add proper be32 annotation")c0a3e080f929 ("mmc: core: Move erase/trim/discard defines from public core.h to mmc.h") 55244c5659b5 ("mmc: core: Move public functions from core.h to private headers") 066185d69063 ("mmc: core: First step in cleaning up private mmc header files") 164b50b35390 ("mmc: block: Replace "goto retry" by a proper do / while loop") e85baa8868b0 ("mmc: sd: Meet alignment requirements for raw_ssr DMA") f397c8d80a5e ("mmc: block: Move files to core")e711f0309109 ("mmc: mmc: Introduce mmc_abort_tuning()")aa33ce3c411a ("mmc: core: Enable __mmc_switch() to change bus speed timing for the host") 625228fa3e01 ("mmc: core: Rename ignore_crc to retry_crc_err to reflect its purpose") 437590a123b6 ("mmc: core: Retry instead of ignore at CRC errors when polling for busy") 8e8b3f514c12 ("mmc: core: use enum mmc_blk_status properly")70562644f4ee ("mmc: core: Don't use ->card_busy() and CMD13 in combination when polling") 716bdb8953c7 ("mmc: core: Factor out code related to polling in __mmc_switch()") cb26ce069ffa ("mmc: core: Clarify code which deals with polling in __mmc_switch()") 20348d1981da ("mmc: core: Make mmc_switch_status() available for mmc core")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 489d144563f23911262a652234b80c70c89c978b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20L=C3=B6hle?= <[email protected]>
Date: Thu, 17 Nov 2022 14:42:09 +0000
Subject: [PATCH] mmc: core: Fix ambiguous TRIM and DISCARD arg
Clean up the MMC_TRIM_ARGS define that became ambiguous with DISCARD introduction. While at it, let's fix one usage where MMC_TRIM_ARGS falsely included DISCARD too.
drivers/mmc/core/core.c +7 -2
@@ -1484,6 +1484,11 @@ void mmc_init_erase(struct mmc_card *card) card->pref_erase =0 ; } +static bool is_trim_arg (unsigned int arg) +{ +return (arg &MMC_TRIM_OR_DISCARD_ARGS ) && arg !=MMC_DISCARD_ARG ; +} +static unsigned int mmc_mmc_erase_timeout (struct mmc_card *card,unsigned int arg,unsigned int qty) {
@@ -1766,7 +1771,7 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, !(card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN))return -EOPNOTSUPP ; -if (mmc_card_mmc (card) && (arg &MMC_TRIM_ARGS ) && +if (mmc_card_mmc (card) &&is_trim_arg (arg) && !(card->ext_csd.sec_feature_support &EXT_CSD_SEC_GB_CL_EN ))return -EOPNOTSUPP ;
@@ -1796,7 +1801,7 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,* identified by the card->eg_boundary flag. */ rem = card->erase_size - (from % card->erase_size); -if ((arg &MMC_TRIM_ARGS ) && (card->eg_boundary) && (nr > rem)) { +if ((arg &MMC_TRIM_OR_DISCARD_ARGS ) && card->eg_boundary && nr > rem) { err =mmc_do_erase (card, from, from + rem -1 , arg); from += rem;if ((err) || (to <= from))
include/linux/mmc/mmc.h +1 -1
@@ -451,7 +451,7 @@ static inline bool mmc_ready_for_data(u32 status)#define MMC_SECURE_TRIM1_ARG 0x80000001#define MMC_SECURE_TRIM2_ARG 0x80008000#define MMC_SECURE_ARGS 0x80000000 -#define MMC_TRIM_ARGS 0x00008001 +#define MMC_TRIM_OR_DISCARD_ARGS 0x00008003#define mmc_driver_type_mask (n) (1 << (n))