diff mbox series

[v3,4/4] usb: xhci-mtk: use first-fit for LS/FS

Message ID 20210507021127.54717-4-chunfeng.yun@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/4] usb: xhci-mtk: use bitfield instead of bool | expand

Commit Message

Chunfeng Yun May 7, 2021, 2:11 a.m. UTC
Use first-fit instead of best-fit for LS/FS devices under TT,
we found that best-fit will consume more bandwidth for some
cases.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v3: no changes
---
 drivers/usb/host/xhci-mtk-sch.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ikjoon Jang June 10, 2021, 3:40 a.m. UTC | #1
On Fri, May 7, 2021 at 10:11 AM Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:
>
> Use first-fit instead of best-fit for LS/FS devices under TT,
> we found that best-fit will consume more bandwidth for some
> cases.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Reviewed-and-Tested-by: Ikjoon Jang <ikjn@chromium.org>

> ---
> v3: no changes
> ---
>  drivers/usb/host/xhci-mtk-sch.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c
> index 9fb75085e40f..c07411d9b16f 100644
> --- a/drivers/usb/host/xhci-mtk-sch.c
> +++ b/drivers/usb/host/xhci-mtk-sch.c
> @@ -634,6 +634,11 @@ static int check_sch_bw(struct mu3h_sch_bw_info *sch_bw,
>                         min_bw = worst_bw;
>                         min_index = offset;
>                 }
> +
> +               /* use first-fit for LS/FS */
> +               if (sch_ep->sch_tt && min_index >= 0)
> +                       break;
> +
>                 if (min_bw == 0)
>                         break;
>         }
> --
> 2.18.0
>
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c
index 9fb75085e40f..c07411d9b16f 100644
--- a/drivers/usb/host/xhci-mtk-sch.c
+++ b/drivers/usb/host/xhci-mtk-sch.c
@@ -634,6 +634,11 @@  static int check_sch_bw(struct mu3h_sch_bw_info *sch_bw,
 			min_bw = worst_bw;
 			min_index = offset;
 		}
+
+		/* use first-fit for LS/FS */
+		if (sch_ep->sch_tt && min_index >= 0)
+			break;
+
 		if (min_bw == 0)
 			break;
 	}