From: Michal Pecio <michal.pecio@gmail.com>
To: Sean Rhodes <sean@starlabs.systems>
Cc: Ulf Hansson <ulfh@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ricky Wu <ricky_wu@realtek.com>, Lee Jones <lee@kernel.org>,
Roger Tseng <rogerable@realtek.com>,
Dan Carpenter <error27@gmail.com>,
Jisheng Zhang <jszhang@kernel.org>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] misc: rtsx_usb: avoid USB I/O in runtime autosuspend
Date: Mon, 5 Oct 2026 10:30:11 +0200 [thread overview]
Message-ID: <20261005103011.03175826.michal.pecio@gmail.com> (raw)
In-Reply-To: <7acac70a471452a6ccf23b7ccc557f3c3861e0ad.1783352430.git.sean@starlabs.systems>
On Mon, 6 Jul 2026 16:40:43 +0100, Sean Rhodes wrote:
> The runtime autosuspend callback currently queries card status and
> clears OCP by issuing USB register accesses. This can run from the
> USB runtime-PM path itself, which is the wrong place to start more
> device I/O.
>
> Keep a cached copy of the card-status bits from normal status reads
> instead. During runtime autosuspend, use that cached value only to
> preserve the existing Memory Stick autosuspend deferral.
How is the driver supposed to detect card insertion after the last poll
but before the reader goes to suspend and can issue remote wakeup?
This is exactly what happens now: if I insert a new card within two
seconds of the "card removed" message showing up (which itself happens
up to a second after removal) the insertion is never detected and the
reader enters suspend with the card in.
It seems that not only was "starting more I/O in the runtime-PM path"
actually a good idea, but polling should only stop when the parent USB
device suspends, not the child MMC host, because there is a two second
delay between them. And even with this patch reverted, insertion never
works if USB autosuspend is simply disabled altogether.
Also, does anyone know if there is any way to utilize the interrupt
endpoint instead of polling? I tried submitting a URB to it and got
regular responses, but only zeros. Can this be changed?
> Do not treat raw SD_CD as an autosuspend blocker, because tray-based
> SD readers can assert SD_CD with an empty tray. A real SD card is
> protected by the SD/MMC child runtime-PM usage once powered.
Sounds like the proper condition is to ignore the card if and only if
it failed to initialize and has not been swapped for a new one.
Hence the question about interrupts: this would vastly reduce the risk
that a swap for an actual working card remains undetected.
Regards,
Michal
next prev parent reply other threads:[~2026-10-05 8:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 15:40 [PATCH v2 0/2] rtsx_usb: fix tray-reader false card detect and autosuspend Sean Rhodes
2026-07-06 15:40 ` [PATCH v2 1/2] misc: rtsx_usb: avoid USB I/O in runtime autosuspend Sean Rhodes
2026-10-05 8:30 ` Michal Pecio [this message]
2026-07-06 15:40 ` [PATCH v2 2/2] mmc: rtsx_usb_sdmmc: suppress false CD after init timeout Sean Rhodes
2026-07-10 13:21 ` [PATCH v2 0/2] rtsx_usb: fix tray-reader false card detect and autosuspend Ulf Hansson
2026-07-10 14:23 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261005103011.03175826.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=arnd@arndb.de \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jszhang@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ricky_wu@realtek.com \
--cc=rogerable@realtek.com \
--cc=sean@starlabs.systems \
--cc=ulfh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®