Skip to contentSkip to conversation

wifi: rt2x00: use VCO_IC 0x2 for RF3053 on 2.4 GHz

RFC PATCH In review Ho Jie Feng 2 participants 5 messages Oct 12 – Oct 14 Ralink RT2X00 wireless LAN driver

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 wifi: rt2x00: use VCO_IC 0x2 for RF3053 on 2.4 GHz

Using the 0x1, the VCO calibration result is 0x7f on channels 6 and below. Using 0x2 fixes it.

Hardware: Netgear WNDA4100 (USB 0846:9013, RT3593 rev 0402, RF3053)

---
RFC for this since I am not sure if it is a generic fix, since the vendor driver also doesn't use VCO_IC=0x2.
Is this also a known issue?

Testing on different hardware would be appreciated.

 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2800lib.c +1 -1
index 2e2e382b62475..4a44a0222210d 100644
@@ -2979,7 +2979,7 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
 
 	rfcsr = rt2800_rfcsr_read(rt2x00dev, 6);
 	if (rf->channel >= 1 && rf->channel <= 14)
-		rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 1);
+		rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 2);
 	else if (rf->channel >= 36 && rf->channel <= 64)
 		rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 2);
 	else if (rf->channel >= 100 && rf->channel <= 128)

base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e

Signature · 1 line
2.55.0
#1 lore raw

Hi

Quoted 10 lines · Ho Jie Feng

Using the 0x1, the VCO calibration result is 0x7f on channels 6 and below. Using 0x2 fixes it.

Hardware: Netgear WNDA4100 (USB 0846:9013, RT3593 rev 0402, RF3053)

---
RFC for this since I am not sure if it is a generic fix, since the vendor driver also doesn't use VCO_IC=0x2.
Is this also a known issue?

Could you elaborate what is the issue and what you mean by "VCO calibration result is 0x7f" ?

Regards
Stanislaw

Quoted 23 lines

Testing on different hardware would be appreciated.

 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2800lib.c +1 -1
index 2e2e382b62475..4a44a0222210d 100644
@@ -2979,7 +2979,7 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
 
 	rfcsr = rt2800_rfcsr_read(rt2x00dev, 6);
 	if (rf->channel >= 1 && rf->channel <= 14)
-		rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 1);
+		rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 2);
 	else if (rf->channel >= 36 && rf->channel <= 64)
 		rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 2);
 	else if (rf->channel >= 100 && rf->channel <= 128)

base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e

Signature · 1 line
2.55.0
author
#2 lore raw
Quoted 9 lines · Stanislaw Gruszka

Hi

Quoted 5 lines · Ho Jie Feng

Using the 0x1, the VCO calibration result is 0x7f on channels 6 and below. Using 0x2 fixes it.

Hardware: Netgear WNDA4100 (USB 0846:9013, RT3593 rev 0402, RF3053)

Quoted 8 lines
Quoted 5 lines

---
RFC for this since I am not sure if it is a generic fix, since the vendor driver also doesn't use VCO_IC=0x2.
Is this also a known issue?

Could you elaborate what is the issue and what you mean by "VCO calibration result is 0x7f" ?'

I had accidentally left the description out, sorry about that.

The adapter doesn't work on the lower channels in 2.4GHz, channels 8 and below. This looked like an issue with the PLL or something after debugging.

By tuning to channels 1-12 and using the debugfs to dump the RFCSR registers, RFCSR4 is always 0x7f on the failing channels consistently. Since there is code to switch RFCSR6 based on channel, I tried the same as the 5GHz code to switch RFCSR6=0x2 for lower channels and it worked on all the channels surprisingly.

Due to the behaviour of RFCSR4, I think it is a VCO calibration result since it seems to change after enabling the calibration.

I could not find any mention of this issue elsewhere, and suspect either this hardware has very few Linux users or my hardware is special in some way, so I can't guarantee that setting it to 0x2 will work with another device even if it is the same WNDA4100 model and chipset, so some testing would be appreciated.

Quoted 26 lines

Regards
Stanislaw

Quoted 23 lines

Testing on different hardware would be appreciated.

 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2800lib.c +1 -1
index 2e2e382b62475..4a44a0222210d 100644
@@ -2979,7 +2979,7 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
 
      rfcsr = rt2800_rfcsr_read(rt2x00dev, 6);
      if (rf->channel >= 1 && rf->channel <= 14)
-             rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 1);
+             rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 2);
      else if (rf->channel >= 36 && rf->channel <= 64)
              rt2x00_set_field8(&rfcsr, RFCSR6_VCO_IC, 2);
      else if (rf->channel >= 100 && rf->channel <= 128)

base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e --
2.55.0

#3 lore raw
Quoted 8 lines · Jie Feng
Quoted 7 lines · Stanislaw Gruszka

Hi

Quoted 3 lines · Ho Jie Feng

Using the 0x1, the VCO calibration result is 0x7f on channels 6 and below. Using 0x2 fixes it.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Hardware: Netgear WNDA4100 (USB 0846:9013, RT3593 rev 0402, RF3053)

