wifi: brcmfmac: Detect corner error case earlier with log
authorNeal Sidhwaney <nealsid@gmail.com>
Sat, 3 Jun 2023 06:00:23 +0000 (02:00 -0400)
committerKalle Valo <kvalo@kernel.org>
Thu, 8 Jun 2023 16:00:00 +0000 (19:00 +0300)
commitf8f912bf69a021c8cfff23e69e59c7c975a47c1a
tree64bae774f5eb865234512b119cf5b740d2b3c769
parent5883fc2ef8573649ee6a63968ae82e679766b878
wifi: brcmfmac: Detect corner error case earlier with log

In brcmf_chip_recognition(), the return value from an MMIO read is
interpreted as various fields without checking if it failed, which is
harmless today, as the interpreted fields are checked for validity a
few lines below.  However, in corner cases (on my MacbookPro 14,1,
sometimes after waking from sleep or soft reboot), when this happens,
it causes the logging to be misleading, because the message indicates
an unsupported chip type ("brcmfmac: brcmf_chip_recognition: chip
backplane type 15 is not supported").  This patch detects this case
slightly earlier and logs an appropriate message, with the same return
result as is the case today.

Signed-off-by: Neal Sidhwaney <nealsid@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230603060021.57225-1-nealsid@gmail.com
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c