In the Linux kernel, the following vulnerability has been resolved:
usb: dwc3-am62: fix module unload/reload behavior
As runtime PM is enabled, the module can be runtime suspended when .remove() is called.
Do a pmruntimeget_sync() to make sure module is active before doing any register operations.
Doing a pmruntimeput_sync() should disable the refclk so no need to disable it again.
Fixes the below warning at module removel.
[ 39.705310] ------------[ cut here ]------------ [ 39.710004] clk:162:3 already disabled [ 39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clkcoredisable+0xb0/0xb8
We called ofplatformpopulate() in .probe() so call the cleanup function ofplatformdepopulate() in .remove(). Get rid of the now unnnecessary dwc3tiremove_core(). Without this, module re-load doesn't work properly.