FROMLIST: usb: xhci-mtk: handle bandwidth table rollover

xhci-mtk has 64 slots for periodic bandwidth calculations and each
slot represents byte budgets on a microframe. When an endpoint's
allocation sits on the boundary of the table, byte budgets' slot
should be rolled over but the current implementation doesn't.

This patch applies a 6 bits mask to the microframe index to handle
its rollover 64 slots and prevent out-of-bounds array access.

Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
(am from https://patchwork.kernel.org/patch/12425871/)
(also found at https://lore.kernel.org/r/20210809165904.RFC.1.I5165a4a8da5cac23c9928b1ec3c3a1a7383b7c23@changeid)

BUG=b:190087110, b:194321800
TEST=testing FS audio headsets in meet

[Regenerated the Change-Id, original CL: https://crrev.com/c/3103033]

Change-Id: I99617651972c3dc62829515ff22ce973d828a191
Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3106718
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Ikjoon Jang <ikjn@chromium.org>
Commit-Queue: Ikjoon Jang <ikjn@chromium.org>
2 files changed