Skip to content

Commit 5b8315f

Browse files
sparmarcdnsksacilotto
authored andcommitted
usb: cdns3: Enable TDL_CHK only for OUT ep
BugLink: https://bugs.launchpad.net/bugs/1939442 commit d6eef88 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Kelsey Skunberg <[email protected]>
1 parent e1c71a8 commit 5b8315f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/usb/cdns3/gadget.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ void cdns3_configure_dmult(struct cdns3_device *priv_dev,
15311531
else
15321532
mask = BIT(priv_ep->num);
15331533

1534-
if (priv_ep->type != USB_ENDPOINT_XFER_ISOC) {
1534+
if (priv_ep->type != USB_ENDPOINT_XFER_ISOC && !priv_ep->dir) {
15351535
cdns3_set_register_bit(&regs->tdl_from_trb, mask);
15361536
cdns3_set_register_bit(&regs->tdl_beh, mask);
15371537
cdns3_set_register_bit(&regs->tdl_beh2, mask);
@@ -1569,15 +1569,13 @@ void cdns3_ep_config(struct cdns3_endpoint *priv_ep)
15691569
case USB_ENDPOINT_XFER_INT:
15701570
ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_INT);
15711571

1572-
if ((priv_dev->dev_ver == DEV_VER_V2 && !priv_ep->dir) ||
1573-
priv_dev->dev_ver > DEV_VER_V2)
1572+
if (priv_dev->dev_ver >= DEV_VER_V2 && !priv_ep->dir)
15741573
ep_cfg |= EP_CFG_TDL_CHK;
15751574
break;
15761575
case USB_ENDPOINT_XFER_BULK:
15771576
ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_BULK);
15781577

1579-
if ((priv_dev->dev_ver == DEV_VER_V2 && !priv_ep->dir) ||
1580-
priv_dev->dev_ver > DEV_VER_V2)
1578+
if (priv_dev->dev_ver >= DEV_VER_V2 && !priv_ep->dir)
15811579
ep_cfg |= EP_CFG_TDL_CHK;
15821580
break;
15831581
default:

0 commit comments

Comments
 (0)