]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mmc: core: Avoid bitfield RMW for claim/retune flags
authorPenghe Geng <pgeng@nvidia.com>
Thu, 19 Feb 2026 20:29:54 +0000 (15:29 -0500)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 12:45:50 +0000 (13:45 +0100)
commit901084c51a0a8fb42a3f37d2e9c62083c495f824
tree3c4d2db3a4e8617b08c89c7e2903a096bd39e06b
parent79ad471530e0baef0dce991816013df55e401d9c
mmc: core: Avoid bitfield RMW for claim/retune flags

Move claimed and retune control flags out of the bitfield word to
avoid unrelated RMW side effects in asynchronous contexts.

The host->claimed bit shared a word with retune flags. Writes to claimed
in __mmc_claim_host() or retune_now in mmc_mq_queue_rq() can overwrite
other bits when concurrent updates happen in other contexts, triggering
spurious WARN_ON(!host->claimed). Convert claimed, can_retune,
retune_now and retune_paused to bool to remove shared-word coupling.

Fixes: 6c0cedd1ef952 ("mmc: core: Introduce host claiming by context")
Fixes: 1e8e55b67030c ("mmc: block: Add CQE support")
Cc: stable@vger.kernel.org
Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Penghe Geng <pgeng@nvidia.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
include/linux/mmc/host.h