diff mbox series

[4/5] mt76: mt7915: stop ext_phy queue when mac reset happens

Message ID 20a4b03ba4a347a76df67291680704dfdb7da5d6.1614411256.git.ryder.lee@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [1/5] mt76: mt7615: fix CSA notification for DBDC | expand

Commit Message

Ryder Lee Feb. 27, 2021, 7:39 a.m. UTC
Stop Tx burst for ext_phy after mac reset.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Lorenzo Bianconi Feb. 27, 2021, 10:26 a.m. UTC | #1
> Stop Tx burst for ext_phy after mac reset.
> 
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index 6b6ea33bd320..c653cd01b8d8 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -1607,9 +1607,10 @@ void mt7915_mac_reset_work(struct work_struct *work)
>  	set_bit(MT76_MCU_RESET, &dev->mphy.state);
>  	wake_up(&dev->mt76.mcu.wait);
>  	cancel_delayed_work_sync(&dev->mphy.mac_work);
> -	if (phy2)
> +	if (phy2) {
> +		set_bit(MT76_RESET, &phy2->mt76->state);
>  		cancel_delayed_work_sync(&phy2->mt76->mac_work);

same question here as mt7615, do we really need this?

Regards,
Lorenzo

> -
> +	}
>  	/* lock/unlock all queues to ensure that no tx is pending */
>  	mt76_txq_schedule_all(&dev->mphy);
>  	if (ext_phy)
> @@ -1637,6 +1638,8 @@ void mt7915_mac_reset_work(struct work_struct *work)
>  
>  	clear_bit(MT76_MCU_RESET, &dev->mphy.state);
>  	clear_bit(MT76_RESET, &dev->mphy.state);
> +	if (phy2)
> +		clear_bit(MT76_RESET, &phy2->mt76->state);
>  
>  	mt76_worker_enable(&dev->mt76.tx_worker);
>  	napi_enable(&dev->mt76.tx_napi);
> -- 
> 2.18.0
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 6b6ea33bd320..c653cd01b8d8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -1607,9 +1607,10 @@  void mt7915_mac_reset_work(struct work_struct *work)
 	set_bit(MT76_MCU_RESET, &dev->mphy.state);
 	wake_up(&dev->mt76.mcu.wait);
 	cancel_delayed_work_sync(&dev->mphy.mac_work);
-	if (phy2)
+	if (phy2) {
+		set_bit(MT76_RESET, &phy2->mt76->state);
 		cancel_delayed_work_sync(&phy2->mt76->mac_work);
-
+	}
 	/* lock/unlock all queues to ensure that no tx is pending */
 	mt76_txq_schedule_all(&dev->mphy);
 	if (ext_phy)
@@ -1637,6 +1638,8 @@  void mt7915_mac_reset_work(struct work_struct *work)
 
 	clear_bit(MT76_MCU_RESET, &dev->mphy.state);
 	clear_bit(MT76_RESET, &dev->mphy.state);
+	if (phy2)
+		clear_bit(MT76_RESET, &phy2->mt76->state);
 
 	mt76_worker_enable(&dev->mt76.tx_worker);
 	napi_enable(&dev->mt76.tx_napi);