ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices
PATCH 1/1 ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices
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.
--- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -1
@@ -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);
drivers/net/wireless/ath/ath9k/hw.c +1 -1
@@ -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;
Signature · 1 line
2.31.0
Quoted 11 lines
When the error check in
ath9k_hw_read_revisions()was added, it checked for-EIOwhich is whatath9k_regread()in theath9k_htcdriver uses. However, for plain ath9k, the register read function usesioread32(), 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 likeioread32()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 <[email protected]>
Hi Kalle
This patch is merged as "deferred" in patchwork - what's up with that?
-Toke
Quoted 9 lines · Toke Høiland-Jørgensen
Quoted 9 lines
When the error check in
ath9k_hw_read_revisions()was added, it checked for-EIOwhich is whatath9k_regread()in theath9k_htcdriver uses. However, for plain ath9k, the register read function usesioread32(), 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 likeioread32()does, and fix the error check to look for that instead of-EIO.
Quoted 6 lines
Quoted 2 lines
Fixes 2f90c7e5d094 ("ath9k: Check for errors when reading SREV register")Signed-off-by Toke Høiland-Jørgensen <[email protected]>Hi Kalle
This patch is merged as "deferred" in patchwork - what's up with that?
Just lack of time on my part. Reviewed-by tags would help a lot :)
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 11 lines · Kalle Valo
Quoted 9 lines · Toke Høiland-Jørgensen
Quoted 9 lines
When the error check in
ath9k_hw_read_revisions()was added, it checked for-EIOwhich is whatath9k_regread()in theath9k_htcdriver uses. However, for plain ath9k, the register read function usesioread32(), 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 likeioread32()does, and fix the error check to look for that instead of-EIO.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Fixes 2f90c7e5d094 ("ath9k: Check for errors when reading SREV register")Signed-off-by Toke Høiland-Jørgensen <[email protected]>Hi Kalle
This patch is merged as "deferred" in patchwork - what's up with that?
Just lack of time on my part. Reviewed-by tags would help a lot :)
Right, gotcha - will see if I can find someone to review :)
-Toke
Lorenzo Bianconi
Reviewed-byQuoted 11 lines
Quoted 9 lines · Toke Høiland-Jørgensen
Quoted 9 lines
When the error check in
ath9k_hw_read_revisions()was added, it checked for-EIOwhich is whatath9k_regread()in theath9k_htcdriver uses. However, for plain ath9k, the register read function usesioread32(), 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 likeioread32()does, and fix the error check to look for that instead of-EIO.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Fixes 2f90c7e5d094 ("ath9k: Check for errors when reading SREV register")Signed-off-by Toke Høiland-Jørgensen <[email protected]>Hi Kalle
This patch is merged as "deferred" in patchwork - what's up with that?
Just lack of time on my part. Reviewed-by tags would help a lot :)
Quoted 5 lines
Signature · 4 lines
-- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 6 lines · Toke Høiland-Jørgensen
When the error check in
ath9k_hw_read_revisions()was added, it checked for-EIOwhich is whatath9k_regread()in theath9k_htcdriver uses. However, for plain ath9k, the register read function usesioread32(), 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.
Quoted 7 lines
Fix this by changing
ath9k_regread()to return -1 on error likeioread32()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 <[email protected]>Reviewed-by Lorenzo Bianconi <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
7dd9a40fd6e0 ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches