Skip to content

Commit d98a30c

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: mtu3: fix random remote wakeup
Some platforms, e.g. 8183/8192, use low level latch way to keep wakeup signal, it may latch a wrong signal if debounce more time, and enable wakeup earlier. ____________________ ip_sleep ____/ \__________ ___________________ wakeup_signal ____________/ \______ _______________________________ wakeup_en _______/ ^ ^ |(1) |(2) latch wakeup_signal mistakenly at (1), should latch it at (2); Workaround: delay about 100us to enable wakeup, meanwhile decrease debounce time. Fixes: b1a3445 ("usb: mtu3: support ip-sleep wakeup for MT8183") Cc: [email protected] Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 50fdcb5 commit d98a30c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/usb/mtu3/mtu3_host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable)
6262
case SSUSB_UWK_V1_1:
6363
reg = ssusb->uwk_reg_base + PERI_WK_CTRL0;
6464
msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
65-
val = enable ? (WC0_IS_EN | WC0_IS_C(0x8)) : 0;
65+
val = enable ? (WC0_IS_EN | WC0_IS_C(0x1)) : 0;
6666
break;
6767
case SSUSB_UWK_V1_2:
6868
reg = ssusb->uwk_reg_base + PERI_WK_CTRL0;

drivers/usb/mtu3/mtu3_plat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ static int wait_for_ip_sleep(struct ssusb_mtk *ssusb)
6363
if (ret) {
6464
dev_err(ssusb->dev, "ip sleep failed!!!\n");
6565
ret = -EBUSY;
66+
} else {
67+
/* workaround: avoid wrong wakeup signal latch for some soc */
68+
usleep_range(100, 200);
6669
}
6770

6871
return ret;

0 commit comments

Comments
 (0)