Skip to content

Commit e0fa498

Browse files
Wayne ChangSasha Levin
authored andcommitted
usb: gadget: tegra-xudc: ACK ST_RC after clearing CTRL_RUN
commit 59820fd upstream. We identified a bug where the ST_RC bit in the status register was not being acknowledged after clearing the CTRL_RUN bit in the control register. This could lead to unexpected behavior in the USB gadget drivers. This patch resolves the issue by adding the necessary code to explicitly acknowledge ST_RC after clearing CTRL_RUN based on the programming sequence, ensuring proper state transition. Fixes: 49db427 ("usb: gadget: Add UDC driver for tegra XUSB device mode controller") Cc: stable <[email protected]> Signed-off-by: Wayne Chang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2e956a3 commit e0fa498

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/usb/gadget/udc/tegra-xudc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,10 @@ static int __tegra_xudc_ep_disable(struct tegra_xudc_ep *ep)
17491749
val = xudc_readl(xudc, CTRL);
17501750
val &= ~CTRL_RUN;
17511751
xudc_writel(xudc, val, CTRL);
1752+
1753+
val = xudc_readl(xudc, ST);
1754+
if (val & ST_RC)
1755+
xudc_writel(xudc, ST_RC, ST);
17521756
}
17531757

17541758
dev_info(xudc->dev, "ep %u disabled\n", ep->index);

0 commit comments

Comments
 (0)