]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: fix airoha_npu dependency tracking
authorArnd Bergmann <arnd@arndb.de>
Fri, 12 Jun 2026 20:13:19 +0000 (22:13 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 22 Jul 2026 06:13:31 +0000 (06:13 +0000)
There is a new build failure with MT7996E=m MT76_CORE=y and NET_AIROHA_NPU=m:

ld.lld: error: undefined symbol: airoha_npu_get
ld.lld: error: undefined symbol: airoha_npu_put
>>> referenced by npu.c
>>>               drivers/net/wireless/mediatek/mt76/npu.o:(mt76_npu_init) in archive vmlinux.a

Fix this by reworking the dependency for the MT7996_NPU to only
allow enabling that when mt76_core can link against the npu driver.

To make sure this gets caught more easily in the future when additional
mt76 variants need the same dependency, also turn CONFIG_MT76_NPU into
a tristate symbol that has the same dependency.

Fixes: 7fb554b1b623 ("wifi: mt76: Introduce the NPU generic layer")
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260612201519.4054683-1-arnd@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/Kconfig
drivers/net/wireless/mediatek/mt76/Makefile
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt7996/Kconfig

index 502303622a5382aa58a85d2049f32132f04a568d..2ca96e0527c0292839a8d11b2247b5edd891aecc 100644 (file)
@@ -38,8 +38,8 @@ config MT792x_USB
        select MT76_USB
 
 config MT76_NPU
-       bool
-       depends on MT76_CORE
+       tristate
+       depends on NET_AIROHA_NPU=y || MT76_CORE=NET_AIROHA_NPU
 
 source "drivers/net/wireless/mediatek/mt76/mt76x0/Kconfig"
 source "drivers/net/wireless/mediatek/mt76/mt76x2/Kconfig"
index 1d42adfe8030447d551614abef35dde947b5f292..cacdd2b13d05bfa441c573ef692a0e89418cb0a2 100644 (file)
@@ -12,7 +12,11 @@ mt76-y := \
        mmio.o util.o trace.o dma.o mac80211.o debugfs.o eeprom.o \
        tx.o agg-rx.o mcu.o wed.o scan.o channel.o
 
-mt76-$(CONFIG_MT76_NPU) += npu.o
+ifdef CONFIG_MT76_NPU
+# CONFIG_MT76_NPU is tristate to simplify dependency tracking,
+# but it behaves as a bool symbol here.
+mt76-y += npu.o
+endif
 mt76-$(CONFIG_PCI) += pci.o
 mt76-$(CONFIG_NL80211_TESTMODE) += testmode.o
 
index a32ba7c23f92b3c90a8dcde6b788e0db2d971bdb..3822eb8fd88fc28c0960d6a92876dc801f76830b 100644 (file)
@@ -1647,7 +1647,7 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,
 int mt76_testmode_set_state(struct mt76_phy *phy, enum mt76_testmode_state state);
 int mt76_testmode_alloc_skb(struct mt76_phy *phy, u32 len);
 
-#ifdef CONFIG_MT76_NPU
+#if IS_ENABLED(CONFIG_MT76_NPU)
 void mt76_npu_check_ppe(struct mt76_dev *dev, struct sk_buff *skb,
                        u32 info);
 int mt76_npu_dma_add_buf(struct mt76_phy *phy, struct mt76_queue *q,
index 5503d03bf62c65f953c6f7dec4008f731b90bb77..5742bce12fbb58b0901f90205fdf44c8eca4e62c 100644 (file)
@@ -16,6 +16,6 @@ config MT7996E
 config MT7996_NPU
        bool "MT7996 (PCIe) NPU support"
        depends on MT7996E
-       depends on NET_AIROHA_NPU=y || MT7996E=NET_AIROHA_NPU
+       depends on NET_AIROHA_NPU=y || MT76_CORE=NET_AIROHA_NPU
        select MT76_NPU
        default n