Skip to content

Commit 84e8c9f

Browse files
ptrcrfabiobaltieri
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 f82ade9 commit 84e8c9f

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
@@ -865,6 +865,10 @@ int usb_dc_ep_clear_stall(const uint8_t ep)
865865
return -EINVAL;
866866
}
867867

868+
if (!ep_state->ep_stalled) {
869+
return 0;
870+
}
871+
868872
status = HAL_PCD_EP_ClrStall(&usb_dc_stm32_state.pcd, ep);
869873
if (status != HAL_OK) {
870874
LOG_ERR("HAL_PCD_EP_ClrStall failed(0x%02x), %d", ep,

0 commit comments

Comments
 (0)