Skip to contentSkip to conversation

rt2800: do not enable tbtt unless we are in a beacon mode

PATCH In review Josef Bacik 5 participants 5 messages Nov 16, 2009 – Nov 17, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2800: do not enable tbtt unless we are in a beacon mode

Please be gentle, I'm a fs developer and this is my first foray into drivers, as I'm tired of building ralinks driver everytime I update my kernel. Whenever I load the rt2800pci driver my box bogs down, and a few printk's later I discovered its because I was getting 10's of thousands of TBTT interrupts a second. I discovered this was because we were setting the beacon timer to 0, which is apparently what TBTT keys off of. It seems to me that we should only be enabling TBTT when we are in a beacon transmitting mode, which from what I can tell is in AD-HOC and other such modes where the mac80211 layer would have given us a proper beacon_int to set the beacon timer to instead of 0. So this is my fix, only enable TBTT if our sync mode is for beacon. This makes it so my box doesn't die everytime I load the rt2800pci driver. Let me know if this is acceptable, I just learned all these terms about 15 minutes ago via wikipedia, so I really am not familiar with how this stuff is supposed to work. Thanks,

---
 drivers/net/wireless/rt2x00/rt2800lib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +2 -1
index eb6d129..e90d6fd 100644
@@ -560,7 +560,8 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
 		rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
 		rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
 		rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_SYNC, conf->sync);
-		rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
+		rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE,
+				   (conf->sync == TSF_SYNC_BEACON));
 		rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
 	}
 
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 25 lines · Josef Bacik

Please be gentle, I'm a fs developer and this is my first foray into drivers, as I'm tired of building ralinks driver everytime I update my kernel.  Whenever I load the rt2800pci driver my box bogs down, and a few printk's later I discovered its because I was getting 10's of thousands of TBTT interrupts a second.  I discovered this was because we were setting the beacon timer to 0, which is apparently what TBTT keys off of.  It seems to me that we should only be enabling TBTT when we are in a beacon transmitting mode, which from what I can tell is in AD-HOC and other such modes where the mac80211 layer would have given us a proper beacon_int to set the beacon timer to instead of 0.  So this is my fix, only enable TBTT if our sync mode is for beacon.  This makes it so my box doesn't die everytime I load the rt2800pci driver.  Let me know if this is acceptable, I just learned all these terms about 15 minutes ago via wikipedia, so I really am not familiar with how this stuff is supposed to work.  Thanks,

---
 drivers/net/wireless/rt2x00/rt2800lib.c |    3 ++-

 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +0 -0
index eb6d129..e90d6fd 100644

drivers/net/wireless/rt2x00/rt2800lib.c void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, · line 567

Quoted 9 lines
drivers/net/wireless/rt2x00/rt2800lib.c +2 -1
@@ -560,7 +560,8 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
                rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
                rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
                rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_SYNC, conf->sync);
-               rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
+               rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE,
+                                  (conf->sync == TSF_SYNC_BEACON));
                rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
        }
 

Oh btw this is against the wireless-testing git tree, I forgot to mention that. Thanks,

Josef

#2 lore raw
Quoted 30 lines · Josef Bacik
Quoted 29 lines · Josef Bacik

Please be gentle, I'm a fs developer and this is my first foray into drivers, as I'm tired of building ralinks driver everytime I update my kernel.  Whenever I load the rt2800pci driver my box bogs down, and a few printk's later I discovered its because I was getting 10's of thousands of TBTT interrupts a second.  I discovered this was because we were setting the beacon timer to 0, which is apparently what TBTT keys off of.  It seems to me that we should only be enabling TBTT when we are in a beacon transmitting mode, which from what I can tell is in AD-HOC and other such modes where the mac80211 layer would have given us a proper beacon_int to set the beacon timer to instead of 0.  So this is my fix, only enable TBTT if our sync mode is for beacon.  This makes it so my box doesn't die everytime I load the rt2800pci driver.  Let me know if this is acceptable, I just learned all these terms about 15 minutes ago via wikipedia, so I really am not familiar with how this stuff is supposed to work.  Thanks,

---
 drivers/net/wireless/rt2x00/rt2800lib.c |    3 ++-

 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +0 -1
index eb6d129..e90d6fd 100644
@@ -560,7 +560,8 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
                rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
                rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
                rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_SYNC, conf->sync);
-               rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
Quoted 8 lines

drivers/net/wireless/rt2x00/rt2800lib.c void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, · line 567

Quoted 5 lines
drivers/net/wireless/rt2x00/rt2800lib.c +2 -0
+               rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE,
+                                  (conf->sync == TSF_SYNC_BEACON));
                rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
        }
 

Oh btw this is against the wireless-testing git tree, I forgot to mention that.  Thanks,

This is assumed, if you want it in you should send to: linville though.

Luis

Acked-by on v1 1/1
#3 lore raw
In reply to Josef Bacik

[ Added john to CC list ]

Quoted 14 lines · Josef Bacik

Please be gentle, I'm a fs developer and this is my first foray into drivers, as I'm tired of building ralinks driver everytime I update my kernel. Whenever I load the rt2800pci driver my box bogs down, and a few printk's later I discovered its because I was getting 10's of thousands of TBTT interrupts a second. I discovered this was because we were setting the beacon timer to 0, which is apparently what TBTT keys off of. It seems to me that we should only be enabling TBTT when we are in a beacon transmitting mode, which from what I can tell is in AD-HOC and other such modes where the mac80211 layer would have given us a proper beacon_int to set the beacon timer to instead of 0. So this is my fix, only enable TBTT if our sync mode is for beacon. This makes it so my box doesn't die everytime I load the rt2800pci driver. Let me know if this is acceptable, I just learned all these terms about 15 minutes ago via wikipedia, so I really am not familiar with how this stuff is supposed to work. Thanks,

Quoted 1 line

Good catch.

Quoted 18 lines
---
 drivers/net/wireless/rt2x00/rt2800lib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +2 -1
index eb6d129..e90d6fd 100644
@@ -560,7 +560,8 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
 		rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
 		rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
 		rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_SYNC, conf->sync);
-		rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
+		rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE,
+				   (conf->sync == TSF_SYNC_BEACON));
 		rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
 	}
 
#4 lore raw
In reply to Josef Bacik
Quoted 3 lines

Please be gentle, I'm a fs developer and this is my first foray into drivers, as I'm tired of building ralinks driver everytime I update my kernel.

We are (sometimes) gentle, but hey, even for FS linux code the "please be gentle" shouldn't be part of the commit message, but rather be in the comment part of the patch mail.

Signature · 1 line
http://www.holgerschurig.de