]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rsi_91x_usb: do not pause rfkill polling when stopping mac80211
authorVille Nummela <ville.nummela@kempower.com>
Wed, 18 Mar 2026 08:19:12 +0000 (10:19 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 19 Mar 2026 08:07:16 +0000 (09:07 +0100)
Removing rsi_91x USB adapter could cause rtnetlink to lock up.
When rsi_mac80211_stop is called, wiphy_lock is locked. Call to
wiphy_rfkill_stop_polling would wait until the work queue has
finished, but because the work queue waits for wiphy_lock, that
would never happen.

Moving the call to rsi_disconnect avoids the lock up.

Signed-off-by: Ville Nummela <ville.nummela@kempower.com>
Link: https://patch.msgid.link/20260318081912.87744-1-ville.nummela@kempower.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/rsi/rsi_91x_mac80211.c
drivers/net/wireless/rsi/rsi_91x_usb.c
drivers/net/wireless/rsi/rsi_common.h

index c7ae8031436ae13a9be1d1c33412341315049054..3faf2235728be7102235fb1e6aeddb56ad64c931 100644 (file)
@@ -325,6 +325,22 @@ void rsi_mac80211_detach(struct rsi_hw *adapter)
 }
 EXPORT_SYMBOL_GPL(rsi_mac80211_detach);
 
+/**
+ * rsi_mac80211_rfkill_exit() - This function is used to stop rfkill polling
+ *                              when the device is removed.
+ * @adapter: Pointer to the adapter structure.
+ *
+ * Return: None.
+ */
+void rsi_mac80211_rfkill_exit(struct rsi_hw *adapter)
+{
+       struct ieee80211_hw *hw = adapter->hw;
+
+       if (hw)
+               wiphy_rfkill_stop_polling(hw->wiphy);
+}
+EXPORT_SYMBOL_GPL(rsi_mac80211_rfkill_exit);
+
 /**
  * rsi_indicate_tx_status() - This function indicates the transmit status.
  * @adapter: Pointer to the adapter structure.
@@ -422,7 +438,6 @@ static void rsi_mac80211_stop(struct ieee80211_hw *hw, bool suspend)
        rsi_dbg(ERR_ZONE, "===> Interface DOWN <===\n");
        mutex_lock(&common->mutex);
        common->iface_down = true;
-       wiphy_rfkill_stop_polling(hw->wiphy);
 
        /* Block all rx frames */
        rsi_send_rx_filter_frame(common, 0xffff);
index d83204701e27ec198b4042d164e7282dab22565b..8765cac6f875b050c5a943b10d8f96653b0a22aa 100644 (file)
@@ -877,6 +877,8 @@ static void rsi_disconnect(struct usb_interface *pfunction)
        if (!adapter)
                return;
 
+       rsi_mac80211_rfkill_exit(adapter);
+
        rsi_mac80211_detach(adapter);
 
        if (IS_ENABLED(CONFIG_RSI_COEX) && adapter->priv->coex_mode > 1 &&
index 7aa5124575cfef28e5082175b37b7e7c82f07ef8..591602beeec6893e1553151658a588e1570ba426 100644 (file)
@@ -79,6 +79,7 @@ static inline int rsi_kill_thread(struct rsi_thread *handle)
 }
 
 void rsi_mac80211_detach(struct rsi_hw *hw);
+void rsi_mac80211_rfkill_exit(struct rsi_hw *hw);
 u16 rsi_get_connected_channel(struct ieee80211_vif *vif);
 struct rsi_hw *rsi_91x_init(u16 oper_mode);
 void rsi_91x_deinit(struct rsi_hw *adapter);