From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 B5CB13043C9 for ; Thu, 5 Mar 2026 19:40:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772739657; cv=none; b=J2y8L5zkfpdtDvr4amvLSItz4cJZfmHB2YGDGS8NYhgbg/7lCxgfvkvqFOtViGpsMcmonw7g1IMoylZYeu82kklqqdo9xnuonk5T6xOAdjLRDVv3oF0g9lHdz55e2OMwVU25Lc+W8ZAEB4taWS8pnBIblundjkXsM3/BrAM5Enw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772739657; c=relaxed/simple; bh=m20zyPh9j0kootMidayNQ1oOQzrk/KoLdQEO5NKeekM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qY9FMzhpiS3Azp1avxnvg1/Yfm9kl3kYohrunpy2EmXzMfVbN9vfKKKZ8/rE7ENxyJAq5MYOQz1PP8YReQuu1+WvauKWo7SIn13cwszz0HDgrTQOIefJX5YgIiUlg3yAmU4H5CB+Of1Fivv7kk+1nxpQ60kQ1N5DltzpVvX8dIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=starlabs.systems; spf=pass smtp.mailfrom=starlabs.systems; dkim=pass (2048-bit key) header.d=starlabs-systems.20230601.gappssmtp.com header.i=@starlabs-systems.20230601.gappssmtp.com header.b=IR7Wigny; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=starlabs.systems Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starlabs.systems Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=starlabs-systems.20230601.gappssmtp.com header.i=@starlabs-systems.20230601.gappssmtp.com header.b="IR7Wigny" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-439c5b40f60so2095211f8f.0 for ; Thu, 05 Mar 2026 11:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20230601.gappssmtp.com; s=20230601; t=1772739654; x=1773344454; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0APM3Tj7oBoGfg9KCKIHOkr3C7tCvxi2WdbZ2UmZlhY=; b=IR7WignyJtmqxLg/vKwZUQaHiMjD2JUXTTJVAZ2FnXKn+A4yV082UZaHS+70oSXL/d ehhOA08aEf2OfIDeMXJsSrIvJeurTCxYXdNn8HBjgG/UvXbABJCdZYhwHV3LpFWVfoNU F7Kf/Ncqp85MW53EVlsH1tMWjWkpbHLUhGFlB6Y2ccI0umZQUpMt7lmFxIVeRa+PsaYQ rKBGVbuqni/736HGfq++fsPfo4dOyWikkHl+5VRxUHdSXepeI1lGpv/Y4s9n47O/iz5T 04Rb0a4xwL57Hx4VpKqA3IJhsJPTR+cDFoznarjJDWsppUyX2nlaDvprnWGKcJ37oxoj BmgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772739654; x=1773344454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0APM3Tj7oBoGfg9KCKIHOkr3C7tCvxi2WdbZ2UmZlhY=; b=ZKWicbjXF+Ae622bYtbdF+PBeu7GL7u84tAhOKQE0CBTXq/rwNfv8tsi4fJzKIbc52 QWQ+LvroDdnx29umBDrO0RpGL6iAChXPBIe4C/IsL+G+yxz5SMrwdrQFidfY3yWyRfu0 vET4nLgmfrSvjnc1d0rkEXPUbiH9pF7mbpEw/w9nm8aPzm1It0KnCcTu0IHVPp0sPLMM 0jdN6zdNnOebwZ78Q7Si7QNx8wfAx17KFUEbooWturGeuXxlx8UlM+BoF0YxYQCDcMd/ QQa33jbsGKDAyt1FUzxBLizAW64RTeq5pqL6sgRPmu5FVRgraUQGYJhCeln9buDf+x1U HMlA== X-Forwarded-Encrypted: i=1; AJvYcCWXyk3aPrQjcCWpX+NL9tze1bOdaJEWyuRwxhCBaOInP7hprudbVjVciaxzCyPFvTWUqUg/NMXQoAt3CJY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyfl4cCum/TFtr3kQRwrgISrk5HTahhvtcs/wwxj43iSM3vtTkV fDJvwktxBxNbXhwJD9a4eCMHo2tL8x8+HcXTSnArDMbcIN+T0iBcVXMNWbyyLtMs7g== X-Gm-Gg: ATEYQzyw50+R9GzkJIf+lsnAyOTfFOYUWUR6wwy6iw4DdkA6Kt7haQ1B2PAZDrNdVPp 0rbnOHC547alcnlA5goYofoExghQ48RLoh9jzz05V1LLDDQ/Xf18jmD1CLPZpFGyMJDpjoKXy8k mw28YY4MXXD+YL7yfM+pEzKkayJDsJFc0jEJwcc/B0D8LVC5u+AzJtwmKuQkN9Vr1iY5j4Du+7S aVfJjqNKszrhtPs+DZMQ4IRsCqTzCcjGk2wqgtypkQF7wbaa1YYdhtqVjutRMxDkxT8dEmBdyvO TZWLxCdS4nzNv/08CIy2Ef/VEo/1qVb7HcKW4FihVdd1n6UPUlJZRwsD1gnzaBv4uGeQwudTWqD bvgwhtv/BWhl5gf9+KRxi5FDuyeEPYqH27G/dxsTmH4LOaL4J8RYa/UUO1kk5O0ii4UpnP0FNO5 7WF1FP/xOABy7I1XBS4vdq15YT7HtbVYGOeZ647GuNMzSEZYQWRbAmjhTGwVly2A== X-Received: by 2002:a05:600c:828a:b0:480:1c53:2085 with SMTP id 5b1f17b1804b1-4851986f362mr133686845e9.19.1772739653915; Thu, 05 Mar 2026 11:40:53 -0800 (PST) Received: from starbook ([217.155.46.38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485246fd127sm3265e9.6.2026.03.05.11.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2026 11:40:53 -0800 (PST) From: Sean Rhodes To: linux-mmc@vger.kernel.org, Ulf Hansson , Greg Kroah-Hartman Cc: Ricky Wu , Avri Altman , Binbin Zhou , Dan Carpenter , Jisheng Zhang , Nathan Chancellor , Arnd Bergmann , Huacai Chen , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/6] rtsx_usb_sdmmc: tray CD fix + UHS + runtime PM Date: Thu, 5 Mar 2026 19:40:46 +0000 Message-ID: <20260305194052.5120-1-sean@starlabs.systems> X-Mailer: git-send-email 2.51.0 In-Reply-To: <1ca7b488a11e03b3f107f1829a40cf2c92c7d5fd.1771533586.git.sean@starlabs.systems> References: <1ca7b488a11e03b3f107f1829a40cf2c92c7d5fd.1771533586.git.sean@starlabs.systems> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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