Commit b3bf3dcb authored by Johannes Berg's avatar Johannes Berg
Browse files

Merge tag 'mt76-fixes-2025-08-27' of https://github.com/nbd168/wireless



Felix Fietkay says:
===================
mt76 fixes for 6.17

- fix regressions from mt7996 MLO support rework
- fix offchannel handling issues on mt7996
- mt792x fixes
- fix multiple wcid linked list corruption issues
===================

Change-Id: Ib3e9a3217a40b9da69e122514d47fa46699c864b
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parents 0e204508 49fba872
Loading
Loading
Loading
Loading
+42 −1
Original line number Diff line number Diff line
@@ -818,6 +818,43 @@ void mt76_free_device(struct mt76_dev *dev)
}
EXPORT_SYMBOL_GPL(mt76_free_device);

static void mt76_reset_phy(struct mt76_phy *phy)
{
	if (!phy)
		return;

	INIT_LIST_HEAD(&phy->tx_list);
}

void mt76_reset_device(struct mt76_dev *dev)
{
	int i;

	rcu_read_lock();
	for (i = 0; i < ARRAY_SIZE(dev->wcid); i++) {
		struct mt76_wcid *wcid;

		wcid = rcu_dereference(dev->wcid[i]);
		if (!wcid)
			continue;

		wcid->sta = 0;
		mt76_wcid_cleanup(dev, wcid);
		rcu_assign_pointer(dev->wcid[i], NULL);
	}
	rcu_read_unlock();

	INIT_LIST_HEAD(&dev->wcid_list);
	INIT_LIST_HEAD(&dev->sta_poll_list);
	dev->vif_mask = 0;
	memset(dev->wcid_mask, 0, sizeof(dev->wcid_mask));

	mt76_reset_phy(&dev->phy);
	for (i = 0; i < ARRAY_SIZE(dev->phys); i++)
		mt76_reset_phy(dev->phys[i]);
}
EXPORT_SYMBOL_GPL(mt76_reset_device);

struct mt76_phy *mt76_vif_phy(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif)
{
@@ -1679,6 +1716,10 @@ void mt76_wcid_cleanup(struct mt76_dev *dev, struct mt76_wcid *wcid)
	skb_queue_splice_tail_init(&wcid->tx_pending, &list);
	spin_unlock(&wcid->tx_pending.lock);

	spin_lock(&wcid->tx_offchannel.lock);
	skb_queue_splice_tail_init(&wcid->tx_offchannel, &list);
	spin_unlock(&wcid->tx_offchannel.lock);

	spin_unlock_bh(&phy->tx_lock);

	while ((skb = __skb_dequeue(&list)) != NULL) {
@@ -1690,7 +1731,7 @@ EXPORT_SYMBOL_GPL(mt76_wcid_cleanup);

void mt76_wcid_add_poll(struct mt76_dev *dev, struct mt76_wcid *wcid)
{
	if (test_bit(MT76_MCU_RESET, &dev->phy.state))
	if (test_bit(MT76_MCU_RESET, &dev->phy.state) || !wcid->sta)
		return;

	spin_lock_bh(&dev->sta_poll_lock);
+1 −0
Original line number Diff line number Diff line
@@ -1243,6 +1243,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
			 struct ieee80211_rate *rates, int n_rates);
void mt76_unregister_device(struct mt76_dev *dev);
void mt76_free_device(struct mt76_dev *dev);
void mt76_reset_device(struct mt76_dev *dev);
void mt76_unregister_phy(struct mt76_phy *phy);

struct mt76_phy *mt76_alloc_radio_phy(struct mt76_dev *dev, unsigned int size,
+5 −7
Original line number Diff line number Diff line
@@ -1460,17 +1460,15 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
	if (i == 10)
		dev_err(dev->mt76.dev, "chip full reset failed\n");

	spin_lock_bh(&dev->mt76.sta_poll_lock);
	while (!list_empty(&dev->mt76.sta_poll_list))
		list_del_init(dev->mt76.sta_poll_list.next);
	spin_unlock_bh(&dev->mt76.sta_poll_lock);

	memset(dev->mt76.wcid_mask, 0, sizeof(dev->mt76.wcid_mask));
	dev->mt76.vif_mask = 0;
	dev->phy.omac_mask = 0;
	if (phy2)
		phy2->omac_mask = 0;

	mt76_reset_device(&dev->mt76);

	INIT_LIST_HEAD(&dev->sta_rc_list);
	INIT_LIST_HEAD(&dev->twt_list);

	i = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
	dev->mt76.global_wcid.idx = i;
	dev->recovery.hw_full_reset = false;
+1 −4
Original line number Diff line number Diff line
@@ -1459,11 +1459,8 @@ static int mt7921_pre_channel_switch(struct ieee80211_hw *hw,
	if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc)
		return -EOPNOTSUPP;

	/* Avoid beacon loss due to the CAC(Channel Availability Check) time
	 * of the AP.
	 */
	if (!cfg80211_chandef_usable(hw->wiphy, &chsw->chandef,
				     IEEE80211_CHAN_RADAR))
				     IEEE80211_CHAN_DISABLED))
		return -EOPNOTSUPP;

	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -1449,7 +1449,7 @@ void mt7925_usb_sdio_tx_complete_skb(struct mt76_dev *mdev,
	sta = wcid_to_sta(wcid);

	if (sta && likely(e->skb->protocol != cpu_to_be16(ETH_P_PAE)))
		mt76_connac2_tx_check_aggr(sta, txwi);
		mt7925_tx_check_aggr(sta, e->skb, wcid);

	skb_pull(e->skb, headroom);
	mt76_tx_complete_skb(mdev, e->wcid, e->skb);
Loading