fjpanag commented on code in PR #8943:
URL: https://github.com/apache/nuttx/pull/8943#discussion_r1165221204
##########
arch/arm/src/stm32/stm32_eth.c:
##########
@@ -2046,8 +2042,23 @@ static void stm32_interrupt_work(void *arg)
/* Clear the pending abnormal summary interrupt */
stm32_putreg(ETH_DMAINT_AIS, STM32_ETH_DMASR);
+
+ /* As per the datasheet's recommendation, the MAC
+ * needs to be reset for all abnormal events. The
+ * scheduled job will take the interface down and
+ * up again.
+ */
+
+ work_queue(ETHWORK, &priv->irqwork, stm32_txtimeout_work, priv, 0);
Review Comment:
Yes you are very correct about this!
But the delay is not the correct solution. Nothing guarantees that indeed
the `net_unlock()` line will be reached before this delay runs out, no matter
how large it is. The worker can always be scheduled-out in favor of a higher
priority (and long running) task just after the `work_queue()` call.
Either the network has to be unlocked before the work is queued, or these
two must be protected by a critical section.
I am in favor of the second solution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]