Commit 93385908 authored by Piotr Ciura's avatar Piotr Ciura Committed by github-actions[bot]
Browse files

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: default avatarPiotr Ciura <piotr.ciura@hidglobal.com>
(cherry picked from commit 29a191ad)
parent c08390df
Loading
Loading
Loading
Loading
+4 −0
Changes for drivers/usb/device/usb_dc_stm32.c: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -772,6 +772,10 @@ int usb_dc_ep_clear_stall(const uint8_t ep)
		return -EINVAL;
	}

	if (!ep_state->ep_stalled) {
		return 0;
	}

	status = HAL_PCD_EP_ClrStall(&usb_dc_stm32_state.pcd, ep);
	if (status != HAL_OK) {
		LOG_ERR("HAL_PCD_EP_ClrStall failed(0x%02x), %d", ep,