From nobody Mon Jun 15 01:24:30 2026 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 397C03B2FC6 for ; Tue, 7 Apr 2026 11:56:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775563008; cv=none; b=OTQzjT/lQq33OcKyyRA7gRe34w1HFkjVYJOYvdzwEEgVasiBxl51zVwD0djJEYUGY7nv3PUppyJznkQ9FICAB87sW/onigaBrlNxuwvRZsn2qDhBbqc3pfjQBbD+zTjFwNppEsroFYjszjsTPV99LBfOhK3Tz+oQ3QQzS2VbQFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775563008; c=relaxed/simple; bh=q36f3RLxu1TQVd3NN+p51ezMRv7VpdfvBQ4n2zcWzq0=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=g0NnScdk86AlwYKQ+dDZUPgy4bqIDgRH2xMXyCN2IjgWolvZoIdVtf9h9KnEs4085/65RceuBED3yQkk3JixWKrbSLLAi1tzHvgoKYVQ9GtWnxPVS2BwkFfRAA1m6TuxJHsju20V58Gjz1xWkG2yZf0QkifRVO0cFcxR1xY5Sq0= 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=VrcBNRsH; arc=none smtp.client-ip=209.85.219.48 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="VrcBNRsH" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-8a032383008so66394296d6.1 for ; Tue, 07 Apr 2026 04:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775563005; x=1776167805; darn=vger.kernel.org; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=aHsPO7VkkkmF+LzDzouz7Fz5iyV2CQc/HSeILC33tdo=; b=VrcBNRsHgBUSNm9xQ1uVq7KAlQvKXxNuY3yEsZYVh09EUSL8AEDp4wdG33drJ60msr 107O1tHxbU+jDOjyuEDBTMQDDLHLfajhC/YzohZc111bxAon8M3Lefqg7+PD/xV2EGt5 PXtDegyD9BtNH6C1XZMKpcQ6Yc8dvSEzmLn9rGPf3uyyJvoOqY88xfnrP9d2WlDwawm7 jAZPpbFcnFIxnTg5Aq9pdc2tbBGDzlnSw4akU6IwoIu1+LtQB6L6YrTxTtz0ZyjHHfEr WKPLyrTYt8CZiIj92HsBydvLEIhDOo3KC1SFdgsIbW2OPyTiqIFldtCrGJljUzXjSzSj 3mrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775563005; x=1776167805; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aHsPO7VkkkmF+LzDzouz7Fz5iyV2CQc/HSeILC33tdo=; b=gp2FJuTLipzf17ZOlSsOrRdY3W7xuQQSg4ty5pXs8YnEQY09z5TT1ZuhVl+FGp/hIS SzcRP/HmUSGgjZFBVdtPOgTraTX7FJgS8dAHb0cnmR9ImxygY9U4Dzbu1McvOWhWrvxF 9eegcNDnKiutXvvqeQyYnUnM2IkpkYmojMpWnOkPaUEEeJk2tn1BPh+LyyKOup7oocLg 2pTeX7gDkvRVk+jdA7Z02kRfj1YrZNsxgYZRpJylvQHuSWpptkwUXMjTcVMMuuWkMNzq uthFIcOnJjvHs2BvWB5hiA/wt+uoVall/ii8av9CfLu6cyljUz5RVoaUo1JqP2WDkjbh A4Tg== X-Forwarded-Encrypted: i=1; AJvYcCWioBHyzWVNqJvEdowVP0nAdZuV/C320fTC1OsbzSKYKOAkKpQeUXwp+Bbqqdszr1GU2yzWE2l+wClLb7c=@vger.kernel.org X-Gm-Message-State: AOJu0YwrHlGdxkBgXnIRcNq6qu4UJyPPR6IdNKu0yzkc+2fqzthDhkXB VG9oLWwskEpo3cmPk69ZKVW7dariRYd15Cp6HtYN5i9qk4mlNSydCcYe X-Gm-Gg: AeBDieup2vV9HE9EriaCWvwnF8o37pqY3FZ3fgJduRXdq7wn+wIYUqb0BwrHP7EwtET tGRtDBwezrDMHqi4yAXoOL3rkOoG5ExQUURPJWsNwqylNAoW6E54M5HOH4cs7ATthhk0gNbcrX/ 0Hlenr5kIWGp1FdfTw9TJZXLFj2EbUMRTfEHjqSqpybaMN1vkqEQrI4NaBHqUaw3i1MzBO3QWhq f9doA9BylBzcspCk5xQ+glKZobd+vcD7+YtFmRFudUBjF4KQfdFu4oQ2f+HYEDeSEBA+uhHxGnz yhQ3C9eqBStGXMXGjenOC6W6cJh5K6SprFfn4hkC0zTuexIbINTXkzouRDQclQVIHdURnGZmx/D dbkioZ/6E7JvfWA60I2EN5btHDGD+g+Rl0/0kCZKgOmhokRCLobGVJW68GRcLtMtoIbXitD+/Ys 6NHF0OAGqgXTP2AX86r61Q X-Received: by 2002:a05:6214:1d07:b0:89c:d424:aceb with SMTP id 6a1803df08f44-8a7043ee093mr281400346d6.31.1775563005076; Tue, 07 Apr 2026 04:56:45 -0700 (PDT) Received: from [10.10.10.1] ([157.245.8.14]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8ab9acde805sm34223276d6.2.2026.04.07.04.56.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2026 04:56:44 -0700 (PDT) Message-ID: <964d54a3-90ce-475e-952f-342bb383f878@gmail.com> Date: Tue, 7 Apr 2026 14:56:39 +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 Content-Language: en-US To: ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, rogerable@realtek.com From: Greg S Subject: [PATCH] misc: rtsx_usb: reset chip on resume to restore card detection Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable 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. Signed-off-by: Greg S --- =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.= =C2=A0 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