]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices
authorToke Høiland-Jørgensen <toke@redhat.com>
Fri, 26 Mar 2021 18:08:19 +0000 (19:08 +0100)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:42 +0000 (17:46 -0600)
commitab41ab52df6d388efd1064b9268fe710dccef2b3
treeb6176c6d6991d39831c5ed9374820a51f9f0ebb8
parent782b50bc1a46e7fd88e43f1b1aad80942bd1d067
ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 7dd9a40fd6e0d0f1fd8e1931c007e080801dfdce ]

When the error check in ath9k_hw_read_revisions() was added, it checked for
-EIO which is what ath9k_regread() in the ath9k_htc driver uses. However,
for plain ath9k, the register read function uses ioread32(), which just
returns -1 on error. So if such a read fails, it still gets passed through
and ends up as a weird mac revision in the log output.

Fix this by changing ath9k_regread() to return -1 on error like ioread32()
does, and fix the error check to look for that instead of -EIO.

Fixes: 2f90c7e5d094 ("ath9k: Check for errors when reading SREV register")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210326180819.142480-1-toke@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/hw.c