AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/05 08:15 flow patch-triage
1m Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the mailbox communication logic in the Airoha EN7581/AN7583 NPU driver (airoha_npu). This is a vendor-specific platform driver for networking SoC hardware that requires physical hardware and specific firmware to probe successfully. It cannot be reached or meaningfully fuzzed in standard virtualized environments like QEMU.",
  "WorthFuzzing": false
}

1/1 2026/08/05 08:15 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit db87d9fe8cdb3e207ca59148d61f5a656d70437d\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Wed Aug 5 08:15:14 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c\nindex b679bed952de3..d2f6c9c084b85 100644\n--- a/drivers/net/ethernet/airoha/airoha_npu.c\n+++ b/drivers/net/ethernet/airoha/airoha_npu.c\n@@ -166,12 +166,21 @@ static int airoha_npu_send_msg(struct airoha_npu *npu, int func_id,\n \tu16 core = 0; /* FIXME */\n \tu32 val, offset = core \u003c\u003c 4;\n \tdma_addr_t dma_addr;\n+\tvoid *dma_buf;\n \tint ret;\n \n-\tdma_addr = dma_map_single(npu-\u003edev, p, size, DMA_BIDIRECTIONAL);\n-\tret = dma_mapping_error(npu-\u003edev, dma_addr);\n-\tif (ret)\n-\t\treturn ret;\n+\t/*\n+\t * Mailbox payloads are small and bidirectional (CPU sets the\n+\t * request, NPU writes the response). Streaming DMA_BIDIRECTIONAL\n+\t * mapping regresses EN7581+MT7996: MBOX reports success but\n+\t * WLAN_FUNC_GET_WAIT_NPU_VERSION still reads as 0.0. Use a\n+\t * coherent bounce buffer so the CPU always sees the NPU response.\n+\t */\n+\tdma_buf = dma_alloc_coherent(npu-\u003edev, size, \u0026dma_addr, GFP_ATOMIC);\n+\tif (!dma_buf)\n+\t\treturn -ENOMEM;\n+\n+\tmemcpy(dma_buf, p, size);\n \n \tspin_lock_bh(\u0026npu-\u003ecores[core].lock);\n \n@@ -191,7 +200,9 @@ static int airoha_npu_send_msg(struct airoha_npu *npu, int func_id,\n \n \tspin_unlock_bh(\u0026npu-\u003ecores[core].lock);\n \n-\tdma_unmap_single(npu-\u003edev, dma_addr, size, DMA_BIDIRECTIONAL);\n+\tif (!ret)\n+\t\tmemcpy(p, dma_buf, size);\n+\tdma_free_coherent(npu-\u003edev, size, dma_buf, dma_addr);\n \n \treturn ret;\n }\n"
}

2/1 2026/08/05 08:15 agent patch-evaluator
1m Model:
best-expensive

Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the mailbox communication logic in the Airoha EN7581/AN7583 NPU driver (airoha_npu). This is a vendor-specific platform driver for networking SoC hardware that requires physical hardware and specific firmware to probe successfully. It cannot be reached or meaningfully fuzzed in standard virtualized environments like QEMU.",
  "WorthFuzzing": false
}

Instruction:
You are an expert Linux kernel maintainer.
Your job is to review a provided patch series and determine
if it makes functional changes to the kernel that should be fuzzed.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively
use your code access tools to examine the actual source code and confirm any assumptions.

Return WorthFuzzing=false if the patch only contains:
- Modifications to Documentation/, Kconfig files, or code comments.
- Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints.
- Changes to numeric constants or macros that do not functionally alter execution flow.
- Code paths that are impossible to reach in virtualized environments like GCE or QEMU,
  even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim).
- Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed,
  ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU.
- Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove)
  that are executed only during PCI hot-unplug or sysfs driver unbind operations.

If it modifies reachable core kernel logic, drivers, or architectures, use your code search
tools to verify the code can be executed, then return WorthFuzzing=true.

When returning WorthFuzzing=true, you MUST ALSO:
1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols.
   Avoid listing generic hot-path functions to prevent skewed test distributions.
   Prefer non-static, non-inlined API entrypoint functions over internal static helper functions
   (which are inlined by the compiler and do not have distinct symbol addresses).
2. Identify any specific CONFIG_ options required to properly test this new/modified feature.
   Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions.
   Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs
   needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs
   output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit db87d9fe8cdb3e207ca59148d61f5a656d70437d
