usb: mtu3: fix random remote wakeup
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Thu, 26 Aug 2021 08:36:37 +0000 (16:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 11:41:52 +0000 (13:41 +0200)
commitd98a30ccdc839947c9233369744341d1fa54439c
treeb697f6f128ca3b9c667c70f37834713fe794f34c
parent50fdcb56c41904c3535687a0e1e1dbd9423a8f9a
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: b1a344589eea ("usb: mtu3: support ip-sleep wakeup for MT8183")
Cc: stable@vger.kernel.org
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20210826083637.33237-2-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/mtu3/mtu3_host.c
drivers/usb/mtu3/mtu3_plat.c