linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] wifi: mwifiex: Fix interface type change
@ 2024-05-10 11:04 Francesco Dolcini
  2024-05-17  8:03 ` [v1] " Kalle Valo
  2024-05-17  8:04 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Francesco Dolcini @ 2024-05-10 11:04 UTC (permalink / raw)
  To: Brian Norris, Francesco Dolcini, Kalle Valo
  Cc: Rafael Beims, linux-wireless, linux-kernel, tsung-hsien.hsieh,
	David Lin, stable, Francesco Dolcini

From: Rafael Beims <rafael.beims@toradex.com>

When changing the interface type we also need to update the bss_num, the
driver private data is searched based on a unique (bss_type, bss_num)
tuple, therefore every time bss_type changes, bss_num must also change.

This fixes for example an issue in which, after the mode changed, a
wireless scan on the changed interface would not finish, leading to
repeated -EBUSY messages to userspace when other scan requests were
sent.

Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes")
Cc: stable@vger.kernel.org
Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index b909a7665e9c..155eb0fab12a 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -926,6 +926,8 @@ mwifiex_init_new_priv_params(struct mwifiex_private *priv,
 		return -EOPNOTSUPP;
 	}
 
+	priv->bss_num = mwifiex_get_unused_bss_num(adapter, priv->bss_type);
+
 	spin_lock_irqsave(&adapter->main_proc_lock, flags);
 	adapter->main_locked = false;
 	spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [v1] wifi: mwifiex: Fix interface type change
  2024-05-10 11:04 [PATCH v1] wifi: mwifiex: Fix interface type change Francesco Dolcini
@ 2024-05-17  8:03 ` Kalle Valo
  2024-05-17  8:04 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2024-05-17  8:03 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Brian Norris, Francesco Dolcini, Rafael Beims, linux-wireless,
	linux-kernel, tsung-hsien.hsieh, David Lin, stable,
	Francesco Dolcini

Francesco Dolcini <francesco@dolcini.it> wrote:

> From: Rafael Beims <rafael.beims@toradex.com>
> 
> When changing the interface type we also need to update the bss_num, the
> driver private data is searched based on a unique (bss_type, bss_num)
> tuple, therefore every time bss_type changes, bss_num must also change.
> 
> This fixes for example an issue in which, after the mode changed, a
> wireless scan on the changed interface would not finish, leading to
> repeated -EBUSY messages to userspace when other scan requests were
> sent.
> 
> Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes")
> Cc: stable@vger.kernel.org
> Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Patch applied to wireless-next.git, thanks.

a17b9f590f6e wifi: mwifiex: Fix interface type change

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240510110458.15475-1-francesco@dolcini.it/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v1] wifi: mwifiex: Fix interface type change
  2024-05-10 11:04 [PATCH v1] wifi: mwifiex: Fix interface type change Francesco Dolcini
  2024-05-17  8:03 ` [v1] " Kalle Valo
@ 2024-05-17  8:04 ` Kalle Valo
  2024-05-17  8:13   ` Francesco Dolcini
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2024-05-17  8:04 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Brian Norris, Francesco Dolcini, Rafael Beims, linux-wireless,
	linux-kernel, tsung-hsien.hsieh, David Lin, stable,
	Francesco Dolcini

Francesco Dolcini <francesco@dolcini.it> wrote:

> From: Rafael Beims <rafael.beims@toradex.com>
> 
> When changing the interface type we also need to update the bss_num, the
> driver private data is searched based on a unique (bss_type, bss_num)
> tuple, therefore every time bss_type changes, bss_num must also change.
> 
> This fixes for example an issue in which, after the mode changed, a
> wireless scan on the changed interface would not finish, leading to
> repeated -EBUSY messages to userspace when other scan requests were
> sent.
> 
> Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes")
> Cc: stable@vger.kernel.org
> Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

BTW I removed the Reviewed-by from the commit message, I don't see the need to
have both Reviewed-by and s-o-b.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240510110458.15475-1-francesco@dolcini.it/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v1] wifi: mwifiex: Fix interface type change
  2024-05-17  8:04 ` Kalle Valo
@ 2024-05-17  8:13   ` Francesco Dolcini
  2024-05-17  9:32     ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Francesco Dolcini @ 2024-05-17  8:13 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Francesco Dolcini, Brian Norris, Rafael Beims, linux-wireless,
	linux-kernel, tsung-hsien.hsieh, David Lin, stable,
	Francesco Dolcini

On Fri, May 17, 2024 at 08:04:24AM +0000, Kalle Valo wrote:
> Francesco Dolcini <francesco@dolcini.it> wrote:
> 
> > From: Rafael Beims <rafael.beims@toradex.com>
> > 
> > When changing the interface type we also need to update the bss_num, the
> > driver private data is searched based on a unique (bss_type, bss_num)
> > tuple, therefore every time bss_type changes, bss_num must also change.
> > 
> > This fixes for example an issue in which, after the mode changed, a
> > wireless scan on the changed interface would not finish, leading to
> > repeated -EBUSY messages to userspace when other scan requests were
> > sent.
> > 
> > Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> BTW I removed the Reviewed-by from the commit message, I don't see the need to
> have both Reviewed-by and s-o-b.

Sure, I was in doubt about this, in the end I added it because I have seen
this done in other subsystems, e.g. commit 6a4020b4c639 ("drm/bridge:
tc358768: fix PLL parameters computation").

Thanks
Francesco



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v1] wifi: mwifiex: Fix interface type change
  2024-05-17  8:13   ` Francesco Dolcini
@ 2024-05-17  9:32     ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2024-05-17  9:32 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Brian Norris, Rafael Beims, linux-wireless, linux-kernel,
	tsung-hsien.hsieh, David Lin, stable, Francesco Dolcini

Francesco Dolcini <francesco@dolcini.it> writes:

> On Fri, May 17, 2024 at 08:04:24AM +0000, Kalle Valo wrote:
>
>> Francesco Dolcini <francesco@dolcini.it> wrote:
>> 
>> > From: Rafael Beims <rafael.beims@toradex.com>
>> > 
>> > When changing the interface type we also need to update the bss_num, the
>> > driver private data is searched based on a unique (bss_type, bss_num)
>> > tuple, therefore every time bss_type changes, bss_num must also change.
>> > 
>> > This fixes for example an issue in which, after the mode changed, a
>> > wireless scan on the changed interface would not finish, leading to
>> > repeated -EBUSY messages to userspace when other scan requests were
>> > sent.
>> > 
>> > Fixes: c606008b7062 ("mwifiex: Properly initialize private
>> > structure on interface type changes")
>> > Cc: stable@vger.kernel.org
>> > Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
>> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
>> 
>> BTW I removed the Reviewed-by from the commit message, I don't see the need to
>> have both Reviewed-by and s-o-b.
>
> Sure, I was in doubt about this, in the end I added it because I have seen
> this done in other subsystems, e.g. commit 6a4020b4c639 ("drm/bridge:
> tc358768: fix PLL parameters computation").

Heh, yeah we all do things a bit differently :) In my view s-o-b implies
that you have reviewed it as well but clearly not everyone think the
same. I'm fine either way, this is cosmetics anyway.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-17  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10 11:04 [PATCH v1] wifi: mwifiex: Fix interface type change Francesco Dolcini
2024-05-17  8:03 ` [v1] " Kalle Valo
2024-05-17  8:04 ` Kalle Valo
2024-05-17  8:13   ` Francesco Dolcini
2024-05-17  9:32     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).