Author: syz-cluster <triage@syzkaller.com>
Date:   Wed Aug 5 08:15:14 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c
index b679bed952de3..d2f6c9c084b85 100644
--- a/drivers/net/ethernet/airoha/airoha_npu.c
+++ b/drivers/net/ethernet/airoha/airoha_npu.c
@@ -166,12 +166,21 @@ static int airoha_npu_send_msg(struct airoha_npu *npu, int func_id,
 	u16 core = 0; /* FIXME */
 	u32 val, offset = core << 4;
 	dma_addr_t dma_addr;
+	void *dma_buf;
 	int ret;
 
-	dma_addr = dma_map_single(npu->dev, p, size, DMA_BIDIRECTIONAL);
-	ret = dma_mapping_error(npu->dev, dma_addr);
-	if (ret)
-		return ret;
+	/*
+	 * Mailbox payloads are small and bidirectional (CPU sets the
+	 * request, NPU writes the response). Streaming DMA_BIDIRECTIONAL
+	 * mapping regresses EN7581+MT7996: MBOX reports success but
+	 * WLAN_FUNC_GET_WAIT_NPU_VERSION still reads as 0.0. Use a
+	 * coherent bounce buffer so the CPU always sees the NPU response.
+	 */
+	dma_buf = dma_alloc_coherent(npu->dev, size, &dma_addr, GFP_ATOMIC);
+	if (!dma_buf)
+		return -ENOMEM;
+
+	memcpy(dma_buf, p, size);
 
 	spin_lock_bh(&npu->cores[core].lock);
 
@@ -191,7 +200,9 @@ static int airoha_npu_send_msg(struct airoha_npu *npu, int func_id,
 
 	spin_unlock_bh(&npu->cores[core].lock);
 
-	dma_unmap_single(npu->dev, dma_addr, size, DMA_BIDIRECTIONAL);
+	if (!ret)
+		memcpy(p, dma_buf, size);
+	dma_free_coherent(npu->dev, size, dma_buf, dma_addr);
 
 	return ret;
 }

3/2 2026/08/05 08:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 2487
							output: 35
							thoughts: 108
						

Thoughts:
**Analyzing a Mailbox Payload Allocation Change in the airoha_npu Ethernet Driver**

Okay, so I'm looking at a patch in `drivers/net/ethernet/airoha/airoha_npu.c`. The core change seems to be in `airoha_npu_send_msg`, where they're swapping out `dma_map_single` for `dma_alloc_coherent` when dealing with the mailbox payloads. My immediate thought is, "Why the change?". What's the context here? Is this addressing a performance issue, or possibly fixing a potential coherency problem? It’s pretty standard practice to check what the driver actually *is*. This is an `airoha_npu` driver, which to my knowledge is fairly specific to a certain chipset. I wonder what the particular role of this `npu` is in the architecture? Perhaps an offload engine?

I'm thinking I should really dig into the driver configuration to understand the bigger picture. I'll need to check the Kconfig files, probably in the `drivers/net/ethernet/airoha/` directory. Maybe even some of the header files for relevant definitions or dependencies to help me understand what's actually going on. This will give me a better understanding of the hardware this is designed for, and the implications of this mailbox change. I need to be sure that this change is safe and is being done for a good reason.



4/2 2026/08/05 08:15 tool grepper
0m Args:
{
  "Expression": "airoha_npu",
  "PathPrefix": "drivers/net/ethernet/airoha/"
}

Results:
{
  "Output": "drivers/net/ethernet/airoha/Makefile=8=airoha-eth-$(CONFIG_DEBUG_FS) += airoha_ppe_debugfs.o\ndrivers/net/ethernet/airoha/Makefile:9:obj-$(CONFIG_NET_AIROHA_NPU) += airoha_npu.o\n--\ndrivers/net/ethernet/airoha/airoha_eth.h=645=struct airoha_eth {\n--\ndrivers/net/ethernet/airoha/airoha_eth.h-652-\ndrivers/net/ethernet/airoha/airoha_eth.h:653:\tstruct airoha_npu __rcu *npu;\ndrivers/net/ethernet/airoha/airoha_eth.h-654-\n--\ndrivers/net/ethernet/airoha/airoha_npu.c=105=enum {\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-109-\ndrivers/net/ethernet/airoha/airoha_npu.c:110:struct airoha_npu_fw {\ndrivers/net/ethernet/airoha/airoha_npu.c-111-\tconst char *name;\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-114-\ndrivers/net/ethernet/airoha/airoha_npu.c:115:struct airoha_npu_soc_data {\ndrivers/net/ethernet/airoha/airoha_npu.c:116:\tstruct airoha_npu_fw fw_rv32;\ndrivers/net/ethernet/airoha/airoha_npu.c:117:\tstruct airoha_npu_fw fw_data;\ndrivers/net/ethernet/airoha/airoha_npu.c-118-};\n--\ndrivers/net/ethernet/airoha/airoha_npu.c=156=struct wlan_mbox_data {\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-162-\ndrivers/net/ethernet/airoha/airoha_npu.c:163:static int airoha_npu_send_msg(struct airoha_npu *npu, int func_id,\ndrivers/net/ethernet/airoha/airoha_npu.c-164-\t\t\t       void *p, int size)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-209-\ndrivers/net/ethernet/airoha/airoha_npu.c:210:static int airoha_npu_load_firmware(struct device *dev, void __iomem *addr,\ndrivers/net/ethernet/airoha/airoha_npu.c-211-\t\t\t\t    const char *fw_name, int fw_max_size)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c=234=static int\ndrivers/net/ethernet/airoha/airoha_npu.c:235:airoha_npu_load_firmware_from_dts(struct device *dev, void __iomem *addr,\ndrivers/net/ethernet/airoha/airoha_npu.c-236-\t\t\t\t  void __iomem *base)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-245-\ndrivers/net/ethernet/airoha/airoha_npu.c:246:\tret = airoha_npu_load_firmware(dev, addr, fw_names[0],\ndrivers/net/ethernet/airoha/airoha_npu.c-247-\t\t\t\t       NPU_EN7581_FIRMWARE_RV32_MAX_SIZE);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-250-\ndrivers/net/ethernet/airoha/airoha_npu.c:251:\treturn airoha_npu_load_firmware(dev, base + REG_NPU_LOCAL_SRAM,\ndrivers/net/ethernet/airoha/airoha_npu.c-252-\t\t\t\t\tfw_names[1],\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-255-\ndrivers/net/ethernet/airoha/airoha_npu.c:256:static int airoha_npu_run_firmware(struct device *dev, void __iomem *base,\ndrivers/net/ethernet/airoha/airoha_npu.c-257-\t\t\t\t   struct resource *res)\ndrivers/net/ethernet/airoha/airoha_npu.c-258-{\ndrivers/net/ethernet/airoha/airoha_npu.c:259:\tconst struct airoha_npu_soc_data *soc;\ndrivers/net/ethernet/airoha/airoha_npu.c-260-\tvoid __iomem *addr;\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-274-\tif (of_find_property(dev-\u003eof_node, \"firmware-name\", NULL))\ndrivers/net/ethernet/airoha/airoha_npu.c:275:\t\treturn airoha_npu_load_firmware_from_dts(dev, addr, base);\ndrivers/net/ethernet/airoha/airoha_npu.c-276-\ndrivers/net/ethernet/airoha/airoha_npu.c-277-\t/* Load rv32 npu firmware */\ndrivers/net/ethernet/airoha/airoha_npu.c:278:\tret = airoha_npu_load_firmware(dev, addr, soc-\u003efw_rv32.name,\ndrivers/net/ethernet/airoha/airoha_npu.c-279-\t\t\t\t       soc-\u003efw_rv32.max_size);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-283-\t/* Load data npu firmware */\ndrivers/net/ethernet/airoha/airoha_npu.c:284:\treturn airoha_npu_load_firmware(dev, base + REG_NPU_LOCAL_SRAM,\ndrivers/net/ethernet/airoha/airoha_npu.c-285-\t\t\t\t\tsoc-\u003efw_data.name,\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-288-\ndrivers/net/ethernet/airoha/airoha_npu.c:289:static irqreturn_t airoha_npu_mbox_handler(int irq, void *npu_instance)\ndrivers/net/ethernet/airoha/airoha_npu.c-290-{\ndrivers/net/ethernet/airoha/airoha_npu.c:291:\tstruct airoha_npu *npu = npu_instance;\ndrivers/net/ethernet/airoha/airoha_npu.c-292-\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-303-\ndrivers/net/ethernet/airoha/airoha_npu.c:304:static void airoha_npu_wdt_work(struct work_struct *work)\ndrivers/net/ethernet/airoha/airoha_npu.c-305-{\ndrivers/net/ethernet/airoha/airoha_npu.c:306:\tstruct airoha_npu_core *core;\ndrivers/net/ethernet/airoha/airoha_npu.c:307:\tstruct airoha_npu *npu;\ndrivers/net/ethernet/airoha/airoha_npu.c-308-\tvoid *dump;\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-311-\ndrivers/net/ethernet/airoha/airoha_npu.c:312:\tcore = container_of(work, struct airoha_npu_core, wdt_work);\ndrivers/net/ethernet/airoha/airoha_npu.c-313-\tnpu = core-\u003enpu;\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-326-\ndrivers/net/ethernet/airoha/airoha_npu.c:327:static irqreturn_t airoha_npu_wdt_handler(int irq, void *core_instance)\ndrivers/net/ethernet/airoha/airoha_npu.c-328-{\ndrivers/net/ethernet/airoha/airoha_npu.c:329:\tstruct airoha_npu_core *core = core_instance;\ndrivers/net/ethernet/airoha/airoha_npu.c:330:\tstruct airoha_npu *npu = core-\u003enpu;\ndrivers/net/ethernet/airoha/airoha_npu.c-331-\tint c = core - \u0026npu-\u003ecores[0];\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-341-\ndrivers/net/ethernet/airoha/airoha_npu.c:342:static int airoha_npu_ppe_init(struct airoha_npu *npu)\ndrivers/net/ethernet/airoha/airoha_npu.c-343-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-355-\ndrivers/net/ethernet/airoha/airoha_npu.c:356:\terr = airoha_npu_send_msg(npu, NPU_FUNC_PPE, ppe_data,\ndrivers/net/ethernet/airoha/airoha_npu.c-357-\t\t\t\t  sizeof(*ppe_data));\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-362-\ndrivers/net/ethernet/airoha/airoha_npu.c:363:static int airoha_npu_ppe_deinit(struct airoha_npu *npu)\ndrivers/net/ethernet/airoha/airoha_npu.c-364-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-374-\ndrivers/net/ethernet/airoha/airoha_npu.c:375:\terr = airoha_npu_send_msg(npu, NPU_FUNC_PPE, ppe_data,\ndrivers/net/ethernet/airoha/airoha_npu.c-376-\t\t\t\t  sizeof(*ppe_data));\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-381-\ndrivers/net/ethernet/airoha/airoha_npu.c:382:static int airoha_npu_ppe_flush_sram_entries(struct airoha_npu *npu,\ndrivers/net/ethernet/airoha/airoha_npu.c-383-\t\t\t\t\t     dma_addr_t foe_addr,\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-398-\ndrivers/net/ethernet/airoha/airoha_npu.c:399:\terr = airoha_npu_send_msg(npu, NPU_FUNC_PPE, ppe_data,\ndrivers/net/ethernet/airoha/airoha_npu.c-400-\t\t\t\t  sizeof(*ppe_data));\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-405-\ndrivers/net/ethernet/airoha/airoha_npu.c:406:static int airoha_npu_foe_commit_entry(struct airoha_npu *npu,\ndrivers/net/ethernet/airoha/airoha_npu.c-407-\t\t\t\t       dma_addr_t foe_addr,\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-423-\ndrivers/net/ethernet/airoha/airoha_npu.c:424:\terr = airoha_npu_send_msg(npu, NPU_FUNC_PPE, ppe_data,\ndrivers/net/ethernet/airoha/airoha_npu.c-425-\t\t\t\t  sizeof(*ppe_data));\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-432-\ndrivers/net/ethernet/airoha/airoha_npu.c:433:\terr = airoha_npu_send_msg(npu, NPU_FUNC_PPE, ppe_data,\ndrivers/net/ethernet/airoha/airoha_npu.c-434-\t\t\t\t  sizeof(*ppe_data));\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-440-\ndrivers/net/ethernet/airoha/airoha_npu.c:441:static int airoha_npu_ppe_stats_setup(struct airoha_npu *npu,\ndrivers/net/ethernet/airoha/airoha_npu.c-442-\t\t\t\t      dma_addr_t foe_stats_addr,\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-455-\ndrivers/net/ethernet/airoha/airoha_npu.c:456:\terr = airoha_npu_send_msg(npu, NPU_FUNC_PPE, ppe_data,\ndrivers/net/ethernet/airoha/airoha_npu.c-457-\t\t\t\t  sizeof(*ppe_data));\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-471-\ndrivers/net/ethernet/airoha/airoha_npu.c:472:static int airoha_npu_wlan_msg_send(struct airoha_npu *npu, int ifindex,\ndrivers/net/ethernet/airoha/airoha_npu.c:473:\t\t\t\t    enum airoha_npu_wlan_set_cmd func_id,\ndrivers/net/ethernet/airoha/airoha_npu.c-474-\t\t\t\t    void *data, int data_len, gfp_t gfp)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-488-\ndrivers/net/ethernet/airoha/airoha_npu.c:489:\terr = airoha_npu_send_msg(npu, NPU_FUNC_WIFI, wlan_data, len);\ndrivers/net/ethernet/airoha/airoha_npu.c-490-\tkfree(wlan_data);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-494-\ndrivers/net/ethernet/airoha/airoha_npu.c:495:static int airoha_npu_wlan_msg_get(struct airoha_npu *npu, int ifindex,\ndrivers/net/ethernet/airoha/airoha_npu.c:496:\t\t\t\t   enum airoha_npu_wlan_get_cmd func_id,\ndrivers/net/ethernet/airoha/airoha_npu.c-497-\t\t\t\t   void *data, int data_len, gfp_t gfp)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-510-\ndrivers/net/ethernet/airoha/airoha_npu.c:511:\terr = airoha_npu_send_msg(npu, NPU_FUNC_WIFI, wlan_data, len);\ndrivers/net/ethernet/airoha/airoha_npu.c-512-\tif (!err)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c=519=static int\ndrivers/net/ethernet/airoha/airoha_npu.c:520:airoha_npu_wlan_set_reserved_memory(struct airoha_npu *npu,\ndrivers/net/ethernet/airoha/airoha_npu.c-521-\t\t\t\t    int ifindex, const char *name,\ndrivers/net/ethernet/airoha/airoha_npu.c:522:\t\t\t\t    enum airoha_npu_wlan_set_cmd func_id)\ndrivers/net/ethernet/airoha/airoha_npu.c-523-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-534-\tval = res.start;\ndrivers/net/ethernet/airoha/airoha_npu.c:535:\treturn airoha_npu_wlan_msg_send(npu, ifindex, func_id, \u0026val,\ndrivers/net/ethernet/airoha/airoha_npu.c-536-\t\t\t\t\tsizeof(val), GFP_KERNEL);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-538-\ndrivers/net/ethernet/airoha/airoha_npu.c:539:static int airoha_npu_wlan_init_memory(struct airoha_npu *npu)\ndrivers/net/ethernet/airoha/airoha_npu.c-540-{\ndrivers/net/ethernet/airoha/airoha_npu.c:541:\tenum airoha_npu_wlan_set_cmd cmd = WLAN_FUNC_SET_WAIT_NPU_BAND0_ONCPU;\ndrivers/net/ethernet/airoha/airoha_npu.c-542-\tu32 val = 0;\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-544-\ndrivers/net/ethernet/airoha/airoha_npu.c:545:\terr = airoha_npu_wlan_msg_send(npu, 1, cmd, \u0026val, sizeof(val),\ndrivers/net/ethernet/airoha/airoha_npu.c-546-\t\t\t\t       GFP_KERNEL);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-550-\tcmd = WLAN_FUNC_SET_WAIT_TX_BUF_CHECK_ADDR;\ndrivers/net/ethernet/airoha/airoha_npu.c:551:\terr = airoha_npu_wlan_set_reserved_memory(npu, 0, \"tx-bufid\", cmd);\ndrivers/net/ethernet/airoha/airoha_npu.c-552-\tif (err)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-555-\tcmd = WLAN_FUNC_SET_WAIT_PKT_BUF_ADDR;\ndrivers/net/ethernet/airoha/airoha_npu.c:556:\terr = airoha_npu_wlan_set_reserved_memory(npu, 0, \"pkt\", cmd);\ndrivers/net/ethernet/airoha/airoha_npu.c-557-\tif (err)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-560-\tcmd = WLAN_FUNC_SET_WAIT_TX_PKT_BUF_ADDR;\ndrivers/net/ethernet/airoha/airoha_npu.c:561:\terr = airoha_npu_wlan_set_reserved_memory(npu, 0, \"tx-pkt\", cmd);\ndrivers/net/ethernet/airoha/airoha_npu.c-562-\tif (err)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-567-\t\tcmd = WLAN_FUNC_SET_WAIT_DRAM_BA_NODE_ADDR;\ndrivers/net/ethernet/airoha/airoha_npu.c:568:\t\terr = airoha_npu_wlan_set_reserved_memory(npu, 0, \"ba\", cmd);\ndrivers/net/ethernet/airoha/airoha_npu.c-569-\t\tif (err)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-573-\tcmd = WLAN_FUNC_SET_WAIT_IS_FORCE_TO_CPU;\ndrivers/net/ethernet/airoha/airoha_npu.c:574:\treturn airoha_npu_wlan_msg_send(npu, 0, cmd, \u0026val, sizeof(val),\ndrivers/net/ethernet/airoha/airoha_npu.c-575-\t\t\t\t\tGFP_KERNEL);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-577-\ndrivers/net/ethernet/airoha/airoha_npu.c:578:static u32 airoha_npu_wlan_queue_addr_get(struct airoha_npu *npu, int qid,\ndrivers/net/ethernet/airoha/airoha_npu.c-579-\t\t\t\t\t  bool xmit)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-586-\ndrivers/net/ethernet/airoha/airoha_npu.c:587:static void airoha_npu_wlan_irq_status_set(struct airoha_npu *npu, u32 val)\ndrivers/net/ethernet/airoha/airoha_npu.c-588-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-591-\ndrivers/net/ethernet/airoha/airoha_npu.c:592:static u32 airoha_npu_wlan_irq_status_get(struct airoha_npu *npu, int q)\ndrivers/net/ethernet/airoha/airoha_npu.c-593-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-599-\ndrivers/net/ethernet/airoha/airoha_npu.c:600:static void airoha_npu_wlan_irq_enable(struct airoha_npu *npu, int q)\ndrivers/net/ethernet/airoha/airoha_npu.c-601-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-604-\ndrivers/net/ethernet/airoha/airoha_npu.c:605:static void airoha_npu_wlan_irq_disable(struct airoha_npu *npu, int q)\ndrivers/net/ethernet/airoha/airoha_npu.c-606-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-609-\ndrivers/net/ethernet/airoha/airoha_npu.c:610:struct airoha_npu *airoha_npu_get(struct device *dev)\ndrivers/net/ethernet/airoha/airoha_npu.c-611-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-613-\tstruct device_node *np;\ndrivers/net/ethernet/airoha/airoha_npu.c:614:\tstruct airoha_npu *npu;\ndrivers/net/ethernet/airoha/airoha_npu.c-615-\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-657-}\ndrivers/net/ethernet/airoha/airoha_npu.c:658:EXPORT_SYMBOL_GPL(airoha_npu_get);\ndrivers/net/ethernet/airoha/airoha_npu.c-659-\ndrivers/net/ethernet/airoha/airoha_npu.c:660:void airoha_npu_put(struct airoha_npu *npu)\ndrivers/net/ethernet/airoha/airoha_npu.c-661-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-664-}\ndrivers/net/ethernet/airoha/airoha_npu.c:665:EXPORT_SYMBOL_GPL(airoha_npu_put);\ndrivers/net/ethernet/airoha/airoha_npu.c-666-\ndrivers/net/ethernet/airoha/airoha_npu.c:667:static const struct airoha_npu_soc_data en7581_npu_soc_data = {\ndrivers/net/ethernet/airoha/airoha_npu.c-668-\t.fw_rv32 = {\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-677-\ndrivers/net/ethernet/airoha/airoha_npu.c:678:static const struct airoha_npu_soc_data an7583_npu_soc_data = {\ndrivers/net/ethernet/airoha/airoha_npu.c-679-\t.fw_rv32 = {\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-688-\ndrivers/net/ethernet/airoha/airoha_npu.c:689:static const struct of_device_id of_airoha_npu_match[] = {\ndrivers/net/ethernet/airoha/airoha_npu.c-690-\t{ .compatible = \"airoha,en7581-npu\", .data = \u0026en7581_npu_soc_data },\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-693-};\ndrivers/net/ethernet/airoha/airoha_npu.c:694:MODULE_DEVICE_TABLE(of, of_airoha_npu_match);\ndrivers/net/ethernet/airoha/airoha_npu.c-695-\ndrivers/net/ethernet/airoha/airoha_npu.c=696=static const struct regmap_config regmap_config = {\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-703-\ndrivers/net/ethernet/airoha/airoha_npu.c:704:static int airoha_npu_probe(struct platform_device *pdev)\ndrivers/net/ethernet/airoha/airoha_npu.c-705-{\ndrivers/net/ethernet/airoha/airoha_npu.c-706-\tstruct device *dev = \u0026pdev-\u003edev;\ndrivers/net/ethernet/airoha/airoha_npu.c:707:\tstruct airoha_npu *npu;\ndrivers/net/ethernet/airoha/airoha_npu.c-708-\tstruct resource res;\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-721-\tnpu-\u003edev = dev;\ndrivers/net/ethernet/airoha/airoha_npu.c:722:\tnpu-\u003eops.ppe_init = airoha_npu_ppe_init;\ndrivers/net/ethernet/airoha/airoha_npu.c:723:\tnpu-\u003eops.ppe_deinit = airoha_npu_ppe_deinit;\ndrivers/net/ethernet/airoha/airoha_npu.c:724:\tnpu-\u003eops.ppe_init_stats = airoha_npu_ppe_stats_setup;\ndrivers/net/ethernet/airoha/airoha_npu.c:725:\tnpu-\u003eops.ppe_flush_sram_entries = airoha_npu_ppe_flush_sram_entries;\ndrivers/net/ethernet/airoha/airoha_npu.c:726:\tnpu-\u003eops.ppe_foe_commit_entry = airoha_npu_foe_commit_entry;\ndrivers/net/ethernet/airoha/airoha_npu.c:727:\tnpu-\u003eops.wlan_init_reserved_memory = airoha_npu_wlan_init_memory;\ndrivers/net/ethernet/airoha/airoha_npu.c:728:\tnpu-\u003eops.wlan_send_msg = airoha_npu_wlan_msg_send;\ndrivers/net/ethernet/airoha/airoha_npu.c:729:\tnpu-\u003eops.wlan_get_msg = airoha_npu_wlan_msg_get;\ndrivers/net/ethernet/airoha/airoha_npu.c:730:\tnpu-\u003eops.wlan_get_queue_addr = airoha_npu_wlan_queue_addr_get;\ndrivers/net/ethernet/airoha/airoha_npu.c:731:\tnpu-\u003eops.wlan_set_irq_status = airoha_npu_wlan_irq_status_set;\ndrivers/net/ethernet/airoha/airoha_npu.c:732:\tnpu-\u003eops.wlan_get_irq_status = airoha_npu_wlan_irq_status_get;\ndrivers/net/ethernet/airoha/airoha_npu.c:733:\tnpu-\u003eops.wlan_enable_irq = airoha_npu_wlan_irq_enable;\ndrivers/net/ethernet/airoha/airoha_npu.c:734:\tnpu-\u003eops.wlan_disable_irq = airoha_npu_wlan_irq_disable;\ndrivers/net/ethernet/airoha/airoha_npu.c-735-\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-747-\ndrivers/net/ethernet/airoha/airoha_npu.c:748:\terr = devm_request_irq(dev, irq, airoha_npu_mbox_handler,\ndrivers/net/ethernet/airoha/airoha_npu.c-749-\t\t\t       IRQF_SHARED, \"airoha-npu-mbox\", npu);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-753-\tfor (i = 0; i \u003c ARRAY_SIZE(npu-\u003ecores); i++) {\ndrivers/net/ethernet/airoha/airoha_npu.c:754:\t\tstruct airoha_npu_core *core = \u0026npu-\u003ecores[i];\ndrivers/net/ethernet/airoha/airoha_npu.c-755-\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-762-\ndrivers/net/ethernet/airoha/airoha_npu.c:763:\t\terr = devm_request_irq(dev, irq, airoha_npu_wdt_handler,\ndrivers/net/ethernet/airoha/airoha_npu.c-764-\t\t\t\t       IRQF_SHARED, \"airoha-npu-wdt\", core);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-767-\ndrivers/net/ethernet/airoha/airoha_npu.c:768:\t\tINIT_WORK(\u0026core-\u003ewdt_work, airoha_npu_wdt_work);\ndrivers/net/ethernet/airoha/airoha_npu.c-769-\t}\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-783-\ndrivers/net/ethernet/airoha/airoha_npu.c:784:\terr = airoha_npu_run_firmware(dev, base, \u0026res);\ndrivers/net/ethernet/airoha/airoha_npu.c-785-\tif (err)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-804-\ndrivers/net/ethernet/airoha/airoha_npu.c:805:\tif (!airoha_npu_wlan_msg_get(npu, 0, WLAN_FUNC_GET_WAIT_NPU_VERSION,\ndrivers/net/ethernet/airoha/airoha_npu.c-806-\t\t\t\t     \u0026val, sizeof(val), GFP_KERNEL))\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-814-\ndrivers/net/ethernet/airoha/airoha_npu.c:815:static void airoha_npu_remove(struct platform_device *pdev)\ndrivers/net/ethernet/airoha/airoha_npu.c-816-{\ndrivers/net/ethernet/airoha/airoha_npu.c:817:\tstruct airoha_npu *npu = platform_get_drvdata(pdev);\ndrivers/net/ethernet/airoha/airoha_npu.c-818-\tint i;\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-823-\ndrivers/net/ethernet/airoha/airoha_npu.c:824:static struct platform_driver airoha_npu_driver = {\ndrivers/net/ethernet/airoha/airoha_npu.c:825:\t.probe = airoha_npu_probe,\ndrivers/net/ethernet/airoha/airoha_npu.c:826:\t.remove = airoha_npu_remove,\ndrivers/net/ethernet/airoha/airoha_npu.c-827-\t.driver = {\ndrivers/net/ethernet/airoha/airoha_npu.c-828-\t\t.name = \"airoha-npu\",\ndrivers/net/ethernet/airoha/airoha_npu.c:829:\t\t.of_match_table = of_airoha_npu_match,\ndrivers/net/ethernet/airoha/airoha_npu.c-830-\t},\ndrivers/net/ethernet/airoha/airoha_npu.c-831-};\ndrivers/net/ethernet/airoha/airoha_npu.c:832:module_platform_driver(airoha_npu_driver);\ndrivers/net/ethernet/airoha/airoha_npu.c-833-\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=603=static void airoha_ppe_foe_flow_stat_entry_reset(struct airoha_ppe *ppe,\ndrivers/net/ethernet/airoha/airoha_ppe.c:604:\t\t\t\t\t\t struct airoha_npu *npu,\ndrivers/net/ethernet/airoha/airoha_ppe.c-605-\t\t\t\t\t\t int index)\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=611=static void airoha_ppe_foe_flow_stats_reset(struct airoha_ppe *ppe,\ndrivers/net/ethernet/airoha/airoha_ppe.c:612:\t\t\t\t\t    struct airoha_npu *npu)\ndrivers/net/ethernet/airoha/airoha_ppe.c-613-{\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=624=static void airoha_ppe_foe_flow_stats_update(struct airoha_ppe *ppe,\ndrivers/net/ethernet/airoha/airoha_ppe.c:625:\t\t\t\t\t     struct airoha_npu *npu,\ndrivers/net/ethernet/airoha/airoha_ppe.c-626-\t\t\t\t\t     struct airoha_foe_entry *hwe,\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=761=static int airoha_ppe_foe_commit_entry(struct airoha_ppe *ppe,\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-768-\tstruct airoha_eth *eth = ppe-\u003eeth;\ndrivers/net/ethernet/airoha/airoha_ppe.c:769:\tstruct airoha_npu *npu;\ndrivers/net/ethernet/airoha/airoha_ppe.c-770-\tint err = 0;\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=1297=void airoha_ppe_foe_entry_get_stats(struct airoha_ppe *ppe, u32 hash,\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1301-\tint ppe_num_stats_entries;\ndrivers/net/ethernet/airoha/airoha_ppe.c:1302:\tstruct airoha_npu *npu;\ndrivers/net/ethernet/airoha/airoha_ppe.c-1303-\tu32 index;\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=1375=static int airoha_ppe_flush_sram_entries(struct airoha_ppe *ppe)\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1392-\ndrivers/net/ethernet/airoha/airoha_ppe.c:1393:static struct airoha_npu *airoha_ppe_npu_get(struct airoha_eth *eth)\ndrivers/net/ethernet/airoha/airoha_ppe.c-1394-{\ndrivers/net/ethernet/airoha/airoha_ppe.c:1395:\tstruct airoha_npu *npu = airoha_npu_get(eth-\u003edev);\ndrivers/net/ethernet/airoha/airoha_ppe.c-1396-\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1398-\t\trequest_module(\"airoha-npu\");\ndrivers/net/ethernet/airoha/airoha_ppe.c:1399:\t\tnpu = airoha_npu_get(eth-\u003edev);\ndrivers/net/ethernet/airoha/airoha_ppe.c-1400-\t}\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=1428=static int airoha_ppe_offload_setup(struct airoha_eth *eth)\ndrivers/net/ethernet/airoha/airoha_ppe.c-1429-{\ndrivers/net/ethernet/airoha/airoha_ppe.c:1430:\tstruct airoha_npu *npu = airoha_ppe_npu_get(eth);\ndrivers/net/ethernet/airoha/airoha_ppe.c-1431-\tstruct airoha_ppe *ppe = eth-\u003eppe;\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1462-error_npu_put:\ndrivers/net/ethernet/airoha/airoha_ppe.c:1463:\tairoha_npu_put(npu);\ndrivers/net/ethernet/airoha/airoha_ppe.c-1464-\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=1658=void airoha_ppe_deinit(struct airoha_eth *eth)\ndrivers/net/ethernet/airoha/airoha_ppe.c-1659-{\ndrivers/net/ethernet/airoha/airoha_ppe.c:1660:\tstruct airoha_npu *npu;\ndrivers/net/ethernet/airoha/airoha_ppe.c-1661-\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1668-\t\tnpu-\u003eops.ppe_deinit(npu);\ndrivers/net/ethernet/airoha/airoha_ppe.c:1669:\t\tairoha_npu_put(npu);\ndrivers/net/ethernet/airoha/airoha_ppe.c-1670-\t}\n"
}

5/2 2026/08/05 08:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 13071
							output: 37
							thoughts: 389
						

Thoughts:
**Analyzing the Fuzzing Potential of the `airoha_npu` Driver**

Okay, so I'm looking at this `airoha_npu` driver. It's a platform driver, specifically for the "airoha,en7581-npu" and "airoha,an7583-npu" SoCs. Airoha, being a MediaTek subsidiary, typically means networking SoCs. My first thought is always, "Can this be reached in QEMU?" Platform drivers for specialized networking SoCs like the EN7581 often don't work without a specific QEMU machine type. I need to figure out if this one is an exception.

Wait a second, there's a guideline here. It says to mark patches as "WorthFuzzing=false" if they include code in vendor-specific drivers that need *physical* hardware or paths that are unreachable in virtualized environments. It mentions PCIe switch drivers, SmartNICs, and GPUs specifically. Hmm... is `airoha_npu` in that category? It *is* a platform driver for a specific SoC.

So, *could* it be fuzzed using syzkaller? Syzkaller can generate platform devices, either directly through calls like `syz_gen_syz_platform_device` or by tweaking the device tree, depending on the implementation. But here's the kicker: this driver seems to need specific MMIO registers and firmware loading via `airoha_npu_load_firmware`. That raises some flags. I need to dig into `airoha_npu_probe` now to see what's actually going on. My initial gut feeling? This might not be straightforward to fuzz in a standard QEMU setup. I'm going to have to do some more digging.



6/2 2026/08/05 08:15 tool grepper
0m Args:
{
  "Expression": "airoha_npu_probe",
  "PathPrefix": "drivers/net/ethernet/airoha/"
}

Results:
{
  "Output": "drivers/net/ethernet/airoha/airoha_npu.c=696=static const struct regmap_config regmap_config = {\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-703-\ndrivers/net/ethernet/airoha/airoha_npu.c:704:static int airoha_npu_probe(struct platform_device *pdev)\ndrivers/net/ethernet/airoha/airoha_npu.c-705-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c=824=static struct platform_driver airoha_npu_driver = {\ndrivers/net/ethernet/airoha/airoha_npu.c:825:\t.probe = airoha_npu_probe,\ndrivers/net/ethernet/airoha/airoha_npu.c-826-\t.remove = airoha_npu_remove,\n"
}

7/2 2026/08/05 08:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 14135
							output: 46
							thoughts: 16
						

Thoughts:
Okay, let's dive into this. Here's my thought process as I examine `airoha_npu_probe`:

**Analyzing `airoha_npu_probe`**

Alright, so the task at hand is to understand the purpose and function of `airoha_npu_probe`. Given the name, I'm immediately assuming this is related to probing or detecting the presence and configuration of an NPU (Neural Processing Unit) within a system, specifically one likely manufactured by Airoha. The "probe" part is pretty clear – we're looking for information, attempting to establish communication or read hardware registers, perhaps. I need to figure out:

*   **What triggers this probe?** Is it called during system initialization, module loading, or in response to a specific event? The timing will tell me a lot about its purpose.
*   **What does it *do*?** Does it simply check for the NPU's existence? Does it initialize the hardware? Does it configure it with any specific settings or parameters? Does it register the NPU with the operating system? This is crucial. I'll be looking for register reads/writes, device driver interactions, and any calls to hardware abstraction layers.
*   **What's the data flow?** What information is being passed to and from this probe function? Understanding the input and output parameters is key to understanding its responsibilities. Are there any error handling mechanisms? How does it report its findings (success/failure, device information)?
*   **What are the dependencies?** Does it rely on specific hardware peripherals, other drivers, or system services? Identifying these dependencies will help me understand its context within the broader system.
*   **What are the potential failure modes?** What can go wrong during the probe, and how does the code handle these scenarios? Understanding potential errors is important for debugging and system stability.
*  **What would I expect to see in terms of an overall design?** Given that this is an NPU probe, I would expect to see a carefully designed sequence of steps that will enumerate the hardware and then bring it into a 'ready' state for operations to follow.

I'm ready to dig in and start analyzing the code. Let's get to it.



8/2 2026/08/05 08:15 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/airoha/airoha_npu.c",
  "FirstLine": 704,
  "LineCount": 100
}

