Skip to contentSkip to conversation

usb: xhci-mtk: disable all ports when disable host controller

PATCH New Chunfeng Yun 1 participant 1 message May 27, 2022

Subsystems (4)
lore
Share & tools
lore

Chunfeng Yun

author maintainer
#0 lore raw

PATCH 1/1 usb: xhci-mtk: disable all ports when disable host controller

This is used to avoid the ports status of IPPC being brought in kernel stage, it may cause ports error especially when the xhci controller is a component of dual-role controller.

---
 drivers/usb/host/xhci-mtk.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-mtk.c +4 -2
index 18b4f55d89..3838a990ec 100644
@@ -122,11 +122,13 @@ static int xhci_mtk_host_disable(struct mtk_xhci *mtk)
 
 	/* power down all u3 ports */
 	for (i = 0; i < mtk->num_u3ports; i++)
-		setbits_le32(mtk->ippc + IPPC_U3_CTRL(i), CTRL_U3_PORT_PDN);
+		setbits_le32(mtk->ippc + IPPC_U3_CTRL(i),
+			     CTRL_U3_PORT_PDN | CTRL_U3_PORT_DIS);
 
 	/* power down all u2 ports */
 	for (i = 0; i < mtk->num_u2ports; i++)
-		setbits_le32(mtk->ippc + IPPC_U2_CTRL(i), CTRL_U2_PORT_PDN);
+		setbits_le32(mtk->ippc + IPPC_U2_CTRL(i),
+			     CTRL_U2_PORT_PDN | CTRL_U2_PORT_DIS);
 
 	/* power down host ip */
 	setbits_le32(mtk->ippc + IPPC_IP_PW_CTRL1, CTRL1_IP_HOST_PDN);
Signature · 1 line
2.18.0