From nobody Mon Jun 15 10:45:38 2026 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78B59308F23 for ; Thu, 9 Apr 2026 19:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775763725; cv=none; b=KlgeeQo6/5ozPujYncM2x0vSa/o44lKSpUED+gao9aFt2XZsCEORQpC6IlQwNeIJVCeGttgdmp12yQ8BEvJ4Zxy8jtXgWhHVr2UNfsrgs8M11g32wdFnBbkwGkKNh3cO1D4kV5r6Tau2cpAMUQfBbG2Uxi9dUmS6cj/BlSWode4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775763725; c=relaxed/simple; bh=qOoW4aRym6b3AX+bWSrl2d084ZPhq8jJErEaGtwMluo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NYJ6buTu1nnqeO0+Oku9X1OYji4HIADTJHeB6MvXuPs/igs9cSuKj62zHZd7yJ3eOUBfRhMCr29G0G2qtc7ykwuuCKI+k5j1GOWfAlOqAQtKoRxpFpoPPoni1jiSSGq8oYcxYG6qYxKzoiSI2oVJgoy8zuDpVKTfiLY35GKIg1U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bUSHZZ6j; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bUSHZZ6j" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-899d6b7b073so12503916d6.2 for ; Thu, 09 Apr 2026 12:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775763723; x=1776368523; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GjKxBtkjDt3We9EjyJ1v8TRnifRaBnbhRAoyO7TLFsQ=; b=bUSHZZ6jptNH9uBja6J/nTdn4tQjknpvQ1p4DvUfayssHGXXD3v4ZYZM/lKRf/0+wE BacUqcjGP9jDOmXuefKNaZbcwZWRMfYewsDe/KXAQHMtIwAKzGJTmS+35gXHKnkTKp1l dF0uDHPrVuIHbolMmiG/EkYmJjq2+t374gq8wPJKwfrlD3l/Vcpwi7YMSPt0ZPyaWyx3 4iSfvuJfBRj7BW9DL3uxmjqvOeQTTFH4YEsU60K+wnxCqsDnIbW/Qu1yv2GCDRmombwx UJF3txuVadNvWC+lzmTYAilWWvuQ/P0fm1wWj6AL0HMF+PoDirkZ1/i4Rl5+LvL1aXBT ppow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775763723; x=1776368523; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GjKxBtkjDt3We9EjyJ1v8TRnifRaBnbhRAoyO7TLFsQ=; b=QDULLSTU6/SPz2ghErXZAFnoekVf/gZbaJCAPWvqIjoBCSic8z2OPk8omY+ouKd/lu aqsXO1Z65e83URv/XHC9C9nYdpqtKLoNjS2GsbGXlodHDVjUdnivu5GeuuPuFZrO4jvI 8lmYNtPE1BhyrJ+SgbfojasVxDWr2Cwi5wycrTuHBUimNdTvVHHXXs/erCH2y0WwOMiv x6CKvJa/RxIGfZmkkbUU3TNsafgvvusfC7V+sh6HXqu08BM/SqRUabsm5E180zDNxO+M w4ax7JFgWTdOvXMY9NdxkbKXSHbtQIoLDx5sFis1V43vvsHONzad91StVRoC4+vCvIbz UJ/g== X-Forwarded-Encrypted: i=1; AJvYcCVhgkmA3C5DGhubI0PS8RJVWASUlNKcoJ2QH0AIsBzwychxCEgIocx/QNWMZ5y87qhmRxwJs9DlgLtOOaU=@vger.kernel.org X-Gm-Message-State: AOJu0YwAVXBCwZMQY16mtF9DzFffbaKlIGmjVy/FgtA6C0IKaau745bi pNCRaIM1MCr5AlNqcxUF8SDEXW7tHTOByTyFbuaRMbnsSrjA+R7YLjsf X-Gm-Gg: AeBDietlCrwNdAPlSkPBB1vArUUQ6UOJLM6cko8NvD3alBxyqsKnKReZEv6rXOAYF/r GNyl8Cwx46DVg578tXrvTNUuiU/NjA4SmN1LTLysywrn49q+V7Yn0k2F0aBqgasJwjNt3GSzp7H wnTT5fX1HhQ/Ffa3c51OlMpbPiAHTGs/5giQBWW5ZvyE29t/QSNiV2sZj6Bzy63iBzzRXk8VYB3 UXYif86Jk74Mzn0u8QzlO6bD+5wKYOO+O/+GRfyzR1Br7QSboMsKGg0J2VzR6bQsI3mLb0jVEkh 5W4rzdQzUM24pQraek0i+yBAqlMCylfZzws0ok0uPgLsJZZs1t2qI38pRpo2koe2cm/zkALfG4P tIumJ8oFQQ5DqCiB1ZqeU79cc28uwsaQaNxCuoc/Q2FsF+fzm8gWrLel+fDFodANquS7WS9z0Z2 yp1ocHLCjHxYXbTgqNkVP/ X-Received: by 2002:ad4:5f88:0:b0:89a:1069:d229 with SMTP id 6a1803df08f44-8ac86322208mr1316236d6.55.1775763723142; Thu, 09 Apr 2026 12:42:03 -0700 (PDT) Received: from [10.10.10.1] ([157.245.8.14]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8ac8449e664sm4160336d6.0.2026.04.09.12.42.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2026 12:42:02 -0700 (PDT) Message-ID: <9e52c51d-c358-47ad-a2b1-763a348f6c7d@gmail.com> Date: Thu, 9 Apr 2026 22:41:58 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2] misc: rtsx_usb: reset chip on resume to re-detect card after S3 To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, rogerable@realtek.com, Ricky Wu , Sean Rhodes References: <964d54a3-90ce-475e-952f-342bb383f878@gmail.com> Content-Language: en-US From: Greg S In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable On Tue, 7 Apr 2026 at XX:XX, Ulf Hansson wrote: > The patch looks reasonable to me, but perhaps we also need a fixes tag? Good point, thanks. Here is v2 with the Fixes tag added. --- [PATCH v2] misc: rtsx_usb: reset chip on resume to re-detect card after S3 After S3 suspend the Realtek RTS5129 USB card reader loses its internal state, but rtsx_usb_resume() does not reinitialize it =E2=80=94 it only wak= es up child devices.=C2=A0 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.=C2=A0 The SD card (mmcblk0) disappears and does not come back unt= il the next full reboot. rtsx_usb_reset_resume() already handles this correctly by calling rtsx_usb_reset_chip() before waking children.=C2=A0 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.=C2=A0 Before the patch, mmcblk0 was lost after every S3 cycle; after the patch, the card is reliably re-detected on resume. Fixes: 730876be2566 ("mfd: Add realtek USB card reader driver") Signed-off-by: Greg S --- Changes in v2: =C2=A0- Added Fixes tag (Ulf Hansson) =C2=A0drivers/misc/cardreader/rtsx_usb.c | 12 ++++++++++++ =C2=A01 file changed, 12 insertions(+) diff --git a/drivers/misc/cardreader/rtsx_usb.c=20 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=20 *dev, void *data) =C2=A0static int rtsx_usb_resume(struct usb_interface *intf) =C2=A0{ +=C2=A0 =C2=A0 struct rtsx_ucr *ucr =3D +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (struct rtsx_ucr *)usb_get_intfdata(intf); + +=C2=A0 =C2=A0 /* After S3 suspend the chip loses its internal state and ne= eds a full +=C2=A0 =C2=A0 =C2=A0* reset, identical to what reset_resume already does. = Without this +=C2=A0 =C2=A0 =C2=A0* the first command sent to the chip after resume time= s out +=C2=A0 =C2=A0 =C2=A0* (-ETIMEDOUT) and the mmc subsystem never re-detects = the card +=C2=A0 =C2=A0 =C2=A0* (mmcblk0 disappears until the next reboot). +=C2=A0 =C2=A0 =C2=A0* +=C2=A0 =C2=A0 =C2=A0* Affected: at least RTS5129 on several laptop models. +=C2=A0 =C2=A0 =C2=A0*/ +=C2=A0 =C2=A0 rtsx_usb_reset_chip(ucr); =C2=A0 =C2=A0 =C2=A0device_for_each_child(&intf->dev, NULL, rtsx_usb_resum= e_child); =C2=A0 =C2=A0 =C2=A0return 0; =C2=A0} -- 2.43.0