usb: xhci-mtk: relax TT periodic bandwidth allocation
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 19 Aug 2022 08:05:55 +0000 (16:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Sep 2022 10:28:07 +0000 (12:28 +0200)
commit27102b39b6d09a0afb37194107c03331b7634a81
tree8c20c8ae5f02372f743f12db3efbe62247f70de6
parentc548b99e1c37db6f7df86ecfe9a1f895d6c5966e
usb: xhci-mtk: relax TT periodic bandwidth allocation

commit 8b13ea05117ffad4727b0971ed09122d5c91c4dc upstream.

Currently uses the worst case byte budgets on FS/LS bus bandwidth,
for example, for an isochronos IN endpoint with 192 bytes budget, it
will consume the whole 5 uframes(188 * 5) while the actual FS bus
budget should be just 192 bytes. It cause that many usb audio headsets
with 3 interfaces (audio input, audio output, and HID) cannot be
configured.
To improve it, changes to use "approximate" best case budget for FS/LS
bandwidth management. For the same endpoint from the above example,
the approximate best case budget is now reduced to (188 * 2) bytes.

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