Re: [PATCH wireless-next 1/8] wifi: rt2x00: start the link tuner when an interface is added

From: Stanislaw Gruszka

Date: Sat Oct 31 2026 - 06:52:11 EST


On Thu, Oct 29, 2026 at 09:47:42PM +0800, Ho Jie Feng wrote:
> rt2x00lib_start() enables the radio before mac80211 adds the first
> interface, so rt2x00link_start_tuner(), called from
> rt2x00lib_enable_radio(), finds no station or AP interface and returns.
>
> Start the link tuner again when an interface is added.
>
> Fixes: d96324703ffa ("rt2x00: merge agc and vco works with link tuner")
> Signed-off-by: Ho Jie Feng <hjf3108@xxxxxxxxx>
> ---
> drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
> index 3bc0c1c906c91..d9e323ccc6d62 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
> @@ -264,6 +264,12 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
> */
> rt2x00dev->packet_filter = 0;
>
> + /*
> + * Start the link tuner again if the radio is enabled before the
> + * first interface is added.
> + */
> + rt2x00link_start_tuner(rt2x00dev);
Maybe add (rt2x00dev->intf_ap_count + rt2x00dev->intf_sta_count == 1)
check, to prevent reset of the tuner if already running?
And add corresponding counter part when removing interface.

Regards
Stanislaw

> +
> return 0;
> }
> EXPORT_SYMBOL_GPL(rt2x00mac_add_interface);
> --
> 2.53.0
>