ipq40xx: 5.10: fix ar40xx driver
authorNick Hainke <vincent@systemli.org>
Mon, 18 Apr 2022 13:04:25 +0000 (15:04 +0200)
committerDavid Bauer <mail@david-bauer.net>
Thu, 28 Apr 2022 22:27:25 +0000 (00:27 +0200)
commitab7e53e5cce703c7a62efbe1d41fb94c2228a178
tree6efdf8ddcb80498dc138d3b3969958346fe890e0
parentc283defa886f790ca3ab1c54f50b1a36d33d50ba
ipq40xx: 5.10: fix ar40xx driver

This commit is completely based on the work of adron-s:
https://github.com/openwrt/openwrt/pull/4721#issuecomment-1101108651

The commit fixes the data corruption on TX packets. Packets are
transmitted, but their contents are replaced with zeros. This error is
caused by the lack of guard (50 ms) intervals between calibration phases.
This error is treated by adding mdelay(50) to the calibration function
code. In the original qca-ssda code [0], these mdelays were existing, but
in the ar41xx.c they are gone.

Tested on:
- Fritz!Box 4040
- Fritz!Box 7530
- Mikrotik SXTsq 5AC
- ZyXEL NBG6617

- [0] https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk/-/blob/NHSS.QSDK.11.4/src/init/ssdk_init.c#L2072

Suggested-by: Serhii Serhieiev <adron@mstnt.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c