mt7603: move cab queue enabling to pre-tbtt tasklet

It is not necessary to time the start of the queue in software, the hardware
already does that for us.
Move all processing into the pre-tbtt tasklet to get rid of a race condition
that could happen when the pre-tbtt tasklet takes too long

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2018-11-28 22:15:31 +01:00
parent 6ac9653037
commit d22feb00e9
3 changed files with 5 additions and 12 deletions
+5 -9
View File
@@ -67,15 +67,6 @@ mt7603_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif)
data->count[mvif->idx]++;
}
void mt7603_tbtt(struct mt7603_dev *dev)
{
u32 mask = MT_WF_ARB_CAB_START_BSSn(0) |
(MT_WF_ARB_CAB_START_BSS0n(1) *
((1 << (MT7603_MAX_INTERFACES - 1)) - 1));
mt76_wr(dev, MT_WF_ARB_CAB_START, mask);
}
void mt7603_pre_tbtt_tasklet(unsigned long arg)
{
struct mt7603_dev *dev = (struct mt7603_dev *)arg;
@@ -135,6 +126,11 @@ void mt7603_pre_tbtt_tasklet(unsigned long arg)
mt76_wr(dev, MT_WF_ARB_CAB_COUNT(i),
data.count[i] << MT_WF_ARB_CAB_COUNT_B0_SHIFT(i));
mt76_wr(dev, MT_WF_ARB_CAB_START,
MT_WF_ARB_CAB_START_BSSn(0) |
(MT_WF_ARB_CAB_START_BSS0n(1) *
((1 << (MT7603_MAX_INTERFACES - 1)) - 1)));
out:
mt76_queue_tx_cleanup(dev, MT_TXQ_BEACON, false);
if (dev->mt76.q_tx[MT_TXQ_BEACON].queued > MT7603_MAX_INTERFACES)
-2
View File
@@ -54,8 +54,6 @@ irqreturn_t mt7603_irq_handler(int irq, void *dev_instance)
mt76_wr(dev, MT_HW_INT_STATUS(3), hwintr);
if (hwintr & MT_HW_INT3_PRE_TBTT0)
tasklet_schedule(&dev->pre_tbtt_tasklet);
if (hwintr & MT_HW_INT3_TBTT0)
mt7603_tbtt(dev);
}
if (intr & MT_INT_TX_DONE_ALL) {
-1
View File
@@ -237,7 +237,6 @@ int mt7603_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
void mt7603_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta);
void mt7603_tbtt(struct mt7603_dev *dev);
void mt7603_pre_tbtt_tasklet(unsigned long arg);
void mt7603_update_channel(struct mt76_dev *mdev);