I’ve identified an issue in jor the RG351 handles suspend on Batocera vs the various forks like AmberELEC, and I’ve worked out the fix:
The issue:
When resuming the RG351 from suspend, the network controller and the device controls both stop functioning until reboot.
The cause:
The RG351 uses the dwc2
kernel module for its USB root hub. This driver has a known bug where it fails to reinitialize the device on suspend. This can be seen in my messages file, the kernel immediately reports loss of it’s USB controller upon resume. Unfortunately, the message is quite sparse beyond a usb port disconnected
for the network controller and USB controls.
The fix:
AmberELEC handles this with a custom sleep.sh script that unloads the dwc2 module and reloads it on resume (script here: https://github.com/AmberELEC/AmberELEC/blob/dev/projects/Rockchip/devices/RG351P/packages/enable-oga-sleep/sources/sleep.sh)
Batocera appears to be using pm-suspend, so I attempted to fix this myself by just adding a device quirks handler to load and unload the module. Unfortunately, the dwc2
module for the RG351 is compiled into the kernel instead of as a module, so this is not currently possible.
Is there any chance this support could be added for the RG351?