usb: xhci-mtk: fix random remote wakeup
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Tue, 2 Nov 2021 02:50:04 +0000 (10:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 13:56:55 +0000 (14:56 +0100)
commit0d8cfeeef3f5a5966abce1903f80308be33280cb
tree461b83d67fada528f34509c249ff9e3e2a0ad8e8
parent38269d2faddc26278edc99e14458c95dfd10455b
usb: xhci-mtk: 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 function 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.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20211102025004.29156-2-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mtk.c