linux/drivers/misc/cardreader
Sean Rhodes 483c948324 misc: rtsx_usb: avoid USB I/O in runtime autosuspend
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.

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.

Also stop clearing OCP from the runtime autosuspend callback, so the
callback does not issue USB commands.

Fixes: bb400d2120 ("mfd: rtsx_usb: Defer autosuspend while card exists")
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-07-13 13:15:02 +02:00
..
alcor_pci.c misc: cardreader: Return -EBUSY if regions are busy 2025-04-25 15:54:08 +02:00
Kconfig misc: rtsx: list supported models in Kconfig help 2024-10-18 13:40:17 +02:00
Makefile misc: rtsx: add to support new card reader rts5264 new definition and function 2023-12-15 17:27:04 +01:00
rtl8411.c misc: rtsx: Quiesce rts5249 on system suspend 2022-01-26 18:53:28 +01:00
rts5209.c misc: rtsx: Quiesce rts5249 on system suspend 2022-01-26 18:53:28 +01:00
rts5227.c misc: rtsx_pci: Add separate CD/WP pin polarity reversal support 2025-08-19 12:37:10 +02:00
rts5228.c misc: rtsx_pci: Add separate CD/WP pin polarity reversal support 2025-08-19 12:37:10 +02:00
rts5228.h misc: rtsx: Add support new chip rts5228 mmc: rtsx: Add support MMC_CAP2_NO_MMC 2020-07-10 14:58:47 +02:00
rts5229.c misc: rtsx: Quiesce rts5249 on system suspend 2022-01-26 18:53:28 +01:00
rts5249.c misc: rtsx_pci: Add separate CD/WP pin polarity reversal support 2025-08-19 12:37:10 +02:00
rts5260.c misc: rtsx: Fix some platforms can not boot and move the l1ss judgment to probe 2023-09-25 10:48:19 +02:00
rts5260.h
rts5261.c misc: rtsx: Fix some platforms can not boot and move the l1ss judgment to probe 2023-09-25 10:48:19 +02:00
rts5261.h misc: rtsx: Check mmc support for RTS5261 2020-11-16 11:59:30 +01:00
rts5264.c misc: rtsx_pci: Add separate CD/WP pin polarity reversal support 2025-08-19 12:37:10 +02:00
rts5264.h misc: rtsx_pci: Add separate CD/WP pin polarity reversal support 2025-08-19 12:37:10 +02:00
rtsx_pcr.c misc: rtsx: Use named initializers for struct pci_device_id 2026-05-23 13:47:33 +02:00
rtsx_pcr.h misc: rtsx_pci: Add separate CD/WP pin polarity reversal support 2025-08-19 12:37:10 +02:00
rtsx_usb.c misc: rtsx_usb: avoid USB I/O in runtime autosuspend 2026-07-13 13:15:02 +02:00