Skip to content

Commit 59820fd

Browse files
Wayne Changgregkh
authored andcommitted
usb: gadget: tegra-xudc: ACK ST_RC after clearing CTRL_RUN
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 <stable@kernel.org> Signed-off-by: Wayne Chang <waynec@nvidia.com> Link: https://lore.kernel.org/r/20250418081228.1194779-1-waynec@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b443265 commit 59820fd

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)