Description
Describe the bug
I am using the NXP MIMXRT1060-EVK with Microchip KSZ8081 Ethernet PHY. The function phy_mc_ksz8081_reset()
will busy wait for 500ms or even 1000ms (if a reset pin is configured) for the reset of the Ethernet PHY. The function will be called from the system workqueue for example when plugging in or out the Ethernet cable. By default, the system work queue priority is the lowest cooperative priority, i.e. the busy wait won't be preempted by any other thread until finished.
To Reproduce
Use for example the Telnet console sample
- west build --pristine -b mimxrt1060_evk samples/net/telnet
- run the sample from the debugger
- set breakpoint at
phy_mc_ksz8081_reset()
- unplug the Ethernet cable
phy_mc_ksz8081_reset()
will busy wait for 2x500ms in the context of the system workqueue
Expected behavior
Items in the system workqueue shall not perform blocking operations that would delay other system workqueue processing to an unacceptable degree.
Impact
Realtime deadlines might not be met. Our application is doing audio processing and blocking the thread providing audio samples to I2S driver will result in audio dropouts.
Environment
- OS: Windows
- Zephyr SDK 0.16.8
- Zephyr 3.7.0