2015-08-20 01:21:54

by Pan, Miaoqing

[permalink] [raw]
Subject: [PATCH v2 1/2] ath9k: fix AR_RX_FILTER for ar9462/ar9565 when rx stopped

From: Miaoqing Pan <[email protected]>

When rx stopped, AR_RX_FILTER should be cleared, but in
ath9k_hw_setrxfilter(), ATH9K_RX_FILTER_CONTROL_WRAPPER will always
be set for ar9462/ar9565.

Fix this by moving the code in ath9k_hw_setrxfilter() to
ath_calcrxfilter().

Signed-off-by: Miaoqing Pan <[email protected]>
---
drivers/net/wireless/ath/ath9k/hw.c | 3 ---
drivers/net/wireless/ath/ath9k/recv.c | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index a31a680..0e2b28c 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2760,9 +2760,6 @@ void ath9k_hw_setrxfilter(struct ath_hw *ah, u32 bits)

ENABLE_REGWRITE_BUFFER(ah);

- if (AR_SREV_9462(ah) || AR_SREV_9565(ah))
- bits |= ATH9K_RX_FILTER_CONTROL_WRAPPER;
-
REG_WRITE(ah, AR_RX_FILTER, bits);

phybits = 0;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index d3189da..0689f6b 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -424,6 +424,9 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
AR_SREV_9561(sc->sc_ah))
rfilt |= ATH9K_RX_FILTER_4ADDRESS;

+ if (AR_SREV_9462(sc->sc_ah) || AR_SREV_9565(sc->sc_ah))
+ rfilt |= ATH9K_RX_FILTER_CONTROL_WRAPPER;
+
if (ath9k_is_chanctx_enabled() &&
test_bit(ATH_OP_SCANNING, &common->op_flags))
rfilt |= ATH9K_RX_FILTER_BEACON;
--
1.9.1



2015-08-20 04:11:51

by Sujith Manoharan

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] ath9k: fix incorrect calibration initial for ar9561

[email protected] wrote:
> - if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah))
> + if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah) ||
> + AR_SREV_9561(ah))
> priv_ops->init_cal = ar9003_hw_init_cal_pcoem;
> else
> priv_ops->init_cal = ar9003_hw_init_cal_soc;

Are you sure about this ? AR9561 is not a PCOEM chip, IIRC.
Maybe the SoC routine is missing some code changes for AR956x ?

Sujith

2015-08-20 01:22:04

by Pan, Miaoqing

[permalink] [raw]
Subject: [PATCH v2 2/2] ath9k: fix incorrect calibration initial for ar9561

From: Miaoqing Pan <[email protected]>

One stuck issue was found on AP152, the root cause is using wrong
calibration initial function.

Signed-off-by: Miaoqing Pan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_calib.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 174442b..3880df7 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -1310,7 +1310,8 @@ static void ar9003_hw_do_pcoem_manual_peak_cal(struct ath_hw *ah,
struct ath9k_hw_cal_data *caldata = ah->caldata;
int i;

- if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah) && !AR_SREV_9485(ah))
+ if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah) && !AR_SREV_9485(ah) &&
+ !AR_SREV_9561(ah))
return;

if ((ah->caps.hw_caps & ATH9K_HW_CAP_RTT) && !run_rtt_cal)
@@ -1707,7 +1708,8 @@ void ar9003_hw_attach_calib_ops(struct ath_hw *ah)
struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
struct ath_hw_ops *ops = ath9k_hw_ops(ah);

- if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah))
+ if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah) ||
+ AR_SREV_9561(ah))
priv_ops->init_cal = ar9003_hw_init_cal_pcoem;
else
priv_ops->init_cal = ar9003_hw_init_cal_soc;
--
1.9.1


2015-08-20 07:07:45

by Pan, Miaoqing

[permalink] [raw]
Subject: RE: [PATCH v2 2/2] ath9k: fix incorrect calibration initial for ar9561

Thanks Sujith. You mentioned this before, so need more investigation, and this patch will be discarded.

Miaoqing

-----Original Message-----
From: Sujith Manoharan [mailto:[email protected]]
Sent: Thursday, August 20, 2015 11:47 AM
To: Pan, Miaoqing
Cc: [email protected]; [email protected]; ath9k-devel; Valo, Kalle
Subject: Re: [PATCH v2 2/2] ath9k: fix incorrect calibration initial for ar9561

[email protected] wrote:
> - if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah))
> + if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah) ||
> + AR_SREV_9561(ah))
> priv_ops->init_cal = ar9003_hw_init_cal_pcoem;
> else
> priv_ops->init_cal = ar9003_hw_init_cal_soc;

Are you sure about this ? AR9561 is not a PCOEM chip, IIRC.
Maybe the SoC routine is missing some code changes for AR956x ?

Sujith