Results:
{
  "Contents": " 704:\tstatic int airoha_npu_probe(struct platform_device *pdev)\n 705:\t{\n 706:\t\tstruct device *dev = \u0026pdev-\u003edev;\n 707:\t\tstruct airoha_npu *npu;\n 708:\t\tstruct resource res;\n 709:\t\tvoid __iomem *base;\n 710:\t\tint i, irq, err;\n 711:\t\tu32 val;\n 712:\t\n 713:\t\tbase = devm_platform_ioremap_resource(pdev, 0);\n 714:\t\tif (IS_ERR(base))\n 715:\t\t\treturn PTR_ERR(base);\n 716:\t\n 717:\t\tnpu = devm_kzalloc(dev, sizeof(*npu), GFP_KERNEL);\n 718:\t\tif (!npu)\n 719:\t\t\treturn -ENOMEM;\n 720:\t\n 721:\t\tnpu-\u003edev = dev;\n 722:\t\tnpu-\u003eops.ppe_init = airoha_npu_ppe_init;\n 723:\t\tnpu-\u003eops.ppe_deinit = airoha_npu_ppe_deinit;\n 724:\t\tnpu-\u003eops.ppe_init_stats = airoha_npu_ppe_stats_setup;\n 725:\t\tnpu-\u003eops.ppe_flush_sram_entries = airoha_npu_ppe_flush_sram_entries;\n 726:\t\tnpu-\u003eops.ppe_foe_commit_entry = airoha_npu_foe_commit_entry;\n 727:\t\tnpu-\u003eops.wlan_init_reserved_memory = airoha_npu_wlan_init_memory;\n 728:\t\tnpu-\u003eops.wlan_send_msg = airoha_npu_wlan_msg_send;\n 729:\t\tnpu-\u003eops.wlan_get_msg = airoha_npu_wlan_msg_get;\n 730:\t\tnpu-\u003eops.wlan_get_queue_addr = airoha_npu_wlan_queue_addr_get;\n 731:\t\tnpu-\u003eops.wlan_set_irq_status = airoha_npu_wlan_irq_status_set;\n 732:\t\tnpu-\u003eops.wlan_get_irq_status = airoha_npu_wlan_irq_status_get;\n 733:\t\tnpu-\u003eops.wlan_enable_irq = airoha_npu_wlan_irq_enable;\n 734:\t\tnpu-\u003eops.wlan_disable_irq = airoha_npu_wlan_irq_disable;\n 735:\t\n 736:\t\tnpu-\u003eregmap = devm_regmap_init_mmio(dev, base, \u0026regmap_config);\n 737:\t\tif (IS_ERR(npu-\u003eregmap))\n 738:\t\t\treturn PTR_ERR(npu-\u003eregmap);\n 739:\t\n 740:\t\terr = of_reserved_mem_region_to_resource(dev-\u003eof_node, 0, \u0026res);\n 741:\t\tif (err)\n 742:\t\t\treturn err;\n 743:\t\n 744:\t\tirq = platform_get_irq(pdev, 0);\n 745:\t\tif (irq \u003c 0)\n 746:\t\t\treturn irq;\n 747:\t\n 748:\t\terr = devm_request_irq(dev, irq, airoha_npu_mbox_handler,\n 749:\t\t\t\t       IRQF_SHARED, \"airoha-npu-mbox\", npu);\n 750:\t\tif (err)\n 751:\t\t\treturn err;\n 752:\t\n 753:\t\tfor (i = 0; i \u003c ARRAY_SIZE(npu-\u003ecores); i++) {\n 754:\t\t\tstruct airoha_npu_core *core = \u0026npu-\u003ecores[i];\n 755:\t\n 756:\t\t\tspin_lock_init(\u0026core-\u003elock);\n 757:\t\t\tcore-\u003enpu = npu;\n 758:\t\n 759:\t\t\tirq = platform_get_irq(pdev, i + 1);\n 760:\t\t\tif (irq \u003c 0)\n 761:\t\t\t\treturn irq;\n 762:\t\n 763:\t\t\terr = devm_request_irq(dev, irq, airoha_npu_wdt_handler,\n 764:\t\t\t\t\t       IRQF_SHARED, \"airoha-npu-wdt\", core);\n 765:\t\t\tif (err)\n 766:\t\t\t\treturn err;\n 767:\t\n 768:\t\t\tINIT_WORK(\u0026core-\u003ewdt_work, airoha_npu_wdt_work);\n 769:\t\t}\n 770:\t\n 771:\t\t/* wlan IRQ lines */\n 772:\t\tfor (i = 0; i \u003c ARRAY_SIZE(npu-\u003eirqs); i++) {\n 773:\t\t\tirq = platform_get_irq(pdev, i + ARRAY_SIZE(npu-\u003ecores) + 1);\n 774:\t\t\tif (irq \u003c 0)\n 775:\t\t\t\treturn irq;\n 776:\t\n 777:\t\t\tnpu-\u003eirqs[i] = irq;\n 778:\t\t}\n 779:\t\n 780:\t\terr = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));\n 781:\t\tif (err)\n 782:\t\t\treturn err;\n 783:\t\n 784:\t\terr = airoha_npu_run_firmware(dev, base, \u0026res);\n 785:\t\tif (err)\n 786:\t\t\treturn dev_err_probe(dev, err, \"failed to run npu firmware\\n\");\n 787:\t\n 788:\t\tregmap_write(npu-\u003eregmap, REG_CR_NPU_MIB(10),\n 789:\t\t\t     res.start + NPU_EN7581_FIRMWARE_RV32_MAX_SIZE);\n 790:\t\tregmap_write(npu-\u003eregmap, REG_CR_NPU_MIB(11), 0x40000); /* SRAM 256K */\n 791:\t\tregmap_write(npu-\u003eregmap, REG_CR_NPU_MIB(12), 0);\n 792:\t\tregmap_write(npu-\u003eregmap, REG_CR_NPU_MIB(21), 1);\n 793:\t\tmsleep(100);\n 794:\t\n 795:\t\t/* setting booting address */\n 796:\t\tfor (i = 0; i \u003c NPU_NUM_CORES; i++)\n 797:\t\t\tregmap_write(npu-\u003eregmap, REG_CR_BOOT_BASE(i), res.start);\n 798:\t\tusleep_range(1000, 2000);\n 799:\t\n 800:\t\t/* enable NPU cores */\n 801:\t\tregmap_write(npu-\u003eregmap, REG_CR_BOOT_CONFIG, 0xff);\n 802:\t\tregmap_write(npu-\u003eregmap, REG_CR_BOOT_TRIGGER, 0x1);\n 803:\t\tmsleep(100);\n"
}

