xhci: Fix repeated xhci wake after suspend due to uncleared internal wake state
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 11 Mar 2021 11:53:53 +0000 (13:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:30 +0000 (17:06 +0100)
commitfc411ca43bed94dcee7ecf4f0840f6b6afde6e5d
treed5460d8a8b4d9a0de62a9b273d74ecfff7dc7570
parent209b3ff98debaad55c6b8353ff51ef2ea9951c75
xhci: Fix repeated xhci wake after suspend due to uncleared internal wake state

commit d26c00e7276fc92b18c253d69e872f6b03832bad upstream.

If port terminations are detected in suspend, but link never reaches U0
then xHCI may have an internal uncleared wake state that will cause an
immediate wake after suspend.

This wake state is normally cleared when driver clears the PORT_CSC bit,
which is set after a device is enabled and in U0.

Write 1 to clear PORT_CSC for ports that don't have anything connected
when suspending. This makes sure any pending internal wake states in
xHCI are cleared.

Cc: stable@vger.kernel.org
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20210311115353.2137560-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c