All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Niels Dossche <dossche.niels@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	Amitkumar Karwar <amitkarwar@gmail.com>,
	Ganapathi Bhat <ganapathi017@gmail.com>,
	Sharvari Harisangam <sharvari.harisangam@nxp.com>,
	Xinming Hu <huxinming820@gmail.com>,
	Kalle Valo <kvalo@kernel.org>
Subject: Re: [PATCH RFT] mwifiex: add mutex lock for call in mwifiex_dfs_chan_sw_work_queue
Date: Mon, 21 Mar 2022 13:17:52 -0700	[thread overview]
Message-ID: <YjjdcG5NmzLOmjEu@google.com> (raw)
In-Reply-To: <20220319224751.72241-1-dossche.niels@gmail.com>

On Sat, Mar 19, 2022 at 11:47:52PM +0100, Niels Dossche wrote:
> --- a/drivers/net/wireless/marvell/mwifiex/11h.c
> +++ b/drivers/net/wireless/marvell/mwifiex/11h.c
> @@ -285,6 +285,7 @@ void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work)
>  	struct mwifiex_private *priv =
>  			container_of(delayed_work, struct mwifiex_private,
>  				     dfs_chan_sw_work);
> +	struct net_device *netdev;
>  
>  	bss_cfg = &priv->bss_cfg;
>  	if (!bss_cfg->beacon_period) {
> @@ -301,7 +302,11 @@ void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work)
>  		return;
>  	}
>  
> +	netdev = priv->netdev;
> +
>  	mwifiex_dbg(priv->adapter, MSG,
>  		    "indicating channel switch completion to kernel\n");
> -	cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef);
> +	mutex_lock(&netdev->ieee80211_ptr->mtx);

A more appropriate route to this object might be priv->wdev.mtx. But
otherwise, I think this makes sense, and matches what
ath6kl_cfg80211_ch_switch_notify() and qtnf_event_handle_freq_change()
do. With the suggested change:

Reviewed-by: Brian Norris <briannorris@chromium.org>

Thanks.

> +	cfg80211_ch_switch_notify(netdev, &priv->dfs_chandef);
> +	mutex_unlock(&netdev->ieee80211_ptr->mtx);
>  }
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-03-21 20:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-19 22:47 [PATCH RFT] mwifiex: add mutex lock for call in mwifiex_dfs_chan_sw_work_queue Niels Dossche
2022-03-21 20:17 ` Brian Norris [this message]
2022-03-21 22:47   ` Niels Dossche

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=YjjdcG5NmzLOmjEu@google.com \
    --to=briannorris@chromium.org \
    --cc=amitkarwar@gmail.com \
    --cc=dossche.niels@gmail.com \
    --cc=ganapathi017@gmail.com \
    --cc=huxinming820@gmail.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sharvari.harisangam@nxp.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.