All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: linux-wireless@vger.kernel.org
Cc: "Ajay Singh" <ajay.kathat@microchip.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Kalle Valo" <kvalo@kernel.org>,
	"David Mosberger-Tang" <davidm@egauge.net>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-kernel@vger.kernel.org,
	"Alexis Lothoré" <alexis.lothore@bootlin.com>
Subject: [PATCH 5/5] wifi: wilc1000: fix multi-vif management when deleting a vif
Date: Mon, 15 Jan 2024 15:56:34 +0100	[thread overview]
Message-ID: <20240115-wilc_1000_fixes-v1-5-54d29463a738@bootlin.com> (raw)
In-Reply-To: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com>

From: Ajay Singh <ajay.kathat@microchip.com>

Adding then removing a second vif currently makes the first vif not working
anymore. This is visible for example when we have a first interface
connected to some access point:
- create a wpa_supplicant.conf with some AP credentials
- wpa_supplicant -Dnl80211 -c /etc/wpa_supplicant.conf -i wlan0
- dhclient wlan0
- iw phy phy0 interface add wlan1 type managed
- iw dev wlan1 del
wlan0 does not manage properly traffic anymore (eg: ping not working)

This is due to vif mode being incorrectly reconfigured with some default
values in del_virtual_intf, affecting by default first vif.

Prevent first vif from being affected on second vif removal by removing vif
mode change command in del_virtual_intf

Fixes: 9bc061e88054 ("staging: wilc1000: added support to dynamically add/remove interfaces")
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Co-developed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
This patch has been initiated by Ajay, and I reworked it a bit/split it.
I could have just fixed the parameters passed to wilc_set_operation_mode,
but I observed that even calling wilc_set_operation_mode seems faulty in
del_virtual_intf: for example the thread in charge of sending commands to
the chip is possibly not running (because interface is not up). Also, the
vif mode is only configured in change_virtual_intf and not in
add_virtual_intf, which tends to validate the removal from
del_virtual_intf.
---
 drivers/net/wireless/microchip/wilc1000/cfg80211.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
index 2d0474e6404e..f03fd15c0c97 100644
--- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c
+++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
@@ -1609,7 +1609,6 @@ static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
 	cfg80211_unregister_netdevice(vif->ndev);
 	vif->monitor_flag = 0;
 
-	wilc_set_operation_mode(vif, 0, 0, 0);
 	mutex_lock(&wl->vif_mutex);
 	list_del_rcu(&vif->list);
 	wl->vif_num--;

-- 
2.42.1


      parent reply	other threads:[~2024-01-15 15:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 14:56 [PATCH 0/5] wifi: wilc1000: minor fixes Alexis Lothoré
2024-01-15 14:56 ` [PATCH 1/5] wifi: wilc1000: set preamble size to auto as default in wilc_init_fw_config() Alexis Lothoré
2024-01-18  9:31   ` Kalle Valo
2024-01-18 15:08     ` Alexis Lothoré
2024-01-18 16:52       ` Ajay.Kathat
2024-01-19  7:43         ` Alexis Lothoré
2024-01-19 18:19           ` Ajay.Kathat
2024-02-12 15:36   ` [1/5] " Kalle Valo
2024-01-15 14:56 ` [PATCH 2/5] wifi: wilc1000: fix driver_handler when committing initial configuration Alexis Lothoré
2024-01-18  9:35   ` Kalle Valo
2024-01-15 14:56 ` [PATCH 3/5] wilc: wifi: do not realloc workqueue everytime an interface is added Alexis Lothoré
2024-01-15 14:56 ` [PATCH 4/5] wifi: wilc1000: fix incorrect power down sequence Alexis Lothoré
2024-01-15 14:56 ` Alexis Lothoré [this message]

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=20240115-wilc_1000_fixes-v1-5-54d29463a738@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=ajay.kathat@microchip.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=davidm@egauge.net \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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.