HAL_ETH_Transmit_IT() and HAL_ETH_Transmit() do not set HAL_ETH_STATE_BUSY before modifying TX descriptors creating race-condition #71
Labels
bug
Something isn't working
eth
Ethernet-related issue or pull-request
hal
HAL-LL driver-related issue or pull-request.
internal bug tracker
Issue confirmed and reported into a ticket in the internal bug tracking system
HAL_ETH_Transmit_IT()
andHAL_ETH_Transmit()
both test gState but do not set it to HAL_ETH_STATE_BUSY before operating on the TX descriptors insideETH_Prepare_Tx_Descriptors()
. This creates a race-condition among themselves and among each other when used concurrently from multiple threads (e.g. preemption under FreeRTOS).Also Test-and-Set of gState needs to be done atomically (see #70).
stm32h7xx_hal_driver/Src/stm32h7xx_hal_eth.c
Lines 1002 to 1009 in ceda3ce
Expected was at minimum a Test-and-Set like this:
stm32h7xx_hal_driver/Src/stm32h7xx_hal_eth.c
Lines 719 to 721 in ceda3ce
The text was updated successfully, but these errors were encountered: