Skip to content

Commit 40dbf73

Browse files
committed
usb: gadget: f_uac: update maxpacket in function bind
This patch fixes the bug of RV1126 USB crash when configed as UVC + UAC + RNDIS + ADB. If we resize txfifo before opening UAC stream, the maxpacket of epin will be the default value 1024 and txfifo will exceed the maximum limit. Fixes: e658b2131e79 ("usb: dwc3: gadget: fix tx fifos resize for disabled eps") Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com> Change-Id: I1e892b11a0bdda2877d3e17148867d21cb68238c
1 parent f8d69a5 commit 40dbf73

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/usb/gadget/function/f_uac1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ static int f_audio_bind(struct usb_configuration *c, struct usb_function *f)
930930
ep = usb_ep_autoconfig(cdev->gadget, &as_in_ep_desc);
931931
if (!ep)
932932
goto fail;
933+
ep->maxpacket = usb_endpoint_maxp(&as_in_ep_desc) & 0x7ff;
933934
audio->in_ep = ep;
934935
audio->in_ep->desc = &as_in_ep_desc;
935936
}

drivers/usb/gadget/function/f_uac2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
813813
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
814814
return -ENODEV;
815815
}
816+
agdev->in_ep->maxpacket =
817+
usb_endpoint_maxp(&fs_epin_desc) & 0x7ff;
816818
}
817819

818820
agdev->in_ep_maxpsize = max_t(u16,

0 commit comments

Comments
 (0)