| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/21 08:58 | flow | patch-triage |
2mArgs:null Results: {
"EnableConfigs": [
"MT76_CORE",
"MT76_USB",
"MT76_SDIO",
"MT76x0U",
"MT76x2U",
"MT7663U",
"MT7663S",
"MT7921U",
"MT7921S",
"MT7925U",
"MT76_NPU"
],
"FocusSymbols": [
"mt76_rx_poll_complete",
"mt76u_process_rx_queue",
"mt76s_process_rx_queue",
"mt76_rx_aggr_reorder"
],
"Reasoning": "The patch fixes a bug in `mt76_npu_device_active` and `mt76_ppe_device_active` where they could incorrectly return true for non-MMIO devices (like USB or SDIO) by accessing fields in a union that overlap with USB/SDIO specific data. This incorrect return value caused the RX path in `mt76_rx_poll_complete` to bypass RX aggregation reordering (`mt76_rx_aggr_reorder`) for USB/SDIO devices. By adding the `mt76_is_mmio(dev)` check, the code correctly identifies MMIO devices and restores the proper RX path for USB/SDIO devices. This is a functional fix reachable via USB fuzzing.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/21 08:58 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit d5ec41671b6321de85c27512209a1443cbc2866c\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Jul 21 08:58:36 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h\nindex 07955555f84d83..a32ba7c23f92b3 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt76.h\n+++ b/drivers/net/wireless/mediatek/mt76/mt76.h\n@@ -1736,12 +1736,12 @@ static inline int mt76_npu_send_txrx_addr(struct mt76_dev *dev, int ifindex,\n \n static inline bool mt76_npu_device_active(struct mt76_dev *dev)\n {\n-\treturn !!rcu_access_pointer(dev-\u003emmio.npu);\n+\treturn mt76_is_mmio(dev) \u0026\u0026 !!rcu_access_pointer(dev-\u003emmio.npu);\n }\n \n static inline bool mt76_ppe_device_active(struct mt76_dev *dev)\n {\n-\treturn !!rcu_access_pointer(dev-\u003emmio.ppe_dev);\n+\treturn mt76_is_mmio(dev) \u0026\u0026 !!rcu_access_pointer(dev-\u003emmio.ppe_dev);\n }\n \n static inline int mt76_npu_send_msg(struct airoha_npu *npu, int ifindex,\n"
} |
| 2/1 | 2026/07/21 08:58 | agent | patch-evaluator |
2mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"MT76_CORE",
"MT76_USB",
"MT76_SDIO",
"MT76x0U",
"MT76x2U",
"MT7663U",
"MT7663S",
"MT7921U",
"MT7921S",
"MT7925U",
"MT76_NPU"
],
"FocusSymbols": [
"mt76_rx_poll_complete",
"mt76u_process_rx_queue",
"mt76s_process_rx_queue",
"mt76_rx_aggr_reorder"
],
"Reasoning": "The patch fixes a bug in `mt76_npu_device_active` and `mt76_ppe_device_active` where they could incorrectly return true for non-MMIO devices (like USB or SDIO) by accessing fields in a union that overlap with USB/SDIO specific data. This incorrect return value caused the RX path in `mt76_rx_poll_complete` to bypass RX aggregation reordering (`mt76_rx_aggr_reorder`) for USB/SDIO devices. By adding the `mt76_is_mmio(dev)` check, the code correctly identifies MMIO devices and restores the proper RX path for USB/SDIO devices. This is a functional fix reachable via USB fuzzing.",
"WorthFuzzing": true
}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). 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. 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. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. 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 d5ec41671b6321de85c27512209a1443cbc2866c
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Jul 21 08:58:36 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 07955555f84d83..a32ba7c23f92b3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -1736,12 +1736,12 @@ static inline int mt76_npu_send_txrx_addr(struct mt76_dev *dev, int ifindex,
static inline bool mt76_npu_device_active(struct mt76_dev *dev)
{
- return !!rcu_access_pointer(dev->mmio.npu);
+ return mt76_is_mmio(dev) && !!rcu_access_pointer(dev->mmio.npu);
}
static inline bool mt76_ppe_device_active(struct mt76_dev *dev)
{
- return !!rcu_access_pointer(dev->mmio.ppe_dev);
+ return mt76_is_mmio(dev) && !!rcu_access_pointer(dev->mmio.ppe_dev);
}
static inline int mt76_npu_send_msg(struct airoha_npu *npu, int ifindex,
|
| 3/2 | 2026/07/21 08:58 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 2058 output: 41 thoughts: 253 Thoughts: **Analyzing a Driver Patch for Virtualized Environments** Okay, so I'm looking at this patch that tweaks `mt76_npu_device_active` and `mt76_ppe_device_active` in `mt76.h`. The core of the change is adding `mt76_is_mmio(dev) &&` to both of those functions. That's a functional modification, and I immediately want to understand the implications for virtualized environments. I'm thinking, can we even *reach* this code path if the hardware is virtualized? `mt76` is the driver for MediaTek wireless devices, right? So, the question becomes, can we effectively emulate that specific hardware within QEMU? Typically, you can get away with PCI or USB device emulation or pass-through, but my initial thought is, we don't usually find MediaTek wireless hardware readily available in a standard QEMU setup. Unless we're using something like `mac80211_hwsim`, but that avoids `mt76` entirely. And USB emulation... well, `mt76` does have USB drivers, like the `mt76x0u`, `mt76x2u`, or `mt7921u` which we might use, yes. But hang on… `mt76_is_mmio(dev)`... that's checking if the device is Memory-Mapped I/O. So, this boils down to: Are we using a memory-mapped I/O approach or not? I should check the definition of `mt76_is_mmio` itself to confirm my understanding and make sure it's accurate. Gotta look at that definition. |
| 4/2 | 2026/07/21 08:58 | tool | grepper |
0mArgs:{
"Expression": "mt76_is_mmio",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/debugfs.c=29=mt76_napi_threaded_set(void *data, u64 val)\n--\ndrivers/net/wireless/mediatek/mt76/debugfs.c-32-\ndrivers/net/wireless/mediatek/mt76/debugfs.c:33:\tif (!mt76_is_mmio(dev))\ndrivers/net/wireless/mediatek/mt76/debugfs.c-34-\t\treturn -EOPNOTSUPP;\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=616=int mt76_create_page_pool(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-643-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:644:\tif (mt76_is_mmio(dev)) {\ndrivers/net/wireless/mediatek/mt76/mac80211.c-645-\t\t/* rely on page_pool for DMA mapping */\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=95=struct mt76_bus_ops {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-110-#define mt76_is_usb(dev) ((dev)-\u003ebus-\u003etype == MT76_BUS_USB)\ndrivers/net/wireless/mediatek/mt76/mt76.h:111:#define mt76_is_mmio(dev) ((dev)-\u003ebus-\u003etype == MT76_BUS_MMIO)\ndrivers/net/wireless/mediatek/mt76/mt76.h-112-#define mt76_is_sdio(dev) ((dev)-\u003ebus-\u003etype == MT76_BUS_SDIO)\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1737=static inline bool mt76_npu_device_active(struct mt76_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt76.h-1738-{\ndrivers/net/wireless/mediatek/mt76/mt76.h:1739:\treturn mt76_is_mmio(dev) \u0026\u0026 !!rcu_access_pointer(dev-\u003emmio.npu);\ndrivers/net/wireless/mediatek/mt76/mt76.h-1740-}\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1742=static inline bool mt76_ppe_device_active(struct mt76_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt76.h-1743-{\ndrivers/net/wireless/mediatek/mt76/mt76.h:1744:\treturn mt76_is_mmio(dev) \u0026\u0026 !!rcu_access_pointer(dev-\u003emmio.ppe_dev);\ndrivers/net/wireless/mediatek/mt76/mt76.h-1745-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=330=static int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-389-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:390:\tif (mt76_is_mmio(\u0026dev-\u003emt76) \u0026\u0026 (rxd0 \u0026 csum_mask) == csum_mask \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-391-\t !(csum_status \u0026 (BIT(0) | BIT(2) | BIT(3))))\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=709=int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-721-\tstruct ieee80211_vif *vif = info-\u003econtrol.vif;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:722:\tbool is_mmio = mt76_is_mmio(\u0026dev-\u003emt76);\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-723-\tu32 val, sz_txd = is_mmio ? MT_TXD_SIZE : MT_USB_TXD_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=1094=void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1103-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1104:\tif (!mt76_is_mmio(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1105-\t\tmt7615_mac_queue_rate_update(phy, sta, probe_rate, rates);\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/main.c=335=static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/main.c-392-\tmt76_wcid_key_setup(\u0026dev-\u003emt76, wcid, key);\ndrivers/net/wireless/mediatek/mt76/mt7615/main.c:393:\tif (mt76_is_mmio(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7615/main.c-394-\t\terr = mt7615_mac_wtbl_set_key(dev, wcid, key);\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c=410=mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-492-\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c:493:\tif (mt76_is_mmio(dev)) {\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-494-\t\tval = FIELD_PREP(MT_TXD7_TYPE, fc_type) |\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c=504=void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-513-\tu8 p_fmt, q_idx, omac_idx = 0, wmm_idx = 0, band_idx = 0;\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c:514:\tu32 val, sz_txd = mt76_is_mmio(dev) ? MT_TXD_SIZE : MT_SDIO_TXD_SIZE;\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-515-\tbool is_8023 = info-\u003eflags \u0026 IEEE80211_TX_CTL_HW_80211_ENCAP;\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-539-\t} else if (qid \u003e= MT_TXQ_PSD) {\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c:540:\t\tp_fmt = mt76_is_mmio(dev) ? MT_TX_TYPE_CT : MT_TX_TYPE_SF;\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-541-\t\tq_idx = MT_LMAC_ALTX0;\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-542-\t} else {\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c:543:\t\tp_fmt = mt76_is_mmio(dev) ? MT_TX_TYPE_CT : MT_TX_TYPE_SF;\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-544-\t\tq_idx = wmm_idx * MT76_CONNAC_MAX_WMM_SETS +\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c=1272=int mt76_connac_mcu_sta_wed_update(struct mt76_dev *dev, struct sk_buff *skb)\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-1273-{\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:1274:\tif (!mt76_is_mmio(dev))\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-1275-\t\treturn 0;\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c=2566=mt76_connac_mcu_set_wow_ctrl(struct mt76_phy *phy, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-2606-\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:2607:\tif (mt76_is_mmio(dev))\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-2608-\t\treq.wow_ctrl_tlv.wakeup_hif = WOW_PCIE;\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c=2619=int mt76_connac_mcu_set_hif_suspend(struct mt76_dev *dev, bool suspend, bool wait_resp)\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-2642-\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:2643:\tif (mt76_is_mmio(dev))\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-2644-\t\treq.hdr.hif_type = 2;\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/main.c=11=int mt76x0_set_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/main.c-15-\tmt76x02_pre_tbtt_enable(dev, false);\ndrivers/net/wireless/mediatek/mt76/mt76x0/main.c:16:\tif (mt76_is_mmio(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt76x0/main.c-17-\t\ttasklet_disable(\u0026dev-\u003edfs_pd.dfs_tasklet);\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/main.c-23-\ndrivers/net/wireless/mediatek/mt76/mt76x0/main.c:24:\tif (mt76_is_mmio(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt76x0/main.c-25-\t\tmt76x02_dfs_init_params(dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h=31=static inline bool is_mt7610e(struct mt76x02_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h-32-{\ndrivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h:33:\tif (!mt76_is_mmio(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h-34-\t\treturn false;\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c=168=mt76x0_phy_rf_csr_wr_rp(struct mt76x02_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c-178-#define RF_RANDOM_WRITE(dev, tab) do {\t\t\t\t\t\\\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c:179:\tif (mt76_is_mmio(\u0026dev-\u003emt76))\t\t\t\t\t\\\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c-180-\t\tmt76x0_phy_rf_csr_wr_rp(dev, tab, ARRAY_SIZE(tab));\t\\\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c=697=mt76x0_phy_get_delta_power(struct mt76x02_dev *dev, u8 tx_mode,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c-748-\t\tdata = mt76_rr(dev, MT_BBP(CORE, 1));\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c:749:\t\tif (is_mt7630(dev) \u0026\u0026 mt76_is_mmio(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c-750-\t\t\tint offset;\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c=1116=static void mt76x0_rf_patch_reg_array(struct mt76x02_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c-1126-\t\tcase MT_RF(0, 3):\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c:1127:\t\t\tif (mt76_is_mmio(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt76x0/phy.c-1128-\t\t\t\tif (is_mt7630(dev))\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mcu.c=117=int mt76x02_mcu_calibrate(struct mt76x02_dev *dev, int type, u32 param)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mcu.c-125-\t};\ndrivers/net/wireless/mediatek/mt76/mt76x02_mcu.c:126:\tbool is_mt76x2e = mt76_is_mmio(\u0026dev-\u003emt76) \u0026\u0026 is_mt76x2(dev);\ndrivers/net/wireless/mediatek/mt76/mt76x02_mcu.c-127-\tint ret;\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_util.c=622=void mt76x02_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_util.c-629-\tmt76_stop_tx_queues(\u0026dev-\u003emphy, sta, true);\ndrivers/net/wireless/mediatek/mt76/mt76x02_util.c:630:\tif (mt76_is_mmio(mdev))\ndrivers/net/wireless/mediatek/mt76/mt76x02_util.c-631-\t\tmt76x02_mac_wcid_set_drop(dev, idx, ps);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/debugfs.c=264=int mt7921_init_debugfs(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/debugfs.c-269-\ndrivers/net/wireless/mediatek/mt76/mt7921/debugfs.c:270:\tif (mt76_is_mmio(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7921/debugfs.c-271-\t\tdebugfs_create_devm_seqfile(dev-\u003emt76.dev, \"xmit-queues\",\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c=170=int mt7921_register_device(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-217-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:218:\tif (!mt76_is_mmio(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-219-\t\thw-\u003eextra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c=169=mt7921_mac_fill_rx(struct mt792x_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-239-\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c:240:\tif (mt76_is_mmio(\u0026dev-\u003emt76) \u0026\u0026 (rxd0 \u0026 csum_mask) == csum_mask \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-241-\t !(csum_status \u0026 (BIT(0) | BIT(2) | BIT(3))))\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=227=int __mt7921_start(struct mt792x_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-252-\t\t\t\t MT792x_WATCHDOG_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:253:\tif (mt76_is_mmio(mphy-\u003edev)) {\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-254-\t\terr = mt7921_mcu_radio_led_ctrl(phy-\u003edev, EXT_CMD_RADIO_LED_CTRL_ENABLE);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=284=static void mt7921_stop(struct ieee80211_hw *hw, bool suspend)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-288-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:289:\tif (mt76_is_mmio(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-290-\t\tmt792x_mutex_acquire(dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=410=static int mt7921_load_clc(struct mt792x_dev *dev, const char *fw_name)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-425-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:426:\tif (mt76_is_mmio(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-427-\t\tret = mt7921_mcu_read_eeprom(dev, MT_EE_HW_TYPE, \u0026hw_encap);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/debugfs.c=289=int mt7925_init_debugfs(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/debugfs.c-294-\ndrivers/net/wireless/mediatek/mt76/mt7925/debugfs.c:295:\tif (mt76_is_mmio(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7925/debugfs.c-296-\t\tdebugfs_create_devm_seqfile(dev-\u003emt76.dev, \"xmit-queues\",\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c=206=int mt7925_register_device(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-251-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:252:\tif (!mt76_is_mmio(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-253-\t\thw-\u003eextra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=359=mt7925_mac_fill_rx(struct mt792x_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-423-\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:424:\tif (mt76_is_mmio(\u0026dev-\u003emt76) \u0026\u0026 (rxd3 \u0026 csum_mask) == csum_mask \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-425-\t !(csum_status \u0026 (BIT(0) | BIT(2) | BIT(3))))\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=730=mt7925_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-737-\tu8 p_fmt, q_idx, omac_idx = 0, wmm_idx = 0, band_idx = 0;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:738:\tu32 val, sz_txd = mt76_is_mmio(dev) ? MT_TXD_SIZE : MT_SDIO_TXD_SIZE;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-739-\tbool is_8023 = info-\u003eflags \u0026 IEEE80211_TX_CTL_HW_80211_ENCAP;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-763-\t} else if (qid \u003e= MT_TXQ_PSD) {\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:764:\t\tp_fmt = mt76_is_mmio(dev) ? MT_TX_TYPE_CT : MT_TX_TYPE_SF;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-765-\t\tq_idx = MT_LMAC_ALTX0;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-766-\t} else {\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:767:\t\tp_fmt = mt76_is_mmio(dev) ? MT_TX_TYPE_CT : MT_TX_TYPE_SF;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-768-\t\tq_idx = wmm_idx * MT76_CONNAC_MAX_WMM_SETS +\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=160=mt7925_connac_mcu_set_wow_ctrl(struct mt76_phy *phy, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-201-\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:202:\tif (mt76_is_mmio(dev))\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-203-\t\treq.wow_ctrl_tlv.wakeup_hif = WOW_PCIE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=798=static int mt7925_load_clc(struct mt792x_dev *dev, const char *fw_name)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-813-\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:814:\tif (mt76_is_mmio(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-815-\t\tret = mt7925_mcu_read_eeprom(dev, MT_EE_HW_TYPE, \u0026hw_encap);\n"
} |
| 5/2 | 2026/07/21 08:58 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 9884 output: 43 thoughts: 38 Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person: **Analyzing the Impact of the `mt76` Patch** Alright, so the patch I'm looking at touches `mt76_npu_device_active` and `mt76_ppe_device_active`. Naturally, my first instinct is to understand the scope of these changes. I need to figure out where these functions are actually *used* within the `mt76` framework. Just knowing they're modified isn't enough; I need the calling context. Are we talking about a simple conditional change, or something more fundamental to the device initialization or power management logic? Time to start tracing the call paths and see what dependencies are involved. Let's see how deep this rabbit hole goes... |
| 6/2 | 2026/07/21 08:58 | tool | grepper |
0mArgs:{
"Expression": "mt76_npu_device_active",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/dma.c=190=mt76_dma_sync_idx(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-192-\tif ((q-\u003eflags \u0026 MT_QFLAG_WED_RRO_EN) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/dma.c:193:\t (!is_mt7992(dev) || !mt76_npu_device_active(dev)))\ndrivers/net/wireless/mediatek/mt76/dma.c-194-\t\tQ_WRITE(q, ring_size, MT_DMA_RRO_EN | q-\u003endesc);\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=640=mt76_dma_tx_queue_skb(struct mt76_phy *phy, struct mt76_queue *q,\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-661-\t/* TODO: Take into account unlinear skbs */\ndrivers/net/wireless/mediatek/mt76/dma.c:662:\tif (mt76_npu_device_active(dev) \u0026\u0026 skb_linearize(skb))\ndrivers/net/wireless/mediatek/mt76/dma.c-663-\t\tgoto free_skb;\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-713-\ndrivers/net/wireless/mediatek/mt76/dma.c:714:\tif (mt76_npu_device_active(dev))\ndrivers/net/wireless/mediatek/mt76/dma.c-715-\t\treturn mt76_npu_dma_add_buf(phy, q, skb, \u0026tx_info.buf[1], txwi);\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=861=mt76_dma_rx_cleanup(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-885-\ndrivers/net/wireless/mediatek/mt76/dma.c:886:\t\tif (mt76_npu_device_active(dev) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/dma.c-887-\t\t mt76_queue_is_wed_rro(q))\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=905=mt76_dma_rx_reset(struct mt76_dev *dev, enum mt76_rxq_id qid)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-931-\ndrivers/net/wireless/mediatek/mt76/dma.c:932:\tif (mt76_npu_device_active(dev) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/dma.c-933-\t mt76_queue_is_wed_rro(q))\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1554=void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1564-\t\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) ||\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1565:\t\t mt76_npu_device_active(dev))\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1566-\t\t\t__skb_queue_tail(\u0026frames, skb);\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1729=static inline int mt76_npu_send_txrx_addr(struct mt76_dev *dev, int ifindex,\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-1736-\ndrivers/net/wireless/mediatek/mt76/mt76.h:1737:static inline bool mt76_npu_device_active(struct mt76_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt76.h-1738-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=10=int mt7996_init_tx_queues(struct mt7996_phy *phy, int idx, int n_desc,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-25-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:26:\tif (mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-27-\t\tflags = MT_NPU_Q_TX(phy-\u003emt76-\u003eband_idx);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=46=static void mt7996_dma_config(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-131-\t\tif (dev-\u003ehif2) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:132:\t\t\tif (mt76_npu_device_active(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-133-\t\t\t\tTXQ_CONFIG(0, WFDMA0, MT_INT_TX_DONE_BAND2,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=306=void mt7996_dma_start(struct mt7996_dev *dev, bool reset, bool wed_reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-361-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:362:\tif (!mt7996_has_wa(dev) || mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-363-\t\tirq_mask \u0026= ~(MT_INT_RX(MT_RXQ_MAIN_WA) |\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-364-\t\t\t MT_INT_RX(MT_RXQ_BAND1_WA));\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:365:\tif (is_mt7996(\u0026dev-\u003emt76) \u0026\u0026 mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-366-\t\tirq_mask \u0026= ~(MT_INT_RX(MT_RXQ_TXFREE_BAND0) |\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=374=static void mt7996_dma_enable(struct mt7996_dev *dev, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-448-\t\tif (is_mt7996(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:449:\t\t\tif (mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-450-\t\t\t\tmt76_set(dev, MT_WFDMA_HOST_CONFIG,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-464-\t\tif (!is_mt7996(\u0026dev-\u003emt76) ||\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:465:\t\t !mt76_npu_device_active(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-466-\t\t\tif (dev-\u003ehif2-\u003espeed \u003c PCIE_SPEED_5_0GT ||\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=521=int mt7996_dma_rro_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-531-\t\t\tmdev-\u003eq_rx[MT_RXQ_RRO_RXDMAD_C].wed = \u0026mdev-\u003emmio.wed;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:532:\t\telse if (!mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-533-\t\t\tmdev-\u003eq_rx[MT_RXQ_RRO_RXDMAD_C].flags |= MT_QFLAG_EMI_EN;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-573-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:574:\tsize = is_mt7996(mdev) \u0026\u0026 mt76_npu_device_active(mdev)\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-575-\t ? MT7996_NPU_RX_RING_SIZE / 4 : MT7996_RX_RING_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-590-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:591:\t\tsize = is_mt7996(mdev) \u0026\u0026 mt76_npu_device_active(mdev)\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-592-\t\t ? MT7996_NPU_RX_RING_SIZE / 2 : MT7996_RX_RING_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-608-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:609:\t\tsize = is_mt7996(mdev) \u0026\u0026 mt76_npu_device_active(mdev)\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-610-\t\t ? MT7996_NPU_RX_RING_SIZE : MT7996_RX_RING_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=622=void mt7996_dma_rro_start(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-659-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:660:\tif (!mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-661-\t\tmt7996_irq_enable(dev, MT_INT_RRO_RX_DONE);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=664=int mt7996_dma_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-681-\t/* init tx queue */\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:682:\tif (is_mt7996(\u0026dev-\u003emt76) \u0026\u0026 mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-683-\t\tret = mt7996_init_tx_queues(\u0026dev-\u003ephy, MT_TXQ_ID(0),\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-759-\t} else if (is_mt7992(\u0026dev-\u003emt76) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:760:\t\t mt76_npu_device_active(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-761-\t\tdev-\u003emt76.q_rx[MT_RXQ_MAIN_WA].flags = MT_NPU_Q_TXFREE(0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-893-\t\t\t\tdev-\u003emt76.q_rx[MT_RXQ_TXFREE_BAND0].wed = wed;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:894:\t\t\t} else if (mt76_npu_device_active(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-895-\t\t\t\tdev-\u003emt76.q_rx[MT_RXQ_TXFREE_BAND0].flags = MT_NPU_Q_TXFREE(0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-918-\t\t\tsize = is_mt7996(\u0026dev-\u003emt76) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:919:\t\t\t mt76_npu_device_active(\u0026dev-\u003emt76)\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-920-\t\t\t ? MT7996_NPU_RX_RING_SIZE : MT7996_RX_RING_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=478=mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-492-\thw-\u003enetdev_features = NETIF_F_RXCSUM;\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:493:\tif (mtk_wed_device_active(wed) || mt76_npu_device_active(mdev))\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-494-\t\thw-\u003enetdev_features |= NETIF_F_HW_TC;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=610=void mt7996_mac_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-627-\tif (dev-\u003ehif2) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:628:\t\tif (mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-629-\t\t\trx_path_type = is_mt7996(\u0026dev-\u003emt76) ? 6 : 8;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=682=static int mt7996_register_phy(struct mt7996_dev *dev, enum mt76_band_id band)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-695-\t (is_mt7996(\u0026dev-\u003emt76) \u0026\u0026 band == MT_BAND2 \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:696:\t !mt76_npu_device_active(\u0026dev-\u003emt76)))) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-697-\t\thif1_ofs = MT_WFDMA0_PCIE1(0) - MT_WFDMA0(0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-737-\t ((band == MT_BAND1 \u0026\u0026 !dev-\u003ehif2) ||\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:738:\t (band == MT_BAND2 \u0026\u0026 mt76_npu_device_active(\u0026dev-\u003emt76)))) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-739-\t\tint i;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-744-\t\tint size = is_mt7996(\u0026dev-\u003emt76) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:745:\t\t\t mt76_npu_device_active(\u0026dev-\u003emt76)\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-746-\t\t\t ? MT7996_NPU_TX_RING_SIZE / 2 : MT7996_TX_RING_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=868=void mt7996_rro_hw_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-888-\t\t\tif (!mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:889:\t\t\t !mt76_npu_device_active(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-890-\t\t\t\tmt76_set(dev, MT_RRO_3_1_GLOBAL_CONFIG,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=949=static int mt7996_wed_rro_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-992-\t\tif (is_mt7996(\u0026dev-\u003emt76) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:993:\t\t mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-994-\t\t\tmt76_npu_send_txrx_addr(\u0026dev-\u003emt76, 0, i,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1057-\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:1058:\tif (is_mt7996(\u0026dev-\u003emt76) \u0026\u0026 mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1059-\t\tmt76_npu_send_txrx_addr(\u0026dev-\u003emt76, 1, 0,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=1127=static void mt7996_wed_rro_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1147-\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:1148:\t\tif (mt76_npu_device_active(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1149-\t\t\tif (is_mt7996(\u0026dev-\u003emt76))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=2451=void mt7996_mac_reset_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2518-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2519:\t\tif (mt76_npu_device_active(\u0026dev-\u003emt76) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2520-\t\t mt76_queue_is_wed_rro(\u0026dev-\u003emt76.q_rx[i]))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2580-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2581:\t\tif (mt76_npu_device_active(\u0026dev-\u003emt76) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2582-\t\t mt76_queue_is_wed_rro(\u0026dev-\u003emt76.q_rx[i]))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c=2381=mt7996_net_fill_forward_path(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2409-\tif (!mtk_wed_device_active(wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c:2410:\t !mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2411-\t\treturn -ENODEV;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2419-#endif\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c:2420:\tif (is_mt7996(\u0026dev-\u003emt76) \u0026\u0026 mt76_npu_device_active(\u0026dev-\u003emt76) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2421-\t msta_link-\u003ewcid.phy_idx == MT_BAND2)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/npu.c=500=int mt7996_npu_rx_queues_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/npu.c-503-\ndrivers/net/wireless/mediatek/mt76/mt7996/npu.c:504:\tif (!mt76_npu_device_active(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7996/npu.c-505-\t\treturn 0;\n--\ndrivers/net/wireless/mediatek/mt76/npu.c=116=void mt76_npu_check_ppe(struct mt76_dev *dev, struct sk_buff *skb,\n--\ndrivers/net/wireless/mediatek/mt76/npu.c-121-\ndrivers/net/wireless/mediatek/mt76/npu.c:122:\tif (!mt76_npu_device_active(dev))\ndrivers/net/wireless/mediatek/mt76/npu.c-123-\t\treturn;\n--\ndrivers/net/wireless/mediatek/mt76/npu.c=371=int mt76_npu_net_setup_tc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/npu.c-379-\ndrivers/net/wireless/mediatek/mt76/npu.c:380:\tif (!mt76_npu_device_active(phy-\u003edev))\ndrivers/net/wireless/mediatek/mt76/npu.c-381-\t\treturn -EOPNOTSUPP;\n"
} |
| 7/2 | 2026/07/21 08:58 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 16818 output: 40 thoughts: 137 Thoughts: **Analyzing the Proposed Patch for mt76 Driver** Okay, so this patch introduces a crucial `mt76_is_mmio(dev)` check within the `mt76_npu_device_active` and `mt76_ppe_device_active` functions. My initial assessment is that this is likely a very good idea. The core concern here is about preventing crashes or, even worse, subtle corruption when the code tries to access `dev->mmio.npu` or `dev->mmio.ppe_dev` on devices that *aren't* memory-mapped I/O (MMIO). USB or SDIO devices, for example, wouldn't have these MMIO addresses directly accessible. A red flag immediately goes up, though: I need to be absolutely sure about the `dev->mmio` structure. Is it a straightforward struct, or, even more likely in a driver like this, a union, or a struct that potentially overlaps with other fields within `struct mt76_dev`? This is critical. If it's a union, accessing these fields when it's *not* an MMIO device could lead to all sorts of unexpected behavior, memory corruption, or even security vulnerabilities. Let me take a quick look at `mt76.h` to refresh my memory on the structure definition, and confirm my suspicion about the union or overlapping fields. This check is necessary to confirm the scope of this patch and see if it adequately addresses the potential problem. |
| 8/2 | 2026/07/21 08:58 | tool | grepper |
0mArgs:{
"Expression": "struct mt76_dev \\{",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt76.h=855=struct mt76_phy {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-920-\ndrivers/net/wireless/mediatek/mt76/mt76.h:921:struct mt76_dev {\ndrivers/net/wireless/mediatek/mt76/mt76.h-922-\tstruct mt76_phy phy; /* must be first */\n"
} |
| 9/2 | 2026/07/21 08:58 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 17450 output: 47 thoughts: 14 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Diving into the `mt76_dev` Structure** Okay, let's get down to brass tacks. I need to understand how the Mediatek 802.11 driver interacts with the hardware at a fundamental level. My initial instinct, as always, is to go directly to the source. The `struct mt76_dev` definition is the logical starting point. It's the core data structure, the control center, if you will, for the Mediatek device management within the kernel. I'm expecting to find the hardware registers accessible through this structure, potentially a descriptor for the DMA engine, and, of course, the interrupt handling related components. Essentially, this is where the *magic* happens, where the software maps to the silicon. I need to understand all its members to form an effective mental model of its operation. |
| 10/2 | 2026/07/21 08:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt76.h",
"FirstLine": 921,
"LineCount": 100
}Results: {
"Contents": " 921:\tstruct mt76_dev {\n 922:\t\tstruct mt76_phy phy; /* must be first */\n 923:\t\tstruct mt76_phy *phys[__MT_MAX_BAND];\n 924:\t\tstruct mt76_phy *band_phys[NUM_NL80211_BANDS];\n 925:\t\n 926:\t\tstruct ieee80211_hw *hw;\n 927:\t\n 928:\t\tspinlock_t wed_lock;\n 929:\t\tspinlock_t lock;\n 930:\t\tspinlock_t cc_lock;\n 931:\t\n 932:\t\tu32 cur_cc_bss_rx;\n 933:\t\n 934:\t\tstruct mt76_rx_status rx_ampdu_status;\n 935:\t\tu32 rx_ampdu_len;\n 936:\t\tu32 rx_ampdu_ref;\n 937:\t\n 938:\t\tstruct mutex mutex;\n 939:\t\n 940:\t\tconst struct mt76_bus_ops *bus;\n 941:\t\tconst struct mt76_driver_ops *drv;\n 942:\t\tconst struct mt76_mcu_ops *mcu_ops;\n 943:\t\tstruct device *dev;\n 944:\t\tstruct device *dma_dev;\n 945:\t\n 946:\t\tstruct mt76_mcu mcu;\n 947:\t\n 948:\t\tstruct net_device *napi_dev;\n 949:\t\tstruct net_device *tx_napi_dev;\n 950:\t\tspinlock_t rx_lock;\n 951:\t\tstruct napi_struct napi[__MT_RXQ_MAX];\n 952:\t\tstruct sk_buff_head rx_skb[__MT_RXQ_MAX];\n 953:\t\tstruct tasklet_struct irq_tasklet;\n 954:\t\n 955:\t\tstruct list_head txwi_cache;\n 956:\t\tstruct list_head rxwi_cache;\n 957:\t\tstruct mt76_queue *q_mcu[__MT_MCUQ_MAX];\n 958:\t\tstruct mt76_queue q_rx[__MT_RXQ_MAX];\n 959:\t\tconst struct mt76_queue_ops *queue_ops;\n 960:\t\tint tx_dma_idx[4];\n 961:\t\tenum mt76_hwrro_mode hwrro_mode;\n 962:\t\n 963:\t\tstruct mt76_worker tx_worker;\n 964:\t\tstruct napi_struct tx_napi;\n 965:\t\n 966:\t\tspinlock_t token_lock;\n 967:\t\tstruct idr token;\n 968:\t\tu16 wed_token_count;\n 969:\t\tu16 token_count;\n 970:\t\tu16 token_start;\n 971:\t\tu16 token_size;\n 972:\t\n 973:\t\tspinlock_t rx_token_lock;\n 974:\t\tstruct idr rx_token;\n 975:\t\tu16 rx_token_size;\n 976:\t\n 977:\t\twait_queue_head_t tx_wait;\n 978:\t\t/* spinclock used to protect wcid pktid linked list */\n 979:\t\tspinlock_t status_lock;\n 980:\t\n 981:\t\tu32 wcid_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];\n 982:\t\n 983:\t\tu64 vif_mask;\n 984:\t\n 985:\t\tstruct mt76_wcid global_wcid;\n 986:\t\tstruct mt76_wcid __rcu *wcid[MT76_N_WCIDS];\n 987:\t\tstruct list_head wcid_list;\n 988:\t\n 989:\t\tstruct list_head sta_poll_list;\n 990:\t\tspinlock_t sta_poll_lock;\n 991:\t\n 992:\t\tu32 rev;\n 993:\t\n 994:\t\tstruct tasklet_struct pre_tbtt_tasklet;\n 995:\t\tint beacon_int;\n 996:\t\tu8 beacon_mask;\n 997:\t\n 998:\t\tstruct debugfs_blob_wrapper eeprom;\n 999:\t\tstruct debugfs_blob_wrapper otp;\n1000:\t\n1001:\t\tchar alpha2[3];\n1002:\t\tenum nl80211_dfs_regions region;\n1003:\t\n1004:\t\tstruct mt76_scan_rnr_param rnr;\n1005:\t\n1006:\t\tu32 debugfs_reg;\n1007:\t\n1008:\t\tu8 csa_complete;\n1009:\t\n1010:\t\tu32 rxfilter;\n1011:\t\n1012:\t\tstruct delayed_work scan_work;\n1013:\t\tspinlock_t scan_lock;\n1014:\t\tstruct {\n1015:\t\t\tstruct cfg80211_scan_request *req;\n1016:\t\t\tstruct ieee80211_channel *chan;\n1017:\t\t\tstruct ieee80211_vif *vif;\n1018:\t\t\tstruct mt76_vif_link *mlink;\n1019:\t\t\tstruct mt76_phy *phy;\n1020:\t\t\tint chan_idx;\n"
} |
| 11/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 19199 output: 48 thoughts: 14 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person: **Diving Deeper into `struct mt76_dev`** Alright, let's get into the nitty-gritty. "Let's read more of `struct mt76_dev`." That means it's time to drill down. I'm already familiar with the general architecture of the mt76 driver, of course, and I know where this structure fits in at a high level. But the devil's in the details. What are we *really* dealing with inside this crucial data structure? I need a more complete picture to understand how the driver handles device initialization, resource allocation, interrupt handling, and likely, the various device-specific operations related to the WiFi radio itself. I want to know: * **Internal Fields:** Which fields are critical for basic device operation versus those that pertain to specific hardware features or variations? Are there any bitfields or unions that require careful analysis to understand the interactions? * **Data Structures within:** What are the key pointers within `mt76_dev` pointing to? Are they allocating memory from the heap or are they embedded within the structure itself? I need to analyze how those are used to map device registers, manage FIFOs, and track firmware loading. * **Concurrency Considerations:** Does the structure account for any synchronization primitives such as mutexes or spinlocks? Where? Are there any potential race conditions I should be on the lookout for? * **Driver Lifecycle Hooks:** How does `mt76_dev` fit into the driver's overall lifecycle? Are there initialization routines, cleanup functions, and interrupt handlers that rely on this structure? I want to connect the dots between this structure and the driver's interactions with the kernel's device model, especially how device resources are managed, allocated and released. * **Hardware Abstraction:** What kind of hardware-specific information does the `struct mt76_dev` structure encapsulate and what level of abstraction does it use to hide the lower-level details? I'm hoping to see a well defined API to handle the hardware-specific quirks. So, yeah, time to dig into that definition. It's time to get a good mental model of this beast. Understanding `struct mt76_dev` is essential to really grasp the driver's inner workings. |
| 12/2 | 2026/07/21 08:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt76.h",
"FirstLine": 1021,
"LineCount": 100
}Results: {
"Contents": "1021:\t\t\tbool beacon_wait;\n1022:\t\t\tbool beacon_received;\n1023:\t\t} scan;\n1024:\t\n1025:\t#ifdef CONFIG_NL80211_TESTMODE\n1026:\t\tconst struct mt76_testmode_ops *test_ops;\n1027:\t\tstruct {\n1028:\t\t\tconst char *name;\n1029:\t\t\tu32 offset;\n1030:\t\t} test_mtd;\n1031:\t#endif\n1032:\t\tstruct workqueue_struct *wq;\n1033:\t\n1034:\t\tunion {\n1035:\t\t\tstruct mt76_mmio mmio;\n1036:\t\t\tstruct mt76_usb usb;\n1037:\t\t\tstruct mt76_sdio sdio;\n1038:\t\t};\n1039:\t\n1040:\t\tatomic_t bus_hung;\n1041:\t};\n1042:\t\n1043:\t/* per-phy stats. */\n1044:\tstruct mt76_mib_stats {\n1045:\t\tu32 ack_fail_cnt;\n1046:\t\tu32 fcs_err_cnt;\n1047:\t\tu32 rts_cnt;\n1048:\t\tu32 rts_retries_cnt;\n1049:\t\tu32 ba_miss_cnt;\n1050:\t\tu32 tx_bf_cnt;\n1051:\t\tu32 tx_mu_bf_cnt;\n1052:\t\tu32 tx_mu_mpdu_cnt;\n1053:\t\tu32 tx_mu_acked_mpdu_cnt;\n1054:\t\tu32 tx_su_acked_mpdu_cnt;\n1055:\t\tu32 tx_bf_ibf_ppdu_cnt;\n1056:\t\tu32 tx_bf_ebf_ppdu_cnt;\n1057:\t\n1058:\t\tu32 tx_bf_rx_fb_all_cnt;\n1059:\t\tu32 tx_bf_rx_fb_eht_cnt;\n1060:\t\tu32 tx_bf_rx_fb_he_cnt;\n1061:\t\tu32 tx_bf_rx_fb_vht_cnt;\n1062:\t\tu32 tx_bf_rx_fb_ht_cnt;\n1063:\t\n1064:\t\tu32 tx_bf_rx_fb_bw; /* value of last sample, not cumulative */\n1065:\t\tu32 tx_bf_rx_fb_nc_cnt;\n1066:\t\tu32 tx_bf_rx_fb_nr_cnt;\n1067:\t\tu32 tx_bf_fb_cpl_cnt;\n1068:\t\tu32 tx_bf_fb_trig_cnt;\n1069:\t\n1070:\t\tu32 tx_ampdu_cnt;\n1071:\t\tu32 tx_stop_q_empty_cnt;\n1072:\t\tu32 tx_mpdu_attempts_cnt;\n1073:\t\tu32 tx_mpdu_success_cnt;\n1074:\t\tu32 tx_pkt_ebf_cnt;\n1075:\t\tu32 tx_pkt_ibf_cnt;\n1076:\t\n1077:\t\tu32 tx_rwp_fail_cnt;\n1078:\t\tu32 tx_rwp_need_cnt;\n1079:\t\n1080:\t\t/* rx stats */\n1081:\t\tu32 rx_fifo_full_cnt;\n1082:\t\tu32 channel_idle_cnt;\n1083:\t\tu32 primary_cca_busy_time;\n1084:\t\tu32 secondary_cca_busy_time;\n1085:\t\tu32 primary_energy_detect_time;\n1086:\t\tu32 cck_mdrdy_time;\n1087:\t\tu32 ofdm_mdrdy_time;\n1088:\t\tu32 green_mdrdy_time;\n1089:\t\tu32 rx_vector_mismatch_cnt;\n1090:\t\tu32 rx_delimiter_fail_cnt;\n1091:\t\tu32 rx_mrdy_cnt;\n1092:\t\tu32 rx_len_mismatch_cnt;\n1093:\t\tu32 rx_mpdu_cnt;\n1094:\t\tu32 rx_ampdu_cnt;\n1095:\t\tu32 rx_ampdu_bytes_cnt;\n1096:\t\tu32 rx_ampdu_valid_subframe_cnt;\n1097:\t\tu32 rx_ampdu_valid_subframe_bytes_cnt;\n1098:\t\tu32 rx_pfdrop_cnt;\n1099:\t\tu32 rx_vec_queue_overflow_drop_cnt;\n1100:\t\tu32 rx_ba_cnt;\n1101:\t\n1102:\t\tu32 tx_amsdu[8];\n1103:\t\tu32 tx_amsdu_cnt;\n1104:\t\n1105:\t\t/* mcu_muru_stats */\n1106:\t\tu32 dl_cck_cnt;\n1107:\t\tu32 dl_ofdm_cnt;\n1108:\t\tu32 dl_htmix_cnt;\n1109:\t\tu32 dl_htgf_cnt;\n1110:\t\tu32 dl_vht_su_cnt;\n1111:\t\tu32 dl_vht_2mu_cnt;\n1112:\t\tu32 dl_vht_3mu_cnt;\n1113:\t\tu32 dl_vht_4mu_cnt;\n1114:\t\tu32 dl_he_su_cnt;\n1115:\t\tu32 dl_he_ext_su_cnt;\n1116:\t\tu32 dl_he_2ru_cnt;\n1117:\t\tu32 dl_he_2mu_cnt;\n1118:\t\tu32 dl_he_3ru_cnt;\n1119:\t\tu32 dl_he_3mu_cnt;\n1120:\t\tu32 dl_he_4ru_cnt;\n"
} |
| 13/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 21435 output: 37 thoughts: 532 Thoughts: **Analyzing the MT76 Driver Patch** Okay, so I'm looking at this `union` structure within the MT76 driver, specifically how it handles MMIO, USB, and SDIO devices. I see that accessing `dev->mmio.npu` or `dev->mmio.ppe_dev` is only valid when dealing with an MMIO device. If we're working with USB or SDIO, accessing those fields is likely going to read from the other device-specific structures, which could be valid but lead to crashes or undefined behavior. This patch is addressing that by adding a check using `mt76_is_mmio(dev) &&` to ensure those functions are only called for the correct device type in `mt76_npu_device_active` and `mt76_ppe_device_active`. From a functional perspective, this is a clear bug fix. Now, the question is, how reachable is this code, especially in virtualized environments? Hmm, well, MT76 has several USB drivers, like `mt76x0u`, `mt76x2u`, `mt7921u`, and `mt7925u`. And, of course, USB devices can definitely be emulated in QEMU, using either `dummy_hcd` or `vhci-hcd`. I know syzkaller frequently leverages `vhci-hcd` for USB fuzzing. So, yes, this code is absolutely reachable and testable. Hang on… Let me just clarify. The patch is specifically targeting the behavior of `mt76_npu_device_active` and `mt76_ppe_device_active`. Those functions are pretty important and used in a bunch of places – `mt76_dma_tx_queue_skb`, `mt76_dma_rx_cleanup`, `mt76_rx_poll_complete`, and others. So, if `mt76_npu_device_active` were to be incorrectly called for a USB device, it might return true erroneously, and that could definitely lead to crashes, or at least incorrect operation. Yep, it's a bug fix that prevents crashes in USB/SDIO configurations. Alright, that settles it. This is a functional fix in a driver that we can absolutely reach through USB fuzzing. This is worth fuzzing. Now, let me check the necessary configs… I'm seeing `CONFIG_MT76_CORE`, `CONFIG_MT76_USB`, `CONFIG_MT7921U`, `CONFIG_MT7925U`, `CONFIG_MT76x0U`, and `CONFIG_MT76x2U`. I'll cross-reference these against the `drivers/net/wireless/mediatek/mt76/Kconfig` file just to be sure. |
| 14/2 | 2026/07/21 08:59 | tool | grepper |
0mArgs:{
"Expression": "config MT76",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/Kconfig:2:config MT76_CORE\ndrivers/net/wireless/mediatek/mt76/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-5-\ndrivers/net/wireless/mediatek/mt76/Kconfig:6:config MT76_LEDS\ndrivers/net/wireless/mediatek/mt76/Kconfig-7-\tbool\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-11-\ndrivers/net/wireless/mediatek/mt76/Kconfig:12:config MT76_USB\ndrivers/net/wireless/mediatek/mt76/Kconfig-13-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-15-\ndrivers/net/wireless/mediatek/mt76/Kconfig:16:config MT76_SDIO\ndrivers/net/wireless/mediatek/mt76/Kconfig-17-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-19-\ndrivers/net/wireless/mediatek/mt76/Kconfig:20:config MT76x02_LIB\ndrivers/net/wireless/mediatek/mt76/Kconfig-21-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-23-\ndrivers/net/wireless/mediatek/mt76/Kconfig:24:config MT76x02_USB\ndrivers/net/wireless/mediatek/mt76/Kconfig-25-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-27-\ndrivers/net/wireless/mediatek/mt76/Kconfig:28:config MT76_CONNAC_LIB\ndrivers/net/wireless/mediatek/mt76/Kconfig-29-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig=36=config MT792x_USB\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-39-\ndrivers/net/wireless/mediatek/mt76/Kconfig:40:config MT76_NPU\ndrivers/net/wireless/mediatek/mt76/Kconfig-41-\tbool\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7603/Kconfig:2:config MT7603E\ndrivers/net/wireless/mediatek/mt76/mt7603/Kconfig-3-\ttristate \"MediaTek MT7603E (PCIe) and MT76x8 WLAN support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-2-\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig:3:config MT7615_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-4-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-7-\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig:8:config MT7615E\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-9-\ttristate \"MediaTek MT7615E and MT7663E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-20-\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig:21:config MT7622_WMAC\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-22-\tbool \"MT7622 (SoC) WMAC support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-31-\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig:32:config MT7663_USB_SDIO_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-33-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-35-\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig:36:config MT7663U\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-37-\ttristate \"MediaTek MT7663U (USB) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-46-\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig:47:config MT7663S\ndrivers/net/wireless/mediatek/mt76/mt7615/Kconfig-48-\ttristate \"MediaTek MT7663S (SDIO) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig:2:config MT76x0_COMMON\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig-5-\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig:6:config MT76x0U\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig-7-\ttristate \"MediaTek MT76x0U (USB) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig-18-\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig:19:config MT76x0E\ndrivers/net/wireless/mediatek/mt76/mt76x0/Kconfig-20-\ttristate \"MediaTek MT76x0E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig:2:config MT76x2_COMMON\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig-5-\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig:6:config MT76x2E\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig-7-\ttristate \"MediaTek MT76x2E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig-17-\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig:18:config MT76x2U\ndrivers/net/wireless/mediatek/mt76/mt76x2/Kconfig-19-\ttristate \"MediaTek MT76x2U (USB) support\"\n"
} |
| 15/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 24607 output: 37 thoughts: 7 Thoughts: Okay, let's dive into this. Here's how I'd approach this task, as if these were my internal thoughts: **Deep Dive into Configuration Files** Right, let's see. My initial assessment is complete. Now I need to ensure a holistic understanding of this system; the original data alone isn't sufficient. This means a thorough investigation of the configuration files. I need to be methodical here. I'll need to identify the key configurations. What specific areas are the configurations impacting? I'll review all the configs. I will be looking for interactions, dependencies, and any subtle inconsistencies. I'll double-check all the configs. Time to dive in. |
| 16/2 | 2026/07/21 08:59 | tool | grepper |
0mArgs:{
"Expression": "config MT79",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/Kconfig=28=config MT76_CONNAC_LIB\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-31-\ndrivers/net/wireless/mediatek/mt76/Kconfig:32:config MT792x_LIB\ndrivers/net/wireless/mediatek/mt76/Kconfig-33-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-35-\ndrivers/net/wireless/mediatek/mt76/Kconfig:36:config MT792x_USB\ndrivers/net/wireless/mediatek/mt76/Kconfig-37-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7915/Kconfig:2:config MT7915E\ndrivers/net/wireless/mediatek/mt76/mt7915/Kconfig-3-\ttristate \"MediaTek MT7915E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/Kconfig-16-\ndrivers/net/wireless/mediatek/mt76/mt7915/Kconfig:17:config MT798X_WMAC\ndrivers/net/wireless/mediatek/mt76/mt7915/Kconfig-18-\tbool \"MT798x (SoC) WMAC support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:2:config MT7921_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-6-\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:7:config MT7921E\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-8-\ttristate \"MediaTek MT7921E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-16-\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:17:config MT7921S\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-18-\ttristate \"MediaTek MT7921S (SDIO) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-27-\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:28:config MT7921U\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-29-\ttristate \"MediaTek MT7921U (USB) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:2:config MT7925_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-6-\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:7:config MT7925E\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-8-\ttristate \"MediaTek MT7925E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-18-\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:19:config MT7925U\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-20-\ttristate \"MediaTek MT7925U (USB) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7996/Kconfig:2:config MT7996E\ndrivers/net/wireless/mediatek/mt76/mt7996/Kconfig-3-\ttristate \"MediaTek MT7996 (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/Kconfig-15-\ndrivers/net/wireless/mediatek/mt76/mt7996/Kconfig:16:config MT7996_NPU\ndrivers/net/wireless/mediatek/mt76/mt7996/Kconfig-17-\tbool \"MT7996 (PCIe) NPU support\"\n"
} |
| 17/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 26151 output: 46 thoughts: 516 Thoughts: **Analyzing the Potential Impact of the Patch** Okay, so I've got a set of configurations here: `MT76_CORE`, `MT76_USB`, `MT76x0U`, `MT76x2U`, `MT7921U`, and `MT7925U`. Those seem like the relevant modules to be enabled for this patch. I need to figure out the scope of these changes. Alright, the patch touches `mt76_npu_device_active` and `mt76_ppe_device_active`. Those are inline functions in `mt76.h`, so I should note their usage. It looks like they're called from quite a few places: `mt76_dma_tx_queue_skb`, `mt76_dma_rx_cleanup`, `mt76_dma_rx_reset`, `mt76_rx_poll_complete`, and a whole slew of `mt7996_` functions related to DMA configuration, initialization, and network setup. That's a decent-sized surface area to be reviewing. Hold on a minute, `mt7996` is PCIe-only, so that module and its associated functions shouldn't be relevant for USB fuzzing. That's an important distinction to keep in mind. Let's make sure I didn't miss something. I was originally focused on the `mt76_dma_tx_queue_skb` function, as that one's in `dma.c`. I need to confirm if that is used by USB devices or not. I'll need to check the call path through that function for my analysis. |
| 18/2 | 2026/07/21 08:59 | tool | grepper |
0mArgs:{
"Expression": "mt76_dma_tx_queue_skb",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/dma.c=606=static int\ndrivers/net/wireless/mediatek/mt76/dma.c:607:mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,\ndrivers/net/wireless/mediatek/mt76/dma.c-608-\t\t\t struct sk_buff *skb, u32 tx_info)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=639=static int\ndrivers/net/wireless/mediatek/mt76/dma.c:640:mt76_dma_tx_queue_skb(struct mt76_phy *phy, struct mt76_queue *q,\ndrivers/net/wireless/mediatek/mt76/dma.c-641-\t\t enum mt76_txq_id qid, struct sk_buff *skb,\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=1148=static const struct mt76_queue_ops mt76_dma_ops = {\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-1151-\t.reset_q = mt76_dma_queue_reset,\ndrivers/net/wireless/mediatek/mt76/dma.c:1152:\t.tx_queue_skb_raw = mt76_dma_tx_queue_skb_raw,\ndrivers/net/wireless/mediatek/mt76/dma.c:1153:\t.tx_queue_skb = mt76_dma_tx_queue_skb,\ndrivers/net/wireless/mediatek/mt76/dma.c-1154-\t.tx_cleanup = mt76_dma_tx_cleanup,\n"
} |
| 19/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 27570 output: 40 thoughts: 47 Thoughts: **USB DMA Operations Inquiry** Okay, hold on a second. I was just thinking about DMA operations within the `mt76` framework, specifically `mt76_dma_ops`. But, that's for PCIe or MMIO, right? I'm forgetting something crucial here... what about USB? It's not the same. USB has its own set of operations, and I seem to recall that they're handled via `mt76_usb_ops`. Right, that feels more correct. Time to confirm my suspicion. Let's dig into `usb.c` and make sure my memory serves me correctly. It's time to refresh myself on how the USB side of `mt76` is structured. |
| 20/2 | 2026/07/21 08:59 | tool | grepper |
0mError:no matches Args: {
"Expression": "mt76_usb_ops",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"error": "no matches"
} |
| 21/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 27826 output: 41 thoughts: 13 Thoughts: Here's a summary of my thought process, as though I were considering `mt76_queue_ops`, tailored for an expert audience: **Diving into `mt76_queue_ops`** Okay, so I need to check out `mt76_queue_ops`. Given the context, this *has* to be the structure containing the operational function pointers for the MT76's internal queue management. My first thought is to recall the general MT76 architecture. Are we talking about dedicated hardware queues? Software emulation? Hybrid? That's going to dictate the specifics of what I'm looking for. I'm instantly going to be interested in the typical suspects: `tx_enqueue`, `tx_dequeue`, `rx_enqueue`, `rx_dequeue`, `queue_init`, `queue_deinit`. Also, let's see, what about error handling functions? Are there per-queue stats counters exposed via this struct? Probably. I'll need to look for those. Given the MT76's common use with PCIe and USB interfaces, I expect some functions will be related to descriptor management, DMA operations, and perhaps interrupt handling related to the queues. I'll be looking to see if these functions manage the hardware directly or use an intermediary layer of software queues. Are there likely to be rate limiting or traffic shaping functions here? Quite possibly, especially if this covers multiple queues with differing priorities. Also, does it contain functions for power management or queue draining on suspend/resume? These are things to look for. I'm expecting some pretty low-level stuff, potentially involving memory barriers and careful synchronization. If this is a modern MT76 driver, I'm hoping to see well-commented code, but I know better than to get my hopes up. Time to dig in and see what's actually going on! |
| 22/2 | 2026/07/21 08:59 | tool | grepper |
0mArgs:{
"Expression": "struct mt76_queue_ops",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/dma.c=1108=mt76_dma_init(struct mt76_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-1147-\ndrivers/net/wireless/mediatek/mt76/dma.c:1148:static const struct mt76_queue_ops mt76_dma_ops = {\ndrivers/net/wireless/mediatek/mt76/dma.c-1149-\t.init = mt76_dma_init,\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=270=struct mt76_mcu_ops {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-291-\ndrivers/net/wireless/mediatek/mt76/mt76.h:292:struct mt76_queue_ops {\ndrivers/net/wireless/mediatek/mt76/mt76.h-293-\tint (*init)(struct mt76_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=921=struct mt76_dev {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-958-\tstruct mt76_queue q_rx[__MT_RXQ_MAX];\ndrivers/net/wireless/mediatek/mt76/mt76.h:959:\tconst struct mt76_queue_ops *queue_ops;\ndrivers/net/wireless/mediatek/mt76/mt76.h-960-\tint tx_dma_idx[4];\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c=587=static void mt76s_tx_kick(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c-593-\ndrivers/net/wireless/mediatek/mt76/sdio.c:594:static const struct mt76_queue_ops sdio_queue_ops = {\ndrivers/net/wireless/mediatek/mt76/sdio.c-595-\t.tx_queue_skb = mt76s_tx_queue_skb,\n--\ndrivers/net/wireless/mediatek/mt76/usb.c=1069=EXPORT_SYMBOL_GPL(mt76u_alloc_queues);\ndrivers/net/wireless/mediatek/mt76/usb.c-1070-\ndrivers/net/wireless/mediatek/mt76/usb.c:1071:static const struct mt76_queue_ops usb_queue_ops = {\ndrivers/net/wireless/mediatek/mt76/usb.c-1072-\t.tx_queue_skb = mt76u_tx_queue_skb,\n"
} |
| 23/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 29033 output: 42 thoughts: 108 Thoughts: **Investigating the `mt76_npu_device_active` Call** Okay, so I was looking at the `mt76_dma_tx_queue_skb` function, and it seems pretty clear that it's exclusively used for devices that rely on Direct Memory Access, like PCIe and MMIO based hardware. That makes perfect sense. But then I hit a snag. The function `mt76_npu_device_active`, the one I was actually focused on, is seemingly *only* called from within DMA-related sections of the code. That's a red flag. If it's *only* called from DMA contexts, how in the world could it be triggered for a USB device? The logic just doesn't follow. Alright, let's step back and take a more granular approach. I need to trace this function back to its origins. Let me see... where *else* is `mt76_npu_device_active` being called? Ah ha! I found it - `mt76_rx_poll_complete` in `mac80211.c`. That's an interesting data point. Now I have another place to focus on to build this mental model. This makes more sense now, I'll need to drill down into `mt76_rx_poll_complete` and how it might call, or not call, the `mt76_npu_device_active` function and under what circumstances. |
| 24/2 | 2026/07/21 08:59 | tool | grepper |
0mArgs:{
"Expression": "mt76_rx_poll_complete",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/dma.c=1073=int mt76_dma_rx_poll(struct napi_struct *napi, int budget)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-1084-\t\tcur = mt76_dma_rx_process(dev, \u0026dev-\u003eq_rx[qid], budget - done);\ndrivers/net/wireless/mediatek/mt76/dma.c:1085:\t\tmt76_rx_poll_complete(dev, qid, napi);\ndrivers/net/wireless/mediatek/mt76/dma.c-1086-\t\tdone += cur;\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1514=void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1553-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1554:void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1555-\t\t\t struct napi_struct *napi)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1572-}\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1573:EXPORT_SYMBOL_GPL(mt76_rx_poll_complete);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1574-\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1793=void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1794-\t\t struct napi_struct *napi);\ndrivers/net/wireless/mediatek/mt76/mt76.h:1795:void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1796-\t\t\t struct napi_struct *napi);\n--\ndrivers/net/wireless/mediatek/mt76/npu.c=144=static int mt76_npu_rx_poll(struct napi_struct *napi, int budget)\n--\ndrivers/net/wireless/mediatek/mt76/npu.c-165-\t\tdev-\u003edrv-\u003erx_skb(dev, qid, skb, \u0026info);\ndrivers/net/wireless/mediatek/mt76/npu.c:166:\t\tmt76_rx_poll_complete(dev, qid, napi);\ndrivers/net/wireless/mediatek/mt76/npu.c-167-\t\tdone++;\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c=383=mt76s_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c-402-\tif (qid == MT_RXQ_MAIN)\ndrivers/net/wireless/mediatek/mt76/sdio.c:403:\t\tmt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL);\ndrivers/net/wireless/mediatek/mt76/sdio.c-404-\n--\ndrivers/net/wireless/mediatek/mt76/usb.c=602=mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/usb.c-622-\t\tlocal_bh_disable();\ndrivers/net/wireless/mediatek/mt76/usb.c:623:\t\tmt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL);\ndrivers/net/wireless/mediatek/mt76/usb.c-624-\t\tlocal_bh_enable();\n"
} |
| 25/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 30631 output: 50 thoughts: 91 Thoughts: Okay, here's my interpretation of this debugging thought process, as if it were my own: **Tracing the Receive Path** Alright, I'm digging into this receive path... I'm pretty sure I remember `mt76_rx_poll_complete` being called from `mt76u_process_rx_queue` – yep, that's in `usb.c`, exactly where I'd expect it. The next thing I'm seeing is a check: `mt76_rx_poll_complete` is calling `mt76_npu_device_active(dev)`. This is interesting, a conditional call, so let's see what is happening in the `mt76_rx_poll_complete` function. Looks like I'll need to jump over to `mac80211.c` to trace this further. |
| 26/2 | 2026/07/21 08:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mac80211.c",
"FirstLine": 1554,
"LineCount": 20
}Results: {
"Contents": "1554:\tvoid mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,\n1555:\t\t\t\t struct napi_struct *napi)\n1556:\t{\n1557:\t\tstruct sk_buff_head frames;\n1558:\t\tstruct sk_buff *skb;\n1559:\t\n1560:\t\t__skb_queue_head_init(\u0026frames);\n1561:\t\n1562:\t\twhile ((skb = __skb_dequeue(\u0026dev-\u003erx_skb[q])) != NULL) {\n1563:\t\t\tmt76_check_sta(dev, skb);\n1564:\t\t\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) ||\n1565:\t\t\t mt76_npu_device_active(dev))\n1566:\t\t\t\t__skb_queue_tail(\u0026frames, skb);\n1567:\t\t\telse\n1568:\t\t\t\tmt76_rx_aggr_reorder(skb, \u0026frames);\n1569:\t\t}\n1570:\t\n1571:\t\tmt76_rx_complete(dev, \u0026frames, napi);\n1572:\t}\n1573:\tEXPORT_SYMBOL_GPL(mt76_rx_poll_complete);\n"
} |
| 27/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 31318 output: 41 thoughts: 212 Thoughts: **Analyzing the `mt76_rx_poll_complete` Function's Behavior** Okay, so `mt76_rx_poll_complete` is definitely being invoked for USB devices. That's good, but it's leading to some potential issues I need to address. Specifically, it's calling both `mtk_wed_device_active(&dev->mmio.wed)` and `mt76_npu_device_active(dev)`. The problem is, for USB devices, `dev->mmio` is invalid; it's overlapping memory with `dev->usb`. This means these functions, particularly the ones that check for active devices, are likely reading garbage data from `dev->usb`. That's not ideal. This can result in either `mtk_wed_device_active` or `mt76_npu_device_active` returning a non-zero value when they shouldn't. If this happens, instead of properly using `mt76_rx_aggr_reorder`, the code incorrectly goes to `__skb_queue_tail`. This completely breaks the RX aggregation reordering mechanism for USB devices. Furthermore, there's a real possibility of it causing crashes if it attempts to dereference something unexpected or invalid. I need to be careful. Wait, looking at `mtk_wed_device_active` again, it's also accessing `dev->mmio.wed`. Does it have a check to determine if it's operating on an MMIO device? I need to verify that; it's a critical piece of the puzzle. I need to get into that function and see what's happening. |
| 28/2 | 2026/07/21 08:59 | tool | grepper |
0mArgs:{
"Expression": "mtk_wed_device_active",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 503 lines.\nUse more precise expression if possible.\n\ndrivers/net/wireless/mediatek/mt76/dma.c=802=mt76_dma_alloc_queue(struct mt76_dev *dev, struct mt76_queue *q,\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-845-\ndrivers/net/wireless/mediatek/mt76/dma.c:846:\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/dma.c-847-\t\tif ((mtk_wed_get_rx_capa(\u0026dev-\u003emmio.wed) \u0026\u0026 mt76_queue_is_wed_rro(q)) ||\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=861=mt76_dma_rx_cleanup(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-881-\ndrivers/net/wireless/mediatek/mt76/dma.c:882:\t\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/dma.c-883-\t\t mt76_queue_is_wed_rro(q))\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=905=mt76_dma_rx_reset(struct mt76_dev *dev, enum mt76_rxq_id qid)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-927-\ndrivers/net/wireless/mediatek/mt76/dma.c:928:\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/dma.c-929-\t mt76_queue_is_wed_rro(q))\n--\ndrivers/net/wireless/mediatek/mt76/dma.c=1167=void mt76_dma_cleanup(struct mt76_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/dma.c-1197-\ndrivers/net/wireless/mediatek/mt76/dma.c:1198:\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/dma.c-1199-\t\tmtk_wed_device_detach(\u0026dev-\u003emmio.wed);\ndrivers/net/wireless/mediatek/mt76/dma.c-1200-\ndrivers/net/wireless/mediatek/mt76/dma.c:1201:\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed_hif2))\ndrivers/net/wireless/mediatek/mt76/dma.c-1202-\t\tmtk_wed_device_detach(\u0026dev-\u003emmio.wed_hif2);\n--\ndrivers/net/wireless/mediatek/mt76/dma.h=175=mt76_dma_reset_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/dma.h-179-\tdev-\u003equeue_ops-\u003ereset_q(dev, q, reset_idx);\ndrivers/net/wireless/mediatek/mt76/dma.h:180:\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/dma.h-181-\t\tmt76_wed_dma_setup(dev, q, true);\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1554=void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1563-\t\tmt76_check_sta(dev, skb);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1564:\t\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) ||\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1565-\t\t mt76_npu_device_active(dev))\n--\ndrivers/net/wireless/mediatek/mt76/mmio.c=77=void mt76_set_irq_mask(struct mt76_dev *dev, u32 addr,\n--\ndrivers/net/wireless/mediatek/mt76/mmio.c-85-\tif (addr) {\ndrivers/net/wireless/mediatek/mt76/mmio.c:86:\t\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mmio.c-87-\t\t\tmtk_wed_device_irq_set_mask(\u0026dev-\u003emmio.wed,\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c=504=void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-547-\t\t/* mt7915 WA only counts WED path */\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c:548:\t\tif (is_mt7915(dev) \u0026\u0026 mtk_wed_device_active(\u0026dev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-549-\t\t\twcid-\u003estats.tx_packets++;\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c=624=bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-636-\t/* PPDU based reporting */\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c:637:\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mac.c-638-\t FIELD_GET(MT_TXS0_TXS_FORMAT, txs) \u003e 1) {\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c=1272=int mt76_connac_mcu_sta_wed_update(struct mt76_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-1276-\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:1277:\tif (!mtk_wed_device_active(\u0026dev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c-1278-\t\treturn 0;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c=9=mt7915_init_tx_queues(struct mt7915_phy *phy, int idx, int n_desc, int ring_base)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-13-\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:14:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-15-\t\tif (is_mt798x(\u0026dev-\u003emt76))\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c=41=static void mt7915_dma_config(struct mt7915_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-86-\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:87:\t\tif (is_mt7916(\u0026dev-\u003emt76) \u0026\u0026 mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-88-\t\t\tRXQ_CONFIG(MT_RXQ_MAIN, WFDMA0, MT_INT_WED_RX_DONE_BAND0_MT7916,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c=255=int mt7915_dma_start(struct mt7915_dev *dev, bool reset, bool wed_reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-308-\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:309:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026 wed_reset) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-310-\t\tu32 wed_irq_mask = irq_mask;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c=408=int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-423-\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:424:\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-425-\t\tif (!is_mt798x(mdev)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-493-\t/* event from WA */\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:494:\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026 is_mt7915(mdev)) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-495-\t\twa_rx_base = MT_WED_RX_RING_BASE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-510-\tif (!dev-\u003ephy.mt76-\u003eband_idx) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:511:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-512-\t\t mtk_wed_get_rx_capa(\u0026mdev-\u003emmio.wed)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-532-\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:533:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-534-\t\t\tmdev-\u003eq_rx[MT_RXQ_MAIN_WA].flags = MT_WED_Q_TXFREE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-549-\tif (dev-\u003edbdc_support || dev-\u003ephy.mt76-\u003eband_idx) {\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:550:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-551-\t\t mtk_wed_get_rx_capa(\u0026mdev-\u003emmio.wed)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c=590=int mt7915_dma_reset(struct mt7915_dev *dev, bool force)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-612-\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:613:\tif (mtk_wed_device_active(wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-614-\t\tmtk_wed_device_dma_reset(wed);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-640-\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c:641:\tif (mtk_wed_device_active(wed) \u0026\u0026 is_mt7915(\u0026dev-\u003emt76))\ndrivers/net/wireless/mediatek/mt76/mt7915/dma.c-642-\t\tmt76_rmw(dev, MT_WFDMA0_EXT0_CFG, MT_WFDMA0_EXT0_RXWB_KEEP,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c=358=mt7915_init_wiphy(struct mt7915_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c-370-\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c:371:\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c-372-\t\thw-\u003enetdev_features |= NETIF_F_HW_TC;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c=484=mt7915_mac_init_band(struct mt7915_dev *dev, u8 band)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c-549-\t */\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c:550:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c-551-\t\tmt76_set(dev, MT_AGG_ACR4(band), MT_AGG_ACR_PPDU_TXS2H);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c=867=mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-913-\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c:914:\t\tif (!mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026 wcid) {\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-915-\t\t\tu32 tx_retries = 0, tx_failed = 0, count;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c=1473=void mt7915_mac_reset_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1533-\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c:1534:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1535-\t\tmtk_wed_device_stop(\u0026dev-\u003emt76.mmio.wed);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c=1157=static void mt7915_sta_statistics(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c-1189-\t */\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c:1190:\tif (mtk_wed_device_active(\u0026phy-\u003edev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c-1191-\t\tsinfo-\u003etx_bytes = msta-\u003ewcid.stats.tx_bytes;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c=1723=mt7915_net_fill_forward_path(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c-1734-\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c:1735:\tif (!mtk_wed_device_active(wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/main.c-1736-\t\treturn -ENODEV;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c=2384=int mt7915_mcu_init_firmware(struct mt7915_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-2417-\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2418:\tif ((mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-2419-\t is_mt7915(\u0026dev-\u003emt76)) ||\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-2435-\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2436:\treturn mt7915_mcu_set_red(dev, mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed));\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-2437-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c=793=void mt7915_dual_hif_set_irq_mask(struct mt7915_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-805-\tif (write_reg) {\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c:806:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-807-\t\t\tmtk_wed_device_irq_set_mask(\u0026mdev-\u003emmio.wed,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c=826=static void mt7915_irq_tasklet(struct tasklet_struct *t)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-831-\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c:832:\tif (mtk_wed_device_active(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-833-\t\tmtk_wed_device_irq_set_mask(wed, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c=896=irqreturn_t mt7915_irq_handler(int irq, void *dev_instance)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-900-\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c:901:\tif (mtk_wed_device_active(wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-902-\t\tmtk_wed_device_irq_set_mask(wed, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/pci.c=103=static int mt7915_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/pci.c-192-free_wed_or_irq_vector:\ndrivers/net/wireless/mediatek/mt76/mt7915/pci.c:193:\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/pci.c-194-\t\tmtk_wed_device_detach(\u0026mdev-\u003emmio.wed);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/soc.c=1220=static int mt798x_wmac_probe(struct platform_device *pdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/soc.c-1272-free_device:\ndrivers/net/wireless/mediatek/mt76/mt7915/soc.c:1273:\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7915/soc.c-1274-\t\tmtk_wed_device_detach(\u0026mdev-\u003emmio.wed);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=10=int mt7996_init_tx_queues(struct mt7996_phy *phy, int idx, int n_desc,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-15-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:16:\tif (mtk_wed_device_active(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-17-\t\tring_base += MT_TXQ_ID(0) * MT_RING_SIZE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=306=void mt7996_dma_start(struct mt7996_dev *dev, bool reset, bool wed_reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-316-\tif (!reset) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:317:\t\tif (mtk_wed_device_active(wed) \u0026\u0026 mtk_wed_get_rx_capa(wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-318-\t\t\tmt76_set(dev, MT_WFDMA0_GLO_CFG,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-353-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:354:\tif (mtk_wed_device_active(wed) \u0026\u0026 wed_reset) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-355-\t\tu32 wed_irq_mask = irq_mask;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=374=static void mt7996_dma_enable(struct mt7996_dev *dev, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-502-\t\t */\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:503:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-504-\t\t mt7996_has_hwrro(dev)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=521=int mt7996_dma_rro_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-529-\t\tmdev-\u003eq_rx[MT_RXQ_RRO_RXDMAD_C].flags = MT_WED_RRO_Q_RXDMAD_C;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:530:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-531-\t\t\tmdev-\u003eq_rx[MT_RXQ_RRO_RXDMAD_C].wed = \u0026mdev-\u003emmio.wed;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-541-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:542:\t\tif (!mtk_wed_device_active(\u0026mdev-\u003emmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-543-\t\t\t/* We need to set cpu idx pointer before resetting the\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-556-\tmdev-\u003eq_rx[MT_RXQ_RRO_IND].flags = MT_WED_RRO_Q_IND;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:557:\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-558-\t mtk_wed_get_rx_capa(\u0026mdev-\u003emmio.wed))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-569-\t\tMT_WED_RRO_Q_MSDU_PG(0) | MT_QFLAG_WED_RRO_EN;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:570:\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-571-\t mtk_wed_get_rx_capa(\u0026mdev-\u003emmio.wed))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-586-\t\t\tMT_WED_RRO_Q_MSDU_PG(1) | MT_QFLAG_WED_RRO_EN;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:587:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-588-\t\t mtk_wed_get_rx_capa(\u0026mdev-\u003emmio.wed))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-604-\t\t\tMT_WED_RRO_Q_MSDU_PG(2) | MT_QFLAG_WED_RRO_EN;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:605:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-606-\t\t mtk_wed_get_rx_capa(\u0026mdev-\u003emmio.wed))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=622=void mt7996_dma_rro_start(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-625-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:626:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-627-\t\tirq_mask = dev-\u003emt76.mmio.irqmask |\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=664=int mt7996_dma_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-739-\t/* rx data queue for band0 and mt7996 band1 */\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:740:\tif (mtk_wed_device_active(wed) \u0026\u0026 mtk_wed_get_rx_capa(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-741-\t\tdev-\u003emt76.q_rx[MT_RXQ_MAIN].flags = MT_WED_Q_RX(0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-753-\t/* tx free notify event from WA for band0 */\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:754:\tif (mtk_wed_device_active(wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-755-\t ((is_mt7996(\u0026dev-\u003emt76) \u0026\u0026 !mt7996_has_hwrro(dev)) ||\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-772-\t} else {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:773:\t\tif (mtk_wed_device_active(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-774-\t\t\tdev-\u003emt76.q_rx[MT_RXQ_TXFREE_BAND0].flags = MT_WED_Q_TXFREE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-786-\tif (!mt7996_has_wa(dev) \u0026\u0026 dev-\u003ehif2) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:787:\t\tif (mtk_wed_device_active(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-788-\t\t\tdev-\u003emt76.q_rx[MT_RXQ_TXFREE_BAND1].flags = MT_WED_Q_TXFREE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-813-\t\t */\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:814:\t\tif (mtk_wed_device_active(wed_hif2) \u0026\u0026 !mt7996_has_hwrro(dev)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-815-\t\t\tdev-\u003emt76.q_rx[MT_RXQ_BAND2_WA].flags = MT_WED_Q_TXFREE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-828-\t\trx_base = MT_RXQ_RING_BASE(MT_RXQ_BAND1) + hif1_ofs;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:829:\t\tif (mtk_wed_device_active(wed) \u0026\u0026 mtk_wed_get_rx_capa(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-830-\t\t\tdev-\u003emt76.q_rx[MT_RXQ_BAND1].flags = MT_WED_Q_RX(1);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-844-\t\t\trx_base = MT_RXQ_RING_BASE(MT_RXQ_BAND1_WA) + hif1_ofs;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:845:\t\t\tif (mtk_wed_device_active(wed_hif2)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-846-\t\t\t\tdev-\u003emt76.q_rx[MT_RXQ_BAND1_WA].flags =\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-864-\t\t\tMT_WED_RRO_Q_DATA(0) | MT_QFLAG_WED_RRO_EN;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:865:\t\tif (mtk_wed_device_active(wed) \u0026\u0026 mtk_wed_get_rx_capa(wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-866-\t\t\tdev-\u003emt76.q_rx[MT_RXQ_RRO_BAND0].wed = wed;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-877-\t\t\t\tMT_WED_RRO_Q_DATA(1) | MT_QFLAG_WED_RRO_EN;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:878:\t\t\tif (mtk_wed_device_active(wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-879-\t\t\t mtk_wed_get_rx_capa(wed))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-889-\t\t} else {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:890:\t\t\tif (mtk_wed_device_active(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-891-\t\t\t\t/* tx free notify event from WA for band0 */\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-913-\t\t\t\tMT_WED_RRO_Q_DATA(1) | MT_QFLAG_WED_RRO_EN;\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:914:\t\t\tif (mtk_wed_device_active(wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-915-\t\t\t mtk_wed_get_rx_capa(wed))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-928-\t\t\t/* tx free notify event from MAC for band2 */\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:929:\t\t\tif (mtk_wed_device_active(wed_hif2)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-930-\t\t\t\tdev-\u003emt76.q_rx[MT_RXQ_TXFREE_BAND2].flags = MT_WED_Q_TXFREE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c=960=void mt7996_dma_reset(struct mt7996_dev *dev, bool force)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-994-\tif (mt7996_has_hwrro(dev) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:995:\t !mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-996-\t\tmt7996_rro_msdu_page_map_free(dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1001-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:1002:\tif (dev-\u003ehif2 \u0026\u0026 mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed_hif2))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1003-\t\tmtk_wed_device_dma_reset(\u0026dev-\u003emt76.mmio.wed_hif2);\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1004-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:1005:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1006-\t\tmtk_wed_device_dma_reset(\u0026dev-\u003emt76.mmio.wed);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1026-\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:1027:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1028-\t\t\tif (mt76_queue_is_wed_rro(q) ||\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1040-\tmt76_for_each_q_rx(\u0026dev-\u003emt76, i) {\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c:1041:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026 force \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/dma.c-1042-\t\t (mt76_queue_is_wed_rro_ind(\u0026dev-\u003emt76.q_rx[i]) ||\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=478=mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-492-\thw-\u003enetdev_features = NETIF_F_RXCSUM;\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:493:\tif (mtk_wed_device_active(wed) || mt76_npu_device_active(mdev))\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-494-\t\thw-\u003enetdev_features |= NETIF_F_HW_TC;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=682=static int mt7996_register_phy(struct mt7996_dev *dev, enum mt76_band_id band)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-759-\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:760:\tif (wed == \u0026dev-\u003emt76.mmio.wed_hif2 \u0026\u0026 mtk_wed_device_active(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-761-\t\tmt76_wr(dev, MT_INT_PCIE1_MASK_CSR, MT_INT_TX_RX_DONE_EXT);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=825=static void mt7996_rro_hw_init_v3(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-833-#ifdef CONFIG_NET_MEDIATEK_SOC_WED\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:834:\tif (mtk_wed_device_active(wed) \u0026\u0026 mtk_wed_get_rx_capa(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-835-\t\twed-\u003ewlan.ind_cmd.win_size =\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-848-\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:849:\tif (mtk_wed_device_active(wed) \u0026\u0026 mtk_wed_get_rx_capa(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-850-\t\tmt76_wr(dev, MT_RRO_IND_CMD_SIGNATURE_BASE0, 0x15010e00);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=868=void mt7996_rro_hw_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-887-\t\t\t\t MT_RRO_3_1_GLOBAL_CONFIG_RXDMAD_SEL);\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:888:\t\t\tif (!mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-889-\t\t\t !mt76_npu_device_active(\u0026dev-\u003emt76)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=949=static int mt7996_wed_rro_init(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-998-#ifdef CONFIG_NET_MEDIATEK_SOC_WED\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:999:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1000-\t\t mtk_wed_get_rx_capa(\u0026dev-\u003emt76.mmio.wed)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1022-\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:1023:\tif (!mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1024-\t dev-\u003emt76.hwrro_mode == MT76_HWRRO_V3_1) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c=1798=void mt7996_unregister_device(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1811-\tif (mt7996_has_hwrro(dev) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c:1812:\t !mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/init.c-1813-\t\tmt7996_rro_msdu_page_map_free(dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=1406=mt7996_mac_add_txs_skb(struct mt7996_dev *dev, struct mt76_wcid *wcid,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-1439-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:1440:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026 wcid-\u003esta) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-1441-\t\tstruct ieee80211_sta *sta;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=1620=void mt7996_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-1638-\tcase PKT_TYPE_TXRX_NOTIFY:\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:1639:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed_hif2) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-1640-\t\t q == MT_RXQ_TXFREE_BAND2) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=2220=mt7996_mac_restart(struct mt7996_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2248-\tmt76_for_each_q_rx(mdev, i) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2249:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2250-\t\t mt76_queue_is_wed_rro(\u0026mdev-\u003eq_rx[i]))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2264-\tmt76_for_each_q_rx(mdev, i) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2265:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2266-\t\t mt76_queue_is_wed_rro(\u0026mdev-\u003eq_rx[i]))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2295-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2296:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2297-\t mt7996_has_hwrro(dev)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2314-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2315:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed_hif2)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2316-\t\tmt76_wr(dev, MT_INT_PCIE1_MASK_CSR,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=2451=void mt7996_mac_reset_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2491-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2492:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed_hif2))\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2493-\t\tmtk_wed_device_stop(\u0026dev-\u003emt76.mmio.wed_hif2);\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2494-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2495:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2496-\t\tmtk_wed_device_stop(\u0026dev-\u003emt76.mmio.wed);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2514-\tmt76_for_each_q_rx(\u0026dev-\u003emt76, i) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2515:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2516-\t\t mt76_queue_is_wed_rro(\u0026dev-\u003emt76.q_rx[i]))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2552-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2553:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2554-\t\tu32 wed_irq_mask = MT_INT_TX_DONE_BAND2 |\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2563-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2564:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed_hif2)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2565-\t\tmt76_wr(dev, MT_INT_PCIE1_MASK_CSR, MT_INT_TX_RX_DONE_EXT);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2576-\tmt76_for_each_q_rx(\u0026dev-\u003emt76, i) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2577:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2578-\t\t mt76_queue_is_wed_rro(\u0026dev-\u003emt76.q_rx[i]))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=2901=void mt7996_mac_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2918-\t\tmt7996_mcu_get_all_sta_info(phy, UNI_ALL_STA_TXRX_RATE);\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2919:\t\tif (mtk_wed_device_active(\u0026phy-\u003edev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2920-\t\t\tmt7996_mcu_get_all_sta_info(phy, UNI_ALL_STA_TXRX_ADM_STAT);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c=1861=static void mt7996_sta_statistics(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-1901-\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c:1902:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-1903-\t\tsinfo-\u003etx_bytes = msta_link-\u003ewcid.stats.tx_bytes;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c=2381=mt7996_net_fill_forward_path(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2408-\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c:2409:\tif (!mtk_wed_device_active(wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2410-\t !mt76_npu_device_active(\u0026dev-\u003emt76))\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2415-#ifdef CONFIG_NET_MEDIATEK_SOC_WED\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c:2416:\tif (mtk_wed_device_active(wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/main.c-2417-\t\tpath-\u003emtk_wdma.wdma_idx = wed-\u003ewdma_idx;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c=679=void mt7996_dual_hif_set_irq_mask(struct mt7996_dev *dev, bool write_reg,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-690-\tif (write_reg) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:691:\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-692-\t\t\tmtk_wed_device_irq_set_mask(\u0026mdev-\u003emmio.wed,\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-693-\t\t\t\t\t\t mdev-\u003emmio.irqmask);\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:694:\t\t\tif (mtk_wed_device_active(\u0026mdev-\u003emmio.wed_hif2)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-695-\t\t\t\tmtk_wed_device_irq_set_mask(\u0026mdev-\u003emmio.wed_hif2,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c=725=static void mt7996_irq_tasklet(struct tasklet_struct *t)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-731-\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:732:\tif (dev-\u003ehif2 \u0026\u0026 mtk_wed_device_active(wed_hif2)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-733-\t\tmtk_wed_device_irq_set_mask(wed_hif2, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-745-\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:746:\tif (mtk_wed_device_active(wed)) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-747-\t\tmtk_wed_device_irq_set_mask(wed, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c=792=irqreturn_t mt7996_irq_handler(int irq, void *dev_instance)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-795-\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:796:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-797-\t\tmtk_wed_device_irq_set_mask(\u0026dev-\u003emt76.mmio.wed, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-801-\tif (dev-\u003ehif2) {\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:802:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed_hif2))\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-803-\t\t\tmtk_wed_device_irq_set_mask(\u0026dev-\u003emt76.mmio.wed_hif2, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/pci.c=99=static int mt7996_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/pci.c-205-\tif (dev-\u003ehif2) {\ndrivers/net/wireless/mediatek/mt76/mt7996/pci.c:206:\t\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed_hif2))\ndrivers/net/wireless/mediatek/mt76/mt7996/pci.c-207-\t\t\tmtk_wed_device_detach(\u0026dev-\u003emt76.mmio.wed_hif2);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/pci.c-215-free_wed_or_irq_vector:\ndrivers/net/wireless/mediatek/mt76/mt7996/pci.c:216:\tif (mtk_wed_device_active(\u0026dev-\u003emt76.mmio.wed))\ndrivers/net/wireless/mediatek/mt76/mt7996/pci.c-217-\t\tmtk_wed_device_detach(\u0026dev-\u003emt76.mmio.wed);\n--\ndrivers/net/wireless/mediatek/mt76/tx.c=122=mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid,\n--\ndrivers/net/wireless/mediatek/mt76/tx.c-139-\t\t\t IEEE80211_TX_CTL_RATE_CTRL_PROBE))) {\ndrivers/net/wireless/mediatek/mt76/tx.c:140:\t\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/tx.c-141-\t\t ((info-\u003eflags \u0026 IEEE80211_TX_CTL_HW_80211_ENCAP) ||\n--\ndrivers/net/wireless/mediatek/mt76/tx.c=860=int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi)\n--\ndrivers/net/wireless/mediatek/mt76/tx.c-878-#ifdef CONFIG_NET_MEDIATEK_SOC_WED\ndrivers/net/wireless/mediatek/mt76/tx.c:879:\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/tx.c-880-\t token \u003e= dev-\u003emmio.wed.wlan.token_start)\n--\ndrivers/net/wireless/mediatek/mt76/tx.c=912=mt76_token_release(struct mt76_dev *dev, int token, bool *wake)\n--\ndrivers/net/wireless/mediatek/mt76/tx.c-928-#ifdef CONFIG_NET_MEDIATEK_SOC_WED\ndrivers/net/wireless/mediatek/mt76/tx.c:929:\t\tif (mtk_wed_device_active(\u0026dev-\u003emmio.wed) \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/tx.c-930-\t\t token \u003e= dev-\u003emmio.wed.wlan.token_start \u0026\u0026\n--\ndrivers/net/wireless/mediatek/mt76/wed.c=93=int mt76_wed_dma_setup(struct mt76_dev *dev, struct mt76_queue *q, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/wed.c-101-\tflags = q-\u003eflags;\ndrivers/net/wireless/mediatek/mt76/wed.c:102:\tif (!q-\u003ewed || !mtk_wed_device_active(q-\u003ewed))\ndrivers/net/wireless/mediatek/mt76/wed.c-103-\t\tq-\u003eflags \u0026= ~MT_QFLAG_WED;\n--\ndrivers/net/wireless/mediatek/mt76/wed.c=183=int mt76_wed_net_setup_tc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,\n--\n\n"
} |
| 29/2 | 2026/07/21 08:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 48985 output: 30 thoughts: 47 Thoughts: **Investigating the `mtk_wed_device_active` Definition** Okay, so I'm trying to track down where this `mtk_wed_device_active` variable is defined. My initial hunch is that it's likely residing within the `include/linux/soc/mediatek/mtk_wed.h` header file. It seems a logical place to start, given the naming convention suggesting a MediaTek Wideband Echo Cancellation (WED) context. Time to confirm this by digging into the code and verifying the definition's location and purpose. |
| 30/2 | 2026/07/21 09:00 | tool | grepper |
0mArgs:{
"Expression": "mtk_wed_device_active",
"PathPrefix": "include/"
}Results: {
"Output": "include/linux/soc/mediatek/mtk_wed.h=264=static inline bool mtk_wed_is_amsdu_supported(struct mtk_wed_device *dev)\n--\ninclude/linux/soc/mediatek/mtk_wed.h-273-#ifdef CONFIG_NET_MEDIATEK_SOC_WED\ninclude/linux/soc/mediatek/mtk_wed.h:274:#define mtk_wed_device_active(_dev) !!(_dev)-\u003eops\ninclude/linux/soc/mediatek/mtk_wed.h-275-#define mtk_wed_device_detach(_dev) (_dev)-\u003eops-\u003edetach(_dev)\n--\ninclude/linux/soc/mediatek/mtk_wed.h-308-#else\ninclude/linux/soc/mediatek/mtk_wed.h:309:static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)\ninclude/linux/soc/mediatek/mtk_wed.h-310-{\n"
} |
| 31/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 49443 output: 40 thoughts: 123 Thoughts: **Analyzing the `mtk_wed_device_active` Function** Okay, so `mtk_wed_device_active` really just does a simple check: `!!(_dev)->ops`. Nothing too complex there. But, hold on... if we're dealing with a USB device, `dev->mmio` isn't actually valid. That's a key point. This means `dev->mmio.wed.ops` is going to be reading garbage directly from `dev->usb`. And that *could* result in a non-NULL value, which would be problematic. Right, I need to remember that `dev->mmio.wed` is at some fixed offset within `dev->mmio`. When it's a USB device, the system uses `dev->usb` instead of `dev->mmio`. Time to cross-reference with the definitions for `struct mt76_usb` and `struct mt76_mmio`. I need to figure out what's going on with those structures. |
| 32/2 | 2026/07/21 09:00 | tool | grepper |
0mArgs:{
"Expression": "struct mt76_usb \\{",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt76.h=649=struct mt76_mcu {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-662-#define MCU_RESP_URB_SIZE\t1024\ndrivers/net/wireless/mediatek/mt76/mt76.h:663:struct mt76_usb {\ndrivers/net/wireless/mediatek/mt76/mt76.h-664-\tstruct mutex usb_ctrl_mtx;\n"
} |
| 33/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 49976 output: 46 thoughts: 22 Thoughts: Okay, let's dive into this code. **Diving Deep into mt76 Structures** Alright, I need to get a clear picture of how this mt76 driver is structured. I'm going to start by comparing the `struct mt76_usb` and `struct mt76_mmio` definitions. As an expert, I'm already anticipating some of the key differences: how the hardware access is handled, interrupt mechanisms, and the overall device initialization flow. `mt76_usb` should have a USB-specific descriptor, likely for handling endpoints and transfer buffers. `mt76_mmio`, on the other hand, will probably have register offsets and possibly PCI or other memory mapped IO details. I'll need to look closely at these differences to really understand the divergence of design. This comparison will give me a good handle on how the core mt76 functionality is adapted for different hardware interfaces. I'll be looking for shared elements, indicating a common core, and also the adapter-specific parts that I'll need to isolate if I'm planning to work on a different platform. |
| 34/2 | 2026/07/21 09:00 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt76.h",
"FirstLine": 663,
"LineCount": 50
}Results: {
"Contents": " 663:\tstruct mt76_usb {\n 664:\t\tstruct mutex usb_ctrl_mtx;\n 665:\t\tu8 *data;\n 666:\t\tu16 data_len;\n 667:\t\n 668:\t\tstruct mt76_worker status_worker;\n 669:\t\tstruct mt76_worker rx_worker;\n 670:\t\n 671:\t\tstruct work_struct stat_work;\n 672:\t\n 673:\t\tu8 out_ep[__MT_EP_OUT_MAX];\n 674:\t\tu8 in_ep[__MT_EP_IN_MAX];\n 675:\t\tbool sg_en;\n 676:\t\n 677:\t\tstruct mt76u_mcu {\n 678:\t\t\tu8 *data;\n 679:\t\t\t/* multiple reads */\n 680:\t\t\tstruct mt76_reg_pair *rp;\n 681:\t\t\tint rp_len;\n 682:\t\t\tu32 base;\n 683:\t\t} mcu;\n 684:\t};\n 685:\t\n 686:\t#define MT76S_XMIT_BUF_SZ\t0x3fe00\n 687:\t#define MT76S_NUM_TX_ENTRIES\t256\n 688:\t#define MT76S_NUM_RX_ENTRIES\t512\n 689:\tstruct mt76_sdio {\n 690:\t\tstruct mt76_worker txrx_worker;\n 691:\t\tstruct mt76_worker status_worker;\n 692:\t\tstruct mt76_worker net_worker;\n 693:\t\tstruct mt76_worker stat_worker;\n 694:\t\n 695:\t\tu8 *xmit_buf;\n 696:\t\tu32 xmit_buf_sz;\n 697:\t\n 698:\t\tstruct sdio_func *func;\n 699:\t\tvoid *intr_data;\n 700:\t\tu8 hw_ver;\n 701:\t\twait_queue_head_t wait;\n 702:\t\n 703:\t\tint pse_mcu_quota_max;\n 704:\t\tstruct {\n 705:\t\t\tint pse_data_quota;\n 706:\t\t\tint ple_data_quota;\n 707:\t\t\tint pse_mcu_quota;\n 708:\t\t\tint pse_page_size;\n 709:\t\t\tint deficit;\n 710:\t\t} sched;\n 711:\t\n 712:\t\tint (*parse_irq)(struct mt76_dev *dev, struct mt76s_intr *intr);\n"
} |
| 35/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 51000 output: 41 thoughts: 13 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Diving into `struct mt76_mmio`** Okay, let's get down to brass tacks. Time to dissect `struct mt76_mmio`. I know it's a critical structure, likely holding the base addresses and related parameters for interacting with the MediaTek 76xx WiFi hardware. I'm going to look for hints about how the driver maps the physical MMIO regions into virtual memory, and how it handles potential address remapping if the device isn't in a fixed location. I'm immediately scanning for members that look like register offsets, and also for fields that might indicate bus-specific configuration, maybe PCIe BAR information or some kind of IOMMU setup if this is used. I'll be particularly interested in any synchronization primitives or locking mechanisms used around this struct to ensure proper access from multiple threads or interrupt handlers. This is where the magic (or the bugs) are often found. Finally, I'll pay close attention to the definition's size and any alignment requirements; that can reveal a lot about the architectural assumptions of the driver. Let's see what secrets it holds. |
| 36/2 | 2026/07/21 09:00 | tool | grepper |
0mArgs:{
"Expression": "struct mt76_mmio \\{",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt76.h=689=struct mt76_sdio {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-714-\ndrivers/net/wireless/mediatek/mt76/mt76.h:715:struct mt76_mmio {\ndrivers/net/wireless/mediatek/mt76/mt76.h-716-\tvoid __iomem *regs;\n"
} |
| 37/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 51443 output: 46 thoughts: 15 Thoughts: Here's my take on those thoughts, tailored for an expert audience: **Diving into the `mt76_mmio` Structure** Okay, let's get down to brass tacks. I need to understand how the `mt76_mmio` structure is defined. Specifically, I want to refresh my memory on the layout, members, and purpose of this structure. I'm going to look at the exact definition itself. It's crucial to have a concrete understanding of this structure before making any changes. I need a clear picture in my mind regarding how the registers are mapped, the bitfields used, and how it all hangs together. Only then can I be confident in my next steps, whether I'm debugging, optimizing, or refactoring related code. Grabbing the definition is the only way to do it. |
| 38/2 | 2026/07/21 09:00 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt76.h",
"FirstLine": 715,
"LineCount": 50
}Results: {
"Contents": " 715:\tstruct mt76_mmio {\n 716:\t\tvoid __iomem *regs;\n 717:\t\tspinlock_t irq_lock;\n 718:\t\tu32 irqmask;\n 719:\t\n 720:\t\tstruct mtk_wed_device wed;\n 721:\t\tstruct mtk_wed_device wed_hif2;\n 722:\t\tstruct completion wed_reset;\n 723:\t\tstruct completion wed_reset_complete;\n 724:\t\n 725:\t\tstruct airoha_ppe_dev __rcu *ppe_dev;\n 726:\t\tstruct airoha_npu __rcu *npu;\n 727:\t\tphys_addr_t phy_addr;\n 728:\t\tint npu_type;\n 729:\t};\n 730:\t\n 731:\tstruct mt76_rx_status {\n 732:\t\tunion {\n 733:\t\t\tstruct mt76_wcid *wcid;\n 734:\t\t\tu16 wcid_idx;\n 735:\t\t};\n 736:\t\n 737:\t\tu32 reorder_time;\n 738:\t\n 739:\t\tu32 ampdu_ref;\n 740:\t\tu32 timestamp;\n 741:\t\n 742:\t\tu8 iv[6];\n 743:\t\n 744:\t\tu8 phy_idx:2;\n 745:\t\tu8 aggr:1;\n 746:\t\tu8 qos_ctl;\n 747:\t\tu16 seqno;\n 748:\t\n 749:\t\tu16 freq;\n 750:\t\tu32 flag;\n 751:\t\tu8 enc_flags;\n 752:\t\tu8 encoding:3, bw:4;\n 753:\t\tunion {\n 754:\t\t\tstruct {\n 755:\t\t\t\tu8 he_ru:3;\n 756:\t\t\t\tu8 he_gi:2;\n 757:\t\t\t\tu8 he_dcm:1;\n 758:\t\t\t};\n 759:\t\t\tstruct {\n 760:\t\t\t\tu8 ru:4;\n 761:\t\t\t\tu8 gi:2;\n 762:\t\t\t} eht;\n 763:\t\t};\n 764:\t\n"
} |
| 39/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 52317 output: 42 thoughts: 792 Thoughts: **Analyzing a Potential RX Aggregation Bug in mt76** Okay, so I'm looking at this `mt76` code and I think I've spotted a functional bug. It looks like the layout of the `mt76_mmio` and `mt76_usb` structs are overlapping, specifically where the `wed` member in the `mmio` struct is at offset 16 (assuming 64-bit pointers), and `status_worker` is in `mt76_usb`. This means there's a memory overlap, and the `mmio`'s `npu` field is likely also overlapping with things in `mt76_usb`, like `in_ep` or `mcu`. The problem arises when some non-zero values in the USB side of things make it look like the `mmio`'s `npu` field is active when it shouldn't be. Consequently, `mt76_npu_device_active` can incorrectly return true. Then in `mt76_rx_poll_complete`, the code ends up queuing packets with `__skb_queue_tail` instead of performing the appropriate RX aggregation reordering, breaking the USB device behavior. It seems the patch fixes this by checking `mt76_is_mmio(dev)` *before* checking if the device is actually active within `mt76_npu_device_active` and `mt76_ppe_device_active`. Now, I need to make sure I'm thinking about the complete picture here. I wonder if `mtk_wed_device_active` has the same bug, since it's also called in `mt76_rx_poll_complete`. Let's check the code... ah, yes, `mtk_wed_device_active` *also* seems susceptible to the overlap issue, as it uses the same `wed` field. The good news is that it checks `!!(_dev)->ops`, which offers *some* protection. If `dev->mmio.wed.ops` overlaps with some non-zero USB field, it might still return true, however the patch is limited in addressing this in other parts of the codebase. So, in summary, this patch is a functional fix for USB and SDIO devices, adding a check for `mt76_is_mmio` in `mt76_npu_device_active` and `mt76_ppe_device_active`. Now, I really think this needs some serious fuzzing to make sure this is actually caught and handled. Focusing in, I'm thinking of looking at `mt76_rx_poll_complete`, `mt76u_process_rx_queue`, and also `mt76_dma_rx_cleanup` and `mt76_dma_rx_reset`. Wait, `mt76_dma_rx_cleanup` is only for DMA devices, so that's not relevant here since we're fixing a bug in the code that's shared between both device types, like `mt76_rx_poll_complete`. That's where I need to focus. I want to check where `mt76_ppe_device_active` is used, also. |
| 40/2 | 2026/07/21 09:00 | tool | grepper |
0mArgs:{
"Expression": "mt76_ppe_device_active",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt76.h=1737=static inline bool mt76_npu_device_active(struct mt76_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-1741-\ndrivers/net/wireless/mediatek/mt76/mt76.h:1742:static inline bool mt76_ppe_device_active(struct mt76_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt76.h-1743-{\n"
} |
| 41/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 54017 output: 29 thoughts: 47 Thoughts: Here's my thought process, as if I were considering this issue: **Investigating a Potentially Unused Variable in mt76** Okay, so `mt76_ppe_device_active`... that's a bit odd. I'm pretty familiar with the `mt76` driver, and that name doesn't immediately ring a bell. My initial suspicion is that it might be unused, or, at best, underutilized. The code is usually well-organized, so finding something like this is unusual. Let's confirm this by searching the entire source tree for the variable `mt76_ppe_device_active`. We need to be absolutely certain before concluding anything. It's possible it's used in some obscure corner of the codebase, or maybe it's used conditionally, and I missed it previously. A comprehensive search will give us the definitive answer. |
| 42/2 | 2026/07/21 09:00 | tool | grepper |
0mArgs:{
"Expression": "mt76_ppe_device_active",
"PathPrefix": ""
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt76.h=1737=static inline bool mt76_npu_device_active(struct mt76_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-1741-\ndrivers/net/wireless/mediatek/mt76/mt76.h:1742:static inline bool mt76_ppe_device_active(struct mt76_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt76.h-1743-{\n"
} |
| 43/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 54441 output: 43 thoughts: 132 Thoughts: **Investigating the Usage of `mt76_npu_device_active`** Okay, so I'm looking at this bit of code and I see `mt76_npu_device_active`...and it's not immediately obvious where it's being *directly* called. Hmm, could it be part of a larger patch, or is it perhaps just a utility function? Need to dig deeper. Let's see… I know `mt76_npu_device_active` *is* used in `mt76_rx_poll_complete`, `mt76_npu_check_ppe`, and `mt76_npu_net_setup_tc`. Interesting. I seem to recall that `mt76_npu_check_ppe` is sometimes invoked from `mt76_rx_poll_complete`, so let me quickly verify that… nope, let’s double-check how `mt76_npu_check_ppe` itself is being called. That's the key. |
| 44/2 | 2026/07/21 09:00 | tool | grepper |
0mArgs:{
"Expression": "mt76_npu_check_ppe",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt76.h=1648=int mt76_testmode_alloc_skb(struct mt76_phy *phy, u32 len);\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-1650-#ifdef CONFIG_MT76_NPU\ndrivers/net/wireless/mediatek/mt76/mt76.h:1651:void mt76_npu_check_ppe(struct mt76_dev *dev, struct sk_buff *skb,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1652-\t\t\tu32 info);\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1667=int mt76_npu_send_txrx_addr(struct mt76_dev *dev, int ifindex,\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-1670-#else\ndrivers/net/wireless/mediatek/mt76/mt76.h:1671:static inline void mt76_npu_check_ppe(struct mt76_dev *dev,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1672-\t\t\t\t struct sk_buff *skb, u32 info)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=411=mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-683-\t\t\t\t *info);\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:684:\t\tmt76_npu_check_ppe(\u0026dev-\u003emt76, skb, *info);\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-685-\t}\n--\ndrivers/net/wireless/mediatek/mt76/npu.c=62=static struct sk_buff *mt76_npu_dequeue(struct mt76_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/npu.c-115-\ndrivers/net/wireless/mediatek/mt76/npu.c:116:void mt76_npu_check_ppe(struct mt76_dev *dev, struct sk_buff *skb,\ndrivers/net/wireless/mediatek/mt76/npu.c-117-\t\t\tu32 info)\n--\ndrivers/net/wireless/mediatek/mt76/npu.c-141-}\ndrivers/net/wireless/mediatek/mt76/npu.c:142:EXPORT_SYMBOL_GPL(mt76_npu_check_ppe);\ndrivers/net/wireless/mediatek/mt76/npu.c-143-\n"
} |
| 45/2 | 2026/07/21 09:00 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 55623 output: 44 thoughts: 827 Thoughts: **Analyzing the MT76 NPU Device Active Check** Okay, so I'm digging into this `mt7996_mac_fill_rx` function, and it calls `mt76_npu_check_ppe`. I know `mt7996` is PCIe-only, so the only place `mt76_npu_device_active` gets called for USB/SDIO devices is within `mt76_rx_poll_complete`. Let me circle back to that `mt76_rx_poll_complete` function. Right, it's called from both `mt76u_process_rx_queue` and `mt76s_process_rx_queue`. My focus needs to be on: * `mt76_rx_poll_complete` * `mt76u_process_rx_queue` * `mt76s_process_rx_queue` Okay, let's confirm that `mt76_rx_poll_complete` is indeed reachable. Yup, it's in the NAPI poll loop for USB RX. When a packet arrives via USB, `mt76u_process_rx_queue` gets called. This dequeues SKBs and then calls `mt76_rx_poll_complete`. The core of the problem is that if `mt76_npu_device_active` incorrectly returns true, we end up calling `__skb_queue_tail` instead of `mt76_rx_aggr_reorder`. This means we bypass the aggregation reordering logic. That's a bad thing. It could cause out-of-order packets or even memory leaks if the reorder buffer has dependencies. By fixing this, packets will flow through `mt76_rx_aggr_reorder` properly. Now, which configurations do I need to enable to trigger this? I've got: * `MT76_CORE` * `MT76_USB` * `MT76_SDIO` * `MT7921U` * `MT7925U` * `MT76x0U` * `MT76x2U` * `MT7663U` * `MT7663S` * `MT7921S` Let me quickly list them: * `MT76_CORE` * `MT76_USB` * `MT76_SDIO` * `MT76x0U` * `MT76x2U` * `MT7663U` * `MT7663S` * `MT7921U` * `MT7921S` * `MT7925U` Wait a second, there's `MT76_NPU`. Should I add that too? The fix addresses the case where `MT76_NPU` might be enabled (or a pointer is accessed) but the device isn't MMIO. But `mt76_npu_device_active` accesses `dev->mmio.npu`. If `MT76_NPU` isn't enabled, does that mean `dev->mmio.npu` doesn't exist? Let me double-check the `struct mt76_mmio` definition. Right, `struct airoha_npu __rcu *npu;` is *always* there, it's not under an `#ifdef CONFIG_MT76_NPU`. Hmm, but `MT76_NPU` might still be needed to compile `npu.c`. To be safe, let's include `MT76_NPU`. Okay, the refined focus symbols now become: * `mt76_rx_poll_complete` * `mt76u_process_rx_queue` * `mt76s_process_rx_queue` * `mt76_rx_aggr_reorder` (because this is the function we want to make sure gets called) And finally, let's check `mt76_rx_aggr_reorder`. |
| 46/2 | 2026/07/21 09:01 | tool | grepper |
0mArgs:{
"Expression": "mt76_rx_aggr_reorder",
"PathPrefix": "drivers/net/wireless/mediatek/mt76/"
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/agg-rx.c=90=static void\ndrivers/net/wireless/mediatek/mt76/agg-rx.c:91:mt76_rx_aggr_reorder_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/agg-rx.c-92-{\n--\ndrivers/net/wireless/mediatek/mt76/agg-rx.c=119=mt76_rx_aggr_check_ctl(struct sk_buff *skb, struct sk_buff_head *frames)\n--\ndrivers/net/wireless/mediatek/mt76/agg-rx.c-147-\ndrivers/net/wireless/mediatek/mt76/agg-rx.c:148:void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames)\ndrivers/net/wireless/mediatek/mt76/agg-rx.c-149-{\n--\ndrivers/net/wireless/mediatek/mt76/agg-rx.c=244=int mt76_rx_aggr_start(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno,\n--\ndrivers/net/wireless/mediatek/mt76/agg-rx.c-258-\ttid-\u003enum = tidno;\ndrivers/net/wireless/mediatek/mt76/agg-rx.c:259:\tINIT_DELAYED_WORK(\u0026tid-\u003ereorder_work, mt76_rx_aggr_reorder_work);\ndrivers/net/wireless/mediatek/mt76/agg-rx.c-260-\tspin_lock_init(\u0026tid-\u003elock);\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1554=void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1567-\t\telse\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1568:\t\t\tmt76_rx_aggr_reorder(skb, \u0026frames);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1569-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1795=void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1796-\t\t\t struct napi_struct *napi);\ndrivers/net/wireless/mediatek/mt76/mt76.h:1797:void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames);\ndrivers/net/wireless/mediatek/mt76/mt76.h-1798-void mt76_testmode_tx_pending(struct mt76_phy *phy);\n"
} |
| 47/2 | 2026/07/21 09:01 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 58260 output: 337 thoughts: 369 Thoughts: **Analyzing the RX Aggregation Fix** Okay, after reviewing this patch, I'm zeroing in on `mt76_rx_aggr_reorder` as the crucial focus symbol. Let's break down the reasoning, because this seems like a solid, well-defined problem. The issue stems from a subtle flaw within `mt76_npu_device_active` and `mt76_ppe_device_active`. It seems these functions were, under certain circumstances, misidentifying non-MMIO devices – specifically USB and SDIO ones – as active MMIO devices. This occurs because the functions were accessing fields within a union structure. The data layout overlapped between MMIO and USB/SDIO specific data, leading to the incorrect true return. The ripple effect is significant. This incorrect return value would cause the RX path, within `mt76_rx_poll_complete`, to bypass the crucial RX aggregation reordering step implemented in `mt76_rx_aggr_reorder` for these USB/SDIO devices. That's a direct route to packet loss and out-of-order delivery. Not good, and exactly the kind of thing you'd uncover through USB fuzzing. The fix, as I understand it, is straightforward. The patch introduces an `mt76_is_mmio(dev)` check. This simple addition is all that's needed to properly identify whether a device is, in fact, an MMIO device. This avoids the faulty logic in the existing functions and ensures the correct RX path is taken for the affected USB/SDIO devices, thus restoring the aggregation reordering. The potential for this to manifest under USB fuzzing makes it a solid functional fix, a good catch. My focus symbols are: `mt76_rx_poll_complete`, `mt76u_process_rx_queue`, `mt76s_process_rx_queue`, and especially, `mt76_rx_aggr_reorder`. The relevant configurations seem to be: `MT76_CORE`, `MT76_USB`, `MT76_SDIO`, and any of the USB device drivers ( `MT76x0U`, `MT76x2U`, `MT7663U`, `MT7921U`, `MT7925U` and `MT7663S`, `MT7921S`). Okay, with that clear in my mind, I'm ready to `set-results`. |
| 48/2 | 2026/07/21 09:01 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"MT76_CORE",
"MT76_USB",
"MT76_SDIO",
"MT76x0U",
"MT76x2U",
"MT7663U",
"MT7663S",
"MT7921U",
"MT7921S",
"MT7925U",
"MT76_NPU"
],
"FocusSymbols": [
"mt76_rx_poll_complete",
"mt76u_process_rx_queue",
"mt76s_process_rx_queue",
"mt76_rx_aggr_reorder"
],
"Reasoning": "The patch fixes a bug in `mt76_npu_device_active` and `mt76_ppe_device_active` where they could incorrectly return true for non-MMIO devices (like USB or SDIO) by accessing fields in a union that overlap with USB/SDIO specific data. This incorrect return value caused the RX path in `mt76_rx_poll_complete` to bypass RX aggregation reordering (`mt76_rx_aggr_reorder`) for USB/SDIO devices. By adding the `mt76_is_mmio(dev)` check, the code correctly identifies MMIO devices and restores the proper RX path for USB/SDIO devices. This is a functional fix reachable via USB fuzzing.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"MT76_CORE",
"MT76_USB",
"MT76_SDIO",
"MT76x0U",
"MT76x2U",
"MT7663U",
"MT7663S",
"MT7921U",
"MT7921S",
"MT7925U",
"MT76_NPU"
],
"FocusSymbols": [
"mt76_rx_poll_complete",
"mt76u_process_rx_queue",
"mt76s_process_rx_queue",
"mt76_rx_aggr_reorder"
],
"Reasoning": "The patch fixes a bug in `mt76_npu_device_active` and `mt76_ppe_device_active` where they could incorrectly return true for non-MMIO devices (like USB or SDIO) by accessing fields in a union that overlap with USB/SDIO specific data. This incorrect return value caused the RX path in `mt76_rx_poll_complete` to bypass RX aggregation reordering (`mt76_rx_aggr_reorder`) for USB/SDIO devices. By adding the `mt76_is_mmio(dev)` check, the code correctly identifies MMIO devices and restores the proper RX path for USB/SDIO devices. This is a functional fix reachable via USB fuzzing.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|