Skip to content

Commit d6eef88

Browse files
sparmarcdnsPeter Chen
authored andcommitted
usb: cdns3: Enable TDL_CHK only for OUT ep
ZLP gets stuck if TDL_CHK bit is set and TDL_FROM_TRB is used as TDL source for IN endpoints. To fix it, TDL_CHK is only enabled for OUT endpoints. Fixes: 7733f6c ("usb: cdns3: Add Cadence USB3 DRD Driver") Reported-by: Aswath Govindraju <[email protected]> Signed-off-by: Sanket Parmar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Peter Chen <[email protected]>
1 parent 9e3927f commit d6eef88

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/usb/cdns3/cdns3-gadget.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ static void cdns3_configure_dmult(struct cdns3_device *priv_dev,
20072007
else
20082008
mask = BIT(priv_ep->num);
20092009

2010-
if (priv_ep->type != USB_ENDPOINT_XFER_ISOC) {
2010+
if (priv_ep->type != USB_ENDPOINT_XFER_ISOC && !priv_ep->dir) {
20112011
cdns3_set_register_bit(&regs->tdl_from_trb, mask);
20122012
cdns3_set_register_bit(&regs->tdl_beh, mask);
20132013
cdns3_set_register_bit(&regs->tdl_beh2, mask);
@@ -2046,15 +2046,13 @@ int cdns3_ep_config(struct cdns3_endpoint *priv_ep, bool enable)
20462046
case USB_ENDPOINT_XFER_INT:
20472047
ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_INT);
20482048

2049-
if ((priv_dev->dev_ver == DEV_VER_V2 && !priv_ep->dir) ||
2050-
priv_dev->dev_ver > DEV_VER_V2)
2049+
if (priv_dev->dev_ver >= DEV_VER_V2 && !priv_ep->dir)
20512050
ep_cfg |= EP_CFG_TDL_CHK;
20522051
break;
20532052
case USB_ENDPOINT_XFER_BULK:
20542053
ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_BULK);
20552054

2056-
if ((priv_dev->dev_ver == DEV_VER_V2 && !priv_ep->dir) ||
2057-
priv_dev->dev_ver > DEV_VER_V2)
2055+
if (priv_dev->dev_ver >= DEV_VER_V2 && !priv_ep->dir)
20582056
ep_cfg |= EP_CFG_TDL_CHK;
20592057
break;
20602058
default:

0 commit comments

Comments
 (0)