Re: [PATCH] misc: rtsx_usb: reset chip on resume to restore card detection

From: Ulf Hansson

Date: Thu Apr 09 2026 - 11:49:29 EST


+ Ricky, Sean

On Tue, 7 Apr 2026 at 13:56, Greg S <grigoryya@xxxxxxxxx> wrote:
>
> After S3 suspend the Realtek RTS5129 USB card reader loses its internal
> state, but rtsx_usb_resume() does not reinitialize it — it only wakes up
> child devices. As a result, the first command sent to the chip after
> resume times out with -ETIMEDOUT and the mmc subsystem never re-detects
> the card. The SD card (mmcblk0) disappears and does not come back until
> the next full reboot.
>
> rtsx_usb_reset_resume() already handles this correctly by calling
> rtsx_usb_reset_chip() before waking children. Apply the same logic to
> the regular resume path.
>
> Tested on a laptop with an RTS5129 (0x0bda:0x0129) built-in card reader
> and a 128 GB SDXC card. Before the patch, mmcblk0 was lost after every
> S3 cycle; after the patch, the card is reliably re-detected on resume.
>
> Signed-off-by: Greg S <grigoryya@xxxxxxxxx>

The patch looks reasonable to me, but perhaps we also need a fixes tag?

I have also looped in some of the relevant driver authors to get
confirmation that the change makes sense.

Kind regards
Uffe

> ---
> drivers/misc/cardreader/rtsx_usb.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/misc/cardreader/rtsx_usb.c
> b/drivers/misc/cardreader/rtsx_usb.c
> index 2b3ae2914ec8..f1a3b5c7e912 100644
> --- a/drivers/misc/cardreader/rtsx_usb.c
> +++ b/drivers/misc/cardreader/rtsx_usb.c
> @@ -732,6 +732,18 @@ static int rtsx_usb_resume_child(struct device
> *dev, void *data)
>
> static int rtsx_usb_resume(struct usb_interface *intf)
> {
> + struct rtsx_ucr *ucr =
> + (struct rtsx_ucr *)usb_get_intfdata(intf);
> +
> + /* After S3 suspend the chip loses its internal state and needs a full
> + * reset, identical to what reset_resume already does. Without this
> + * the first command sent to the chip after resume times out
> + * (-ETIMEDOUT) and the mmc subsystem never re-detects the card
> + * (mmcblk0 disappears until the next reboot).
> + *
> + * Affected: at least RTS5129 on several laptop models.
> + */
> + rtsx_usb_reset_chip(ucr);
> device_for_each_child(&intf->dev, NULL, rtsx_usb_resume_child);
> return 0;
> }
> --
> 2.43.0