linux_dsm_epyc7002/drivers/net/wireless
Daniel F. Dickinson ce938231bd ath9k: Avoid OF no-EEPROM quirks without qca,no-eeprom
ath9k_of_init() function[0] was initially written on the assumption that
if someone had an explicit ath9k OF node that "there must be something
wrong, why would someone add an OF node if everything is fine"[1]
(Quoting Martin Blumenstingl <martin.blumenstingl@googlemail.com>)

"it turns out it's not that simple. with your requirements I'm now aware
of two use-cases where the current code in ath9k_of_init() doesn't work
without modifications"[1]

The "your requirements" Martin speaks of is the result of the fact that I
have a device (PowerCloud Systems CR5000) has some kind of default - not
unique mac address - set and requires to set the correct MAC address via
mac-address devicetree property, however:

"some cards come with a physical EEPROM chip [or OTP] so "qca,no-eeprom"
should not be set (your use-case). in this case AH_USE_EEPROM should be
set (which is the default when there is no OF node)"[1]

The other use case is:

the firmware on some PowerMac G5 seems to add a OF node for the ath9k
card automatically. depending on the EEPROM on the card AH_NO_EEP_SWAP
should be unset (which is the default when there is no OF node). see [3]

After this patch to ath9k_of_init() the new behavior will be:

    if there's no OF node then everything is the same as before
    if there's an empty OF node then ath9k will use the hardware EEPROM
      (before ath9k would fail to initialize because no EEPROM data was
      provided by userspace)
    if there's an OF node with only a MAC address then ath9k will use
      the MAC address and the hardware EEPROM (see the case above)
    with "qca,no-eeprom" EEPROM data from userspace will be requested.
      the behavior here will not change
[1]

Martin provides additional background on EEPROM swapping[1].

Thanks to Christian Lamparter <chunkeey@gmail.com> for all his help on
troubleshooting this issue and the basis for this patch.

[0]https://elixir.bootlin.com/linux/v4.20-rc7/source/drivers/net/wireless/ath/ath9k/init.c#L615
[1]https://github.com/openwrt/openwrt/pull/1645#issuecomment-448027058
[2]https://github.com/openwrt/openwrt/pull/1613
[3]https://patchwork.kernel.org/patch/10241731/

Fixes: 138b41253d ("ath9k: parse the device configuration from an OF node")
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-01-10 15:22:51 +02:00
..
admtek
ath ath9k: Avoid OF no-EEPROM quirks without qca,no-eeprom 2019-01-10 15:22:51 +02:00
atmel
broadcom brcmfmac: Fix access point mode 2018-12-20 08:49:01 +02:00
cisco Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-12-27 13:53:32 -08:00
intel wireless-drivers-next patches for 4.21 2018-12-20 16:47:10 -08:00
intersil Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-12-27 13:53:32 -08:00
marvell wireless-drivers-next patches for 4.21 2018-12-20 16:47:10 -08:00
mediatek wireless-drivers-next patches for 4.21 2018-12-20 16:47:10 -08:00
quantenna
ralink
realtek wireless-drivers-next patches for 4.21 2018-12-20 16:47:10 -08:00
rsi
st cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan() 2018-12-20 08:49:37 +02:00
ti wireless-drivers-next patches for 4.21 2018-12-03 15:44:27 -08:00
zydas
Kconfig mac80211-next: rtnetlink wifi simulation device 2018-12-05 15:31:31 +01:00
mac80211_hwsim.c This time we have too many changes to list, highlights: 2018-12-19 08:36:18 -08:00
mac80211_hwsim.h
Makefile mac80211-next: rtnetlink wifi simulation device 2018-12-05 15:31:31 +01:00
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c
virt_wifi.c mac80211-next: rtnetlink wifi simulation device 2018-12-05 15:31:31 +01:00
wl3501_cs.c
wl3501.h