mt76: mt7663: fix when beacon filter is being applied
Subsystems (2)
[email protected]
reviewerPATCH 1/3 mt76: mt7663: fix when beacon filter is being applied
From: Sean Wang <[email protected]>
HW beacon filter command is being applied until we're in associated state because the command would rely on the associated access point's beacon interval and DTIM information.
--- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7615/main.c +3 -3
@@ -217,8 +217,6 @@ static int mt7615_add_interface(struct ieee80211_hw *hw, ret =mt7615_mcu_add_dev_info (phy, vif, true);if (ret) goto out; - -mt7615_mac_set_beacon_filter (phy, vif, true); out:mt7615_mutex_release (dev);
@@ -244,7 +242,6 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw,mt76_connac_free_pending_tx_skbs (&dev->pm, &msta->wcid); -mt7615_mac_set_beacon_filter (phy, vif, false);mt7615_mcu_add_dev_info (phy, vif, false);rcu_assign_pointer (dev->mt76.wcid[idx],NULL );
@@ -548,6 +545,9 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,if (changed &BSS_CHANGED_ARP_FILTER )mt7615_mcu_update_arp_filter (hw, vif, info); +if (changed &BSS_CHANGED_ASSOC ) +mt7615_mac_set_beacon_filter (phy, vif, info->assoc); +mt7615_mutex_release (dev); }
Signature · 5 lines
2.25.1 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
[email protected]
reviewerPATCH 2/3 mt76: mt7663s: make all of packets 4-bytes aligned in sdio tx aggregation
From: Sean Wang <[email protected]>
Each packet should be padded with the additional zero to become 4-bytes alignment in sdio tx aggregation.
--- drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +6 -1
@@ -218,6 +218,7 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q)int qid, err, nframes =0 , len =0 , pse_sz =0 , ple_sz =0 ;bool mcu = q == dev->q_mcu[MT_MCUQ_WM ];struct mt76_sdio *sdio = &dev->sdio; +u8 pad; qid = mcu ?ARRAY_SIZE (sdio->xmit_buf) -1 : q->qid;while (q->first != q->head) {
@@ -234,7 +235,8 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q) goto next; } -if (len + e->skb->len +4 >MT76S_XMIT_BUF_SZ ) + pad =roundup (e->skb->len,4 ) - e->skb->len; +if (len + e->skb->len + pad +4 >MT76S_XMIT_BUF_SZ )break ; if (mt7663s_tx_pick_quota(sdio, mcu, e->buf_sz, &pse_sz,
@@ -252,6 +254,9 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q) len += iter->len; nframes++; } + +memset (sdio->xmit_buf[qid] + len,0 , pad); + len += pad; next: q->first = (q->first +1 ) % q->ndesc; e->done = true;
Signature · 1 line
2.25.1
Re: [PATCH 2/3] mt76: mt7663s: make all of packets 4-bytes aligned in sdio tx aggregation
Quoted 34 lines
From: Sean Wang <[email protected]>
Each packet should be padded with the additional zero to become 4-bytes alignment in sdio tx aggregation.
Fixes 1522ff731f84 ("mt76: mt7663s: introduce sdio tx aggregation")Signed-off-by Sean Wang <[email protected]>--- drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +3
-1@@ -218,6 +218,7 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q)int qid, err, nframes =0 , len =0 , pse_sz =0 , ple_sz =0 ;bool mcu = q == dev->q_mcu[MT_MCUQ_WM ];struct mt76_sdio *sdio = &dev->sdio; +u8 pad; qid = mcu ?ARRAY_SIZE (sdio->xmit_buf) -1 : q->qid;while (q->first != q->head) {@@ -234,7 +235,8 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q) goto next; } -if (len + e->skb->len +4 >MT76S_XMIT_BUF_SZ ) + pad =roundup (e->skb->len,4 ) - e->skb->len; +if (len + e->skb->len + pad +4 >MT76S_XMIT_BUF_SZ )break ; if (mt7663s_tx_pick_quota(sdio, mcu, e->buf_sz, &pse_sz,
drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q) · line 259
Quoted 6 lines
drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +3
-0@@ -252,6 +254,9 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q) len += iter->len; nframes++; } + +memset (sdio->xmit_buf[qid] + len,0 , pad); + len += pad;
maybe it is better to do something like:
if (unlikely(pad)) {
memset(sdio->xmit_buf[qid] + len, 0, pad);
len += pad;
}Regards,
Lorenzo
Quoted 5 lines
drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +0
-0next: q->first = (q->first +1 ) % q->ndesc; e->done = true;Signature · 1 line
2.25.1
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
[email protected]
reviewerPATCH 3/3 mt76: mt7663s: fix the possible device hang in high traffic
In reply to [email protected]From: Sean Wang <[email protected]>
Use the additional memory barrier to ensure the skb list up-to-date between the skb producer and consumer to avoid the invalid skb content written into sdio controller and then cause device hang due to mcu assert caught by WR_TIMEOUT_INT.
--- drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c | 2 ++ drivers/net/wireless/mediatek/mt76/sdio.c | 3 +++ 2 files changed, 5 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +2 -0
@@ -225,6 +225,8 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q)struct mt76_queue_entry *e = &q->entry[q->first];struct sk_buff *iter; +smp_rmb (); +if (!test_bit (MT76_STATE_MCU_RUNNING , &dev->phy.state)) {__skb_put_zero (e->skb,4 ); err = __mt7663s_xmit_queue(dev, e->skb->data,
drivers/net/wireless/mediatek/mt76/sdio.c +3 -0
@@ -256,6 +256,9 @@ mt76s_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, q->entry[q->head].skb = tx_info.skb; q->entry[q->head].buf_sz = len; + +smp_wmb (); + q->head = (q->head +1 ) % q->ndesc; q->queued++;
Signature · 5 lines
2.25.1 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek