Skip to content

Commit 59eb83b

Browse files
wuliangfengrkhuangtao
authored andcommitted
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: Iab02d60b7e25d0cb086fa486e5f31b30029142ec
1 parent 8e6926b commit 59eb83b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/usb/typec/tcpm/tcpci_husb311.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ static void husb311_shutdown(struct i2c_client *client)
324324

325325
disable_irq(client->irq);
326326
cancel_delayed_work_sync(&chip->pm_work);
327-
tcpci_unregister_port(chip->tcpci);
328327
}
329328

330329
static int husb311_pm_suspend(struct device *dev)

0 commit comments

Comments
 (0)