Skip to content

Commit 2585973

Browse files
Haotien Hsugregkh
authored andcommitted
usb: gadget: tegra-xudc: Always reinitialize data toggle when clear halt
The driver previously skipped handling ClearFeature(ENDPOINT_HALT) when the endpoint was already not halted. This prevented the controller from resetting the data sequence number and reinitializing the endpoint state. According to USB 3.2 specification Rev. 1.1, section 9.4.5, ClearFeature(ENDPOINT_HALT) must always reset the data sequence and set the stream state machine to Disabled, regardless of whether the endpoint was halted. Remove the early return so that ClearFeature(ENDPOINT_HALT) always resets the endpoint sequence state as required by the specification. Fixes: 49db427 ("usb: gadget: Add UDC driver for tegra XUSB device mode controller") Cc: stable <stable@kernel.org> Signed-off-by: Haotien Hsu <haotienh@nvidia.com> Signed-off-by: Wayne Chang <waynec@nvidia.com> Link: https://patch.msgid.link/20251127033540.2287517-1-waynec@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c7bbc43 commit 2585973

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,12 +1558,6 @@ static int __tegra_xudc_ep_set_halt(struct tegra_xudc_ep *ep, bool halt)
15581558
return -ENOTSUPP;
15591559
}
15601560

1561-
if (!!(xudc_readl(xudc, EP_HALT) & BIT(ep->index)) == halt) {
1562-
dev_dbg(xudc->dev, "EP %u already %s\n", ep->index,
1563-
halt ? "halted" : "not halted");
1564-
return 0;
1565-
}
1566-
15671561
if (halt) {
15681562
ep_halt(xudc, ep->index);
15691563
} else {

0 commit comments

Comments
 (0)