1
linux/drivers/usb/musb
Zijun Hu 498dbd9aea usb: musb: sunxi: Fix accessing an released usb phy
Commit 6ed05c68cb ("usb: musb: sunxi: Explicitly release USB PHY on
exit") will cause that usb phy @glue->xceiv is accessed after released.

1) register platform driver @sunxi_musb_driver
// get the usb phy @glue->xceiv
sunxi_musb_probe() -> devm_usb_get_phy().

2) register and unregister platform driver @musb_driver
musb_probe() -> sunxi_musb_init()
use the phy here
//the phy is released here
musb_remove() -> sunxi_musb_exit() -> devm_usb_put_phy()

3) register @musb_driver again
musb_probe() -> sunxi_musb_init()
use the phy here but the phy has been released at 2).
...

Fixed by reverting the commit, namely, removing devm_usb_put_phy()
from sunxi_musb_exit().

Fixes: 6ed05c68cb ("usb: musb: sunxi: Explicitly release USB PHY on exit")
Cc: stable@vger.kernel.org
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20241029-sunxi_fix-v1-1-9431ed2ab826@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-05 13:31:16 +01:00
..
cppi_dma.h
da8xx.c Merge 6.10-rc6 into usb-next 2024-07-01 13:59:29 +02:00
jz4740.c
Kconfig
Makefile
mediatek.c usb: musb: mediatek: Simplify code with dev_err_probe() 2024-09-11 15:25:09 +02:00
mpfs.c usb: musb: poll ID pin status in dual-role mode in mpfs glue layer 2024-08-13 10:37:18 +02:00
musb_core.c
musb_core.h
musb_cppi41.c
musb_debug.h
musb_debugfs.c
musb_dma.h
musb_dsps.c
musb_gadget_ep0.c
musb_gadget.c
musb_gadget.h
musb_host.c
musb_host.h
musb_io.h
musb_regs.h
musb_trace.c
musb_trace.h
musb_virthub.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
musbhsdma.c
omap2430.c
omap2430.h
sunxi.c usb: musb: sunxi: Fix accessing an released usb phy 2024-11-05 13:31:16 +01:00
tusb6010_omap.c
tusb6010.c
tusb6010.h
ux500_dma.c
ux500.c