Many! thanks for the work and the drive to solve this problem (from reading i understand that Atheros knows the problem but don't want to solve it)
Actually, the chip has a hardware bug where spurious RF emissions affect the USB PLL. Of course, they will not aknowledge it as a critical bug as they found a software workaround for it.
This workaround is using some undocumented registers, and even the datasheet is normally under NDA only, which makes it very difficult for open source initiatives like OpenWrt to catch up. We basically just lost 2 years because of information obfuscation
For my understanding, this patch sets some bits from the USB controller registers (here the USB PLL) which are not set the right way at initialize (boot) but change when you switch off the WiFi?
Yes, you have to tweak some USB PLL bits every time you change the WiFi (init, change, reset...).
The original macro appeared publicly in QCA's github, but the merit of applying it to OpenWrt goes to the Carambola2 developers!