xhci: dbc: poll at different rate depending on data transfer activity
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 29 Feb 2024 14:14:37 +0000 (16:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Mar 2024 19:25:28 +0000 (20:25 +0100)
commitfb18e5bb96603cc79d97f03e4c05f3992cf28624
tree2aa8cd1752e729facb44ff307c544c96c086cb3d
parentfd9d55d190c0e5fefd3a9165ea361809427885a1
xhci: dbc: poll at different rate depending on data transfer activity

DbC driver starts polling for events immediately when DbC is enabled.
The current polling interval is 1ms, which keeps the CPU busy, impacting
power management even when there are no active data transfers.

Solve this by polling at a slower rate, with a 64ms interval as default
until a transfer request is queued, or if there are still are pending
unhandled transfers at event completion.

Tested-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240229141438.619372-9-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-dbgcap.c
drivers/usb/host/xhci-dbgcap.h