From 7a2ae9ab560d2c89c4bdc19b54aebdfec206be56 Mon Sep 17 00:00:00 2001 From: "he.he" Date: Mon, 31 Jul 2023 17:08:30 +0800 Subject: [PATCH] usb: unplug full speed device on m31phy with and panic [1/1] PD#SWPL-134215 Problem: unplug full speed device on m31phy with and panic Solution: there is no amlogic_usb_v2 struct in usb_phy_trim_tuning for m31phy, so it needs to do some filtering. Verify: t5m, t3 Change-Id: I65a6f968229ef41da8aaa0024cd7438693d5a935 Signed-off-by: he.he --- include/linux/amlogic/usb-v2-common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/amlogic/usb-v2-common.h b/include/linux/amlogic/usb-v2-common.h index 47d68d2a3..a3521d9a5 100644 --- a/include/linux/amlogic/usb-v2-common.h +++ b/include/linux/amlogic/usb-v2-common.h @@ -83,6 +83,10 @@ usb_phy_trim_tuning(struct usb_phy *x, int port, int default_val) struct amlogic_usb_v2 *aml_phy; if (x) { + if (x->label) + if (!strncmp(x->label, "amlogic-usbm31phy3", 18) || + !strncmp(x->label, "amlogic-usb2-m31-phy", 20)) + return; aml_phy = container_of(x, struct amlogic_usb_v2, phy); if (aml_phy->phy_trim_tuning)