]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mac80211: mwifiex: fix freeze for 60 seconds caused by request_firmware 24205/head
authorGeorgi Valkov <gvalkov@gmail.com>
Sun, 12 Jul 2026 20:14:57 +0000 (23:14 +0300)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 28 Jul 2026 07:49:18 +0000 (09:49 +0200)
Fix regression in rgpower table loading, caused by using
request_firmware(): when the requested firmware does not exist, e.g.
nxp/rgpower_WW.bin does not exist on OpenWrt builds for WRT3200ACM,
request_firmware() falls back to firmware_fallback_sysfs(), which expects
the firmware to be provided by user space using SYSFS. No such utility is
provided in this configuration, so the entire system locks up for 60
seconds, until the request times out. During this time, no other log
messages are observed, and the device does not respond to commands over
UART.

The request_firmware() call is performed in the following context:
current->comm kworker/1:2  in_task 1  irqs_disabled 0  in_atomic 0

Fixed by using request_firmware_direct(). This prevents fallback to SYSFS,
and avoids delay. The rgpower table is optional. The driver falls back
to the device tree power table if the firmware is not present.

The error code is printed for debugging and returned to the caller,
which only cares for success or failure, so there are no side effects.

Link: #24205
Fixes: #24434
Fixes: https://forum.openwrt.org/t/25-12-0-slow-boot-on-linksys-wrt3200acm/247751
Fixes: https://github.com/torvalds/linux/commit/7b6f16a258065f85793fb2597a290041c1e3d201
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24205
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
package/kernel/mac80211/Makefile
package/kernel/mac80211/patches/mwl/110-wifi-mwifiex-fix-freeze-for-60-seconds-caused-by-req.patch [new file with mode: 0644]

index 9014ce85e53fb681e61561dbf999e6884e4060ba..f96317a9d5a465cbd405b9f6ab5e04a2a933255a 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=mac80211
 
 PKG_VERSION:=6.18.39
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0-only
 PKG_LICENSE_FILES:=COPYING
 
diff --git a/package/kernel/mac80211/patches/mwl/110-wifi-mwifiex-fix-freeze-for-60-seconds-caused-by-req.patch b/package/kernel/mac80211/patches/mwl/110-wifi-mwifiex-fix-freeze-for-60-seconds-caused-by-req.patch
new file mode 100644 (file)
index 0000000..a0515c6
--- /dev/null
@@ -0,0 +1,66 @@
+From 27882f047c76a7c48988952df5515df13be2fd72 Mon Sep 17 00:00:00 2001
+From: Georgi Valkov <gvalkov@gmail.com>
+Date: Sat, 11 Jul 2026 01:17:00 +0300
+Subject: [PATCH] wifi: mwifiex: fix freeze for 60 seconds caused by
+ request_firmware
+
+Fix regression in rgpower table loading, caused by using
+request_firmware(): when the requested firmware does not exist, e.g.
+nxp/rgpower_WW.bin does not exist on OpenWRT builds for WRT3200ACM,
+request_firmware() falls back to firmware_fallback_sysfs(), which expects
+the firmware to be provided by user space using SYSFS. No such utility is
+provided in this configuration, so the entire system locks up for 60
+seconds, until the request times out. During this time, no other log
+messages are observed, and the device does not respond to commands over
+UART.
+
+The request_firmware() call is performed in the following context:
+current->comm kworker/1:2  in_task 1  irqs_disabled 0  in_atomic 0
+
+Fixed by using request_firmware_direct(). This prevents fallback to SYSFS,
+and avoids delay. The rgpower table is optional. The driver falls back
+to the device tree power table if the firmware is not present.
+
+The error code is printed for debugging and returned to the caller,
+which only cares for success or failure, so there are no side effects.
+
+Fixes: 7b6f16a25806 ("wifi: mwifiex: add rgpower table loading support")
+Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
+---
+ drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
++++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+@@ -196,6 +196,7 @@ static int mwifiex_request_rgpower_table
+       struct mwifiex_adapter *adapter = priv->adapter;
+       char rgpower_table_name[30];
+       char country_code[3];
++      int ret;
+       strscpy(country_code, domain_info->country_code, sizeof(country_code));
+@@ -214,16 +215,17 @@ static int mwifiex_request_rgpower_table
+               adapter->rgpower_data = NULL;
+       }
+-      if ((request_firmware(&adapter->rgpower_data, rgpower_table_name,
+-                            adapter->dev))) {
++      ret = request_firmware_direct(&adapter->rgpower_data, rgpower_table_name,
++                                    adapter->dev);
++
++      if (ret) {
+               mwifiex_dbg(
+                       adapter, INFO,
+-                      "info: %s: failed to request regulatory power table\n",
+-                      __func__);
+-              return -EIO;
++                      "info: %s: failed to request regulatory power table: %d\n",
++                      __func__, ret);
+       }
+-      return 0;
++      return ret;
+ }
+ static int mwifiex_dnld_rgpower_table(struct mwifiex_private *priv)