9/2 2026/08/05 08:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 16633
							output: 45
							thoughts: 36
						

Thoughts:
Okay, here's my interpretation of that thought process, from an expert's perspective:

**Diving into the Firmware Execution**

Right, so we're looking at a critical piece of the puzzle here: the `airoha_npu_run_firmware` function. My initial thought is, "Ah, that's the entry point for getting the firmware up and running on the Airoha NPU." Naturally, I'd want to understand exactly what's going on behind the scenes when that function gets called. My mental model immediately jumps to, "Okay, so this is where the firmware is being loaded. I need to dig into the implementation of `airoha_npu_run_firmware` to see the specifics." I suspect it is the trigger for the firmware execution.



10/2 2026/08/05 08:15 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/airoha/airoha_npu.c",
  "FirstLine": 256,
  "LineCount": 50
}

Results:
{
  "Contents": " 256:\tstatic int airoha_npu_run_firmware(struct device *dev, void __iomem *base,\n 257:\t\t\t\t\t   struct resource *res)\n 258:\t{\n 259:\t\tconst struct airoha_npu_soc_data *soc;\n 260:\t\tvoid __iomem *addr;\n 261:\t\tint ret;\n 262:\t\n 263:\t\tsoc = of_device_get_match_data(dev);\n 264:\t\tif (!soc)\n 265:\t\t\treturn -EINVAL;\n 266:\t\n 267:\t\taddr = devm_ioremap_resource(dev, res);\n 268:\t\tif (IS_ERR(addr))\n 269:\t\t\treturn PTR_ERR(addr);\n 270:\t\n 271:\t\t/* Try to load firmware images using the firmware names provided via\n 272:\t\t * dts if available.\n 273:\t\t */\n 274:\t\tif (of_find_property(dev-\u003eof_node, \"firmware-name\", NULL))\n 275:\t\t\treturn airoha_npu_load_firmware_from_dts(dev, addr, base);\n 276:\t\n 277:\t\t/* Load rv32 npu firmware */\n 278:\t\tret = airoha_npu_load_firmware(dev, addr, soc-\u003efw_rv32.name,\n 279:\t\t\t\t\t       soc-\u003efw_rv32.max_size);\n 280:\t\tif (ret)\n 281:\t\t\treturn ret;\n 282:\t\n 283:\t\t/* Load data npu firmware */\n 284:\t\treturn airoha_npu_load_firmware(dev, base + REG_NPU_LOCAL_SRAM,\n 285:\t\t\t\t\t\tsoc-\u003efw_data.name,\n 286:\t\t\t\t\t\tsoc-\u003efw_data.max_size);\n 287:\t}\n 288:\t\n 289:\tstatic irqreturn_t airoha_npu_mbox_handler(int irq, void *npu_instance)\n 290:\t{\n 291:\t\tstruct airoha_npu *npu = npu_instance;\n 292:\t\n 293:\t\t/* clear mbox interrupt status */\n 294:\t\tregmap_write(npu-\u003eregmap, REG_CR_MBOX_INT_STATUS,\n 295:\t\t\t     MBOX_INT_STATUS_MASK);\n 296:\t\n 297:\t\t/* acknowledge npu */\n 298:\t\tregmap_update_bits(npu-\u003eregmap, REG_CR_MBQ8_CTRL(3),\n 299:\t\t\t\t   MBOX_MSG_STATUS | MBOX_MSG_DONE, MBOX_MSG_DONE);\n 300:\t\n 301:\t\treturn IRQ_HANDLED;\n 302:\t}\n 303:\t\n 304:\tstatic void airoha_npu_wdt_work(struct work_struct *work)\n 305:\t{\n"
}

