From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 4BFD7383306 for ; Mon, 6 Jul 2026 15:40:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783352451; cv=none; b=FUTwBxhlbtkeLw65gSDgr1HtBuVXHa+qQs8T/csLyzKd0U6OKL6AQzgZWZ7E6T0Uq9yW8c4UtztJFUSgcrcRp/FNippS0IirsPlpjguSmUfxDY6vOQgE00XXPuUzQrKufdP4qc+ygQO9jun45LP2LZX+AUJoY2H8MAqPM08ByYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783352451; c=relaxed/simple; bh=gUbam2X1zBZL9uSpYxqgwz7Rq6Dxn12/yakuXDqO3EM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=n+5MGNF/EFcFum3o9GqVyzHE6I8Rs4qgtnllfHnCJ+6fa3f7RVsJzquZTPyMCC4SbaiopWxbvfuwebaf4q207I4T9Npv5gnIQIafrqVrFkWFGMzweZ4LknC8U99j1fvlc98OB/XicK/O6HeB9//NrQihb5loljUtRl39mvPgYbQ= 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.20251104.gappssmtp.com header.i=@starlabs-systems.20251104.gappssmtp.com header.b=id3r42N6; arc=none smtp.client-ip=209.85.128.53 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.20251104.gappssmtp.com header.i=@starlabs-systems.20251104.gappssmtp.com header.b="id3r42N6" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-493c55d5c7aso30998605e9.1 for ; Mon, 06 Jul 2026 08:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20251104.gappssmtp.com; s=20251104; t=1783352447; x=1783957247; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kt3WYRWrht+2ylbL4M+X6SQZM1BEsWSxUIBF7uW5bIk=; b=id3r42N6aiIu972GNWL5s1iIcDIA2h/NmVq7ctr0QVvdWQxyjtLP9GotqqAEv/R8C7 bvmQhQkUMyIYZMUCpLGb8TaKfMdZyL+ayscTfBy0xSOavP6YXVWrpXU8plMoBRIz0zvK zjjxhL6KocyAy3tE0IFQ2QAG+6icYVccfClVjMCJjL50sf/5ok+m3kfhI110z30Q8XAc vs4VfMyGmuZPDN3I77gZWbC3QsW070932J6ARKmMmq1CUet5BZo0+4avjS6L2PFpebY0 WBMEYdfHtl/LA7Z4WpZIP0JnfwNK5Dri+4OtOB98hhDXLGOgMM58B3gdBZI6og4vvqzi kYhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783352447; x=1783957247; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kt3WYRWrht+2ylbL4M+X6SQZM1BEsWSxUIBF7uW5bIk=; b=bJjEpqe4jCNURW5H21p69zfnRZXnVBAi9ylZFeYGHzW5mMBLBRl1tXs+BCfTFebHBy x7U5dvRQ+ODqeTGpR1Dk9iD7vF3fAB8JoUKk3/Vuipl1TGww1puaOunGhiNZwDBg6Z2r b4XNeZvq19j+uYwGnw7Al2wb6kzCtQrfl42bybfsLjyUEkH8fN+kUzslQtYcXtKMI2SR O9q+vQ3IlmbpPkyiKZmZ0jF4Q4FHlhUq7a4mhZUNDU26DIBqf3iAfUGI473t/gfhUCwg 8AbtEpIobfdZBuVM4TxXL1D2b6CoIuzAUv22B2HBrgJ7t4NEY5WHfSbhGZNOmcS8M4iM e3Tg== X-Forwarded-Encrypted: i=1; AHgh+RrvThvJhUgoLIeMYOM8PX4T/Zi5zXm2/KcVG9iN9/a8mPIk6KH/fqp0aRdboztugCE+KjfXUqhOg9c+BMI=@vger.kernel.org X-Gm-Message-State: AOJu0YycamhjOwKwNRSaV5g2PJ9KA0PYnXl8f/33Xaoa6AG8GXfqghpC w8M2PJ0bXnV0xaXjcpQwdHjJyXpsCEOoKcmHPbTTXIE9cHUuS7JhLQPPA597YE/OAg== X-Gm-Gg: AfdE7clsUGXfY2NJxMiMMJ5nCLehyn1jK+YckHYUiNLYjnWdCRXXr+e7RGQE8ImJhhG /6kHRmiqfAynG9CFcxk8KumERX2M55rRIpDm0TdyVy3u2tGaTs4l05oxp9sjBnoWd4R0MFMPCFd kVhQWz2uQZhakz+8DVn/o4wVK85zThNAXMAExNPKzlqx0pCVBUsVnaP7Z/66ckyyDdjcpgpEZHS sO085E38LHrEf+qtu17qXu+OrQkbQcMsQdRQPPYAgh0pM07lPQHw+Bi5W+fdycDW7yLHXd1iD5k Wwn23LDZdOXqoeawpKknuUeEQ2QbgiPrLHhwc3+6UFvLnu02gZ4R0mLAO/H6T9HZl+XvUUnQZKr DTadVkuj0v6Ul0ZczSm8Lqv3m5e4rdrTE3fzPA7f0+JZ/251QL2/SQSYAERdFtkpzzdOdfVW9cA +iBxnLGjL6CBRxvwWb5mzQodDmwBO972cSQCSJ8Gu6zmdCEzWDBc+2J5A= X-Received: by 2002:a05:600c:8b66:b0:493:a7fd:15d6 with SMTP id 5b1f17b1804b1-493df08b4camr12721185e9.9.1783352447174; Mon, 06 Jul 2026 08:40:47 -0700 (PDT) Received: from horizon.localdomain ([150.228.6.107]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493cce03fa1sm283699005e9.11.2026.07.06.08.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 08:40:46 -0700 (PDT) From: Sean Rhodes To: Ulf Hansson Cc: Arnd Bergmann , Greg Kroah-Hartman , Ricky Wu , Sean Rhodes , Lee Jones , Roger Tseng , Dan Carpenter , Jisheng Zhang , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] rtsx_usb: fix tray-reader false card detect and autosuspend Date: Mon, 6 Jul 2026 16:40:42 +0100 Message-ID: X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes the empty-tray detect loop seen on a Realtek RTS5129 USB SD reader, while also avoiding USB register accesses from the USB runtime autosuspend callback. Compared with the previous RFC, this no longer qualifies media by issuing SD/MMC commands from ->get_cd(). The rtsx_usb_sdmmc child still reports the raw card-detect state initially, then lets the normal MMC rescan path probe the media. If an initialization command times out before a card is attached, the SD child suppresses the raw SD_CD signal until the tray/card detect line drops again. The parent rtsx_usb change removes USB I/O from runtime autosuspend and keeps only the existing Memory Stick autosuspend deferral based on cached card-status bits. Raw SD_CD is not used as a parent autosuspend blocker, because this reader can assert it for an empty tray. Runtime-tested on a StarLite Mk V with Realtek RTS5129 (0bda:0129), using these changes as a matched rtsx_usb/rtsx_usb_sdmmc/rtsx_usb_ms module set on Linux 7.0.0-27-generic. Device enumeration: Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller /: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/12p, 480M |__ Port 004: Dev 003, If 0, Class=Vendor Specific Class, Driver=rtsx_usb, 480M Card inserted: mmc0: new UHS-I speed SDR50 SDXC card at address 544c mmcblk0: mmc0:544c LX2TB 1.82 TiB mmcblk0: p1 Deep S3 with the card inserted: PM: suspend entry (deep) ACPI: PM: Waking up from system sleep state S3 PM: suspend exit After resume, the card remained visible: NAME SIZE TYPE FSTYPE MOUNTPOINTS mmcblk0 1.8T disk `-mmcblk0p1 1.8T part exfat Empty tray: mmc0: card 544c removed /sys/bus/usb/devices/1-4/power/control=auto /sys/bus/usb/devices/1-4/power/runtime_status=suspended /sys/bus/usb/devices/1-4/power/runtime_usage=0 With the empty tray left inserted for about three minutes, no repeated MMC detect attempts, command timeouts, or USB reset churn were observed. Sean Rhodes (2): misc: rtsx_usb: avoid USB I/O in runtime autosuspend mmc: rtsx_usb_sdmmc: suppress false CD after init timeout drivers/misc/cardreader/rtsx_usb.c | 26 ++++++++++++++++++++------ drivers/mmc/host/rtsx_usb_sdmmc.c | 13 ++++++++++++- include/linux/rtsx_usb.h | 3 +++ 3 files changed, 35 insertions(+), 7 deletions(-)