Skip to content

Commit be9fab3

Browse files
ptrcrnashif
authored andcommitted
drivers: usb: Prevent from perpetual locked state
The USB CDC driver is unable to process any bulk IN transfers after receiving spurious 'Clear Feature - Endpoint Halt' request from host due to perpetual locked state caused by previously scheduled transfer, that will never be finished, as the endpoint's state is set to NAK. Fix by ignoring spurious request. Signed-off-by: Piotr Ciura <[email protected]> (cherry picked from commit 29a191a)
1 parent 528d139 commit be9fab3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/usb/device/usb_dc_stm32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,10 @@ int usb_dc_ep_clear_stall(const uint8_t ep)
733733
return -EINVAL;
734734
}
735735

736+
if (!ep_state->ep_stalled) {
737+
return 0;
738+
}
739+
736740
status = HAL_PCD_EP_ClrStall(&usb_dc_stm32_state.pcd, ep);
737741
if (status != HAL_OK) {
738742
LOG_ERR("HAL_PCD_EP_ClrStall failed(0x%02x), %d", ep,

0 commit comments

Comments
 (0)