reform-hw-setup: bring down end0 before a311d PHY fix

The PHY reset workaround reloads the dwmac_meson8b and mdio_mux_meson_g12a modules to work around a PHY reset problem on the A311D. This was failing with "Module dwmac_meson8b is in use" at boot on some systems (seen on minimal Arch Linux Arm install).

Investigation showed the module is transiently held by the kernel's async MDIO bus initialisation, which runs in a workqueue after the driver probe returns and can still be in progress when the service starts.

Fix this by polling /sys/module/dwmac_meson8b/refcnt until it reaches zero before attempting the rmmod sequence.

Fixes: #16 (closed)

Signed-off-by: Stephano Cetola stephano@cetola.net

Edited by Stephano Cetola

Merge request reports

Loading