11/2 2026/08/05 08:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 17699
							output: 45
							thoughts: 443
						

Thoughts:
**Analyzing the Fuzzability of the Airoha NPU Driver**

Okay, so here's the deal. I'm looking at this `airoha_npu_load_firmware` function and the way it uses `request_firmware`. The obvious issue jumps out: if the firmware isn't available, which is very likely the case in Syzkaller unless it's a standard firmware or if Syzkaller specifically mocks it, the function fails, and the probe fails. Syzkaller *does* have some firmware mocking, but that tends to be more for common drivers.

The key here is that this is a *platform* driver, specific to the Airoha EN7581 SoC. My instructions tell me to return `WorthFuzzing=false` if the code involves vendor-specific PCIe switch, SmartNIC, or GPU drivers, or if it has code paths unreachable in virtualized environments. Is this `airoha_npu` even reachable within standard QEMU?

Syzkaller *can* generate platform devices with things like `syz_gen_syz_platform_device`, which is encouraging, but those require MMIO resources, IRQs, the whole shebang. And often, these things fail at the probe stage if they require specific hardware behavior. That's assuming Syzkaller even successfully sets up the platform device and gets past the device-tree stuff.

So, the critical question is whether `airoha_npu_probe` is going to trip us up on this. Let's see... looking at the code:

```c
	err = airoha_npu_run_firmware(dev, base, &res);
	if (err)
		return dev_err_probe(dev, err, "failed to run npu firmware\n");
```

Aha! `airoha_npu_run_firmware` calls `airoha_npu_load_firmware`, which, as we've already discussed, relies on loading the firmware. This is probably going to be the blocking point. Looks like this could easily be another instance of a driver whose firmware loading makes it a bad target for fuzzing. Time to check the rest of the probe and see if anything else is obviously going to block us.



12/2 2026/08/05 08:15 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/airoha/airoha_npu.c",
  "FirstLine": 210,
  "LineCount": 25
}

Results:
{
  "Contents": " 210:\tstatic int airoha_npu_load_firmware(struct device *dev, void __iomem *addr,\n 211:\t\t\t\t\t    const char *fw_name, int fw_max_size)\n 212:\t{\n 213:\t\tconst struct firmware *fw;\n 214:\t\tint ret;\n 215:\t\n 216:\t\tret = request_firmware(\u0026fw, fw_name, dev);\n 217:\t\tif (ret)\n 218:\t\t\treturn ret == -ENOENT ? -EPROBE_DEFER : ret;\n 219:\t\n 220:\t\tif (fw-\u003esize \u003e fw_max_size) {\n 221:\t\t\tdev_err(dev, \"%s: fw size too overlimit (%zu)\\n\",\n 222:\t\t\t\tfw_name, fw-\u003esize);\n 223:\t\t\tret = -E2BIG;\n 224:\t\t\tgoto out;\n 225:\t\t}\n 226:\t\n 227:\t\tmemcpy_toio(addr, fw-\u003edata, fw-\u003esize);\n 228:\tout:\n 229:\t\trelease_firmware(fw);\n 230:\t\n 231:\t\treturn ret;\n 232:\t}\n 233:\t\n 234:\tstatic int\n"
}

13/2 2026/08/05 08:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 19032
							output: 33
							thoughts: 217
						

Thoughts:
**Debugging the Airoha Firmware Interaction**

Okay, so I'm troubleshooting this Airoha firmware issue. The code indicates that if `request_firmware` fails with `-ENOENT`, we're getting an `-EPROBE_DEFER`. Right, that's expected behavior. However, the next thought is the firmware itself. Syzkaller probably doesn't have the Airoha firmware baked into its image, unless it's available in linux-firmware and syzkaller is configured to include it. Even then, it's likely very specific to a particular System-on-a-Chip.

Wait a second, this patch I'm looking at modifies `airoha_npu_send_msg`. That function gets called by `airoha_npu_ppe_init`, `airoha_npu_wlan_msg_send`, and probably some others. Let me find out exactly *where* `airoha_npu_send_msg` is being used. Ah, it's in `airoha_npu_ppe_init`, `airoha_npu_ppe_deinit` and a few others. Now, `airoha_npu_ppe_init` gets assigned to `npu->ops.ppe_init`. That's a good lead. 

So the real question is: who *actually* calls `npu->ops.ppe_init`? Time to dig into `airoha_ppe.c` to trace that function call.



14/2 2026/08/05 08:15 tool grepper
0m Args:
{
  "Expression": "ppe_init",
  "PathPrefix": "drivers/net/ethernet/airoha/"
}

Results:
{
  "Output": "drivers/net/ethernet/airoha/airoha_eth.c=74=static int airoha_set_macaddr(struct airoha_gdm_dev *dev, const u8 *addr)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-140-\ndrivers/net/ethernet/airoha/airoha_eth.c:141:\tairoha_ppe_init_upd_mem(dev, addr);\ndrivers/net/ethernet/airoha/airoha_eth.c-142-\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=1612=static int airoha_hw_init(struct platform_device *pdev,\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-1641-\ndrivers/net/ethernet/airoha/airoha_eth.c:1642:\terr = airoha_ppe_init(eth);\ndrivers/net/ethernet/airoha/airoha_eth.c-1643-\tif (err)\n--\ndrivers/net/ethernet/airoha/airoha_eth.h=736=int airoha_ppe_setup_tc_block_cb(struct airoha_ppe_dev *dev, void *type_data);\ndrivers/net/ethernet/airoha/airoha_eth.h:737:int airoha_ppe_init(struct airoha_eth *eth);\ndrivers/net/ethernet/airoha/airoha_eth.h-738-void airoha_ppe_deinit(struct airoha_eth *eth);\ndrivers/net/ethernet/airoha/airoha_eth.h:739:void airoha_ppe_init_upd_mem(struct airoha_gdm_dev *dev, const u8 *addr);\ndrivers/net/ethernet/airoha/airoha_eth.h-740-u32 airoha_ppe_get_total_num_entries(struct airoha_ppe *ppe);\n--\ndrivers/net/ethernet/airoha/airoha_npu.c=327=static irqreturn_t airoha_npu_wdt_handler(int irq, void *core_instance)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-341-\ndrivers/net/ethernet/airoha/airoha_npu.c:342:static int airoha_npu_ppe_init(struct airoha_npu *npu)\ndrivers/net/ethernet/airoha/airoha_npu.c-343-{\n--\ndrivers/net/ethernet/airoha/airoha_npu.c=704=static int airoha_npu_probe(struct platform_device *pdev)\n--\ndrivers/net/ethernet/airoha/airoha_npu.c-721-\tnpu-\u003edev = dev;\ndrivers/net/ethernet/airoha/airoha_npu.c:722:\tnpu-\u003eops.ppe_init = airoha_npu_ppe_init;\ndrivers/net/ethernet/airoha/airoha_npu.c-723-\tnpu-\u003eops.ppe_deinit = airoha_npu_ppe_deinit;\ndrivers/net/ethernet/airoha/airoha_npu.c:724:\tnpu-\u003eops.ppe_init_stats = airoha_npu_ppe_stats_setup;\ndrivers/net/ethernet/airoha/airoha_npu.c-725-\tnpu-\u003eops.ppe_flush_sram_entries = airoha_npu_ppe_flush_sram_entries;\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=1428=static int airoha_ppe_offload_setup(struct airoha_eth *eth)\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1436-\ndrivers/net/ethernet/airoha/airoha_ppe.c:1437:\terr = npu-\u003eops.ppe_init(npu);\ndrivers/net/ethernet/airoha/airoha_ppe.c-1438-\tif (err)\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1447-\tif (ppe_num_stats_entries \u003e 0) {\ndrivers/net/ethernet/airoha/airoha_ppe.c:1448:\t\terr = npu-\u003eops.ppe_init_stats(npu, ppe-\u003efoe_stats_dma,\ndrivers/net/ethernet/airoha/airoha_ppe.c-1449-\t\t\t\t\t      ppe_num_stats_entries);\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=1493=void airoha_ppe_check_skb(struct airoha_ppe_dev *dev, struct sk_buff *skb,\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c-1511-\ndrivers/net/ethernet/airoha/airoha_ppe.c:1512:void airoha_ppe_init_upd_mem(struct airoha_gdm_dev *dev, const u8 *addr)\ndrivers/net/ethernet/airoha/airoha_ppe.c-1513-{\n--\ndrivers/net/ethernet/airoha/airoha_ppe.c=1585=EXPORT_SYMBOL_GPL(airoha_ppe_put_dev);\ndrivers/net/ethernet/airoha/airoha_ppe.c-1586-\ndrivers/net/ethernet/airoha/airoha_ppe.c:1587:int airoha_ppe_init(struct airoha_eth *eth)\ndrivers/net/ethernet/airoha/airoha_ppe.c-1588-{\n"
}

15/2 2026/08/05 08:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 21087
							output: 45
							thoughts: 294
						

Thoughts:
**Analyzing the Airoha Ethernet Driver and Syzkaller Fuzzing Potential**

Okay, so I'm looking at the initialization flow for the Airoha EN7581 Ethernet driver, specifically the `airoha_ppe_init` function. It's called by `airoha_hw_init`, which in turn resides in `airoha_eth.c`. This is the core driver. My immediate thought is, can this be probed effectively? Since it's a platform driver, the compatibility string `airoha,en7581-eth` is crucial.

Now, the interesting part: can Syzkaller fuzz this? I know Syzkaller can generate platform devices, but here's the catch – this driver relies on specific MMIO registers, and more importantly, it has a hard dependency on the NPU driver. The NPU needs to be successfully probed *before* the Ethernet driver can function correctly, and that probe depends on firmware being present and loaded via `airoha_npu_load_firmware`. If the firmware isn't there, `airoha_npu_probe` either defers or fails.

The downstream impact is critical. A failure in `airoha_npu_probe` leads to a failure in `airoha_npu_get`, which then means `airoha_ppe_offload_setup` fails. Ah, wait a minute, `airoha_ppe_npu_get` uses `request_module("airoha-npu")` and then calls `airoha_npu_get(eth->dev)`. So, the NPU driver *should* be loaded and probed, if the module exists. If the NPU isn't probed, `airoha_npu_get` will return an error, and this will prevent the driver from functioning. I need to take a closer look at `airoha_npu_get` to understand how this all hangs together. This is a potential weakness.



16/2 2026/08/05 08:16 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/airoha/airoha_npu.c",
  "FirstLine": 610,
  "LineCount": 40
}

Results:
{
  "Contents": " 610:\tstruct airoha_npu *airoha_npu_get(struct device *dev)\n 611:\t{\n 612:\t\tstruct platform_device *pdev;\n 613:\t\tstruct device_node *np;\n 614:\t\tstruct airoha_npu *npu;\n 615:\t\n 616:\t\tnp = of_parse_phandle(dev-\u003eof_node, \"airoha,npu\", 0);\n 617:\t\tif (!np)\n 618:\t\t\treturn ERR_PTR(-ENODEV);\n 619:\t\n 620:\t\tpdev = of_find_device_by_node(np);\n 621:\t\n 622:\t\tif (!pdev) {\n 623:\t\t\tdev_err(dev, \"cannot find device node %s\\n\", np-\u003ename);\n 624:\t\t\tof_node_put(np);\n 625:\t\t\treturn ERR_PTR(-ENODEV);\n 626:\t\t}\n 627:\t\tof_node_put(np);\n 628:\t\n 629:\t\tif (!try_module_get(THIS_MODULE)) {\n 630:\t\t\tdev_err(dev, \"failed to get the device driver module\\n\");\n 631:\t\t\tnpu = ERR_PTR(-ENODEV);\n 632:\t\t\tgoto error_pdev_put;\n 633:\t\t}\n 634:\t\n 635:\t\tnpu = platform_get_drvdata(pdev);\n 636:\t\tif (!npu) {\n 637:\t\t\tnpu = ERR_PTR(-ENODEV);\n 638:\t\t\tgoto error_module_put;\n 639:\t\t}\n 640:\t\n 641:\t\tif (!device_link_add(dev, \u0026pdev-\u003edev, DL_FLAG_AUTOREMOVE_SUPPLIER)) {\n 642:\t\t\tdev_err(\u0026pdev-\u003edev,\n 643:\t\t\t\t\"failed to create device link to consumer %s\\n\",\n 644:\t\t\t\tdev_name(dev));\n 645:\t\t\tnpu = ERR_PTR(-EINVAL);\n 646:\t\t\tgoto error_module_put;\n 647:\t\t}\n 648:\t\n 649:\t\treturn npu;\n"
}

