All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stf_xl@wp.pl>
To: Shiji Yang <yangshiji66@outlook.com>
Cc: linux-wireless@vger.kernel.org, Kalle Valo <kvalo@kernel.org>
Subject: Re: [PATCH 3/3] wifi: rt2x00: restart beacon queue when hardware reset
Date: Wed, 1 Nov 2023 10:07:10 +0100	[thread overview]
Message-ID: <20231101090710.GB552433@wp.pl> (raw)
In-Reply-To: <TYAP286MB0315339CF8B38FC1286CF39DBCA3A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM>

On Sat, Oct 28, 2023 at 08:15:32PM +0800, Shiji Yang wrote:
> When a hardware reset is triggered, all registers are reset, so all
> queues are forced to stop in hardware interface. However, mac80211
> will not automatically stop the queue. If we don't manually stop the
> beacon queue, the queue will be deadlocked and unable to start again.
> This patch fixes the issue where Apple devices cannot connect to the
> AP after calling ieee80211_restart_hw().

Should not this be solved in mac80211 then? ieee80211_restart_work
does a lot o diffrent things, why beconing is not also
stoped/started there ? 

Regards
Stanislaw

> Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
> ---
>  drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 3 +++
>  drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 4 +++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
> index 9a9cfd0ce..ac58a56c3 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
> @@ -101,6 +101,8 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
>  	rt2x00link_stop_tuner(rt2x00dev);
>  	rt2x00queue_stop_queues(rt2x00dev);
>  	rt2x00queue_flush_queues(rt2x00dev, true);
> +	if (test_bit(DEVICE_STATE_RESET, &rt2x00dev->flags))
> +		rt2x00queue_stop_queue(rt2x00dev->bcn);
>  
>  	/*
>  	 * Disable radio.
> @@ -1286,6 +1288,7 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)
>  	rt2x00dev->intf_ap_count = 0;
>  	rt2x00dev->intf_sta_count = 0;
>  	rt2x00dev->intf_associated = 0;
> +	rt2x00dev->intf_beaconing = 0;
>  
>  	/* Enable the radio */
>  	retval = rt2x00lib_enable_radio(rt2x00dev);
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
> index 4202c6517..6fcbf534a 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
> @@ -615,7 +615,9 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
>  			 * and keep it running on other interfaces.
>  			 */
>  			rt2x00queue_clear_beacon(rt2x00dev, vif);
> -		} else if (bss_conf->enable_beacon && !intf->enable_beacon) {
> +		} else if (bss_conf->enable_beacon &&
> +			   (!intf->enable_beacon ||
> +			    test_bit(DEVICE_STATE_RESET, &rt2x00dev->flags))) {

>  			rt2x00dev->intf_beaconing++;
>  			intf->enable_beacon = true;
>  			/*
> -- 
> 2.39.2
> 

  reply	other threads:[~2023-11-01  9:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231028121532.5397-1-yangshiji66@outlook.com>
2023-10-28 12:15 ` [PATCH 2/3] wifi: rt2x00: disable RTS threshold for rt2800 by default Shiji Yang
2023-10-28 14:54   ` Kalle Valo
2023-10-29  0:54     ` Shiji Yang
2023-11-01  8:53   ` Stanislaw Gruszka
2023-10-28 12:15 ` [PATCH 3/3] wifi: rt2x00: restart beacon queue when hardware reset Shiji Yang
2023-11-01  9:07   ` Stanislaw Gruszka [this message]
2023-11-02 12:36     ` Shiji Yang
2023-11-03  5:55       ` Stanislaw Gruszka
2023-11-04  9:11         ` Shiji Yang
2023-11-03  5:56   ` Stanislaw Gruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231101090710.GB552433@wp.pl \
    --to=stf_xl@wp.pl \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=yangshiji66@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.