---
RFC for this since I am not sure if it is a generic fix, since the vendor driver also doesn't use VCO_IC=0x2.

I looked at vendor driver it does not set VCO_IC=0x2 when switch a channel. However it does it after wake up from suspend:
https://github.com/ashaffer/rt3573sta/blob/09b80e6290769c53736dc09c5ae9025e15bfbe69/chips/rt3593.c#L194

This function: RT3593ReverseRFSleepModeSetup seams to be partially the same what NICInitRT3593RFRegisters does.

Also NICInitRT3593RFRegisters it's different from rt2800_init_rfcsr_3593() i.e. it set RF_R02 before GPIO_SWITCH.

Could you check if modifying rt2800_init_rfcsr_3593() to be more the same with both NICInitRT3593RFRegistersr and RT3593ReverseRFSleepModeSetup (regarding RF_R06 change) solve the problem?

Quoted 1 line
Quoted 1 line
Quoted 1 line

Is this also a known issue?

I didn't knew about it.

Quoted 3 lines
Quoted 2 lines

Could you elaborate what is the issue and what you mean by "VCO calibration result is 0x7f" ?'

I had accidentally left the description out, sorry about that.

No problem.

Quoted 13 lines

The adapter doesn't work on the lower channels in 2.4GHz, channels 8 and below. This looked like an issue with the PLL or something after debugging.

By tuning to channels 1-12 and using the debugfs to dump the RFCSR registers, RFCSR4 is always 0x7f on the failing channels consistently. Since there is code to switch RFCSR6 based on channel, I tried the same as the 5GHz code to switch RFCSR6=0x2 for lower channels and it worked on all the channels surprisingly.

Due to the behaviour of RFCSR4, I think it is a VCO calibration result since it seems to change after enabling the calibration.

Quoted 6 lines

I could not find any mention of this issue elsewhere, and suspect either this hardware has very few Linux users or my hardware is special in some way, so I can't guarantee that setting it to 0x2 will work with another device even if it is the same WNDA4100 model and chipset, so some testing would be appreciated.

I do not have RT3573/RT3593 device by myself and ordinary users do not read linux-wireless mailing list, so we have rather little chance to get more test coverage here.

Anyways, if init change that would make rt2800_init_rfcsr_3593() more like vendor driver do not fix the problem, it's ok to modify rt2800_config_channel_rf3053().

If we want to be more safe with the change, we can limit it with rt2x00_rt_rev() using 'rev' of your tested device.

Regards
Stanislaw

author
#4 lore raw
Quoted 10 lines · Stanislaw Gruszka
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

RFC for this since I am not sure if it is a generic fix, since the vendor driver also doesn't use VCO_IC=0x2.

I looked at vendor driver it does not set VCO_IC=0x2 when switch a channel. However it does it after wake up from suspend:
https://github.com/ashaffer/rt3573sta/blob/09b80e6290769c53736dc09c5ae9025e15bfbe69/chips/rt3593.c#L194

This function: RT3593ReverseRFSleepModeSetup seams to be partially the same what NICInitRT3593RFRegisters does.

Quoted 7 lines

Also NICInitRT3593RFRegisters it's different from rt2800_init_rfcsr_3593() i.e. it set RF_R02 before GPIO_SWITCH.

Could you check if modifying rt2800_init_rfcsr_3593() to be more the same with both NICInitRT3593RFRegistersr and RT3593ReverseRFSleepModeSetup (regarding RF_R06 change) solve the problem?

It didn't solve the problem.

Quoted 23 lines
Quoted 13 lines

The adapter doesn't work on the lower channels in 2.4GHz, channels 8 and below. This looked like an issue with the PLL or something after debugging.

By tuning to channels 1-12 and using the debugfs to dump the RFCSR registers, RFCSR4 is always 0x7f on the failing channels consistently. Since there is code to switch RFCSR6 based on channel, I tried the same as the 5GHz code to switch RFCSR6=0x2 for lower channels and it worked on all the channels surprisingly.

Due to the behaviour of RFCSR4, I think it is a VCO calibration result since it seems to change after enabling the calibration.

Quoted 6 lines

I could not find any mention of this issue elsewhere, and suspect either this hardware has very few Linux users or my hardware is special in some way, so I can't guarantee that setting it to 0x2 will work with another device even if it is the same WNDA4100 model and chipset, so some testing would be appreciated.

I do not have RT3573/RT3593 device by myself and ordinary users do not read linux-wireless mailing list, so we have rather little chance to get more test coverage here.

Quoted 6 lines

Anyways, if init change that would make rt2800_init_rfcsr_3593() more like vendor driver do not fix the problem, it's ok to modify rt2800_config_channel_rf3053().

If we want to be more safe with the change, we can limit it with rt2x00_rt_rev() using 'rev' of your tested device.

My concern is that it is just my specific device being at fault here. It also seems to have an issue where the TX looks to be much weaker than normal.