A card insertion happens after the lastest polling before reader is
suspended may never have a chance to be detected. Under current 1-HZ
polling interval setting in mmc_core, the worst case of such
undetectablility is about 1 second.
To further reduce the undetectability, detect card slot again in suspend
method and defer the autosuspend if the slot is loaded. The default 2
second autosuspend delay of USB subsystem should let the next polling
detects the card.
Signed-off-by: Roger Tseng <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
sd_set_power_mode() in derived module drivers/mmc/host/rtsx_usb_sdmmc.c
acquires dev_mutex and then calls pm_runtime_get_sync() to make sure the
device is awake while initializing a newly inserted card. Once it is
called during suspending state and explicitly before rtsx_usb_suspend()
acquires the same dev_mutex, both routine deadlock and further hang the
driver because pm_runtime_get_sync() waits the pending PM operations.
Fix this by using an empty suspend method. mmc_core always turns the
LED off after a request is done and thus it is ok to remove the only
rtsx_usb_turn_off_led() here.
Cc: <[email protected]> # v3.16+
Fixes: 730876be25 ("mfd: Add realtek USB card reader driver")
Signed-off-by: Roger Tseng <[email protected]>
[Lee: Removed newly unused variable]
Signed-off-by: Lee Jones <[email protected]>
Use mfd_add_hotplug_devices helper to register the subdevices.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
The prefix suggests the number should be printed in hex, so use
the %x specifier to do that.
Found by using regex suggested by Joe Perches.
Signed-off-by: Hans Wennborg <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
mfd_add_devices() expects array of struct mfd_cell to be const.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Roger Tseng <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Explain why there is no need to have a symmetric LED turn-on in resume handler
while calling rtsx_usb_turn_off_led() in suspend handler.
Signed-off-by: Roger Tseng <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Fix two possible race condition generated by misuse of del_timer in
rtsx_usb_bulk_transfer_sglist() and uninitialized timers before mfd_add_devices
in rtsx_usb_probe().
Signed-off-by: Roger Tseng <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Realtek USB card reader provides a channel to transfer command or data to flash
memory cards. This driver exports host instances for mmc and memstick subsystems
and handles basic works.
Acked-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Roger Tseng <[email protected]>
Signed-off-by: Lee Jones <[email protected]>