diff mbox series

[2/5] mt76: mt7615: stop ext_phy queue when mac reset happens

Message ID 3794a3ffadc4a08548a1223e6955671977e78e49.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/mt7615/mac.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Lorenzo Bianconi Feb. 27, 2021, 10:23 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/mt7615/mac.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> index df2dc77a323a..0f613063c1ff 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> @@ -2085,6 +2085,7 @@ void mt7615_mac_reset_work(struct work_struct *work)
>  	del_timer_sync(&dev->phy.roc_timer);
>  	cancel_work_sync(&dev->phy.roc_work);
>  	if (phy2) {
> +		set_bit(MT76_RESET, &phy2->mt76->state);

Hi Ryder,

since we run mt76_txq_schedule_all then and mt76_worker_disable few lines below, what is the point
of setting the state to RESET?

Regards,
Lorenzo

>  		cancel_delayed_work_sync(&phy2->mt76->mac_work);
>  		del_timer_sync(&phy2->roc_timer);
>  		cancel_work_sync(&phy2->roc_work);
> @@ -2118,6 +2119,8 @@ void mt7615_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
>
Ryder Lee Feb. 27, 2021, 1:35 p.m. UTC | #2
On Sat, 2021-02-27 at 11:23 +0100, Lorenzo Bianconi wrote:
> > Stop Tx burst for ext_phy after mac reset.
> > 
> > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> > ---
> >  drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> > index df2dc77a323a..0f613063c1ff 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> > @@ -2085,6 +2085,7 @@ void mt7615_mac_reset_work(struct work_struct *work)
> >  	del_timer_sync(&dev->phy.roc_timer);
> >  	cancel_work_sync(&dev->phy.roc_work);
> >  	if (phy2) {
> > +		set_bit(MT76_RESET, &phy2->mt76->state);
> 
> Hi Ryder,
> 
> since we run mt76_txq_schedule_all then and mt76_worker_disable few lines below, what is the point
> of setting the state to RESET?

Just in case mt76_txq_schedule_* still has the possibility to be called
by some other place at the time reset happens. Also, I think MT76_RESET
is more reliable to break Tx scheduling (from inside of the burst loop).

Ryder
> 
> >  		cancel_delayed_work_sync(&phy2->mt76->mac_work);
> >  		del_timer_sync(&phy2->roc_timer);
> >  		cancel_work_sync(&phy2->roc_work);
> > @@ -2118,6 +2119,8 @@ void mt7615_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/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index df2dc77a323a..0f613063c1ff 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -2085,6 +2085,7 @@  void mt7615_mac_reset_work(struct work_struct *work)
 	del_timer_sync(&dev->phy.roc_timer);
 	cancel_work_sync(&dev->phy.roc_work);
 	if (phy2) {
+		set_bit(MT76_RESET, &phy2->mt76->state);
 		cancel_delayed_work_sync(&phy2->mt76->mac_work);
 		del_timer_sync(&phy2->roc_timer);
 		cancel_work_sync(&phy2->roc_work);
@@ -2118,6 +2119,8 @@  void mt7615_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);