diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2024-02-29 16:14:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-02 20:25:28 +0100 |
commit | fb18e5bb96603cc79d97f03e4c05f3992cf28624 (patch) | |
tree | 2aa8cd1752e729facb44ff307c544c96c086cb3d /drivers/usb/host/xhci-dbgcap.h | |
parent | fd9d55d190c0e5fefd3a9165ea361809427885a1 (diff) | |
download | lwn-fb18e5bb96603cc79d97f03e4c05f3992cf28624.tar.gz lwn-fb18e5bb96603cc79d97f03e4c05f3992cf28624.zip |
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>
Diffstat (limited to 'drivers/usb/host/xhci-dbgcap.h')
-rw-r--r-- | drivers/usb/host/xhci-dbgcap.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-dbgcap.h b/drivers/usb/host/xhci-dbgcap.h index e39e3ae1677a..92661b555c2a 100644 --- a/drivers/usb/host/xhci-dbgcap.h +++ b/drivers/usb/host/xhci-dbgcap.h @@ -94,6 +94,7 @@ struct dbc_ep { #define DBC_QUEUE_SIZE 16 #define DBC_WRITE_BUF_SIZE 8192 +#define DBC_POLL_INTERVAL_DEFAULT 64 /* milliseconds */ /* * Private structure for DbC hardware state: @@ -140,6 +141,7 @@ struct xhci_dbc { enum dbc_state state; struct delayed_work event_work; + unsigned int poll_interval; /* ms */ unsigned resume_required:1; struct dbc_ep eps[2]; |