Search Linux Wireless

Re: [PATCH] wifi: iwlwifi: fix iwlmld-test link failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2025-05-23 at 14:10 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
> 
> If the driver is built-in but the test is in a loadable module, the symbols
> are not exported, resulting in a link failure:
> 
> ERROR: modpost: "iwl_get_cmd_string" [drivers/net/wireless/intel/iwlwifi/mld/tests/iwlmld-tests.ko] undefined!
> ERROR: modpost: "__iwl_dbg" [drivers/net/wireless/intel/iwlwifi/mld/tests/iwlmld-tests.ko] undefined!
> 
> Enable CONFIG_IWLWIFI_OPMODE_MODULAR in this configuration, to
> make those symbols visible.

Hah, thanks. We were just debating exactly this fix, but I think if
CONFIG_INET is _also_ turned off, we still have another link issue, so
what we have now is actually the below (maybe the Fixes: is wrong then
though)



commit 800fe085168e073910d8a0b758df0399d3c38323
Author: Benjamin Berg <benjamin.berg@xxxxxxxxx>
Date:   Mon May 12 14:04:33 2025 +0200

    [BUGFIX] wifi: iwlwifi: ensure iwl_average_neg_dbm is available for kunit
    
    The function was not compiled if CONFIG_INET was not enabled. Change it
    to always be compiled in. Also update the IWLWIFI_OPMODE_MODULAR check
    so that the symbol is exported even if only the kunit tests are build
    as a module.
    
    Change-Id: I02014d338de26768533cd07225780563393b4591
    Signed-off-by: Benjamin Berg <benjamin.berg@xxxxxxxxx>
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Closes: https://lore.kernel.org/oe-kbuild-all/202505120905.ceWoI4rO-lkp@xxxxxxxxx/
    Fixes: 1f52f7f0abe2 ("wifi: iwlwifi: move dBm averaging function into utils")
    Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@xxxxxxxxx>

diff --git a/drivers/net/wireless/intel/iwlwifi/Kconfig b/drivers/net/wireless/intel/iwlwifi/Kconfig
index b2fb1dee59c0..e4a3fe2eaf57 100644
--- a/drivers/net/wireless/intel/iwlwifi/Kconfig
+++ b/drivers/net/wireless/intel/iwlwifi/Kconfig
@@ -105,6 +105,7 @@ config IWLWIFI_OPMODE_MODULAR
 	default y if IWLMVM=m
 	default y if IWLXVT=m
 	default y if IWLMLD=m
+	default y if IWLWIFI_KUNIT_TESTS=m
 
 comment "WARNING: iwlwifi is useless without IWLDVM or IWLMVM or IWLMLD"
 	depends on IWLDVM=n && IWLMVM=n && IWLMLD=n
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-utils.c b/drivers/net/wireless/intel/iwlwifi/iwl-utils.c
index 9edb8f512058..0049a8ca60f3 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-utils.c
@@ -82,6 +82,7 @@ int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,
 	return 0;
 }
 IWL_EXPORT_SYMBOL(iwl_tx_tso_segment);
+#endif /* CONFIG_INET */
 
 static u32 iwl_div_by_db(u32 value, u8 db)
 {
@@ -193,5 +194,3 @@ s8 iwl_average_neg_dbm(const u8 *neg_dbm_values, u8 len)
 	return clamp(average_magnitude - i, -128, 0);
 }
 IWL_EXPORT_SYMBOL(iwl_average_neg_dbm);
-
-#endif /* CONFIG_INET */






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux