From 559da7282a4a5a49fe1ab21b24b1aacd75032b2e Mon Sep 17 00:00:00 2001 From: Kuen-Han Tsai Date: Tue, 12 Dec 2023 14:11:31 +0800 Subject: [PATCH] usb: enable media-presence polling for SD cards After USB enumeration, some SD card readers do not send signals to the device when the SD card is inserted or removed. To support SD card hotplugging, this patch enables in-kernel media-presence polling, which will check the SD card status every 2 seconds after a SD card reader is attached. Bug: 186479576 Test: SD card insertion/removal and data copy (see b/301566595) Change-Id: I044aeffd9386c0bee6138402e5130c39e1adbc9f Signed-off-by: Kuen-Han Tsai --- conf/init.zuma.usb.rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/init.zuma.usb.rc b/conf/init.zuma.usb.rc index 4dff012a..2cbb30b5 100644 --- a/conf/init.zuma.usb.rc +++ b/conf/init.zuma.usb.rc @@ -370,6 +370,8 @@ on boot write sys/module/usbcore/parameters/initial_descriptor_timeout 500 # Use USB Gadget HAL setprop sys.usb.configfs 2 + # Enable in-kernel media-presence polling for SD cards + write /sys/module/block/parameters/events_dfl_poll_msecs 2000 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1 write /config/usb_gadget/g1/idProduct 0x4EE7