William Wu 59eb83b7aa 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 [#1] PREEMPT SMP
Modules linked in:
CPU: 4 PID: 1 Comm: init Not tainted 6.1.99 #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 <william.wu@rock-chips.com>
Change-Id: Iab02d60b7e25d0cb086fa486e5f31b30029142ec
2024-11-18 14:08:24 +08:00
2024-10-25 17:51:39 +08:00
2024-10-25 17:51:39 +08:00
2024-10-25 17:51:39 +08:00
2024-10-25 17:51:39 +08:00
2024-10-25 17:51:39 +08:00
2024-10-25 17:51:39 +08:00
2024-10-25 17:51:39 +08:00
2024-10-25 17:51:39 +08:00
2022-09-28 09:02:20 +02:00
2019-08-29 19:45:37 +08:00
2019-08-29 19:45:37 +08:00
2024-07-15 09:23:49 +02:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 7.9 GiB
Languages
C 97.7%
Assembly 1.6%
Makefile 0.3%
Perl 0.1%