Skip to content

Commit b765a16

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: xhci-mtk: fix bpkts value of LS/HS periodic eps not behind TT
when a LS or FS device doesn't connect though a HS hub, the @bPkts field of its periodic endpoint context should be set to 1. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ccc04af commit b765a16

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

drivers/usb/host/xhci-mtk-sch.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ static bool need_bw_sch(struct usb_host_endpoint *ep,
275275
return false;
276276

277277
/*
278-
* for LS & FS periodic endpoints which its device don't attach
279-
* to TT are also ignored, root-hub will schedule them directly
278+
* for LS & FS periodic endpoints which its device is not behind
279+
* a TT are also ignored, root-hub will schedule them directly,
280+
* but need set @bpkts field of endpoint context to 1.
280281
*/
281282
if (is_fs_or_ls(speed) && !has_tt)
282283
return false;
@@ -339,8 +340,17 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
339340
GET_MAX_PACKET(usb_endpoint_maxp(&ep->desc)),
340341
usb_endpoint_dir_in(&ep->desc), ep);
341342

342-
if (!need_bw_sch(ep, udev->speed, slot_ctx->tt_info & TT_SLOT))
343+
if (!need_bw_sch(ep, udev->speed, slot_ctx->tt_info & TT_SLOT)) {
344+
/*
345+
* set @bpkts to 1 if it is LS or FS periodic endpoint, and its
346+
* device does not connected through an external HS hub
347+
*/
348+
if (usb_endpoint_xfer_int(&ep->desc)
349+
|| usb_endpoint_xfer_isoc(&ep->desc))
350+
ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(1));
351+
343352
return 0;
353+
}
344354

345355
bw_index = get_bw_index(xhci, udev, ep);
346356
sch_bw = &sch_array[bw_index];

0 commit comments

Comments
 (0)