Skip to content

Commit 29a191a

Browse files
ptrcrkartben
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]>
1 parent b756524 commit 29a191a

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
@@ -869,6 +869,10 @@ int usb_dc_ep_clear_stall(const uint8_t ep)
869869
return -EINVAL;
870870
}
871871

872+
if (!ep_state->ep_stalled) {
873+
return 0;
874+
}
875+
872876
status = HAL_PCD_EP_ClrStall(&usb_dc_stm32_state.pcd, ep);
873877
if (status != HAL_OK) {
874878
LOG_ERR("HAL_PCD_EP_ClrStall failed(0x%02x), %d", ep,

0 commit comments

Comments
 (0)