Commit 59eb83b
usb: typec: tcpci_husb311: Avoid unregister port on shutdown
Test on RK3576 EVB1, if do tcpci_unregister_port on
husb311_shutdown, it will cause two issues in reboot
test.
1. Introducing unnecessary usb mode initialization
in dwc3 driver, the call trace:
husb311_shutdown -> tcpci_unregister_port -> tcpm_reset_port ->
tcpm_mux_set -> usb_role_switch_set_role -> dwc3_usb_role_switch_set
2. More seriously, if the dwc3 driver is unbind before
husb311_shutdown, it will cause kernel panic.
(1) echo 23000000.usb > /sys/bus/platform/drivers/dwc3/unbind
(2) do reboot
(3) kernel panic with the following log:
Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000010
Mem abort info:
ESR = 0x0000000096000005
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x05: level 1 translation fault
Data abort info:
ISV = 0, ISS = 0x00000005
CM = 0, WnR = 0
user pgtable: 4k pages, 39-bit VAs, pgdp=00000001021ef000
[0000000000000010] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
Internal error: Oops: 0000000096000005 [khadas#1] PREEMPT SMP
Modules linked in:
CPU: 4 PID: 1 Comm: init Not tainted 6.1.99 khadas#110
Hardware name: Rockchip RK3576 EVB1 V10 Board (DT)
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : usb_role_switch_put+0x24/0x40
lr : tcpm_unregister_port+0x7c/0xd0
...
Call trace:
usb_role_switch_put+0x24/0x40
tcpm_unregister_port+0x7c/0xd0
tcpci_unregister_port+0x18/0x2c
husb311_shutdown+0x80/0xb0
i2c_device_shutdown+0x3c/0x5c
device_shutdown+0x16c/0x21c
kernel_restart+0x3c/0x104
Signed-off-by: William Wu <[email protected]>
Change-Id: Iab02d60b7e25d0cb086fa486e5f31b30029142ec1 parent 8e6926b commit 59eb83b
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
328 | 327 | | |
329 | 328 | | |
330 | 329 | | |
| |||
0 commit comments