17/2 2026/08/05 08:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 22461
							output: 45
							thoughts: 366
						

Thoughts:
**Analyzing the Airoha NPU Driver and Firmware Dependency**

Okay, so to get `airoha_npu_get` working, I need a device node with the `airoha,npu` phandle, and the NPU driver has to be up and running. That means `platform_get_drvdata(pdev)` can't be NULL. For the NPU driver to actually probe correctly, it needs the firmware. And, of course, syzkaller might not have that firmware available, which would cause the probe to fail right away. Even if I could somehow mock the firmware, the driver goes on to do things that suggest a fully operational NPU is required, like writing to registers using `regmap_write`:

```c
	regmap_write(npu->regmap, REG_CR_NPU_MIB(10), ...);
	msleep(100);
	/* enable NPU cores */
	regmap_write(npu->regmap, REG_CR_BOOT_CONFIG, 0xff);
	regmap_write(npu->regmap, REG_CR_BOOT_TRIGGER, 0x1);
	msleep(100);
```

Then, the driver waits for a response from the NPU. This looks a bit involved:

```c
	if (!airoha_npu_wlan_msg_get(npu, 0, WLAN_FUNC_GET_WAIT_NPU_VERSION,
				     &val, sizeof(val), GFP_KERNEL))
		dev_info(dev, "NPU version: %d.%d\n", val >> 16, val & 0xffff);
```

Wait a second... `airoha_npu_wlan_msg_get` calls `airoha_npu_send_msg`! That's the function I modified in the patch! Okay, I need to revisit `airoha_npu_send_msg` to see what is going on.



18/2 2026/08/05 08:16 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/airoha/airoha_npu.c",
  "FirstLine": 163,
  "LineCount": 45
}

Results:
{
  "Contents": " 163:\tstatic int airoha_npu_send_msg(struct airoha_npu *npu, int func_id,\n 164:\t\t\t\t       void *p, int size)\n 165:\t{\n 166:\t\tu16 core = 0; /* FIXME */\n 167:\t\tu32 val, offset = core \u003c\u003c 4;\n 168:\t\tdma_addr_t dma_addr;\n 169:\t\tvoid *dma_buf;\n 170:\t\tint ret;\n 171:\t\n 172:\t\t/*\n 173:\t\t * Mailbox payloads are small and bidirectional (CPU sets the\n 174:\t\t * request, NPU writes the response). Streaming DMA_BIDIRECTIONAL\n 175:\t\t * mapping regresses EN7581+MT7996: MBOX reports success but\n 176:\t\t * WLAN_FUNC_GET_WAIT_NPU_VERSION still reads as 0.0. Use a\n 177:\t\t * coherent bounce buffer so the CPU always sees the NPU response.\n 178:\t\t */\n 179:\t\tdma_buf = dma_alloc_coherent(npu-\u003edev, size, \u0026dma_addr, GFP_ATOMIC);\n 180:\t\tif (!dma_buf)\n 181:\t\t\treturn -ENOMEM;\n 182:\t\n 183:\t\tmemcpy(dma_buf, p, size);\n 184:\t\n 185:\t\tspin_lock_bh(\u0026npu-\u003ecores[core].lock);\n 186:\t\n 187:\t\tregmap_write(npu-\u003eregmap, REG_CR_MBQ0_CTRL(0) + offset, dma_addr);\n 188:\t\tregmap_write(npu-\u003eregmap, REG_CR_MBQ0_CTRL(1) + offset, size);\n 189:\t\tregmap_read(npu-\u003eregmap, REG_CR_MBQ0_CTRL(2) + offset, \u0026val);\n 190:\t\tregmap_write(npu-\u003eregmap, REG_CR_MBQ0_CTRL(2) + offset, val + 1);\n 191:\t\tval = FIELD_PREP(MBOX_MSG_FUNC_ID, func_id) | MBOX_MSG_WAIT_RSP;\n 192:\t\tregmap_write(npu-\u003eregmap, REG_CR_MBQ0_CTRL(3) + offset, val);\n 193:\t\n 194:\t\tret = regmap_read_poll_timeout_atomic(npu-\u003eregmap,\n 195:\t\t\t\t\t\t      REG_CR_MBQ0_CTRL(3) + offset,\n 196:\t\t\t\t\t\t      val, (val \u0026 MBOX_MSG_DONE),\n 197:\t\t\t\t\t\t      100, 100 * MSEC_PER_SEC);\n 198:\t\tif (!ret \u0026\u0026 FIELD_GET(MBOX_MSG_STATUS, val) != NPU_MBOX_SUCCESS)\n 199:\t\t\tret = -EINVAL;\n 200:\t\n 201:\t\tspin_unlock_bh(\u0026npu-\u003ecores[core].lock);\n 202:\t\n 203:\t\tif (!ret)\n 204:\t\t\tmemcpy(p, dma_buf, size);\n 205:\t\tdma_free_coherent(npu-\u003edev, size, dma_buf, dma_addr);\n 206:\t\n 207:\t\treturn ret;\n"
}

19/2 2026/08/05 08:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 24211
							output: 106
							thoughts: 908
						

Thoughts:
**WorthFuzzing=false: Airoha NPU Driver**

Okay, so I've got this `airoha_npu_send_msg` function, and it seems to involve writing to MMIO registers, then waiting for a specific bit, `MBOX_MSG_DONE`, to be set. The issue is, this driver is tied to the Airoha EN7581 hardware, or at least a specific emulator that's not standard in QEMU. If the hardware isn't present, the polling function will time out, which means the code path will never be executed.

Initially, I thought syzkaller, with its MMIO read/write injection, might somehow get around this. However, it looks like syzkaller could inject a platform device, map the MMIO region to dummy memory, and potentially trick the driver into reading a value with `MBOX_MSG_DONE` set. But then, there's the firmware loading issue. The `airoha_npu_probe` routine calls `airoha_npu_run_firmware`, which calls `airoha_npu_load_firmware`. And crucially, this uses `request_firmware`. If the firmware isn't present, `request_firmware` fails with `-ENOENT`, which leads to `-EPROBE_DEFER` and the probe fails. Syzkaller can't provide the firmware unless it's in the image. There's no way to bypass this firmware loading step.

I checked `airoha_npu_load_firmware` to confirm that if `request_firmware` fails with `-ENOENT` then it returns `-EPROBE_DEFER`.

The instructions are clear: if a code path is impossible to reach in virtualized environments like GCE or QEMU, even with software-emulated hardware, then it's not worth fuzzing. This is a vendor-specific NPU driver, requiring physical hardware or specific emulation not found in standard QEMU. It also explicitly lists "vendor-specific PCIe switch, SmartNIC, or GPU drivers" as examples of code not worth fuzzing, and this clearly falls into that category.

There doesn't seem to be a virtual Airoha NPU driver, so there's no way this code would be used anywhere else. It's used by `airoha_eth`, which is another driver for the Airoha EN7581 ethernet hardware. These are all for specific physical hardware.

Therefore, after considering all the angles, my conclusion is that this patch modifies code that is impossible to meaningfully fuzz in a standard QEMU environment. It's a vendor-specific driver that's hardware-dependent, and that's the deciding factor. I'm setting `WorthFuzzing=false`.



20/2 2026/08/05 08:16 tool set-results
0m Args:
{
  "EnableConfigs": [],
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the mailbox communication logic in the Airoha EN7581/AN7583 NPU driver (airoha_npu). This is a vendor-specific platform driver for networking SoC hardware that requires physical hardware and specific firmware to probe successfully. It cannot be reached or meaningfully fuzzed in standard virtualized environments like QEMU.",
  "WorthFuzzing": false
}

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the mailbox communication logic in the Airoha EN7581/AN7583 NPU driver (airoha_npu). This is a vendor-specific platform driver for networking SoC hardware that requires physical hardware and specific firmware to probe successfully. It cannot be reached or meaningfully fuzzed in standard virtualized environments like QEMU.",
  "WorthFuzzing": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)