[PATCH v2 0/6] rtsx_usb_sdmmc: tray CD fix + UHS + runtime PM

From: Sean Rhodes

Date: Thu Mar 05 2026 - 14:41:00 EST


Hi,

Some Realtek USB SD readers with a tray can assert SD_CD when only the
tray is inserted. This can lead to false card-detect, unnecessary card
initialization, and in the worst case suspend/shutdown failures when the
MMC core waits for a non-existent card.

This series hardens card detection by debouncing SD_CD and validating a
new insertion by probing for card responses before reporting it present.
It then brings rtsx_usb_sdmmc closer to the previously shipped Realtek
behaviour (excluding xD/CPRM) for power-up and UHS signalling, and fixes
runtime PM corner cases around USB transfers.

The insertion validation approach is intentionally conservative and is
aligned with the older Realtek rts5139 staging driver (drivers/staging/
rts5139), which was removed in:
00d8521dcd236d1b8f664f54a0309e96bfdcb4f9
("staging: remove rts5139 driver code", 2014-05-23)

This is a resend as v2; the original standalone submission of patch 1
was sent on 2026-02-19 with Message-ID:
<1ca7b488a11e03b3f107f1829a40cf2c92c7d5fd.1771533586.git.sean@starlabs.systems>

Testing (v6.18-rc4 based):
- Readers: Realtek RTS5129, Realtek RTS5170, Realtek
RTS51379
- Tests (all readers): cold-boot detection (card present at power-on),
hotplug insert/remove, and suspend pm_test=devices
- Tray behaviour (tray readers): tray inserted/no card does not create a
phantom mmc device; insert/remove transitions are reported correctly
- Card modes/speeds: UHS-I SDXC cards negotiate UHS SDR104 (1.8V,
208MHz) where supported by the reader/card; non-UHS cards fall back to
SD High Speed (50MHz)

Thanks,
Sean Rhodes

Sean Rhodes (6):
mmc: rtsx_usb_sdmmc: avoid false card-detect on tray readers
mmc: rtsx_usb_sdmmc: start card power-up at 3.3V
mmc: rtsx_usb_sdmmc: advertise UHS SDR104 and DDR50
mmc: rtsx_usb_sdmmc: program SD30 mode for UHS SDR12/SDR25
rtsx_usb: hold runtime PM during transfers
rtsx_usb: avoid USB I/O in runtime autosuspend

drivers/misc/cardreader/rtsx_usb.c | 49 +++++++--
drivers/mmc/host/rtsx_usb_sdmmc.c | 167 +++++++++++++++++++++++++++--
include/linux/rtsx_usb.h | 3 +
3 files changed, 199 insertions(+), 20 deletions(-)

--
2.51.0