arch/arm/stm32: Disable reception of self-transmitted frames.

Set ETH_MACCR_ROD unconditionally when configuring the MAC. In
half-duplex mode the MAC otherwise reflects every frame it transmits
back to its own receiver, flooding the receive path with our own
traffic right as a genuine reply arrives. The bit has no effect in
full-duplex (confirmed on our hardware: fduplex=1), so setting it
unconditionally is safe and changes nothing observable for boards
already running full-duplex.

The sibling stm32f7 driver has the same gap (ETH_MACCR_ROD cleared
but never set) and stm32h7's equivalent ETH_MACCR_DO bit has the same
issue; both are left out of scope here since only m3m4_v1 hardware
was available to validate against.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
(cherry picked from commit 41536cb8c9f5ff448864d2eb490b35aea7cdafcf)
This commit is contained in:
Daniel P. Carvalho 2026-09-13 12:21:39 -03:00 • committed by Alan C. Assis
parent 5938f58fd8
commit 6f7d54d096

View file

@ -3913,6 +3913,16 @@ static int stm32_macconfig(struct stm32_ethmac_s *priv)
regval &= ~MACCR_CLEAR_BITS;
regval |= MACCR_SET_BITS;
/* Disable reception of our own transmitted frames. In half-duplex
* mode the MAC otherwise reflects every frame it transmits back to
* its own receiver (this bit has no effect in full-duplex, so it is
* safe to set unconditionally). Without it, a busy transmitter can
* flood the receive path with its own traffic right as a genuine
* reply arrives.
*/
regval |= ETH_MACCR_ROD;
if (priv->fduplex)
{
/* Set the DM bit for full duplex support */