All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] mmc: misc fixes across MMC/SDHCI/RPMB
@ 2026-07-12 13:07 Peng Fan (OSS)
  2026-07-12 13:07 ` [PATCH 1/5] mmc: fix mmc_poll_for_busy() false timeout when card is ready Peng Fan (OSS)
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2026-07-12 13:07 UTC (permalink / raw)
  To: u-boot
  Cc: Jaehoon Chung, Tom Rini, Tanmay Kathpalia, Jens Wiklander,
	Bhimeswararao Matsa, Yanir Levin, Eran Moshe, Andrew Goodbody,
	Kaustabh Chakraborty, Christoph Stoidner, Tanmay Kathpalia,
	Jimmy Durand Wesolowski, Iulian Banaga, Peng Fan

Patches 1-4 are straightforward single-site fixes found through code
review. Patch 5 fixes a regression introduced by commit 906ee6785b1
("mmc: sd: Handle UHS-I voltage signaling without power cycle").

 1. mmc_poll_for_busy() can return a false -ETIMEDOUT if the card
    becomes ready on the exact iteration where the timeout counter
    reaches zero. Fix by returning 0 directly on card-ready.

 2. rpmb_route_frames() has a tautological condition "req_cnt != 1 ||
    !req_cnt" in the RPMB_REQ_READ_DATA case. The second operand is
    dead code. Based on the pattern of the other cases, this should
    be "req_cnt != 1 || !rsp_cnt" to validate the response count.

 3. sdhci_init() allocates a 512KB aligned bounce buffer on every
    call without checking if one was already allocated, leaking
    memory on re-initialization in the non-DM code path.

 4. mmc_bwrite() uses mmc->cfg->b_max directly instead of calling
    mmc_get_b_max(), which the read path (mmc_bread) uses. This
    means host drivers that implement get_b_max() for DMA boundary
    constraints have those constraints ignored for writes.

 5. mmc_deinit() strips all UHS capabilities before calling
    sd_select_mode_and_width(). After commit 906ee6785b1, that
    function detects cards already at 1.8V and enables UHS mode
    selection, but no UHS modes remain in the filtered caps. The
    non-UHS fallbacks (SD_HS, Legacy) require 3.3V which the card
    cannot revert to without a power cycle. Fix by preserving
    UHS_SDR12 as the minimum fallback when the card is at 1.8V.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Peng Fan (5):
      mmc: fix mmc_poll_for_busy() false timeout when card is ready
      mmc: rpmb: fix tautological condition in RPMB_REQ_READ_DATA validation
      mmc: sdhci: fix align_buffer memory leak on re-initialization
      mmc: fix mmc_bwrite() ignoring host get_b_max() callback
      mmc: fix mmc_deinit regression when card is at 1.8V signaling

 drivers/mmc/mmc.c         | 23 +++++++++++++++--------
 drivers/mmc/mmc_private.h |  4 ++++
 drivers/mmc/mmc_write.c   |  6 ++++--
 drivers/mmc/rpmb.c        |  2 +-
 drivers/mmc/sdhci.c       |  3 ++-
 5 files changed, 26 insertions(+), 12 deletions(-)
---
base-commit: 6741b0dfb41dc82a284ab1cff4c58af6ef2f3f9c
change-id: 20260712-mmc-fix-cc14724541b8

Best regards,
--  
Peng Fan <peng.fan@nxp.com>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-07-13  9:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12 13:07 [PATCH 0/5] mmc: misc fixes across MMC/SDHCI/RPMB Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 1/5] mmc: fix mmc_poll_for_busy() false timeout when card is ready Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 2/5] mmc: rpmb: fix tautological condition in RPMB_REQ_READ_DATA validation Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 3/5] mmc: sdhci: fix align_buffer memory leak on re-initialization Peng Fan (OSS)
2026-07-12 18:50   ` Kathpalia, Tanmay
2026-07-13  8:42     ` Peng Fan
2026-07-13  9:23       ` Kathpalia, Tanmay
2026-07-12 13:07 ` [PATCH 4/5] mmc: fix mmc_bwrite() ignoring host get_b_max() callback Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 5/5] mmc: fix mmc_deinit regression when card is at 1.8V signaling Peng Fan (OSS)
2026-07-12 18:20   ` Kathpalia, Tanmay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.