Patch "ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ath9k-fix-error-check-in-ath9k_hw_read_revisions-for.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5dd9362abeb59cdd20f7f1c8a362e769d1a03cf3
Author: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
Date:   Fri Mar 26 19:08:19 2021 +0100

    ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices
    
    [ 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@xxxxxxxxxx>
    Reviewed-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210326180819.142480-1-toke@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index db0c6fa9c9dc..ff61ae34ecdf 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -246,7 +246,7 @@ static unsigned int ath9k_regread(void *hw_priv, u32 reg_offset)
 	if (unlikely(r)) {
 		ath_dbg(common, WMI, "REGISTER READ FAILED: (0x%04x, %d)\n",
 			reg_offset, r);
-		return -EIO;
+		return -1;
 	}
 
 	return be32_to_cpu(val);
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 6609ce122e6e..c86faebbc459 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -287,7 +287,7 @@ static bool ath9k_hw_read_revisions(struct ath_hw *ah)
 
 	srev = REG_READ(ah, AR_SREV);
 
-	if (srev == -EIO) {
+	if (srev == -1) {
 		ath_err(ath9k_hw_common(ah),
 			"Failed to read SREV register");
 		return false;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux