[OpenWrt-Devel] [PATCH] [RFC] ar71xx: fix Mikrotik wAP AC QCA955X SGMII link loss

David Bauer mail at david-bauer.net
Wed Jul 10 15:04:44 EDT 2019

Hello Etienne,

sorry for my late reply.

On 7/7/19 7:26 AM, Etienne Champetier wrote:
> This commit rework
> "ar71xx: allow to override at803x sgmii aneg status" (4e39e213af7e3e0cd747403e8c227e145cfef988)
> by moving override_sgmii_aneg param from "at803x_platform_data" to "device" struct
> Not sure if it's the right place for it, but wAP AC uses "mdio_gpio_platform_data" struct,
> so the current patch is currently accessing some random memory.

This commit moves 'override_sgmii_aneg' to the generic device struct,
which is less than an ideal place for it. 'override_sgmii_aneg' enables a
hack which overrides an early exit in the PHY state-machine. Otherwise, the
ethernet driver is never informed of the link state-change and does not do it's
fixup work while the PHY driver cries over the broken link.

There's nothing wrong with adding the 'mdio_gpio_platform_data' struct as platform_data
for the mdio-gpio device. Remember, the platform-data is only for the device providing the
mdio-bus, not the mdio device (the PHY).

Have a look how it's done for the AVM FRITZ!WLAN Repeater 450E (mach-fritz450e.c).
The 'mdio_board_info' struct (which contains the 'at803x_platform_data' struct) is registered
to the mdio-device by calling 'mdiobus_register_board_info' in the initiaization code.
Your bus-id is most likely 'mdio-gpio.0'.

I hope this helps you into the right direction :)

Best wishes

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list