AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/09/29 00:10 flow patch-triage
4m Args:
null

Results:
{
  "EnableConfigs": [
    "MAC80211",
    "USB",
    "MT7921U",
    "MT7925U",
    "MT7921_COMMON",
    "MT7925_COMMON",
    "MT792x_USB"
  ],
  "FocusSymbols": [
    "mt792xu_disconnect",
    "mt7921_mac_reset_work",
    "mt7921_mcu_parse_response",
    "mt7921_cancel_remain_on_channel",
    "mt7925_mac_reset_work",
    "mt7925_mcu_parse_response",
    "mt7925_cancel_remain_on_channel"
  ],
  "KMSANReasoning": "The patch modifies state checks and teardown sequencing in the MediaTek mt76 wireless driver (mt7921, mt7925, and common USB code) to properly handle device removal (checking MT76_REMOVED, canceling work items earlier, and avoiding resets/commands on unplugged devices). These changes strictly deal with device teardown, cancellation of work queues, and prevention of use-after-free or race conditions during device disconnect. There are no allocations, no uninitialized variables or struct fields, no changes to buffer bounds or sizes, and no data transferred to user space. Such concurrency and lifetime issues are covered by KASAN and standard kernel debuggers; KMSAN is neither relevant nor required.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch modifies MediaTek mt7921, mt7925, and shared mt792x USB wireless drivers to properly handle MT76_REMOVED during device disconnect, work cancellation, MAC reset, abort ROC, and MCU parse response timeouts. The USB drivers (MT7921U and MT7925U) are accessible and testable via syzkaller through raw-gadget USB emulation (syz_usb_connect/disconnect). The changes alter control flow and work synchronization during device removal and reset operations, making them worth fuzzing.",
  "WorthFuzzing": true
}

1/1 2026/09/29 00:10 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit b3e77860ea864be0a7fa22c5bee4dfdd0ae0c668\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Tue Sep 29 00:10:40 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c\nindex e69978184f68c..7a43472db51bf 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c\n@@ -664,6 +664,9 @@ void mt7921_mac_reset_work(struct work_struct *work)\n \tstruct mt76_connac_pm *pm = \u0026dev-\u003epm;\n \tint i, ret;\n \n+\tif (test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state))\n+\t\treturn;\n+\n \tdev_dbg(dev-\u003emt76.dev, \"chip reset\\n\");\n \tset_bit(MT76_RESET, \u0026dev-\u003emphy.state);\n \tdev-\u003ehw_full_reset = true;\n@@ -674,6 +677,9 @@ void mt7921_mac_reset_work(struct work_struct *work)\n \tcancel_work_sync(\u0026pm-\u003ewake_work);\n \n \tfor (i = 0; i \u003c 10; i++) {\n+\t\tif (test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state))\n+\t\t\tgoto out;\n+\n \t\tif (atomic_read(\u0026dev-\u003emt76.bus_hung))\n \t\t\treturn;\n \n@@ -700,9 +706,13 @@ void mt7921_mac_reset_work(struct work_struct *work)\n \t\tieee80211_scan_completed(dev-\u003emphy.hw, \u0026info);\n \t}\n \n+out:\n \tdev-\u003ehw_full_reset = false;\n-\tclear_bit(MT76_RESET, \u0026dev-\u003emphy.state);\n \tpm-\u003esuspended = false;\n+\tif (test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state))\n+\t\treturn;\n+\n+\tclear_bit(MT76_RESET, \u0026dev-\u003emphy.state);\n \tieee80211_wake_queues(hw);\n \tieee80211_iterate_active_interfaces(hw,\n \t\t\t\t\t    IEEE80211_IFACE_ITER_RESUME_ALL,\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c\nindex 68a059504e838..f189a8a13be04 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c\n@@ -410,6 +410,11 @@ static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)\n \ttimer_delete_sync(\u0026phy-\u003eroc_timer);\n \tcancel_work_sync(\u0026phy-\u003eroc_work);\n \n+\tif (test_bit(MT76_REMOVED, \u0026phy-\u003emt76-\u003estate)) {\n+\t\tclear_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate);\n+\t\treturn 0;\n+\t}\n+\n \tmt792x_mutex_acquire(phy-\u003edev);\n \tif (test_and_clear_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate))\n \t\terr = mt7921_mcu_abort_roc(phy, vif, phy-\u003eroc_token_id);\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c\nindex 40546005c743b..a1dd9d83fb80e 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c\n@@ -20,9 +20,14 @@ int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,\n \tint ret = 0;\n \n \tif (!skb) {\n-\t\tdev_err(mdev-\u003edev, \"Message %08x (seq %d) timeout\\n\",\n-\t\t\tcmd, seq);\n-\t\tmt792x_reset(mdev);\n+\t\tstruct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);\n+\n+\t\tif (!test_bit(MT76_MCU_RESET, \u0026dev-\u003emphy.state) \u0026\u0026\n+\t\t    !test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state)) {\n+\t\t\tdev_err(mdev-\u003edev, \"Message %08x (seq %d) timeout\\n\",\n+\t\t\t\tcmd, seq);\n+\t\t\tmt792x_reset(mdev);\n+\t\t}\n \n \t\treturn -ETIMEDOUT;\n \t}\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c\nindex 101f571b027f1..a48082ac091fc 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c\n@@ -1516,6 +1516,9 @@ void mt7925_mac_reset_work(struct work_struct *work)\n \tstruct mt76_connac_pm *pm = \u0026dev-\u003epm;\n \tint i, ret;\n \n+\tif (test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state))\n+\t\treturn;\n+\n \tif (atomic_read(\u0026dev-\u003emt76.bus_hung))\n \t\treturn;\n \ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c\nindex 5993b31e1aae4..c88219dd0a6a7 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c\n@@ -556,6 +556,11 @@ static int mt7925_abort_roc(struct mt792x_phy *phy,\n \ttimer_delete_sync(\u0026phy-\u003eroc_timer);\n \tcancel_work_sync(\u0026phy-\u003eroc_work);\n \n+\tif (test_bit(MT76_REMOVED, \u0026phy-\u003emt76-\u003estate)) {\n+\t\tclear_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate);\n+\t\treturn 0;\n+\t}\n+\n \tmt792x_mutex_acquire(phy-\u003edev);\n \tif (test_and_clear_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate))\n \t\terr = mt7925_mcu_abort_roc(phy, mconf, phy-\u003eroc_token_id);\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c\nindex fa29c486a4553..211118f416468 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c\n@@ -27,8 +27,14 @@ int mt7925_mcu_parse_response(struct mt76_dev *mdev, int cmd,\n \tint ret = 0;\n \n \tif (!skb) {\n-\t\tdev_err(mdev-\u003edev, \"Message %08x (seq %d) timeout\\n\", cmd, seq);\n-\t\tmt792x_reset(mdev);\n+\t\tstruct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);\n+\n+\t\tif (!test_bit(MT76_MCU_RESET, \u0026dev-\u003emphy.state) \u0026\u0026\n+\t\t    !test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state)) {\n+\t\t\tdev_err(mdev-\u003edev, \"Message %08x (seq %d) timeout\\n\",\n+\t\t\t\tcmd, seq);\n+\t\t\tmt792x_reset(mdev);\n+\t\t}\n \n \t\treturn -ETIMEDOUT;\n \t}\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c\nindex 850f6b2cfc4aa..b41903cfec40b 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c\n@@ -501,6 +501,7 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)\n \tif (!dev)\n \t\treturn;\n \n+\tset_bit(MT76_REMOVED, \u0026dev-\u003emphy.state);\n \tset_bit(MT76_RESET, \u0026dev-\u003emphy.state);\n \tset_bit(MT76_MCU_RESET, \u0026dev-\u003emphy.state);\n \tclear_bit(MT76_STATE_RUNNING, \u0026dev-\u003emphy.state);\n@@ -509,16 +510,15 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)\n \n \tcancel_work_sync(\u0026dev-\u003ereset_work);\n \tcancel_work_sync(\u0026dev-\u003einit_work);\n-\tmt76_worker_disable(\u0026dev-\u003emt76.tx_worker);\n+\tcancel_delayed_work_sync(\u0026dev-\u003emphy.mac_work);\n+\tcancel_delayed_work_sync(\u0026dev-\u003epm.ps_work);\n+\tcancel_work_sync(\u0026dev-\u003epm.wake_work);\n \tmt792xu_reset_work_cleanup(dev);\n-\tif (!test_bit(MT76_STATE_INITIALIZED, \u0026dev-\u003emphy.state)) {\n-\t\tset_bit(MT76_REMOVED, \u0026dev-\u003emphy.state);\n+\tif (!test_bit(MT76_STATE_INITIALIZED, \u0026dev-\u003emphy.state))\n \t\treturn;\n-\t}\n \n \tmt76_unregister_device(\u0026dev-\u003emt76);\n \tmt792xu_cleanup(dev);\n-\tset_bit(MT76_REMOVED, \u0026dev-\u003emphy.state);\n \n \tusb_set_intfdata(usb_intf, NULL);\n \n"
}

2/1 2026/09/29 00:10 agent patch-evaluator
3m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "MAC80211",
    "USB",
    "MT7921U",
    "MT7925U",
    "MT7921_COMMON",
    "MT7925_COMMON",
    "MT792x_USB"
  ],
  "FocusSymbols": [
    "mt792xu_disconnect",
    "mt7921_mac_reset_work",
    "mt7921_mcu_parse_response",
    "mt7921_cancel_remain_on_channel",
    "mt7925_mac_reset_work",
    "mt7925_mcu_parse_response",
    "mt7925_cancel_remain_on_channel"
  ],
  "Reasoning": "The patch modifies MediaTek mt7921, mt7925, and shared mt792x USB wireless drivers to properly handle MT76_REMOVED during device disconnect, work cancellation, MAC reset, abort ROC, and MCU parse response timeouts. The USB drivers (MT7921U and MT7925U) are accessible and testable via syzkaller through raw-gadget USB emulation (syz_usb_connect/disconnect). The changes alter control flow and work synchronization during device removal and reset operations, making them worth fuzzing.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.

================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.

- REACHABILITY IS THE PRIMARY GATE:
  Fuzzing can only discover bugs in code that can actually execute in standard virtualized
  environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
  If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
  regardless of whether it adds assertions or complex logic.

- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
  Patch authors routinely label changes as "cleanups", "refactorings", or state
  "No functional change intended". Do NOT take these claims at face value.
  Code refactorings that rearrange logic, introduce helper functions, or alter state management
  in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
  If reachable executable code is modified or refactored, it MUST be fuzzed.

- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
  When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
  BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
  Even if the author believes the invariant always holds, fuzzing is essential to verify whether
  an unusual sequence of operations can violate it.

================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:

- Non-kernel and non-executable changes:
  * Modifications to Documentation/, comments, or spelling fixes.
  * User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
    that do not affect the compiled kernel image (vmlinux) or kernel modules.
  * Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
    that do not alter control flow or data structures.
  * Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
  * Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
    ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
  * Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
    physical PCI hot-unplug or manual sysfs driver unbinding.
  * Code paths exclusive to architectures other than the target architecture.

================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
  * Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
    BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
  * Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
  * Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
  * Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).

================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:

- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
  Do NOT list generic, ubiquitous functions called by almost every program in the corpus
  (including, but not limited to: general memory allocators and deallocators, page fault
  and trap handlers, or core synchronization primitives; this is not an exhaustive list).
  Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
  which severely dilutes fuzzing effort away from the actual changes.

- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
  List functions that specifically implement the logic being added or altered, or direct API entrypoints
  for the subsystem feature under review.

- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
  Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
  distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
  If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
  functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).

================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any '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:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit b3e77860ea864be0a7fa22c5bee4dfdd0ae0c668
Author: syz-cluster <triage@syzkaller.com>
Date:   Tue Sep 29 00:10:40 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index e69978184f68c..7a43472db51bf 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -664,6 +664,9 @@ void mt7921_mac_reset_work(struct work_struct *work)
 	struct mt76_connac_pm *pm = &dev->pm;
 	int i, ret;
 
+	if (test_bit(MT76_REMOVED, &dev->mphy.state))
+		return;
+
 	dev_dbg(dev->mt76.dev, "chip reset\n");
 	set_bit(MT76_RESET, &dev->mphy.state);
 	dev->hw_full_reset = true;
@@ -674,6 +677,9 @@ void mt7921_mac_reset_work(struct work_struct *work)
 	cancel_work_sync(&pm->wake_work);
 
 	for (i = 0; i < 10; i++) {
+		if (test_bit(MT76_REMOVED, &dev->mphy.state))
+			goto out;
+
 		if (atomic_read(&dev->mt76.bus_hung))
 			return;
 
@@ -700,9 +706,13 @@ void mt7921_mac_reset_work(struct work_struct *work)
 		ieee80211_scan_completed(dev->mphy.hw, &info);
 	}
 
+out:
 	dev->hw_full_reset = false;
-	clear_bit(MT76_RESET, &dev->mphy.state);
 	pm->suspended = false;
+	if (test_bit(MT76_REMOVED, &dev->mphy.state))
+		return;
+
+	clear_bit(MT76_RESET, &dev->mphy.state);
 	ieee80211_wake_queues(hw);
 	ieee80211_iterate_active_interfaces(hw,
 					    IEEE80211_IFACE_ITER_RESUME_ALL,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 68a059504e838..f189a8a13be04 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -410,6 +410,11 @@ static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)
 	timer_delete_sync(&phy->roc_timer);
 	cancel_work_sync(&phy->roc_work);
 
+	if (test_bit(MT76_REMOVED, &phy->mt76->state)) {
+		clear_bit(MT76_STATE_ROC, &phy->mt76->state);
+		return 0;
+	}
+
 	mt792x_mutex_acquire(phy->dev);
 	if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
 		err = mt7921_mcu_abort_roc(phy, vif, phy->roc_token_id);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 40546005c743b..a1dd9d83fb80e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -20,9 +20,14 @@ int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
 	int ret = 0;
 
 	if (!skb) {
-		dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
-			cmd, seq);
-		mt792x_reset(mdev);
+		struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
+
+		if (!test_bit(MT76_MCU_RESET, &dev->mphy.state) &&
+		    !test_bit(MT76_REMOVED, &dev->mphy.state)) {
+			dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
+				cmd, seq);
+			mt792x_reset(mdev);
+		}
 
 		return -ETIMEDOUT;
 	}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 101f571b027f1..a48082ac091fc 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -1516,6 +1516,9 @@ void mt7925_mac_reset_work(struct work_struct *work)
 	struct mt76_connac_pm *pm = &dev->pm;
 	int i, ret;
 
+	if (test_bit(MT76_REMOVED, &dev->mphy.state))
+		return;
+
 	if (atomic_read(&dev->mt76.bus_hung))
 		return;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 5993b31e1aae4..c88219dd0a6a7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -556,6 +556,11 @@ static int mt7925_abort_roc(struct mt792x_phy *phy,
 	timer_delete_sync(&phy->roc_timer);
 	cancel_work_sync(&phy->roc_work);
 
+	if (test_bit(MT76_REMOVED, &phy->mt76->state)) {
+		clear_bit(MT76_STATE_ROC, &phy->mt76->state);
+		return 0;
+	}
+
 	mt792x_mutex_acquire(phy->dev);
 	if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
 		err = mt7925_mcu_abort_roc(phy, mconf, phy->roc_token_id);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index fa29c486a4553..211118f416468 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -27,8 +27,14 @@ int mt7925_mcu_parse_response(struct mt76_dev *mdev, int cmd,
 	int ret = 0;
 
 	if (!skb) {
-		dev_err(mdev->dev, "Message %08x (seq %d) timeout\n", cmd, seq);
-		mt792x_reset(mdev);
+		struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
+
+		if (!test_bit(MT76_MCU_RESET, &dev->mphy.state) &&
+		    !test_bit(MT76_REMOVED, &dev->mphy.state)) {
+			dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
+				cmd, seq);
+			mt792x_reset(mdev);
+		}
 
 		return -ETIMEDOUT;
 	}
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
index 850f6b2cfc4aa..b41903cfec40b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
@@ -501,6 +501,7 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)
 	if (!dev)
 		return;
 
+	set_bit(MT76_REMOVED, &dev->mphy.state);
 	set_bit(MT76_RESET, &dev->mphy.state);
 	set_bit(MT76_MCU_RESET, &dev->mphy.state);
 	clear_bit(MT76_STATE_RUNNING, &dev->mphy.state);
@@ -509,16 +510,15 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)
 
 	cancel_work_sync(&dev->reset_work);
 	cancel_work_sync(&dev->init_work);
-	mt76_worker_disable(&dev->mt76.tx_worker);
+	cancel_delayed_work_sync(&dev->mphy.mac_work);
+	cancel_delayed_work_sync(&dev->pm.ps_work);
+	cancel_work_sync(&dev->pm.wake_work);
 	mt792xu_reset_work_cleanup(dev);
-	if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state)) {
-		set_bit(MT76_REMOVED, &dev->mphy.state);
+	if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state))
 		return;
-	}
 
 	mt76_unregister_device(&dev->mt76);
 	mt792xu_cleanup(dev);
-	set_bit(MT76_REMOVED, &dev->mphy.state);
 
 	usb_set_intfdata(usb_intf, NULL);
 

3/2 2026/09/29 00:10 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 5695
							output: 21
							thoughts: 395
						

Thoughts:
**Analyzing This Patch for Syzkaller Fuzzing Potential**

Okay, let's break this down. The first step is always to understand what this patch actually touches. We've got changes to `drivers/net/wireless/mediatek/mt76/` – specifically `mt7921` and `mt7925` across several files, including the crucial `mt792x_usb.c`. The fact that `mt792x_usb.c` is involved immediately grabs my attention, particularly the mention of `mt792xu_disconnect`. Hmm, that sounds like we're dealing with USB devices, doesn't it?

Right, quick sanity check: what are `mt7921` and `mt7925`? Ah, yes – USB Wi-Fi dongles. The "u" suffix reinforces that. So, the key question becomes: can we effectively emulate or interact with these USB devices within a standard virtualized environment like we use for Syzkaller? And that means QEMU with a USB pass-through, either raw USB, vhci, or a USB gadget setup.

Wait a second… Syzkaller has the `syz_usb_connect` system call and USB fuzzing capabilities (using the Raw Gadget approach)! This is promising. So, the next critical step is to determine if we can reliably probe and interact with these specific `mt7921u` and `mt7925u` devices via USB within our fuzzing setup.

Okay, time to fire up the grep and dive into the kernel source. We need to locate the USB IDs for these devices and see how their driver structures are defined. This will help determine the feasibility of hooking them up to syzkaller.



4/2 2026/09/29 00:10 tool grepper
0m Args:
{
  "Expression": "mt792xu_disconnect"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/usb.c=338=static struct usb_driver mt7921u_driver = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-341-\t.probe\t\t= mt7921u_probe,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:342:\t.disconnect\t= mt792xu_disconnect,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-343-#ifdef CONFIG_PM\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=355=static struct usb_driver mt7925u_driver = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-358-\t.probe\t\t= mt7925u_probe,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:359:\t.disconnect\t= mt792xu_disconnect,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-360-#ifdef CONFIG_PM\n--\ndrivers/net/wireless/mediatek/mt76/mt792x.h=611=void mt792xu_copy(struct mt76_dev *dev, u32 offset, const void *data, int len);\ndrivers/net/wireless/mediatek/mt76/mt792x.h:612:void mt792xu_disconnect(struct usb_interface *usb_intf);\ndrivers/net/wireless/mediatek/mt76/mt792x.h-613-void mt792xu_stop(struct ieee80211_hw *hw, bool suspend);\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c=495=EXPORT_SYMBOL_GPL(mt792xu_stop);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-496-\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:497:void mt792xu_disconnect(struct usb_interface *usb_intf)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-498-{\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-526-}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:527:EXPORT_SYMBOL_GPL(mt792xu_disconnect);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-528-\n"
}

5/2 2026/09/29 00:10 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 7227
							output: 22
							thoughts: 36
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing the Code Change Context**

Alright, before I dive too deep, my initial instinct is to get a handle on the "why" behind these changes. I need to understand the intent. My first move will be to zero in on the commit message itself. Hopefully, it’s descriptive and tells me the problem this change aimed to address. If not, I'm going to leverage my git expertise. I'll fire up `git log` or quickly utilize my preferred GUI, to look at the commit history. I'm going to look specifically for any related issues, bug tickets, or pull request numbers referenced in the commit messages or any adjacent commits, to quickly understand the original context and problem domain. I need to immediately understand what kind of bug was this fixing? Was it a functional issue, a performance bottleneck, a security vulnerability, or something else entirely? A solid understanding of the historical context is crucial before I can really assess the quality and impact of this fix.



6/2 2026/09/29 00:10 tool grepper
0m Args:
{
  "Expression": "mt7921u_driver"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/usb.c=336=MODULE_FIRMWARE(MT7921_ROM_PATCH);\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-337-\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:338:static struct usb_driver mt7921u_driver = {\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-339-\t.name\t\t= KBUILD_MODNAME,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-350-};\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:351:module_usb_driver(mt7921u_driver);\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-352-\n"
}

7/2 2026/09/29 00:10 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 7772
							output: 38
							thoughts: 25
						

Thoughts:
Okay, let's dive into this. Here's my thought process on examining those Kconfig files, rendered as a first-person summary, and assuming expertise:

**Examining mt7921/Kconfig and mt7925/Kconfig**

Alright, time to get a good look at the `mt7921/Kconfig` and `mt7925/Kconfig` files. I'm going to quickly parse their structure, looking for anything that jumps out. I want to see how these configurations define the feature sets for the mt7921 and mt7925 wireless chipsets. Specifically, I'll be searching for how they handle:

*   **Dependencies:** What other kernel modules or options are required for these to function? Any interesting relationships that might point to specific hardware features or board support packages?
*   **Default Values:** Are there any significant defaults that indicate typical use cases or target platforms? Defaults often reveal the developer's intent and priority.
*   **Conditional Compilation:** How are these modules compiled based on other settings? Are there any obvious areas where features are guarded based on board configurations or other hardware definitions? This is critical for understanding device-specific customization.
*   **Feature Flags:** I'm expecting to see flags for things like power management, regulatory domain settings, various 802.11 standards support (a/b/g/n/ac/ax), antenna configuration, and possibly hardware offload features. I'll need to understand how granular the controls are.
*   **Error Prevention:** Are there any cross-dependencies or configuration traps, to prevent misconfiguration? I'll look for places where they are attempting to prevent combinations which could lead to instability or incorrect operation.
*   **Documentation:** Are there any well-written help texts in these files that might provide clues or reveal details not otherwise obvious from the Kconfig syntax? I am always a fan of proper documentation.

I'm also curious about any differences between `mt7921` and `mt7925`. Are they just different revisions of the same core technology? Or do the `Kconfig` files reveal architectural differences, such as additional hardware components, different clock sources, or varied security features? Understanding these variations is vital for downstream driver work and porting efforts. This quick investigation should give me a pretty good mental map of these configurations and, most importantly, identify areas where I might need to dig deeper.



8/2 2026/09/29 00:10 tool grepper
0m Args:
{
  "Expression": "config MT7921",
  "PathPrefix": "drivers/net/wireless/mediatek/mt76"
}

Results:
{
  "Output": "drivers/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"
}

9/2 2026/09/29 00:10 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 8781
							output: 47
							thoughts: 51
						

Thoughts:
Here's my summary, as the expert:

**Diving into Mediatek Wireless Driver Configuration**

Okay, time to get my hands dirty. I need to understand the configuration options for the Mediatek wireless drivers, specifically for the MT7921 and MT7925 chipsets. Let's start by digging into the `Kconfig` files located in `drivers/net/wireless/mediatek/mt76/mt7921/Kconfig` and `drivers/net/wireless/mediatek/mt76/mt7925/Kconfig`. These configuration files are the heart of how we tailor the driver's behavior for these specific hardware revisions. I'm expecting to find the standard set of kernel configuration options: flags for enabling/disabling features, setting default values, and managing dependencies on other kernel subsystems or features. I'll be looking for any device-specific quirks or optimizations that are exposed through the configuration as well as general features to see what is enabled out of the box. Knowing the configuration options intimately will be key to troubleshooting any reported issues, tailoring the drivers for specialized deployments, or even contributing to the driver's development. My focus will be on understanding how these options relate to the overall performance, power consumption, and supported feature set of the wireless interface.



10/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/Kconfig",
  "FirstLine": 1,
  "LineCount": 50
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: BSD-3-Clause-Clear\n   2:\tconfig MT7921_COMMON\n   3:\t\ttristate\n   4:\t\tselect MT792x_LIB\n   5:\t\tselect WANT_DEV_COREDUMP\n   6:\t\n   7:\tconfig MT7921E\n   8:\t\ttristate \"MediaTek MT7921E (PCIe) support\"\n   9:\t\tselect MT7921_COMMON\n  10:\t\tdepends on MAC80211\n  11:\t\tdepends on PCI\n  12:\t\thelp\n  13:\t\t  This adds support for MT7921E 802.11ax 2x2:2SS wireless devices.\n  14:\t\n  15:\t\t  To compile this driver as a module, choose M here.\n  16:\t\n  17:\tconfig MT7921S\n  18:\t\ttristate \"MediaTek MT7921S (SDIO) support\"\n  19:\t\tselect MT76_SDIO\n  20:\t\tselect MT7921_COMMON\n  21:\t\tdepends on MAC80211\n  22:\t\tdepends on MMC\n  23:\t\thelp\n  24:\t\t  This adds support for MT7921S 802.11ax 2x2:2SS wireless devices.\n  25:\t\n  26:\t\t  To compile this driver as a module, choose M here.\n  27:\t\n  28:\tconfig MT7921U\n  29:\t\ttristate \"MediaTek MT7921U (USB) support\"\n  30:\t\tselect MT792x_USB\n  31:\t\tselect MT7921_COMMON\n  32:\t\tdepends on MAC80211\n  33:\t\tdepends on USB\n  34:\t\thelp\n  35:\t\t  This adds support for MT7921U 802.11ax 2x2:2SS wireless devices.\n  36:\t\n  37:\t\t  To compile this driver as a module, choose M here.\n"
}

11/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 9697
							output: 47
							thoughts: 27
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating the MT7925 Kconfig File**

Alright, time to dive into this. Let's start with `drivers/net/wireless/mediatek/mt76/mt7925/Kconfig`. That's the logical place to begin digging around for the MT7925 support within the Mediatek wireless driver ecosystem. The Kconfig file is where we define the configuration options, dependencies, and help text for including the MT7925's drivers. This is the bedrock; it dictates how we expose the MT7925's capabilities to the user via the kernel configuration menus. I'll be looking for things like: the relevant `CONFIG_` symbols, any dependencies on other modules or features (e.g., specific regulatory domains, crypto libraries, firmware files), default selections, and, critically, the help text. The help text will tell me how to enable this device, which might reveal platform requirements, firmware installation instructions, or any known issues that require special attention. Understanding its placement within the greater Mediatek WLAN driver structure will give me a good sense of the MT7925's overall design. I'm especially interested in looking at the dependencies: what else *needs* to be configured to get the MT7925 working? Are there any potential conflicts with other drivers that I should be aware of? Let's get cracking.



12/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7925/Kconfig",
  "FirstLine": 1,
  "LineCount": 50
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: BSD-3-Clause-Clear\n   2:\tconfig MT7925_COMMON\n   3:\t\ttristate\n   4:\t\tselect MT792x_LIB\n   5:\t\tselect WANT_DEV_COREDUMP\n   6:\t\n   7:\tconfig MT7925E\n   8:\t\ttristate \"MediaTek MT7925E (PCIe) support\"\n   9:\t\tselect MT7925_COMMON\n  10:\t\tdepends on MAC80211\n  11:\t\tdepends on PCI\n  12:\t\thelp\n  13:\t\t  This adds support for MT7925-based wireless PCIe devices,\n  14:\t\t  which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n  15:\t\t  2x2:2SS 4096-QAM, 160MHz channels.\n  16:\t\n  17:\t\t  To compile this driver as a module, choose M here.\n  18:\t\n  19:\tconfig MT7925U\n  20:\t\ttristate \"MediaTek MT7925U (USB) support\"\n  21:\t\tselect MT792x_USB\n  22:\t\tselect MT7925_COMMON\n  23:\t\tdepends on MAC80211\n  24:\t\tdepends on USB\n  25:\t\thelp\n  26:\t\t  This adds support for MT7925-based wireless USB devices,\n  27:\t\t  which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n  28:\t\t  2x2:2SS 4096-QAM, 160MHz channels.\n  29:\t\n  30:\t\t  To compile this driver as a module, choose M here.\n"
}

13/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 10570
							output: 50
							thoughts: 112
						

Thoughts:
**Investigating the USB Probe Process**

Okay, let's dive in. My immediate focus is understanding the probing mechanisms for the `mt7921u` and `mt7925u` devices. Specifically, I need to know how these devices are handled during the initial connection phase. I'm wondering if we can leverage `syzkaller` for USB probing. Ah, yes, it seems possible with the `syz_usb_connect` Raw Gadget. That's good news. However, the critical question now becomes: does probing, or even subsequent operation, rely on firmware? I need to clarify if firmware loading is a prerequisite. To get to the bottom of this, I need to examine the `mt7921u_probe` function definition, and I'll find it in `drivers/net/wireless/mediatek/mt76/mt7921/usb.c`. This is where the real answers lie.



14/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/usb.c",
  "FirstLine": 270,
  "LineCount": 80
}

Results:
{
  "Contents": " 270:\t\tpm-\u003esuspended = true;\n 271:\t\tflush_work(\u0026dev-\u003ereset_work);\n 272:\t\n 273:\t\terr = mt76_connac_mcu_set_hif_suspend(\u0026dev-\u003emt76, true, true);\n 274:\t\tif (err)\n 275:\t\t\tgoto failed;\n 276:\t\n 277:\t\tmt76u_stop_rx(\u0026dev-\u003emt76);\n 278:\t\tmt76u_stop_tx(\u0026dev-\u003emt76);\n 279:\t\n 280:\t\treturn 0;\n 281:\t\n 282:\tfailed:\n 283:\t\tpm-\u003esuspended = false;\n 284:\t\n 285:\t\tif (err \u003c 0)\n 286:\t\t\tmt792x_reset(\u0026dev-\u003emt76);\n 287:\t\n 288:\t\treturn err;\n 289:\t}\n 290:\t\n 291:\tstatic int mt7921u_resume(struct usb_interface *intf)\n 292:\t{\n 293:\t\tstruct mt792x_dev *dev = usb_get_intfdata(intf);\n 294:\t\tstruct mt76_connac_pm *pm = \u0026dev-\u003epm;\n 295:\t\tbool reinit = true;\n 296:\t\tint err, i;\n 297:\t\n 298:\t\tfor (i = 0; i \u003c 10; i++) {\n 299:\t\t\tu32 val = mt76_rr(dev, MT_WF_SW_DEF_CR_USB_MCU_EVENT);\n 300:\t\n 301:\t\t\tif (!(val \u0026 MT_WF_SW_SER_TRIGGER_SUSPEND)) {\n 302:\t\t\t\treinit = false;\n 303:\t\t\t\tbreak;\n 304:\t\t\t}\n 305:\t\t\tif (val \u0026 MT_WF_SW_SER_DONE_SUSPEND) {\n 306:\t\t\t\tmt76_wr(dev, MT_WF_SW_DEF_CR_USB_MCU_EVENT, 0);\n 307:\t\t\t\tbreak;\n 308:\t\t\t}\n 309:\t\n 310:\t\t\tmsleep(20);\n 311:\t\t}\n 312:\t\n 313:\t\tif (reinit || mt792x_dma_need_reinit(dev)) {\n 314:\t\t\terr = mt792xu_dma_init(dev, true);\n 315:\t\t\tif (err)\n 316:\t\t\t\tgoto failed;\n 317:\t\t}\n 318:\t\n 319:\t\terr = mt76u_resume_rx(\u0026dev-\u003emt76);\n 320:\t\tif (err \u003c 0)\n 321:\t\t\tgoto failed;\n 322:\t\n 323:\t\terr = mt76_connac_mcu_set_hif_suspend(\u0026dev-\u003emt76, false, true);\n 324:\tfailed:\n 325:\t\tpm-\u003esuspended = false;\n 326:\t\n 327:\t\tif (err \u003c 0)\n 328:\t\t\tmt792x_reset(\u0026dev-\u003emt76);\n 329:\t\n 330:\t\treturn err;\n 331:\t}\n 332:\t#endif /* CONFIG_PM */\n 333:\t\n 334:\tMODULE_DEVICE_TABLE(usb, mt7921u_device_table);\n 335:\tMODULE_FIRMWARE(MT7921_FIRMWARE_WM);\n 336:\tMODULE_FIRMWARE(MT7921_ROM_PATCH);\n 337:\t\n 338:\tstatic struct usb_driver mt7921u_driver = {\n 339:\t\t.name\t\t= KBUILD_MODNAME,\n 340:\t\t.id_table\t= mt7921u_device_table,\n 341:\t\t.probe\t\t= mt7921u_probe,\n 342:\t\t.disconnect\t= mt792xu_disconnect,\n 343:\t#ifdef CONFIG_PM\n 344:\t\t.suspend\t= mt7921u_suspend,\n 345:\t\t.resume\t\t= mt7921u_resume,\n 346:\t\t.reset_resume\t= mt7921u_resume,\n 347:\t#endif /* CONFIG_PM */\n 348:\t\t.soft_unbind\t= 1,\n 349:\t\t.disable_hub_initiated_lpm = 1,\n"
}

15/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 12165
							output: 43
							thoughts: 138
						

Thoughts:
**Diving into the MT7921U Driver Logic**

Okay, so I need to understand what's happening within `mt7921u_probe` and `mt792xu_disconnect`. I'm going to follow the logic and see what's triggered in these routines. Hold on, before I dig too deep, let's take a look at the commit itself. That's always a good starting point to gain some context.

Right, let's get into the details of this commit. I need to see the commit log message; that usually lays out the intent and rationale behind the changes. Okay, the commit ID is `b3e77860ea864be0a7fa22c5bee4dfdd0ae0c668`, and the message is "syz-cluster: applied patch under review". This suggests it's a patch stemming from a syzkaller cluster. I wonder where this patch originated, or if there were recent related commits in the git log? Let me check the git history. I'll quickly look at the last five commits before this one with `git log -n 5 HEAD~1`. That should give me some immediate context and see if there are other related changes.



16/2 2026/09/29 00:11 tool grepper
0m Args:
{
  "Expression": ".*",
  "PathPrefix": "drivers/net/wireless/mediatek/mt76/mt792x_usb.c"
}

Results:
{
  "Output": "\nFull output is too long, showing 500 out of 531 lines.\nUse more precise expression if possible.\n\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:1:// SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:2:/* Copyright (C) 2023 MediaTek Inc.\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:3: *\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:4: * Author: Lorenzo Bianconi \u003clorenzo@kernel.org\u003e\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:5: */\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:6:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:7:#include \u003clinux/kernel.h\u003e\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:8:#include \u003clinux/module.h\u003e\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:9:#include \u003clinux/usb.h\u003e\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:10:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:11:#include \"mt792x.h\"\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:12:#include \"mt76_connac2_mac.h\"\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:13:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:14:#define MT792X_USB_TX_TIMEOUT_LIMIT\t50000\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:15:#define MT792X_USB_UDMA_IDLE_TIMEOUT\t1000\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:16:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:17:static int mt792xu_read32(struct mt76_dev *dev, u32 addr, void *buf)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:18:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:19:\treturn __mt76u_vendor_request(dev, MT_VEND_READ_EXT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:20:\t\t\t\t      USB_DIR_IN | MT_USB_TYPE_VENDOR,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:21:\t\t\t\t      (u16)(addr \u003e\u003e 16), (u16)addr,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:22:\t\t\t\t      buf, sizeof(__le32));\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:23:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:24:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:25:static void mt792xu_reset_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:26:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:27:\tstruct mt792x_dev *dev =\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:28:\t\tcontainer_of(work, struct mt792x_dev, usb_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:29:\tstruct usb_interface *usb_intf = to_usb_interface(dev-\u003emt76.dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:30:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:31:\tif (usb_intf \u0026\u0026 usb_get_intfdata(usb_intf) == dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:32:\t\tusb_queue_reset_device(usb_intf);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:33:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:34:\tatomic_set(\u0026dev-\u003eusb_reset_pending, 0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:35:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:36:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:37:static void mt792xu_queue_usb_reset(struct mt792x_dev *dev, int err)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:38:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:39:\tif (!atomic_xchg(\u0026dev-\u003eusb_reset_pending, 1)) {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:40:\t\tdev_warn(dev-\u003emt76.dev,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:41:\t\t\t \"USB transport access failed (%d), queueing device reset\\n\",\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:42:\t\t\t err);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:43:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:44:\t\tschedule_work(\u0026dev-\u003eusb_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:45:\t}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:46:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:47:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:48:static u32 mt792xu_bus_hung_rr(struct mt76_dev *mdev, u32 offset)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:49:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:50:\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:51:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:52:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:53:static void mt792xu_bus_hung_wr(struct mt76_dev *mdev, u32 offset, u32 val)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:54:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:55:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:56:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:57:static u32 mt792xu_bus_hung_rmw(struct mt76_dev *mdev, u32 offset,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:58:\t\t\t\tu32 mask, u32 val)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:59:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:60:\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:61:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:62:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:63:static void mt792xu_bus_hung_write_copy(struct mt76_dev *mdev, u32 offset,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:64:\t\t\t\t\tconst void *data, int len)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:65:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:66:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:67:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:68:static void mt792xu_bus_hung_read_copy(struct mt76_dev *mdev, u32 offset,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:69:\t\t\t\t       void *data, int len)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:70:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:71:\tmemset(data, 0, len);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:72:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:73:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:74:static const struct mt76_bus_ops mt792xu_bus_hung_ops = {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:75:\t.rr = mt792xu_bus_hung_rr,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:76:\t.wr = mt792xu_bus_hung_wr,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:77:\t.rmw = mt792xu_bus_hung_rmw,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:78:\t.write_copy = mt792xu_bus_hung_write_copy,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:79:\t.read_copy = mt792xu_bus_hung_read_copy,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:80:\t.type = MT76_BUS_USB,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:81:};\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:82:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:83:static void mt792xu_set_bus_hung(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:84:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:85:\tatomic_set(\u0026dev-\u003emt76.bus_hung, true);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:86:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:87:\tif (READ_ONCE(dev-\u003emt76.bus) == \u0026mt792xu_bus_hung_ops)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:88:\t\treturn;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:89:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:90:\tWRITE_ONCE(dev-\u003emt76.bus, \u0026mt792xu_bus_hung_ops);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:91:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:92:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:93:static void mt792xu_ctrl_timeout(struct mt76_dev *mdev, int err)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:94:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:95:\tstruct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:96:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:97:\tmt792xu_set_bus_hung(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:98:\tmt792xu_queue_usb_reset(dev, err);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:99:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:100:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:101:void mt792xu_reset_work_init(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:102:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:103:\tINIT_WORK(\u0026dev-\u003eusb_reset_work, mt792xu_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:104:\tatomic_set(\u0026dev-\u003eusb_reset_pending, 0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:105:\tdev-\u003emt76.usb.ctrl_timeout = mt792xu_ctrl_timeout;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:106:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:107:EXPORT_SYMBOL_GPL(mt792xu_reset_work_init);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:108:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:109:void mt792xu_reset_work_cleanup(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:110:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:111:\tcancel_work_sync(\u0026dev-\u003eusb_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:112:\tatomic_set(\u0026dev-\u003eusb_reset_pending, 0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:113:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:114:EXPORT_SYMBOL_GPL(mt792xu_reset_work_cleanup);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:115:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:116:int mt792xu_check_bus(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:117:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:118:\tint ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:119:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:120:\tmutex_lock(\u0026dev-\u003emt76.usb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:121:\tret = mt792xu_read32(\u0026dev-\u003emt76, MT_HW_CHIPID, dev-\u003emt76.usb.data);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:122:\tmutex_unlock(\u0026dev-\u003emt76.usb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:123:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:124:\tif (ret == sizeof(__le32))\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:125:\t\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:126:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:127:\treturn ret \u003c 0 ? ret : -EIO;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:128:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:129:EXPORT_SYMBOL_GPL(mt792xu_check_bus);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:130:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:131:int mt792xu_reset_on_bus_error(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:132:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:133:\tint err;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:134:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:135:\t/* Once hung, the no-op bus ops stay installed until the queued USB\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:136:\t * reset re-probes the device. Do not clear bus_hung here, or the caller\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:137:\t * would run a full reset over dropped register I/O and report success.\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:138:\t */\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:139:\tif (atomic_read(\u0026dev-\u003emt76.bus_hung))\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:140:\t\treturn -EIO;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:141:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:142:\terr = mt792xu_check_bus(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:143:\tif (err) {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:144:\t\tmt792xu_set_bus_hung(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:145:\t\tmt792xu_queue_usb_reset(dev, err);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:146:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:147:\t\treturn err;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:148:\t}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:149:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:150:\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:151:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:152:EXPORT_SYMBOL_GPL(mt792xu_reset_on_bus_error);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:153:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:154:u32 mt792xu_rr(struct mt76_dev *dev, u32 addr)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:155:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:156:\tu32 ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:157:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:158:\tmutex_lock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:159:\tret = ___mt76u_rr(dev, MT_VEND_READ_EXT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:160:\t\t\t  USB_DIR_IN | MT_USB_TYPE_VENDOR, addr);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:161:\tmutex_unlock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:162:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:163:\treturn ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:164:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:165:EXPORT_SYMBOL_GPL(mt792xu_rr);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:166:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:167:void mt792xu_wr(struct mt76_dev *dev, u32 addr, u32 val)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:168:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:169:\tmutex_lock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:170:\t___mt76u_wr(dev, MT_VEND_WRITE_EXT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:171:\t\t    USB_DIR_OUT | MT_USB_TYPE_VENDOR, addr, val);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:172:\tmutex_unlock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:173:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:174:EXPORT_SYMBOL_GPL(mt792xu_wr);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:175:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:176:u32 mt792xu_rmw(struct mt76_dev *dev, u32 addr, u32 mask, u32 val)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:177:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:178:\tmutex_lock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:179:\tval |= ___mt76u_rr(dev, MT_VEND_READ_EXT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:180:\t\t\t   USB_DIR_IN | MT_USB_TYPE_VENDOR, addr) \u0026 ~mask;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:181:\t___mt76u_wr(dev, MT_VEND_WRITE_EXT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:182:\t\t    USB_DIR_OUT | MT_USB_TYPE_VENDOR, addr, val);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:183:\tmutex_unlock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:184:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:185:\treturn val;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:186:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:187:EXPORT_SYMBOL_GPL(mt792xu_rmw);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:188:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:189:void mt792xu_copy(struct mt76_dev *dev, u32 offset, const void *data, int len)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:190:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:191:\tstruct mt76_usb *usb = \u0026dev-\u003eusb;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:192:\tint ret, i = 0, batch_len;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:193:\tconst u8 *val = data;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:194:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:195:\tlen = round_up(len, 4);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:196:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:197:\tmutex_lock(\u0026usb-\u003eusb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:198:\twhile (i \u003c len) {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:199:\t\tbatch_len = min_t(int, usb-\u003edata_len, len - i);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:200:\t\tmemcpy(usb-\u003edata, val + i, batch_len);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:201:\t\tret = __mt76u_vendor_request(dev, MT_VEND_WRITE_EXT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:202:\t\t\t\t\t     USB_DIR_OUT | MT_USB_TYPE_VENDOR,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:203:\t\t\t\t\t     (offset + i) \u003e\u003e 16, offset + i,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:204:\t\t\t\t\t     usb-\u003edata, batch_len);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:205:\t\tif (ret \u003c 0)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:206:\t\t\tbreak;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:207:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:208:\t\ti += batch_len;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:209:\t}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:210:\tmutex_unlock(\u0026usb-\u003eusb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:211:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:212:EXPORT_SYMBOL_GPL(mt792xu_copy);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:213:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:214:int mt792xu_mcu_power_on(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:215:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:216:\tint ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:217:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:218:\tret = mt76u_vendor_request(\u0026dev-\u003emt76, MT_VEND_POWER_ON,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:219:\t\t\t\t   USB_DIR_OUT | MT_USB_TYPE_VENDOR,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:220:\t\t\t\t   0x0, 0x1, NULL, 0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:221:\tif (ret)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:222:\t\treturn ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:223:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:224:\tif (!mt76_poll_msec(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_PWR_ON,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:225:\t\t\t    MT_TOP_MISC2_FW_PWR_ON, 500)) {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:226:\t\tdev_err(dev-\u003emt76.dev, \"Timeout for power on\\n\");\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:227:\t\tret = -EIO;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:228:\t}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:229:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:230:\treturn ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:231:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:232:EXPORT_SYMBOL_GPL(mt792xu_mcu_power_on);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:233:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:234:static void mt792xu_cleanup(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:235:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:236:\tclear_bit(MT76_STATE_INITIALIZED, \u0026dev-\u003emphy.state);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:237:\tskb_queue_purge(\u0026dev-\u003emt76.mcu.res_q);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:238:\tmt76u_queues_deinit(\u0026dev-\u003emt76);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:239:\tmt792xu_wfsys_reset(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:240:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:241:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:242:static u32 mt792xu_uhw_rr(struct mt76_dev *dev, u32 addr)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:243:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:244:\tu32 ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:245:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:246:\tmutex_lock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:247:\tret = ___mt76u_rr(dev, MT_VEND_DEV_MODE,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:248:\t\t\t  USB_DIR_IN | MT_USB_TYPE_UHW_VENDOR, addr);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:249:\tmutex_unlock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:250:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:251:\treturn ret;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:252:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:253:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:254:static void mt792xu_uhw_wr(struct mt76_dev *dev, u32 addr, u32 val)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:255:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:256:\tmutex_lock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:257:\t___mt76u_wr(dev, MT_VEND_WRITE,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:258:\t\t    USB_DIR_OUT | MT_USB_TYPE_UHW_VENDOR, addr, val);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:259:\tmutex_unlock(\u0026dev-\u003eusb.usb_ctrl_mtx);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:260:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:261:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:262:static void mt792xu_dma_prefetch(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:263:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:264:#define DMA_PREFETCH_CONF(_idx_, _cnt_, _base_) \\\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:265:\tmt76_rmw(dev, MT_UWFDMA0_TX_RING_EXT_CTRL((_idx_)), \\\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:266:\t\t MT_WPDMA0_MAX_CNT_MASK | MT_WPDMA0_BASE_PTR_MASK, \\\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:267:\t\t FIELD_PREP(MT_WPDMA0_MAX_CNT_MASK, (_cnt_)) | \\\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:268:\t\t FIELD_PREP(MT_WPDMA0_BASE_PTR_MASK, (_base_)))\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:269:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:270:\tDMA_PREFETCH_CONF(0, 4, 0x080);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:271:\tDMA_PREFETCH_CONF(1, 4, 0x0c0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:272:\tDMA_PREFETCH_CONF(2, 4, 0x100);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:273:\tDMA_PREFETCH_CONF(3, 4, 0x140);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:274:\tDMA_PREFETCH_CONF(4, 4, 0x180);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:275:\tDMA_PREFETCH_CONF(16, 4, 0x280);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:276:\tDMA_PREFETCH_CONF(17, 4, 0x2c0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:277:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:278:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:279:static void mt792xu_wfdma_init(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:280:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:281:\tint i;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:282:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:283:\tmt792xu_dma_prefetch(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:284:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:285:\tmt76_clear(dev, MT_UWFDMA0_GLO_CFG, MT_WFDMA0_GLO_CFG_OMIT_RX_INFO);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:286:\tmt76_set(dev, MT_UWFDMA0_GLO_CFG,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:287:\t\t MT_WFDMA0_GLO_CFG_OMIT_TX_INFO |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:288:\t\t MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2 |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:289:\t\t MT_WFDMA0_GLO_CFG_FW_DWLD_BYPASS_DMASHDL |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:290:\t\t MT_WFDMA0_GLO_CFG_TX_DMA_EN |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:291:\t\t MT_WFDMA0_GLO_CFG_RX_DMA_EN);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:292:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:293:\tmt76_rmw(dev, MT_DMASHDL_REFILL, MT_DMASHDL_REFILL_MASK, 0xffe00000);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:294:\tmt76_clear(dev, MT_DMASHDL_PAGE, MT_DMASHDL_GROUP_SEQ_ORDER);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:295:\tmt76_rmw(dev, MT_DMASHDL_PKT_MAX_SIZE,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:296:\t\t MT_DMASHDL_PKT_MAX_SIZE_PLE | MT_DMASHDL_PKT_MAX_SIZE_PSE,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:297:\t\t FIELD_PREP(MT_DMASHDL_PKT_MAX_SIZE_PLE, 1) |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:298:\t\t FIELD_PREP(MT_DMASHDL_PKT_MAX_SIZE_PSE, 0));\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:299:\tfor (i = 0; i \u003c 5; i++)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:300:\t\tmt76_wr(dev, MT_DMASHDL_GROUP_QUOTA(i),\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:301:\t\t\tFIELD_PREP(MT_DMASHDL_GROUP_QUOTA_MIN, 0x3) |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:302:\t\t\tFIELD_PREP(MT_DMASHDL_GROUP_QUOTA_MAX, 0xfff));\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:303:\tfor (i = 5; i \u003c 16; i++)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:304:\t\tmt76_wr(dev, MT_DMASHDL_GROUP_QUOTA(i),\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:305:\t\t\tFIELD_PREP(MT_DMASHDL_GROUP_QUOTA_MIN, 0x0) |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:306:\t\t\tFIELD_PREP(MT_DMASHDL_GROUP_QUOTA_MAX, 0x0));\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:307:\tmt76_wr(dev, MT_DMASHDL_Q_MAP(0), 0x32013201);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:308:\tmt76_wr(dev, MT_DMASHDL_Q_MAP(1), 0x32013201);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:309:\tmt76_wr(dev, MT_DMASHDL_Q_MAP(2), 0x55555444);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:310:\tmt76_wr(dev, MT_DMASHDL_Q_MAP(3), 0x55555444);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:311:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:312:\tmt76_wr(dev, MT_DMASHDL_SCHED_SET(0), 0x76540132);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:313:\tmt76_wr(dev, MT_DMASHDL_SCHED_SET(1), 0xFEDCBA98);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:314:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:315:\tmt76_set(dev, MT_WFDMA_DUMMY_CR, MT_WFDMA_NEED_REINIT);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:316:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:317:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:318:static int mt792xu_dma_rx_evt_ep4(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:319:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:320:\tif (!mt76_poll(dev, MT_UWFDMA0_GLO_CFG,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:321:\t\t       MT_WFDMA0_GLO_CFG_RX_DMA_BUSY, 0, 1000))\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:322:\t\treturn -ETIMEDOUT;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:323:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:324:\tmt76_clear(dev, MT_UWFDMA0_GLO_CFG, MT_WFDMA0_GLO_CFG_RX_DMA_EN);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:325:\tmt76_set(dev, MT_WFDMA_HOST_CONFIG,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:326:\t\t MT_WFDMA_HOST_CONFIG_USB_RXEVT_EP4_EN);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:327:\tmt76_set(dev, MT_UWFDMA0_GLO_CFG, MT_WFDMA0_GLO_CFG_RX_DMA_EN);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:328:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:329:\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:330:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:331:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:332:static void mt792xu_epctl_rst_opt(struct mt792x_dev *dev, bool reset)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:333:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:334:\tu32 val;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:335:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:336:\t/* usb endpoint reset opt\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:337:\t * bits[4,9]: out blk ep 4-9\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:338:\t * bits[20,21]: in blk ep 4-5\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:339:\t * bits[22]: in int ep 6\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:340:\t */\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:341:\tval = mt792xu_uhw_rr(\u0026dev-\u003emt76, MT_SSUSB_EPCTL_CSR_EP_RST_OPT);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:342:\tif (reset)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:343:\t\tval |= GENMASK(9, 4) | GENMASK(22, 20);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:344:\telse\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:345:\t\tval \u0026= ~(GENMASK(9, 4) | GENMASK(22, 20));\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:346:\tmt792xu_uhw_wr(\u0026dev-\u003emt76, MT_SSUSB_EPCTL_CSR_EP_RST_OPT, val);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:347:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:348:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:349:static void mt792xu_wait_udma_idle(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:350:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:351:\tu32 mask = MT_WL_RX_BUSY | MT_WL_TX_BUSY;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:352:\tu32 val;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:353:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:354:\tmt76_set(dev, MT_UDMA_WLCFG_0, MT_WL_RX_FLUSH);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:355:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:356:\tif (mt76_poll_msec(dev, MT_UDMA_WLCFG_0, mask, 0,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:357:\t\t\t   MT792X_USB_UDMA_IDLE_TIMEOUT))\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:358:\t\treturn;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:359:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:360:\tval = mt76_rr(dev, MT_UDMA_WLCFG_0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:361:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:362:\tdev_warn(dev-\u003emt76.dev,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:363:\t\t \"UDMA busy before WFSYS reset: WLCFG0=0x%08x\\n\", val);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:364:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:365:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:366:struct mt792xu_wfsys_desc {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:367:\tu32 rst_reg;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:368:\tu32 done_reg;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:369:\tu32 done_mask;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:370:\tu32 done_val;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:371:\tu32 delay_ms;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:372:\tbool need_status_sel;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:373:};\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:374:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:375:static const struct mt792xu_wfsys_desc mt7921_wfsys_desc = {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:376:\t.rst_reg = MT_CBTOP_RGU_WF_SUBSYS_RST,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:377:\t.done_reg = MT_UDMA_CONN_INFRA_STATUS,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:378:\t.done_mask = MT_UDMA_CONN_WFSYS_INIT_DONE,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:379:\t.done_val = MT_UDMA_CONN_WFSYS_INIT_DONE,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:380:\t.delay_ms = 0,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:381:\t.need_status_sel = true,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:382:};\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:383:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:384:static const struct mt792xu_wfsys_desc mt7925_wfsys_desc = {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:385:\t.rst_reg = MT7925_CBTOP_RGU_WF_SUBSYS_RST,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:386:\t.done_reg = MT7925_WFSYS_INIT_DONE_ADDR,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:387:\t.done_mask = U32_MAX,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:388:\t.done_val = MT7925_WFSYS_INIT_DONE,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:389:\t.delay_ms = 20,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:390:\t.need_status_sel = false,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:391:};\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:392:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:393:int mt792xu_dma_init(struct mt792x_dev *dev, bool resume)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:394:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:395:\tint err;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:396:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:397:\tmt792xu_wfdma_init(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:398:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:399:\tmt76_clear(dev, MT_UDMA_WLCFG_0, MT_WL_RX_FLUSH);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:400:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:401:\tmt76_set(dev, MT_UDMA_WLCFG_0,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:402:\t\t MT_WL_RX_EN | MT_WL_TX_EN |\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:403:\t\t MT_WL_RX_MPSZ_PAD0 | MT_TICK_1US_EN);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:404:\tmt76_rmw(dev, MT_UDMA_WLCFG_1, MT_WL_TX_TMOUT_LMT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:405:\t\t FIELD_PREP(MT_WL_TX_TMOUT_LMT,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:406:\t\t\t    MT792X_USB_TX_TIMEOUT_LIMIT));\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:407:\tmt76_set(dev, MT_UDMA_WLCFG_0, MT_WL_TX_TMOUT_FUNC_EN);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:408:\tmt76_clear(dev, MT_UDMA_WLCFG_0,\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:409:\t\t   MT_WL_RX_AGG_TO | MT_WL_RX_AGG_LMT);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:410:\tmt76_clear(dev, MT_UDMA_WLCFG_1, MT_WL_RX_AGG_PKT_LMT);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:411:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:412:\tif (resume)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:413:\t\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:414:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:415:\terr = mt792xu_dma_rx_evt_ep4(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:416:\tif (err)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:417:\t\treturn err;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:418:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:419:\tmt792xu_epctl_rst_opt(dev, false);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:420:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:421:\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:422:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:423:EXPORT_SYMBOL_GPL(mt792xu_dma_init);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:424:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:425:int mt792xu_wfsys_reset(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:426:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:427:\tconst struct mt792xu_wfsys_desc *desc = is_connac3(\u0026dev-\u003emt76) ?\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:428:\t\t\t\t\t\t\u0026mt7925_wfsys_desc :\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:429:\t\t\t\t\t\t\u0026mt7921_wfsys_desc;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:430:\tu32 val;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:431:\tint i;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:432:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:433:\tif (atomic_read(\u0026dev-\u003emt76.bus_hung))\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:434:\t\treturn -EIO;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:435:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:436:\tmt792xu_wait_udma_idle(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:437:\tmt792xu_epctl_rst_opt(dev, false);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:438:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:439:\tval = mt792xu_uhw_rr(\u0026dev-\u003emt76, desc-\u003erst_reg);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:440:\tval |= MT_CBTOP_RGU_WF_SUBSYS_RST_WF_WHOLE_PATH;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:441:\tmt792xu_uhw_wr(\u0026dev-\u003emt76, desc-\u003erst_reg, val);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:442:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:443:\tif (desc-\u003edelay_ms)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:444:\t\tmsleep(desc-\u003edelay_ms);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:445:\telse\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:446:\t\tusleep_range(10, 20);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:447:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:448:\tval = mt792xu_uhw_rr(\u0026dev-\u003emt76, desc-\u003erst_reg);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:449:\tval \u0026= ~MT_CBTOP_RGU_WF_SUBSYS_RST_WF_WHOLE_PATH;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:450:\tmt792xu_uhw_wr(\u0026dev-\u003emt76, desc-\u003erst_reg, val);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:451:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:452:\tif (desc-\u003eneed_status_sel)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:453:\t\tmt792xu_uhw_wr(\u0026dev-\u003emt76, MT_UDMA_CONN_INFRA_STATUS_SEL, 0);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:454:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:455:\tfor (i = 0; i \u003c MT792x_WFSYS_INIT_RETRY_COUNT; i++) {\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:456:\t\tval = mt792xu_uhw_rr(\u0026dev-\u003emt76, desc-\u003edone_reg);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:457:\t\tif ((val \u0026 desc-\u003edone_mask) == desc-\u003edone_val)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:458:\t\t\tbreak;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:459:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:460:\t\tmsleep(100);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:461:\t}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:462:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:463:\tif (i == MT792x_WFSYS_INIT_RETRY_COUNT)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:464:\t\treturn -ETIMEDOUT;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:465:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:466:\treturn 0;\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:467:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:468:EXPORT_SYMBOL_GPL(mt792xu_wfsys_reset);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:469:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:470:int mt792xu_init_reset(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:471:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:472:\tset_bit(MT76_RESET, \u0026dev-\u003emphy.state);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:473:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:474:\twake_up(\u0026dev-\u003emt76.mcu.wait);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:475:\tskb_queue_purge(\u0026dev-\u003emt76.mcu.res_q);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:476:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:477:\tmt76u_stop_rx(\u0026dev-\u003emt76);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:478:\tmt76u_stop_tx(\u0026dev-\u003emt76);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:479:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:480:\tmt792xu_wfsys_reset(dev);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:481:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:482:\tclear_bit(MT76_RESET, \u0026dev-\u003emphy.state);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:483:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:484:\treturn mt76u_resume_rx(\u0026dev-\u003emt76);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:485:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:486:EXPORT_SYMBOL_GPL(mt792xu_init_reset);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:487:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:488:void mt792xu_stop(struct ieee80211_hw *hw, bool suspend)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:489:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:490:\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:491:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:492:\tmt76u_stop_tx(\u0026dev-\u003emt76);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:493:\tmt792x_stop(hw, false);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:494:}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:495:EXPORT_SYMBOL_GPL(mt792xu_stop);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:496:\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:497:void mt792xu_disconnect(struct usb_interface *usb_intf)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:498:{\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:499:\tstruct mt792x_dev *dev = usb_get_intfdata(usb_intf);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:500:\n\n"
}

17/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 32501
							output: 50
							thoughts: 31
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, and written as if they are my own internal considerations:

**Delving Deeper: Disconnect and Probe**

Right, let's get a handle on the bigger picture here. I need to understand the relationship between the `mt792xu_disconnect` and `mt7921u_probe` functions. I know the general roles, but I want to fill in any gaps in my understanding. Specifically, I'm thinking: what happens during disconnect? Are there subtle cleanup steps I might be overlooking? And, looking at the probe function, I'll be searching for how the device is initialized and set up initially. I'm wondering if there are any specific dependencies, configurations, or assumptions made in one function that are handled by the other. This could uncover some hidden interactions or potential race conditions. I want to see if they're handling any special cases, or device-specific quirks. It's likely that a complete understanding of those two functions will reveal how these devices are handled throughout the lifecycle.



18/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/usb.c",
  "FirstLine": 180,
  "LineCount": 80
}

Results:
{
  "Contents": " 180:\t\t\t.read_copy = mt76u_read_copy,\n 181:\t\t\t.write_copy = mt792xu_copy,\n 182:\t\t\t.type = MT76_BUS_USB,\n 183:\t\t};\n 184:\t\tstruct usb_device *udev = interface_to_usbdev(usb_intf);\n 185:\t\tstruct ieee80211_ops *ops;\n 186:\t\tstruct ieee80211_hw *hw;\n 187:\t\tstruct mt792x_dev *dev;\n 188:\t\tstruct mt76_dev *mdev;\n 189:\t\tu8 features;\n 190:\t\tint ret;\n 191:\t\n 192:\t\tops = mt792x_get_mac80211_ops(\u0026usb_intf-\u003edev, \u0026mt7921_ops,\n 193:\t\t\t\t\t      (void *)id-\u003edriver_info, \u0026features);\n 194:\t\tif (!ops)\n 195:\t\t\treturn -ENOMEM;\n 196:\t\n 197:\t\tops-\u003estop = mt792xu_stop;\n 198:\t\tmdev = mt76_alloc_device(\u0026usb_intf-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\n 199:\t\tif (!mdev)\n 200:\t\t\treturn -ENOMEM;\n 201:\t\n 202:\t\tdev = container_of(mdev, struct mt792x_dev, mt76);\n 203:\t\tdev-\u003efw_features = features;\n 204:\t\tdev-\u003ehif_ops = \u0026hif_ops;\n 205:\t\tatomic_set(\u0026dev-\u003emt76.bus_hung, false);\n 206:\t\tmt792xu_reset_work_init(dev);\n 207:\t\n 208:\t\tusb_reset_device(udev);\n 209:\t\n 210:\t\tusb_set_intfdata(usb_intf, dev);\n 211:\t\n 212:\t\tret = __mt76u_init(mdev, usb_intf, \u0026bus_ops);\n 213:\t\tif (ret \u003c 0)\n 214:\t\t\tgoto error;\n 215:\t\n 216:\t\tmdev-\u003erev = (mt76_rr(dev, MT_HW_CHIPID) \u003c\u003c 16) |\n 217:\t\t\t    (mt76_rr(dev, MT_HW_REV) \u0026 0xff);\n 218:\t\tdev_dbg(mdev-\u003edev, \"ASIC revision: %04x\\n\", mdev-\u003erev);\n 219:\t\n 220:\t\tif (mt76_get_field(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_N9_RDY)) {\n 221:\t\t\tret = mt792xu_wfsys_reset(dev);\n 222:\t\t\tif (ret)\n 223:\t\t\t\tgoto error;\n 224:\t\t}\n 225:\t\n 226:\t\tret = mt792xu_mcu_power_on(dev);\n 227:\t\tif (ret)\n 228:\t\t\tgoto error;\n 229:\t\n 230:\t\tret = mt76u_alloc_mcu_queue(\u0026dev-\u003emt76);\n 231:\t\tif (ret)\n 232:\t\t\tgoto error;\n 233:\t\n 234:\t\tret = mt76u_alloc_queues(\u0026dev-\u003emt76);\n 235:\t\tif (ret)\n 236:\t\t\tgoto error;\n 237:\t\n 238:\t\tret = mt792xu_dma_init(dev, false);\n 239:\t\tif (ret)\n 240:\t\t\tgoto error;\n 241:\t\n 242:\t\thw = mt76_hw(dev);\n 243:\t\t/* check hw sg support in order to enable AMSDU */\n 244:\t\thw-\u003emax_tx_fragments = mdev-\u003eusb.sg_en ? MT_HW_TXP_MAX_BUF_NUM : 1;\n 245:\t\n 246:\t\tret = mt7921_register_device(dev);\n 247:\t\tif (ret)\n 248:\t\t\tgoto error;\n 249:\t\n 250:\t\treturn 0;\n 251:\t\n 252:\terror:\n 253:\t\tmt76u_queues_deinit(\u0026dev-\u003emt76);\n 254:\t\tmt792xu_reset_work_cleanup(dev);\n 255:\t\n 256:\t\tusb_set_intfdata(usb_intf, NULL);\n 257:\t\n 258:\t\tmt76_free_device(\u0026dev-\u003emt76);\n 259:\t\n"
}

19/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 34112
							output: 39
							thoughts: 3005
						

Thoughts:
**Analysis of a Potential Fuzzing Target: `mt7921u_driver`**

Okay, so the initial thought was correct: `mt7921u_driver` is indeed probed via USB. This immediately flags it as a potential target for Syzkaller fuzzing, given Syzkaller's USB emulation capabilities. The key question now becomes, is this driver worth fuzzing based on this specific patch?

Section 2 of the document provides the criteria, and it highlights "Reachable Drivers and Protocols" specifically mentions virtual buses, including USB gadget. Syzkaller's USB disconnect/connect functionality, utilizing `syz_usb_connect` and `syz_usb_disconnect` or `raw-gadget` makes this relevant. The concern initially was if the "disconnect" path would be considered *unreachable*.

However, the text explicitly differentiates between PCI drivers and USB drivers regarding teardown callbacks (.remove, .shutdown). PCI hot-unplug is not the same as the Syzkaller USB enumeration and disconnection. Syzkaller's ability to dynamically plug and unplug USB devices changes the equation. Since Syzkaller *frequently* tests USB disconnects, it is *definitely* a potentially reachable code path.

The next critical step is to carefully examine the changes made by this patch. Is the modified code primarily related to disconnect? If so, this further strengthens the argument for fuzzing. If it touches other functionalities unrelated to disconnect, we have to evaluate the "WorthFuzzing" factor.

The diff inspection reveals changes across multiple files: `mac.c`, `main.c`, `mcu.c`, and finally `mt792x_usb.c`.  Let's consider these changes:

1.  `mac.c` and `main.c`:  The additions of checks for `MT76_REMOVED` within the `mac_reset_work` and `abort_roc` functions of both `mt7921` and `mt7925` drivers. These checks are now early returns, before any resets are initiated, or actions are taken.
2.  `mcu.c`: A check against `MT76_REMOVED` has been added to the `mcu_parse_response` functions. This prevents resets on timeout if the device has been removed.
3.  `mt792x_usb.c`: The change to `mt792xu_disconnect` is *significant*. It sets the `MT76_REMOVED` bit and clears other state bits, along with a cascade of cancellations of work queues. The `MT76_REMOVED` flag appears to be the most relevant change here. The patch essentially adds the `MT76_REMOVED` bit to provide a method of checking the state of the device on removal and during cleanup.

The code changes confirm that the patch is *directly* related to the disconnection process or states. The `MT76_REMOVED` bit is clearly about handling driver removal/unloading.

Therefore, because this patch *specifically* touches the disconnect path, which is directly triggered and fuzzed by Syzkaller, the patch is likely *WorthFuzzing=true*.  Fuzzing can detect potential race conditions around `MT76_REMOVED`, which this patch is meant to fix, or other issues around the interaction between reset, removal, and various workqueues. It's time to check the git logs and see if there are any related bug fixes.



20/2 2026/09/29 00:11 tool grepper
0m Args:
{
  "Expression": "mt792xu_disconnect",
  "PathPrefix": "drivers/net/wireless/mediatek/mt76"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/usb.c=338=static struct usb_driver mt7921u_driver = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-341-\t.probe\t\t= mt7921u_probe,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:342:\t.disconnect\t= mt792xu_disconnect,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-343-#ifdef CONFIG_PM\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=355=static struct usb_driver mt7925u_driver = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-358-\t.probe\t\t= mt7925u_probe,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:359:\t.disconnect\t= mt792xu_disconnect,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-360-#ifdef CONFIG_PM\n--\ndrivers/net/wireless/mediatek/mt76/mt792x.h=611=void mt792xu_copy(struct mt76_dev *dev, u32 offset, const void *data, int len);\ndrivers/net/wireless/mediatek/mt76/mt792x.h:612:void mt792xu_disconnect(struct usb_interface *usb_intf);\ndrivers/net/wireless/mediatek/mt76/mt792x.h-613-void mt792xu_stop(struct ieee80211_hw *hw, bool suspend);\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c=495=EXPORT_SYMBOL_GPL(mt792xu_stop);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-496-\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:497:void mt792xu_disconnect(struct usb_interface *usb_intf)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-498-{\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-526-}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:527:EXPORT_SYMBOL_GPL(mt792xu_disconnect);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-528-\n"
}

21/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 38649
							output: 50
							thoughts: 25
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing the `mt792xu_disconnect` Function Pre- and Post-Patch**

Right, let's dive in. My immediate thought is, "Okay, time to get granular." I need to see the *entire* `mt792xu_disconnect` function – before and after the recent patch. That's the only way to truly understand the impact. I'm not looking for a superficial overview; I need a complete diff to pinpoint *precisely* what changed, where, and why. This is more than just skimming lines; I'm mentally parsing the control flow, identifying potential side effects, and anticipating interactions with other modules. I need to understand if the patch was a simple bug fix, a refactoring, or a more significant architectural adjustment that impacts how the driver handles device disconnection. This initial comparison will be critical for forming a sound judgement. I'm already anticipating areas of interest; things like resource cleanup, error handling, and any changes to the sequence of operations. This is where the real work begins.



22/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt792x_usb.c",
  "FirstLine": 495,
  "LineCount": 40
}

Results:
{
  "Contents": " 495:\tEXPORT_SYMBOL_GPL(mt792xu_stop);\n 496:\t\n 497:\tvoid mt792xu_disconnect(struct usb_interface *usb_intf)\n 498:\t{\n 499:\t\tstruct mt792x_dev *dev = usb_get_intfdata(usb_intf);\n 500:\t\n 501:\t\tif (!dev)\n 502:\t\t\treturn;\n 503:\t\n 504:\t\tset_bit(MT76_REMOVED, \u0026dev-\u003emphy.state);\n 505:\t\tset_bit(MT76_RESET, \u0026dev-\u003emphy.state);\n 506:\t\tset_bit(MT76_MCU_RESET, \u0026dev-\u003emphy.state);\n 507:\t\tclear_bit(MT76_STATE_RUNNING, \u0026dev-\u003emphy.state);\n 508:\t\twake_up(\u0026dev-\u003emt76.mcu.wait);\n 509:\t\tskb_queue_purge(\u0026dev-\u003emt76.mcu.res_q);\n 510:\t\n 511:\t\tcancel_work_sync(\u0026dev-\u003ereset_work);\n 512:\t\tcancel_work_sync(\u0026dev-\u003einit_work);\n 513:\t\tcancel_delayed_work_sync(\u0026dev-\u003emphy.mac_work);\n 514:\t\tcancel_delayed_work_sync(\u0026dev-\u003epm.ps_work);\n 515:\t\tcancel_work_sync(\u0026dev-\u003epm.wake_work);\n 516:\t\tmt792xu_reset_work_cleanup(dev);\n 517:\t\tif (!test_bit(MT76_STATE_INITIALIZED, \u0026dev-\u003emphy.state))\n 518:\t\t\treturn;\n 519:\t\n 520:\t\tmt76_unregister_device(\u0026dev-\u003emt76);\n 521:\t\tmt792xu_cleanup(dev);\n 522:\t\n 523:\t\tusb_set_intfdata(usb_intf, NULL);\n 524:\t\n 525:\t\tmt76_free_device(\u0026dev-\u003emt76);\n 526:\t}\n 527:\tEXPORT_SYMBOL_GPL(mt792xu_disconnect);\n 528:\t\n 529:\tMODULE_DESCRIPTION(\"MediaTek MT792x USB helpers\");\n 530:\tMODULE_LICENSE(\"Dual BSD/GPL\");\n 531:\tMODULE_AUTHOR(\"Lorenzo Bianconi \u003clorenzo@kernel.org\u003e\");\n"
}

23/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 39628
							output: 23
							thoughts: 784
						

Thoughts:
**Analyzing the mt792xu Disconnect and USB Device Probe**

Okay, let's break this down. First, I'm noticing a significant change in `mt792xu_disconnect`: `set_bit(MT76_REMOVED, &dev->mphy.state)` has been moved to the very beginning of the function. Previously, this flag was only set at the end, or conditionally within `if (!test_bit(MT76_STATE_INITIALIZED...)`. My initial thought is, why the change? It seems relevant. Now, functions like `mt7921_mac_reset_work`, `mt7921_abort_roc`, and `mt7921_mcu_parse_response` all check `MT76_REMOVED`, which implies a race condition is being addressed.

The problem, as I see it, is that when the USB dongle is physically unplugged or reset while either `mac_reset_work` or `mcu` requests are active, there's a race happening with the disconnect process itself. This move is probably designed to prevent that.

Next, I need to understand if I can reproduce this issue in a controlled environment like QEMU or a standard virtualized setup. The question becomes, can these specific devices (`mt7921u` or `mt7925u`) even be probed successfully in such an environment? Then, I need to think about how a tool like syzkaller would approach testing USB devices.

I recall that syzkaller has a function, `syz_usb_connect`, that appears capable of connecting ANY USB device ID. This is a powerful tool, but I have to carefully consider the implications. Now I'm focused on what happens during `mt7921u_probe`. Let's re-examine that function. I'm going to look at the relevant code in `drivers/net/wireless/mediatek/mt76/mt7921/usb.c`.

Specifically, lines 200-250 are of interest: I see the initialization sequence including calls to `__mt76u_init`, revision checks, `mt792xu_wfsys_reset`, `mt792xu_mcu_power_on`, and DMA initialization. The code is carefully checking if the device has the support of Scatter/Gather (SG), which is used for AMSDU transmission. And finally, `mt7921_register_device` is called.

My next step is to drill down into `mt7921_register_device` and figure out what exactly happens there. That's where I will likely find more clues.



24/2 2026/09/29 00:11 tool grepper
0m Args:
{
  "Expression": "mt7921_register_device"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/init.c=131=static void mt7921_init_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-169-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:170:int mt7921_register_device(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-171-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-255-}\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:256:EXPORT_SYMBOL_GPL(mt7921_register_device);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=204=int __mt7921_start(struct mt792x_phy *phy);\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:205:int mt7921_register_device(struct mt792x_dev *dev);\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-206-void mt7921_unregister_device(struct mt792x_dev *dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=259=static int mt7921_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-433-\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:434:\tret = mt7921_register_device(dev);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-435-\tif (ret)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c=90=static int mt7921s_probe(struct sdio_func *func,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-188-\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c:189:\tret = mt7921_register_device(dev);\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-190-\tif (ret)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c=150=static int mt7921u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-245-\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:246:\tret = mt7921_register_device(dev);\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-247-\tif (ret)\n"
}

25/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 41900
							output: 50
							thoughts: 41
						

Thoughts:
Okay, let's dive into this. Here's my take on those thoughts, as though they were my own:

**Analyzing the mt7921 Device Registration**

Right, let's get down to brass tacks. I need to understand how this MT7921 device is being initialized and brought into the system. Let's start with `mt7921_register_device` within `drivers/net/wireless/mediatek/mt76/mt7921/init.c`. That function is obviously the crucial point where the driver announces itself to the kernel. I need to see what's happening *around* that call: the preceding setup, the arguments passed to it, and critically, what happens *after* it's invoked.

I'm thinking about the data structures being populated. Is it using a `wiphy` structure? What information is being provided to the core wireless stack? Any specific customizations or hardware-specific configuration being applied at this stage? Is this code handling any specific resource allocation, interrupts, DMA setup, or power management steps?

I need to understand its relationship to the lower-level hardware initialization code. Where's the call to `platform_device_register()`? Where is the PCI/SDIO/USB device being mapped to this function? I'm hoping to quickly identify the points of entry, the critical data structures and understand the function's responsibility within the system's broader picture. That initial registration is the lynchpin, the point of connection. I'll need to trace the flow from there. I'm looking for the key registration points within the device tree.



26/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/init.c",
  "FirstLine": 170,
  "LineCount": 80
}

Results:
{
  "Contents": " 170:\tint mt7921_register_device(struct mt792x_dev *dev)\n 171:\t{\n 172:\t\tstruct ieee80211_hw *hw = mt76_hw(dev);\n 173:\t\tint ret;\n 174:\t\n 175:\t\tdev-\u003ephy.dev = dev;\n 176:\t\tdev-\u003ephy.mt76 = \u0026dev-\u003emt76.phy;\n 177:\t\tdev-\u003emt76.phy.priv = \u0026dev-\u003ephy;\n 178:\t\tdev-\u003emt76.tx_worker.fn = mt792x_tx_worker;\n 179:\t\n 180:\t\tINIT_DELAYED_WORK(\u0026dev-\u003epm.ps_work, mt792x_pm_power_save_work);\n 181:\t\tINIT_WORK(\u0026dev-\u003epm.wake_work, mt792x_pm_wake_work);\n 182:\t\tspin_lock_init(\u0026dev-\u003epm.wake.lock);\n 183:\t\tmutex_init(\u0026dev-\u003epm.mutex);\n 184:\t\tinit_waitqueue_head(\u0026dev-\u003epm.wait);\n 185:\t\tinit_waitqueue_head(\u0026dev-\u003ewait);\n 186:\t\tif (mt76_is_sdio(\u0026dev-\u003emt76))\n 187:\t\t\tinit_waitqueue_head(\u0026dev-\u003emt76.sdio.wait);\n 188:\t\tspin_lock_init(\u0026dev-\u003epm.txq_lock);\n 189:\t\tINIT_DELAYED_WORK(\u0026dev-\u003emphy.mac_work, mt792x_mac_work);\n 190:\t\tINIT_DELAYED_WORK(\u0026dev-\u003ephy.scan_work, mt7921_scan_work);\n 191:\t\tINIT_DELAYED_WORK(\u0026dev-\u003ecoredump.work, mt7921_coredump_work);\n 192:\t#if IS_ENABLED(CONFIG_IPV6)\n 193:\t\tINIT_WORK(\u0026dev-\u003eipv6_ns_work, mt7921_set_ipv6_ns_work);\n 194:\t\tskb_queue_head_init(\u0026dev-\u003eipv6_ns_list);\n 195:\t#endif\n 196:\t\tskb_queue_head_init(\u0026dev-\u003ephy.scan_event_list);\n 197:\t\tskb_queue_head_init(\u0026dev-\u003ecoredump.msg_list);\n 198:\t\n 199:\t\tINIT_WORK(\u0026dev-\u003ereset_work, mt7921_mac_reset_work);\n 200:\t\tINIT_WORK(\u0026dev-\u003einit_work, mt7921_init_work);\n 201:\t\n 202:\t\tINIT_WORK(\u0026dev-\u003ephy.roc_work, mt7921_roc_work);\n 203:\t\ttimer_setup(\u0026dev-\u003ephy.roc_timer, mt792x_roc_timer, 0);\n 204:\t\tinit_waitqueue_head(\u0026dev-\u003ephy.roc_wait);\n 205:\t\n 206:\t\tdev-\u003epm.idle_timeout = MT792x_PM_TIMEOUT;\n 207:\t\tdev-\u003epm.stats.last_wake_event = jiffies;\n 208:\t\tdev-\u003epm.stats.last_doze_event = jiffies;\n 209:\t\n 210:\t\tif (!mt76_is_usb(\u0026dev-\u003emt76) \u0026\u0026\n 211:\t\t    !is_mt7902(\u0026dev-\u003emt76)) {\n 212:\t\t\tdev-\u003epm.enable_user = true;\n 213:\t\t\tdev-\u003epm.enable = true;\n 214:\t\t\tdev-\u003epm.ds_enable_user = true;\n 215:\t\t\tdev-\u003epm.ds_enable = true;\n 216:\t\t}\n 217:\t\n 218:\t\tif (!mt76_is_mmio(\u0026dev-\u003emt76))\n 219:\t\t\thw-\u003eextra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE;\n 220:\t\n 221:\t\tmt792x_init_acpi_sar(dev);\n 222:\t\n 223:\t\tret = mt792x_init_wcid(dev);\n 224:\t\tif (ret)\n 225:\t\t\treturn ret;\n 226:\t\n 227:\t\tret = mt792x_init_wiphy(hw);\n 228:\t\tif (ret)\n 229:\t\t\treturn ret;\n 230:\t\n 231:\t\thw-\u003ewiphy-\u003ereg_notifier = mt7921_regd_notifier;\n 232:\t\tdev-\u003emphy.sband_2g.sband.ht_cap.cap |=\n 233:\t\t\t\tIEEE80211_HT_CAP_LDPC_CODING |\n 234:\t\t\t\tIEEE80211_HT_CAP_MAX_AMSDU;\n 235:\t\tdev-\u003emphy.sband_5g.sband.ht_cap.cap |=\n 236:\t\t\t\tIEEE80211_HT_CAP_LDPC_CODING |\n 237:\t\t\t\tIEEE80211_HT_CAP_MAX_AMSDU;\n 238:\t\tdev-\u003emphy.sband_5g.sband.vht_cap.cap |=\n 239:\t\t\t\tIEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |\n 240:\t\t\t\tIEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK |\n 241:\t\t\t\tIEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |\n 242:\t\t\t\tIEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |\n 243:\t\t\t\t(3 \u003c\u003c IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT);\n 244:\t\tif (is_mt7922(\u0026dev-\u003emt76))\n 245:\t\t\tdev-\u003emphy.sband_5g.sband.vht_cap.cap |=\n 246:\t\t\t\tIEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |\n 247:\t\t\t\tIEEE80211_VHT_CAP_SHORT_GI_160;\n 248:\t\n 249:\t\tdev-\u003emphy.hw-\u003ewiphy-\u003eavailable_antennas_rx = dev-\u003emphy.chainmask;\n"
}

27/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 44057
							output: 50
							thoughts: 44
						

Thoughts:
Okay, let's break this down.

**Investigating the Scheduling of `mt7921_init_work`**

Right, so I need to figure out the timing of `mt7921_init_work`. Where is that scheduled? Best place to look is within the device registration sequence, specifically the `mt7921_register_device` function. I seem to recall that the scheduling is in the later stages, so I'll jump down to lines 250 and beyond in that function and see what's happening.



28/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/init.c",
  "FirstLine": 245,
  "LineCount": 35
}

Results:
{
  "Contents": " 245:\t\t\tdev-\u003emphy.sband_5g.sband.vht_cap.cap |=\n 246:\t\t\t\tIEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |\n 247:\t\t\t\tIEEE80211_VHT_CAP_SHORT_GI_160;\n 248:\t\n 249:\t\tdev-\u003emphy.hw-\u003ewiphy-\u003eavailable_antennas_rx = dev-\u003emphy.chainmask;\n 250:\t\tdev-\u003emphy.hw-\u003ewiphy-\u003eavailable_antennas_tx = dev-\u003emphy.chainmask;\n 251:\t\n 252:\t\tqueue_work(system_percpu_wq, \u0026dev-\u003einit_work);\n 253:\t\n 254:\t\treturn 0;\n 255:\t}\n 256:\tEXPORT_SYMBOL_GPL(mt7921_register_device);\n"
}

29/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 44526
							output: 50
							thoughts: 84
						

Thoughts:
Here's my analysis of the provided code snippet:

**Diving into the Initialization Process**

Okay, so I'm looking at line 252, specifically this `queue_work` call targeting `dev->init_work`. Naturally, my first instinct is to understand exactly *what* that `mt7921_init_work` function is doing. I can see it's critical to the initialization sequence. Time to jump over to lines 130-170 within `drivers/net/wireless/mediatek/mt76/mt7921/init.c` to unravel the mystery of that particular work queue item. I expect to see the core tasks involved in setting up the device, potentially including hardware bring-up, register initialization, and potentially driver-specific setup routines. I'll be keeping an eye out for any interactions with the hardware, the firmware loading process, and the registration of the network device itself. Understanding this `init_work` function will be key to grasping how this specific MT7921 device is being brought to life within the system. Let's see what the code reveals!



30/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/init.c",
  "FirstLine": 130,
  "LineCount": 45
}

Results:
{
  "Contents": " 130:\t\n 131:\tstatic void mt7921_init_work(struct work_struct *work)\n 132:\t{\n 133:\t\tstruct mt792x_dev *dev = container_of(work, struct mt792x_dev,\n 134:\t\t\t\t\t\t      init_work);\n 135:\t\tint ret;\n 136:\t\n 137:\t\tret = mt7921_init_hardware(dev);\n 138:\t\tif (ret)\n 139:\t\t\treturn;\n 140:\t\n 141:\t\tmt76_set_stream_caps(\u0026dev-\u003emphy, true);\n 142:\t\tmt7921_set_stream_he_caps(\u0026dev-\u003ephy);\n 143:\t\tmt792x_config_mac_addr_list(dev);\n 144:\t\n 145:\t\tret = mt76_register_device(\u0026dev-\u003emt76, true, mt76_rates,\n 146:\t\t\t\t\t   ARRAY_SIZE(mt76_rates));\n 147:\t\tif (ret) {\n 148:\t\t\tdev_err(dev-\u003emt76.dev, \"register device failed\\n\");\n 149:\t\t\treturn;\n 150:\t\t}\n 151:\t\n 152:\t\tret = mt7921_init_debugfs(dev);\n 153:\t\tif (ret) {\n 154:\t\t\tdev_err(dev-\u003emt76.dev, \"register debugfs failed\\n\");\n 155:\t\t\treturn;\n 156:\t\t}\n 157:\t\n 158:\t\tret = mt7921_thermal_init(\u0026dev-\u003ephy);\n 159:\t\tif (ret) {\n 160:\t\t\tdev_err(dev-\u003emt76.dev, \"thermal init failed\\n\");\n 161:\t\t\treturn;\n 162:\t\t}\n 163:\t\n 164:\t\t/* we support chip reset now */\n 165:\t\tdev-\u003ehw_init_done = true;\n 166:\t\n 167:\t\tmt76_connac_mcu_set_deep_sleep(\u0026dev-\u003emt76, dev-\u003epm.ds_enable);\n 168:\t}\n 169:\t\n 170:\tint mt7921_register_device(struct mt792x_dev *dev)\n 171:\t{\n 172:\t\tstruct ieee80211_hw *hw = mt76_hw(dev);\n 173:\t\tint ret;\n 174:\t\n"
}

31/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 45599
							output: 36
							thoughts: 891
						

Thoughts:
**Analyzing the Fuzzing Potential of the MT7921U USB Driver**

Okay, so `mt7921u_probe` is running – interesting. The first question that pops into my head, given my experience, is: "Does syzkaller even *test* USB devices?" I need to quickly establish if there's any pre-existing coverage or, crucially, if USB devices are considered accessible targets for fuzzing.

Let's do a quick re-read of the key sections of the fuzzing guidance - the rules are paramount here.

Section 1 reminds me of the critical importance of reachability: reachability *is* the gatekeeper. If the code modifications are fundamentally unreachable in a standard virtualized environment, it's a "no-go" for fuzzing, regardless of how complex the logic or how many assertions are added. That's the baseline, and I must adhere to that principle.

Section 2 clarifies when I should definitively return `WorthFuzzing=false`. It's a series of negative criteria: non-kernel changes, code requiring unavailable hardware, or unreachable execution paths. This section is all about what to avoid.

Section 3 is the positive side - when to return `WorthFuzzing=true`. It explicitly states that reachable drivers accessible via virtual buses are fair game. That is *very* interesting. It specifically mentions "USB gadget" right there!

Aha! "Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.)".

Now, what is this driver we're looking at? It's the MediaTek MT7921U, and MT7925U, which are USB wireless drivers! Wait a minute, isn't MT7921 also a PCIe and SDIO driver? Oh, right, MT7921E is PCIe, MT7921S is SDIO, and MT7921U is USB! Okay, so there's shared code. Specifically, the `mac.c`, `main.c`, and `mcu.c` files are shared between all the variants. And `mt792x_usb.c` is the USB-specific helper library used!

So, can MT7921U be probed, in fact, *fuzzed*, via USB gadget or, even better, raw-gadget? Raw-gadget offers the ultimate flexibility here. It allows user space - and this is where syzkaller becomes powerful - to emulate arbitrary USB device descriptors, endpoints, and responses to USB control transfers. This level of control is *perfect* for fuzzing!

The final step: Have any bugs been found in mt76 / mt7921u / mt7925u / mt792x_usb? Let's search the syzbot reports and look for similar commits in the mt76 driver. The git log of `drivers/net/wireless/mediatek/mt76` should provide an answer.



32/2 2026/09/29 00:11 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "syzbot.*",
  "PathPrefix": "drivers/net/wireless/mediatek/mt76"
}

Results:
{
  "error": "no matches"
}

33/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 47188
							output: 35
							thoughts: 49
						

Thoughts:
Okay, let's see what I can gather here.

**Finding Mentions of Syzbot/Syzaller in Code**

Hmm, right. I was a bit hasty expecting grepper to find "syzbot.*" across the entire git history. Of course, grepper focuses on source code, not the commit messages or general git log. That makes perfect sense. No worries, I can adjust my approach. The key here is to determine if "syzkaller" or "syzbot" are mentioned anywhere within the actual comments or code itself. Let's dig in and see what's what. This is where the real interesting stuff usually lies, anyway.



34/2 2026/09/29 00:11 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "syzkaller",
  "PathPrefix": "drivers/net/wireless/mediatek/mt76"
}

Results:
{
  "error": "no matches"
}

35/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 47428
							output: 48
							thoughts: 32
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in the weeds of kernel development and specifically working on the mt7921 wireless driver:

**Investigating the USB Device IDs for the mt7921 USB Driver**

Alright, time to get down to brass tacks. I need to get into the nitty-gritty of the mt7921 USB driver. Let's see... the first thing I need to confirm is the USB device IDs that this driver is designed to handle. I'm going to jump into the `drivers/net/wireless/mediatek/mt76/mt7921/usb.c` file. That's the logical place to start – it's where the USB-specific code for the mt7921 chip should reside. I want to make absolutely sure I'm targeting the correct hardware. Knowing the device IDs is fundamental to the driver's operation, so that's where I will begin my debugging efforts.



36/2 2026/09/29 00:11 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/usb.c",
  "FirstLine": 1,
  "LineCount": 40
}

Results:
{
  "Contents": "   1:\t// SPDX-License-Identifier: BSD-3-Clause-Clear\n   2:\t/* Copyright (C) 2022 MediaTek Inc.\n   3:\t *\n   4:\t * Author: Lorenzo Bianconi \u003clorenzo@kernel.org\u003e\n   5:\t */\n   6:\t\n   7:\t#include \u003clinux/kernel.h\u003e\n   8:\t#include \u003clinux/module.h\u003e\n   9:\t#include \u003clinux/usb.h\u003e\n  10:\t\n  11:\t#include \"mt7921.h\"\n  12:\t#include \"mcu.h\"\n  13:\t#include \"../mt76_connac2_mac.h\"\n  14:\t\n  15:\tstatic const struct usb_device_id mt7921u_device_table[] = {\n  16:\t\t{ USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x7902, 0xff, 0xff, 0xff),\n  17:\t\t\t.driver_info = (kernel_ulong_t)MT7902_FIRMWARE_WM },\n  18:\t\t{ USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x7961, 0xff, 0xff, 0xff),\n  19:\t\t\t.driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM },\n  20:\t\t/* Comfast CF-952AX */\n  21:\t\t{ USB_DEVICE_AND_INTERFACE_INFO(0x3574, 0x6211, 0xff, 0xff, 0xff),\n  22:\t\t\t.driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM },\n  23:\t\t/* Netgear, Inc. [A8000,AXE3000] */\n  24:\t\t{ USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9060, 0xff, 0xff, 0xff),\n  25:\t\t\t.driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM },\n  26:\t\t/* Netgear, Inc. A7500 */\n  27:\t\t{ USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9065, 0xff, 0xff, 0xff),\n  28:\t\t\t.driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM },\n  29:\t\t/* TP-Link TXE50UH */\n  30:\t\t{ USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0107, 0xff, 0xff, 0xff),\n  31:\t\t\t.driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM },\n  32:\t\t{ },\n  33:\t};\n  34:\t\n  35:\tstatic int\n  36:\tmt7921u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,\n  37:\t\t\t\t int cmd, int *seq)\n  38:\t{\n  39:\t\tstruct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);\n  40:\t\tu32 pad, ep;\n"
}

37/2 2026/09/29 00:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 48601
							output: 21
							thoughts: 1760
						

Thoughts:
**Analyzing USB Disconnect in the MT792xu Driver**

Okay, let's break this down. My primary concern is the `mt792xu_disconnect` function and what's changed. Comparing the "before" and "after" code, the key addition is the cancellation of more delayed works: `mac_work`, `ps_work`, and `wake_work`.  This immediately flags a potential race condition and use-after-free scenario, which is exactly the kind of thing I'm always looking for.

I'm thinking about the implications.  While `mt76_unregister_device` is running (during the disconnect sequence), things like `abort_roc` could be called by mac80211 or cfg80211, potentially during unregistration or a ROC timeout. The original `disconnect` code might have left some flags in a state where these operations could attempt to access freed memory.  Also, `reset_work` could be running concurrently and clearing `MT76_RESET` after `disconnect` had set it, leading to a race and memory corruption. And `mcu_parse_response` could be triggered, resulting in `mt792x_reset` when MCU commands time out during removal.

Now, I'm trying to figure out if this is reachable during fuzzing with syzkaller.  The documentation is crucial here.  I need to consider the context of driver teardown callbacks like `.remove` and `.shutdown`. The documentation states that these are often only reached during "physical PCI hot-unplug or manual sysfs driver unbinding." My thought is, syzkaller *doesn't* hot-unplug *physical* PCI devices. However, *USB* devices are emulated using USB gadget and raw gadget. Therefore, syzkaller *does* connect and disconnect USB devices! It can trigger the `.disconnect` callback of the USB driver!

My next immediate task is to confirm if syzkaller can even probe the `mt7921u` driver in the first place, and then to investigate `__mt76u_init` and all the probe requirements.  I need to map out the entire initialization process to understand the full context of these potential race conditions.



38/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "__mt76u_init"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt76.h=1876=void ___mt76u_wr(struct mt76_dev *dev, u8 req, u8 req_type,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1877-\t\t u32 addr, u32 val);\ndrivers/net/wireless/mediatek/mt76/mt76.h:1878:int __mt76u_init(struct mt76_dev *dev, struct usb_interface *intf,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1879-\t\t struct mt76_bus_ops *ops);\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c=112=static int mt7663u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c-160-\tdev-\u003eops = ops;\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c:161:\tret = __mt76u_init(mdev, usb_intf, \u0026bus_ops);\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c-162-\tif (ret \u003c 0)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c=150=static int mt7921u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-211-\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:212:\tret = __mt76u_init(mdev, usb_intf, \u0026bus_ops);\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-213-\tif (ret \u003c 0)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=150=static int mt7925u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-210-\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:211:\tret = __mt76u_init(mdev, usb_intf, \u0026bus_ops);\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-212-\tif (ret \u003c 0)\n--\ndrivers/net/wireless/mediatek/mt76/usb.c=1117=static const struct mt76_queue_ops usb_queue_ops = {\n--\ndrivers/net/wireless/mediatek/mt76/usb.c-1121-\ndrivers/net/wireless/mediatek/mt76/usb.c:1122:int __mt76u_init(struct mt76_dev *dev, struct usb_interface *intf,\ndrivers/net/wireless/mediatek/mt76/usb.c-1123-\t\t struct mt76_bus_ops *ops)\n--\ndrivers/net/wireless/mediatek/mt76/usb.c-1180-}\ndrivers/net/wireless/mediatek/mt76/usb.c:1181:EXPORT_SYMBOL_GPL(__mt76u_init);\ndrivers/net/wireless/mediatek/mt76/usb.c-1182-\ndrivers/net/wireless/mediatek/mt76/usb.c=1183=int mt76u_init(struct mt76_dev *dev, struct usb_interface *intf)\n--\ndrivers/net/wireless/mediatek/mt76/usb.c-1195-\ndrivers/net/wireless/mediatek/mt76/usb.c:1196:\treturn __mt76u_init(dev, intf, \u0026bus_ops);\ndrivers/net/wireless/mediatek/mt76/usb.c-1197-}\n"
}

39/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 51938
							output: 23
							thoughts: 5079
						

Thoughts:
**Summary of Assessment for Fuzzing**

Okay, here's the breakdown, starting with the core question: Can Syzkaller effectively test these changes? My initial thought was to examine the code in `__mt76u_init` and `mt7921u_probe`, specifically how device disconnection might be handled.  Then I started to think about how Syzkaller's USB raw-gadget support is key here, and the changes in `mt792xu_disconnect`.  Section 3 of the fuzzing guide explicitly mentions that drivers accessible via virtual buses, including USB gadgets, are targets for fuzzing. Given that `mt7921` and `mt7925` represent USB Wi-Fi devices, which are historically heavily fuzzed, the relevance is clear. I remembered the interaction between the `cfg80211`, `mac80211`, and `nl80211` layers, in particular, the use of `nl80211` commands that would eventually call functions like `mt7921_abort_roc` and `mt7925_abort_roc`, particularly after looking at `mt7921_abort_roc` and `mt7925_abort_roc`'s code modifications.  The changes in `mt792xu_disconnect` immediately jumped out, especially the removal of `mt76_worker_disable`, and the addition of `cancel_delayed_work_sync`. I then focused on the `mac_reset_work` changes, specifically the check for `MT76_REMOVED` during the reset. Section 2 of the fuzzing guide defines negative criteria, so I methodically went through each point, analyzing whether the modified code fell into any of those categories. I determined that MediaTek MT7921 and MT7925 USB devices are accessible via USB (USB gadget) in standard QEMU. They are not vendor-specific PCIe hardware.  The modified code does not fall into the category of "driver teardown callbacks". This is a crucial point; syzkaller's ability to create and destroy USB devices makes the disconnect paths reachable.  Then I checked if syzkaller can actually probe the `mt7921u` and `mt7925u` drivers, especially as they use Vendor control transfers. I also re-emphasized that Syzkaller has successfully fuzzed USB wireless drivers, leading to various CVEs. Therefore, this code is reachable by syzkaller.  Then I reread Section 1, specifically: "REACHABILITY IS THE PRIMARY GATE", so I confirmed that this applies. The negative criteria do not apply, so the code is worth fuzzing. I confirmed that these functions are not static functions that are impossible to reach via fuzzing.  Therefore, I've concluded that these changes warrant fuzzing.

**FocusSymbols:**

*   `mt792xu_disconnect`
*   `mt7921_mac_reset_work`
*   `mt7921_abort_roc`
*   `mt7921_mcu_parse_response`
*   `mt7925_mac_reset_work`
*   `mt7925_abort_roc`
*   `mt7925_mcu_parse_response`

**EnableConfigs:**

*   `USB`
*   `USB_GADGET`
*   `NET_9250`
*   `CFG80211`
*   `MAC80211`
*   `MT76`

**Reasoning:**

The modified code affects USB device disconnection, MAC reset handling, Remain-on-Channel (ROC) abort, and MCU response parsing within the MT7921 and MT7925 USB Wi-Fi drivers. Syzkaller's USB raw-gadget emulation provides a means to reach and exercise this code, rendering it suitable for fuzzing. The changes are reachable and not excluded by any of the negative criteria. The positive criteria in Section 3, as well as the successful fuzzing of similar USB wireless drivers, confirm this. These changes involve reachable kernel code, which has a likelihood of introducing crashes, regressions, or latent bugs that are worth the investigation to reveal any defects that were introduced by this patch set.



40/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "mt7921_abort_roc"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/main.c=387=void mt7921_roc_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-405-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:406:static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-407-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=473=static int mt7921_cancel_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-478-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:479:\treturn mt7921_abort_roc(phy, mvif);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-480-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1449=static void mt7921_mgd_complete_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1454-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1455:\tmt7921_abort_roc(mvif-\u003ephy, mvif);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1456-}\n"
}

41/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 58494
							output: 27
							thoughts: 57
						

Thoughts:
Here's my analysis of the provided snippet, as if it were my thought process:

**Diving into the `mt7921_cancel_remain_on_channel` Function**

Okay, so I'm looking at `mt7921_cancel_remain_on_channel`. The code flow is pretty direct here, it's calling `mt7921_abort_roc`.  Now, that's not unexpected, cancelling something implies some sort of aborting or interruption, so that makes sense on the surface. But, the question now is, where *is* `mt7921_cancel_remain_on_channel` actually used? I need to understand the *callers* of this function to grasp the broader context. Understanding the origin of this function call will give important context to the design and purpose here. Time to trace back and find out where it's being assigned and initiated within the driver. Let's dig deeper!



42/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "mt7921_cancel_remain_on_channel"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/main.c=456=static int mt7921_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-472-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:473:static int mt7921_cancel_remain_on_channel(struct ieee80211_hw *hw,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-474-\t\t\t\t\t   struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1553=const struct ieee80211_ops mt7921_ops = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1604-\t.remain_on_channel = mt7921_remain_on_channel,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1605:\t.cancel_remain_on_channel = mt7921_cancel_remain_on_channel,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1606-\t.add_chanctx = mt7921_add_chanctx,\n"
}

43/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 59186
							output: 27
							thoughts: 61
						

Thoughts:
Here's my take:

**Investigating the IEEE80211 Callback for Channel Monitoring Cancellation**

Okay, so I'm digging into this `mt7921_cancel_remain_on_channel` function, right? It's registered as the `ieee80211_ops` callback for `.cancel_remain_on_channel`. Makes sense. But what about its cousin, `mt7925_cancel_remain_on_channel`? Are they analogous? I need to quickly determine if `mt7925` also implements a channel monitoring cancellation callback, or if it reuses or shadows the `mt7921` implementation. Time to check the codebase... let's see what's actually going on with that specific function. I need to understand the relationship between these two, specifically how their respective implementations handle channel monitoring cessation.



44/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "mt7925_cancel_remain_on_channel"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7925/main.c=629=static int mt7925_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-646-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:647:static int mt7925_cancel_remain_on_channel(struct ieee80211_hw *hw,\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-648-\t\t\t\t\t   struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=2721=const struct ieee80211_ops mt7925_ops = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2770-\t.remain_on_channel = mt7925_remain_on_channel,\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:2771:\t.cancel_remain_on_channel = mt7925_cancel_remain_on_channel,\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2772-\t.add_chanctx = mt7925_add_chanctx,\n"
}

45/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 59864
							output: 25
							thoughts: 310
						

Thoughts:
**Symbol Visibility in the Kernel**

Okay, so I'm thinking about these `mt7921_abort_roc` and `mt7925_abort_roc` functions and whether they should be listed in FocusSymbols. The question immediately pops up: are static functions, especially those within a `.c` file, even kept as symbols within `vmlinux` or accessible through `kallsyms`? This is a crucial distinction.

Generally, I know that static functions defined in `.c` files, and *not* inlined by the compiler, *are* present in `kallsyms`, but only if `CONFIG_KALLSYMS_ALL` is enabled.  But this gets tricky because the compiler might inline them. For instance, these could be inlined into something like `mt7921_cancel_remain_on_channel` or `mt7921_mgd_complete_tx`. That's the real challenge. But then... wait, `mt7921_cancel_remain_on_channel` *is* static too, so where does that leave us?

Alright, let's switch gears and focus on the non-static functions. I remember that `mt7921_mac_reset_work` is declared in `mt7921.h`, so it *should* be non-static. But, I should verify, just to be completely sure.

Okay, let's verify now:
`mt7921_mac_reset_work`: non-static!
`mt7921_mcu_parse_response`: non-static!
`mt7925_mac_reset_work`: non-static!
`mt7925_mcu_parse_response`: non-static!
`mt792xu_disconnect`: non-static!
This means I know it’s safe to proceed with these functions.  But just to be 100% sure, let me check the declarations of `mt7921_mac_reset_work` and `mt7925_mac_reset_work`... just to confirm.



46/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "mt7921_mac_reset_work"
}

Results:
{
  "Output": "drivers/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-198-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:199:\tINIT_WORK(\u0026dev-\u003ereset_work, mt7921_mac_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-200-\tINIT_WORK(\u0026dev-\u003einit_work, mt7921_init_work);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c=634=mt7921_vif_connect_iter(void *priv, u8 *mac,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-658-/* system error recovery */\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c:659:void mt7921_mac_reset_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-660-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=269=void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-270-\t\t\t   struct ieee80211_sta *sta);\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:271:void mt7921_mac_reset_work(struct work_struct *work);\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-272-int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,\n"
}

47/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 61260
							output: 25
							thoughts: 17
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach summarizing the prompt, keeping in mind my expertise:

**Checking `mt7925_mac_reset_work`**

Alright, so the task at hand is to analyze this `mt7925_mac_reset_work` item. My initial thought process would immediately go into several layers. First, I'm already mentally classifying it – this sounds like a function or work item related to MediaTek's MT7925 chipset, specifically dealing with Medium Access Control (MAC) layer reset operations. The use of "work" suggests it's likely a delayed work queue item, scheduled for later execution, possibly due to interrupts or some event that needs handling outside of an immediate interrupt context to avoid locking issues.

I'd start to think about the typical scenarios where such a reset might be triggered:

*   **Error Conditions:** What kind of MAC-layer errors could necessitate a reset? Is it related to packet transmission or reception failures? CRC errors? DMA issues? Link instabilities?
*   **Driver State:** How does this relate to the overall driver state? Is it part of the initialization/de-initialization sequence? Is it called after an unrecoverable error has been detected and the driver needs to attempt recovery?
*   **Concurrency:** I'd be trying to visualize the potential concurrency issues. Is this work item designed to be thread-safe? Does it need to acquire any locks or semaphores? What are the potential race conditions?
*   **Hardware Interaction:** My mind would already be mapping this to the hardware registers involved. What specific registers are likely to be affected during a MAC reset? I'd be thinking about potential side effects on other parts of the system. Are there any dependencies? Are there other modules that may also need to be notified about the reset, which could affect the whole data path.
*   **Error Handling:** It would be important for me to understand the error handling approach. What happens if the reset fails? Does it retry? Does it log an error? Does it potentially disable the interface?
*   **Context:** What's the context in which this function executes? Is it in a hardware interrupt, in a work queue, etc.? That has considerable implications for what it can safely do.

My first step would be to search for a source-code listing of this routine and try to identify its purpose based on the code's comments and the context where it gets called. Then I can dig into the specifics and potential problem areas. My immediate goal will be to gain a deep conceptual understanding of what the function is intended to do, and where the potential bottlenecks or risks are.



48/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "mt7925_mac_reset_work"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7925/init.c=243=int mt7925_register_device(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-270-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:271:\tINIT_WORK(\u0026dev-\u003ereset_work, mt7925_mac_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-272-\tINIT_WORK(\u0026dev-\u003einit_work, mt7925_init_work);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=1473=mt7925_vif_connect_iter(void *priv, u8 *mac,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1510-/* system error recovery */\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1511:void mt7925_mac_reset_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1512-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h=307=void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-308-\t\t\t   struct ieee80211_sta *sta);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:309:void mt7925_mac_reset_work(struct work_struct *work);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-310-int mt7925e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,\n"
}

49/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 62463
							output: 26
							thoughts: 33
						

Thoughts:
Here's a summary of my thought process, as requested:

**Diving into MCU Response Parsing**

Okay, time to get my hands dirty. I need to understand how we're handling the responses from the microcontrollers in these MediaTek Wi-Fi chipsets. My immediate focus is on the parsing logic. Specifically, I'm thinking about the functions `mt7921_mcu_parse_response` and `mt7925_mcu_parse_response`. I need to compare and contrast them. Are they similar? Are there significant differences in the data structures they handle or the parsing algorithms employed? Are there any indications of potential bugs or areas for optimization that jump out at me as I review this code? Ultimately, I want a firm grasp on the core logic that takes raw MCU data and turns it into something usable by the driver.



50/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "mt7921_mcu_parse_response"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/mcu.c-14-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:15:int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-16-\t\t\t      struct sk_buff *skb, int seq)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-77-}\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:78:EXPORT_SYMBOL_GPL(mt7921_mcu_parse_response);\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-79-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=301=int mt7921_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-302-\t\t\t struct netlink_callback *cb, void *data, int len);\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:303:int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-304-\t\t\t      struct sk_buff *skb, int seq);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c=41=int mt7921e_mcu_init(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c-45-\t\t.mcu_skb_send_msg = mt7921_mcu_send_message,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c:46:\t\t.mcu_parse_response = mt7921_mcu_parse_response,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c-47-\t};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c=74=int mt7921s_mcu_init(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c-80-\t\t.mcu_skb_send_msg = mt7921s_mcu_send_message,\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c:81:\t\t.mcu_parse_response = mt7921_mcu_parse_response,\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c-82-\t\t.mcu_rr = mt76_connac_mcu_reg_rr,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c=65=static int mt7921u_mcu_init(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-71-\t\t.mcu_skb_send_msg = mt7921u_mcu_send_message,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:72:\t\t.mcu_parse_response = mt7921_mcu_parse_response,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-73-\t};\n"
}

51/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 63772
							output: 26
							thoughts: 42
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Checking MCU Response Parsing in MT79xx Drivers**

Right, `mt7921_mcu_parse_response` is *EXPORT_SYMBOL_GPL*. I expect that's for good reason, probably related to some kind of external interaction or perhaps a module-level driver accessing it. Let's see if there's any consistency or, more likely, a shared methodology here. I'll need to check the related function in the other Mediatek wifi drivers – specifically, let's look at `mt7925_mcu_parse_response`. That comparison will likely reveal any patterns. Are the responses parsed similarly across generations of the hardware? Is there a common structure they’re adhering to? Or maybe a standardized error handling approach? It’s useful to see if the later one is doing things differently, perhaps using the learnings from previous iterations. This is all about code re-use, maintainability, and understanding potential points of failure or areas where we might be able to optimize.



52/2 2026/09/29 00:12 tool grepper
0m Args:
{
  "Expression": "mt7925_mcu_parse_response"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7925/mcu.c=16=static bool mt7925_vif_is_nan(struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-21-\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:22:int mt7925_mcu_parse_response(struct mt76_dev *mdev, int cmd,\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-23-\t\t\t      struct sk_buff *skb, int seq)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-80-}\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:81:EXPORT_SYMBOL_GPL(mt7925_mcu_parse_response);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-82-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h=348=void mt7925_txwi_free(struct mt792x_dev *dev, struct mt76_txwi_cache *t,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-350-\t\t      struct list_head *free_list);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:351:int mt7925_mcu_parse_response(struct mt76_dev *mdev, int cmd,\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-352-\t\t\t      struct sk_buff *skb, int seq);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mcu.c=27=int mt7925e_mcu_init(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mcu.c-31-\t\t.mcu_skb_send_msg = mt7925_mcu_send_message,\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mcu.c:32:\t\t.mcu_parse_response = mt7925_mcu_parse_response,\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mcu.c-33-\t};\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=56=static int mt7925u_mcu_init(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-62-\t\t.mcu_skb_send_msg = mt7925u_mcu_send_message,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:63:\t\t.mcu_parse_response = mt7925_mcu_parse_response,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-64-\t};\n"
}

53/2 2026/09/29 00:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 64983
							output: 36
							thoughts: 902
						

Thoughts:
**Analyzing Coverage Requirements for MT7921/MT7925 Abort ROC Functions**

Okay, so I'm looking at these `mt7921_abort_roc` and `mt7925_abort_roc` functions. They're static, called from `*_cancel_remain_on_channel` and `*_mgd_complete_tx`, which is pretty straightforward. The question is, can we actually target them directly for coverage analysis? Since they're static, I need to keep the possibility of inlining in mind.

Right, time to re-read the documentation on this. The relevant section deals with compiler-inlined static functions. The key point is that these static functions *within .c files*, if not inlined, *will* have symbols. If they *are* inlined, the symbol could be that of the caller, not the static function itself.

Given that, I think we're safe to include `mt7921_abort_roc` and `mt7925_abort_roc`, along with `mt7921_mac_reset_work`, `mt7921_mcu_parse_response`, `mt7925_mac_reset_work`, `mt7925_mcu_parse_response`, and `mt792xu_disconnect`. They should provide clear, reliable coverage.

Next, I need to nail down the configuration requirements. What are the dependencies that must be enabled to even compile and reach this code? I'll check the Kconfig files for both the MT7921 and MT7925 drivers.

Okay, I'm digging into `drivers/net/wireless/mediatek/mt76/mt7921/Kconfig` and `drivers/net/wireless/mediatek/mt76/mt7925/Kconfig`. Looking at the `MT7921` and `MT7925` configurations, both share a common structure: Each has a common configuration (`MT7921_COMMON` and `MT7925_COMMON`), and then PCIe (`MT7921E`, `MT7925E`), SDIO (`MT7921S`), and USB (`MT7921U`, `MT7925U`) variants. All the variants require `MAC80211` and a transport-specific dependency (PCI, MMC, or USB). They all also select `MT792x_LIB` and `WANT_DEV_COREDUMP`. This is important for understanding the scope of what we're going to instrument. I'll need to remember that the presence of MT7921, MT7925 drivers depends on the specific transport selected (PCIe, SDIO or USB)



54/2 2026/09/29 00:13 tool grepper
0m Args:
{
  "Expression": "MT792",
  "PathPrefix": "drivers/net/wireless/mediatek/mt76"
}

Results:
{
  "Output": "\nFull output is too long, showing 500 out of 1947 lines.\nUse more precise expression if possible.\n\ndrivers/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/Makefile=7=obj-$(CONFIG_MT76_CONNAC_LIB) += mt76-connac-lib.o\ndrivers/net/wireless/mediatek/mt76/Makefile:8:obj-$(CONFIG_MT792x_LIB) += mt792x-lib.o\ndrivers/net/wireless/mediatek/mt76/Makefile:9:obj-$(CONFIG_MT792x_USB) += mt792x-usb.o\ndrivers/net/wireless/mediatek/mt76/Makefile-10-\n--\ndrivers/net/wireless/mediatek/mt76/Makefile=49=obj-$(CONFIG_MT7915E) += mt7915/\ndrivers/net/wireless/mediatek/mt76/Makefile:50:obj-$(CONFIG_MT7921_COMMON) += mt7921/\ndrivers/net/wireless/mediatek/mt76/Makefile-51-obj-$(CONFIG_MT7996E) += mt7996/\ndrivers/net/wireless/mediatek/mt76/Makefile:52:obj-$(CONFIG_MT7925_COMMON) += mt7925/\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\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:4:\tselect MT792x_LIB\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-5-\tselect WANT_DEV_COREDUMP\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\"\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:9:\tselect MT7921_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-10-\tdepends on MAC80211\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-12-\thelp\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:13:\t  This adds support for MT7921E 802.11ax 2x2:2SS wireless devices.\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-14-\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\"\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-19-\tselect MT76_SDIO\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:20:\tselect MT7921_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-21-\tdepends on MAC80211\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-23-\thelp\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:24:\t  This adds support for MT7921S 802.11ax 2x2:2SS wireless devices.\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-25-\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\"\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:30:\tselect MT792x_USB\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:31:\tselect MT7921_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-32-\tdepends on MAC80211\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-34-\thelp\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:35:\t  This adds support for MT7921U 802.11ax 2x2:2SS wireless devices.\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-36-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Makefile-2-\ndrivers/net/wireless/mediatek/mt76/mt7921/Makefile:3:obj-$(CONFIG_MT7921_COMMON) += mt7921-common.o\ndrivers/net/wireless/mediatek/mt76/mt7921/Makefile:4:obj-$(CONFIG_MT7921E) += mt7921e.o\ndrivers/net/wireless/mediatek/mt76/mt7921/Makefile:5:obj-$(CONFIG_MT7921S) += mt7921s.o\ndrivers/net/wireless/mediatek/mt76/mt7921/Makefile:6:obj-$(CONFIG_MT7921U) += mt7921u.o\ndrivers/net/wireless/mediatek/mt76/mt7921/Makefile-7-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c=64=int mt7921_mac_init(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-73-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:74:\tfor (i = 0; i \u003c MT792x_WTBL_SIZE; i++)\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-75-\t\tmt7921_mac_wtbl_update(dev, i,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c=109=static int mt7921_init_hardware(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-114-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:115:\tfor (i = 0; i \u003c MT792x_MCU_INIT_RETRY_COUNT; i++) {\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-116-\t\tret = __mt7921_init_hardware(dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-122-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:123:\tif (i == MT792x_MCU_INIT_RETRY_COUNT) {\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-124-\t\tdev_err(dev-\u003emt76.dev, \"hardware init failed\\n\");\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-205-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:206:\tdev-\u003epm.idle_timeout = MT792x_PM_TIMEOUT;\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-207-\tdev-\u003epm.stats.last_wake_event = jiffies;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c=447=void mt7921_mac_add_txs(struct mt792x_dev *dev, void *data)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-463-\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c:464:\tif (wcidx \u003e= MT792x_WTBL_SIZE)\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-465-\t\treturn;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c=786=int mt7921_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-818-\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c:819:\ttype = mt76_is_sdio(mdev) ? MT7921_SDIO_DATA : 0;\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-820-\tmt792x_skb_add_usb_sdio_hdr(dev, skb, type);\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-251-\tieee80211_queue_delayed_work(mphy-\u003ehw, \u0026mphy-\u003emac_work,\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)) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-262-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:263:\tif (phy-\u003echip_cap \u0026 MT792x_CHIP_CAP_WF_RF_PIN_CTRL_EVT_EN) {\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-264-\t\tmt7921_mcu_wf_rf_pin_ctrl(phy, WF_RF_PIN_INIT);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=301=mt7921_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-311-\tmvif-\u003ebss_conf.mt76.idx = __ffs64(~dev-\u003emt76.vif_mask);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:312:\tif (mvif-\u003ebss_conf.mt76.idx \u003e= MT792x_MAX_INTERFACES) {\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-313-\t\tret = -ENOSPC;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-331-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:332:\tidx = MT792x_WTBL_RESERVED - mvif-\u003ebss_conf.mt76.idx;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-333-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-350-\tvif-\u003edriver_flags |= IEEE80211_VIF_BEACON_FILTER;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:351:\tif (phy-\u003echip_cap \u0026 MT792x_CHIP_CAP_RSSI_NOTIFY_EVT_EN)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-352-\t\tvif-\u003edriver_flags |= IEEE80211_VIF_SUPPORTS_CQM_RSSI;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=456=static int mt7921_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-466-\tmt792x_mutex_acquire(phy-\u003edev);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:467:\terr = mt7921_set_roc(phy, mvif, chan, duration, MT7921_ROC_REQ_ROC);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-468-\tmt792x_mutex_release(phy-\u003edev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=482=int mt7921_set_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-500-\tieee80211_queue_delayed_work(mphy-\u003ehw, \u0026mphy-\u003emac_work,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:501:\t\t\t\t     MT792x_WATCHDOG_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-502-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=671=static void mt7921_configure_filter(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-675-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:676:#define MT7921_FILTER_FCSFAIL    BIT(2)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:677:#define MT7921_FILTER_CONTROL    BIT(5)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:678:#define MT7921_FILTER_OTHER_BSS  BIT(6)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:679:#define MT7921_FILTER_ENABLE     BIT(31)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-680-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-681-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:682:\tu32 flags = MT7921_FILTER_ENABLE;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-683-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:684:#define MT7921_FILTER(_fif, _type) do {\t\t\t\\\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-685-\t\tif (*total_flags \u0026 (_fif))\t\t\\\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:686:\t\t\tflags |= MT7921_FILTER_##_type;\t\\\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-687-\t} while (0)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-688-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:689:\tMT7921_FILTER(FIF_FCSFAIL, FCSFAIL);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:690:\tMT7921_FILTER(FIF_CONTROL, CONTROL);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:691:\tMT7921_FILTER(FIF_OTHER_BSS, OTHER_BSS);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-692-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=813=int mt7921_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-820-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:821:\tif (sta-\u003eaid \u003e MT7921_MAX_AID)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-822-\t\treturn -ENOENT;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-823-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:824:\tidx = mt76_wcid_alloc(dev-\u003emt76.wcid_mask, MT792x_WTBL_STA - 1);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-825-\tif (idx \u003c 0)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=863=int mt7921_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-869-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:870:\tif (sta-\u003eaid \u003e MT7921_MAX_AID)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-871-\t\treturn -ENOENT;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1174=static int mt7921_resume(struct ieee80211_hw *hw)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1187-\tieee80211_queue_delayed_work(hw, \u0026phy-\u003emt76-\u003emac_work,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1188:\t\t\t\t     MT792x_WATCHDOG_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1189-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1434=static void mt7921_mgd_prepare_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1444-\tmt7921_set_roc(mvif-\u003ephy, mvif, mvif-\u003ebss_conf.mt76.ctx-\u003edef.chan, duration,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1445:\t\t       MT7921_ROC_REQ_JOIN);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1446-\tmt792x_mutex_release(dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1619=EXPORT_SYMBOL_GPL(mt7921_ops);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1620-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1621:MODULE_DESCRIPTION(\"MediaTek MT7921 core driver\");\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1622-MODULE_LICENSE(\"Dual BSD/GPL\");\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=80=static int mt7921_mcu_read_eeprom(struct mt792x_dev *dev, u32 offset, u8 *val)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-83-\t\t.addr = cpu_to_le32(round_down(offset,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:84:\t\t\t\t    MT7921_EEPROM_BLOCK_SIZE)),\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-85-\t};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-94-\tres = (struct mt7921_mcu_eeprom_info *)skb-\u003edata;\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:95:\t*val = res-\u003edata[offset % MT7921_EEPROM_BLOCK_SIZE];\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-96-\tdev_kfree_skb(skb);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=145=mt7921_mcu_uni_roc_event(struct mt792x_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-156-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:157:\tif (grant-\u003ereqtype == MT7921_ROC_REQ_ROC)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-158-\t\tieee80211_ready_on_channel(dev-\u003emt76.phy.hw);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=168=mt7921_mcu_scan_event(struct mt792x_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-177-\tieee80211_queue_delayed_work(mphy-\u003ehw, \u0026phy-\u003escan_work,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:178:\t\t\t\t     MT792x_HW_SCAN_TIMEOUT);\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-179-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=417=static int mt7921_load_clc(struct mt792x_dev *dev, const char *fw_name)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-506-\t\t/* header content sanity */\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:507:\t\tif (clc-\u003eidx == MT7921_CLC_POWER \u0026\u0026\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-508-\t\t    u8_get_bits(clc-\u003etype, MT_EE_HW_TYPE_ENCAP) != hw_encap)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=1103=int mt7921_mcu_set_beacon_filter(struct mt792x_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1106-{\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1107:#define MT7921_FIF_BIT_CLR\t\tBIT(1)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1108:#define MT7921_FIF_BIT_SET\t\tBIT(0)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1109-\tint err;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1116-\t\terr = mt7921_mcu_set_rxfilter(dev, 0,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1117:\t\t\t\t\t      MT7921_FIF_BIT_SET,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1118-\t\t\t\t\t      MT_WF_RFCR_DROP_OTHER_BEACON);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1129-\terr = mt7921_mcu_set_rxfilter(dev, 0,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1130:\t\t\t\t      MT7921_FIF_BIT_CLR,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1131-\t\t\t\t      MT_WF_RFCR_DROP_OTHER_BEACON);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=1338=int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1373-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1374:\tif (dev-\u003ephy.chip_cap \u0026 MT792x_CHIP_CAP_CLC_EVT_EN)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1375-\t\treq.cap |= CLC_CAP_EVT_EN;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=1430=int mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1437-\tfor (i = 0; i \u003c ARRAY_SIZE(phy-\u003eclc); i++) {\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1438:\t\tif (i == MT792x_CLC_REGD)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1439-\t\t\tcontinue;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h-3-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:4:#ifndef __MT7921_MCU_H\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:5:#define __MT7921_MCU_H\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h-6-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h=41=struct mt7921_mcu_eeprom_info {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h-43-\t__le32 valid;\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:44:\tu8 data[MT7921_EEPROM_BLOCK_SIZE];\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h-45-} __packed;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h=88=enum {\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:89:\tMT7921_TM_NORMAL,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:90:\tMT7921_TM_TESTMODE,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:91:\tMT7921_TM_ICAP,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:92:\tMT7921_TM_ICAP_OVERLAP,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h:93:\tMT7921_TM_WIFISPECTRUM,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.h-94-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-3-\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:4:#ifndef __MT7921_H\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:5:#define __MT7921_H\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-6-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-9-\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:10:#define MT7921_MAX_AID                  20\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-11-\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:12:#define MT7921_TX_RING_SIZE\t\t2048\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:13:#define MT7921_TX_MCU_RING_SIZE\t\t256\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:14:#define MT7921_TX_FWDL_RING_SIZE\t128\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-15-\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:16:#define MT7921_RX_RING_SIZE\t\t1536\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:17:#define MT7921_RX_MCU_RING_SIZE\t\t8\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:18:#define MT7921_RX_MCU_WA_RING_SIZE\t512\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-19-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-22-\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:23:#define MT7921_EEPROM_SIZE\t\t3584\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:24:#define MT7921_TOKEN_SIZE\t\t8192\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-25-\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:26:#define MT7921_EEPROM_BLOCK_SIZE\t16\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-27-\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:28:#define MT7921_SKU_RATE_NUM\t\t161\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:29:#define MT7921_SKU_MAX_DELTA_IDX\tMT7921_SKU_RATE_NUM\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:30:#define MT7921_SKU_TABLE_SIZE\t\t(MT7921_SKU_RATE_NUM + 1)\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-31-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=48=enum mt7921_roc_req {\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:49:\tMT7921_ROC_REQ_JOIN,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:50:\tMT7921_ROC_REQ_ROC,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:51:\tMT7921_ROC_REQ_NUM\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-52-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=89=enum mt7921_sdio_pkt_type {\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:90:\tMT7921_SDIO_TXD,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:91:\tMT7921_SDIO_DATA,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:92:\tMT7921_SDIO_CMD,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:93:\tMT7921_SDIO_FWDL,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-94-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=112=enum mt7921_txq_id {\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:113:\tMT7921_TXQ_BAND0,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:114:\tMT7921_TXQ_BAND1,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:115:\tMT7921_TXQ_FWDL = 16,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:116:\tMT7921_TXQ_MCU_WM,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-117-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=119=enum mt7921_rxq_id {\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:120:\tMT7921_RXQ_BAND0 = 0,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:121:\tMT7921_RXQ_BAND1,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:122:\tMT7921_RXQ_MCU_WM = 0,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-123-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=136=enum {\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:137:\tMT7921_CLC_POWER,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:138:\tMT7921_CLC_CHAN,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:139:\tMT7921_CLC_MAX_NUM,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-140-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=17=static const struct pci_device_id mt7921_pci_device_table[] = {\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-18-\t{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7961),\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:19:\t\t.driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM },\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-20-\t{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7922),\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:21:\t\t.driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM },\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-22-\t{ PCI_DEVICE(PCI_VENDOR_ID_ITTIM, 0x7922),\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:23:\t\t.driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM },\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-24-\t{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0608),\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:25:\t\t.driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM },\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-26-\t{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0616),\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:27:\t\t.driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM },\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-28-\t{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7920),\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:29:\t\t.driver_data = (kernel_ulong_t)MT7920_FIRMWARE_WM },\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-30-\t{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7902),\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=44=static void mt7921e_unregister_device(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-49-\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:50:\tif (dev-\u003ephy.chip_cap \u0026 MT792x_CHIP_CAP_WF_RF_PIN_CTRL_EVT_EN)\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-51-\t\twiphy_rfkill_stop_polling(hw-\u003ewiphy);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=171=static int mt7921_dma_init(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-173-\tstruct mt7921_dma_layout layout = {\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:174:\t\t/* General case: MT7921 / MT7922 /MT7920 */\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:175:\t\t.mcu_wm_txq            = MT7921_TXQ_MCU_WM,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:176:\t\t.mcu_rxdone_ring_size  = MT7921_RX_MCU_RING_SIZE,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-177-\t\t.has_mcu_wa            = true,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-202-\t/* init tx queue */\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:203:\tret = mt76_connac_init_tx_queues(dev-\u003ephy.mt76, MT7921_TXQ_BAND0,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:204:\t\t\t\t\t MT7921_TX_RING_SIZE,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-205-\t\t\t\t\t MT_TX_RING_BASE, NULL, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-212-\tret = mt76_init_mcu_queue(\u0026dev-\u003emt76, MT_MCUQ_WM, layout.mcu_wm_txq,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:213:\t\t\t\t  MT7921_TX_MCU_RING_SIZE, MT_TX_RING_BASE);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-214-\tif (ret)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-217-\t/* firmware download */\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:218:\tret = mt76_init_mcu_queue(\u0026dev-\u003emt76, MT_MCUQ_FWDL, MT7921_TXQ_FWDL,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:219:\t\t\t\t  MT7921_TX_FWDL_RING_SIZE, MT_TX_RING_BASE);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-220-\tif (ret)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-224-\tret = mt76_queue_alloc(dev, \u0026dev-\u003emt76.q_rx[MT_RXQ_MCU],\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:225:\t\t\t       MT7921_RXQ_MCU_WM,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-226-\t\t\t       layout.mcu_rxdone_ring_size,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-233-\t\tret = mt76_queue_alloc(dev, \u0026dev-\u003emt76.q_rx[MT_RXQ_MCU_WA],\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:234:\t\t\t\t       MT7921_RXQ_MCU_WM,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:235:\t\t\t\t       MT7921_RX_MCU_WA_RING_SIZE,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-236-\t\t\t\t       MT_RX_BUF_SIZE, MT_WFDMA0(0x540));\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-242-\tret = mt76_queue_alloc(dev, \u0026dev-\u003emt76.q_rx[MT_RXQ_MAIN],\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:243:\t\t\t       MT7921_RXQ_BAND0, MT7921_RX_RING_SIZE,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-244-\t\t\t       MT_RX_BUF_SIZE, MT_RX_DATA_RING_BASE);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=259=static int mt7921_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-269-\t\t\t\tSURVEY_INFO_TIME_BSS_RX,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:270:\t\t.token_size = MT7921_TOKEN_SIZE,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-271-\t\t.tx_prepare_skb = mt7921e_tx_prepare_skb,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=731=MODULE_DEVICE_TABLE(pci, mt7921_pci_device_table);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:732:MODULE_FIRMWARE(MT7920_FIRMWARE_WM);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:733:MODULE_FIRMWARE(MT7920_ROM_PATCH);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:734:MODULE_FIRMWARE(MT7921_FIRMWARE_WM);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:735:MODULE_FIRMWARE(MT7921_ROM_PATCH);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:736:MODULE_FIRMWARE(MT7922_FIRMWARE_WM);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:737:MODULE_FIRMWARE(MT7922_ROM_PATCH);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-738-MODULE_FIRMWARE(MT7902_FIRMWARE_WM);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=741=MODULE_AUTHOR(\"Lorenzo Bianconi \u003clorenzo@kernel.org\u003e\");\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:742:MODULE_DESCRIPTION(\"MediaTek MT7921E (PCIe) wireless driver\");\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-743-MODULE_LICENSE(\"Dual BSD/GPL\");\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c=133=void mt7921_regd_notifier(struct wiphy *wiphy,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-165-\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:166:\tif (MT7921_REGD_SUPPORTED(\u0026dev-\u003ephy)) {\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-167-\t\tmt7921_regd_update(\u0026dev-\u003ephy, req-\u003ealpha2);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c=177=mt7921_regd_query_regdb(struct mt792x_phy *phy, char *alpha2)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-181-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:182:\tstruct mt7921_clc *clc = phy-\u003eclc[MT792x_CLC_REGD];\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-183-\tstruct mt7921_regd_query_req *req;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c=244=int mt7921_regd_update(struct mt792x_phy *phy, char *alpha2)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-260-\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:261:\tif (!MT7921_REGD_SUPPORTED(phy))\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-262-\t\treturn -EOPNOTSUPP;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c=351=int mt7921_regd_change(struct mt792x_phy *phy, char *alpha2)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-372-\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:373:\tif (MT7921_REGD_SUPPORTED(phy))\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-374-\t\treturn mt7921_regd_update(phy, alpha2);\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:375:\telse if (phy-\u003echip_cap \u0026 MT792x_CHIP_CAP_11D_EN)\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-376-\t\treturn regulatory_hint(wiphy, alpha2);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c=381=int mt7921_regd_init(struct mt792x_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-387-\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:388:\tif (MT7921_REGD_SUPPORTED(phy)) {\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-389-\t\twiphy-\u003eregulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED |\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-391-\t\treturn mt7921_regd_update(phy, \"00\");\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:392:\t} else if (phy-\u003echip_cap \u0026 MT792x_CHIP_CAP_11D_EN)\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c-393-\t\twiphy-\u003eregulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE |\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h-3-\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h:4:#ifndef __MT7921_REGD_H\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h:5:#define __MT7921_REGD_H\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h-6-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h=43=struct mt7921_regd_query_req {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h-54-\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h:55:#define MT7921_REGD_SUPPORTED(phy) \\\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h:56:\t(((phy)-\u003echip_cap \u0026 MT792x_CHIP_CAP_REGD_EN) \u0026\u0026 \\\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h:57:\t(phy)-\u003eclc[MT792x_CLC_REGD])\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h-58-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/regs.h-3-\ndrivers/net/wireless/mediatek/mt76/mt7921/regs.h:4:#ifndef __MT7921_REGS_H\ndrivers/net/wireless/mediatek/mt76/mt7921/regs.h:5:#define __MT7921_REGS_H\ndrivers/net/wireless/mediatek/mt76/mt7921/regs.h-6-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c=19=static const struct sdio_device_id mt7921s_table[] = {\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-20-\t{ SDIO_DEVICE(SDIO_VENDOR_ID_MEDIATEK, 0x7901),\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c:21:\t\t.driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM },\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-22-\t{ SDIO_DEVICE(SDIO_VENDOR_ID_MEDIATEK, 0x7902),\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c=319=MODULE_DEVICE_TABLE(sdio, mt7921s_table);\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c:320:MODULE_FIRMWARE(MT7921_FIRMWARE_WM);\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c:321:MODULE_FIRMWARE(MT7921_ROM_PATCH);\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-322-MODULE_FIRMWARE(MT7902_FIRMWARE_WM);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c=334=module_sdio_driver(mt7921s_driver);\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c:335:MODULE_DESCRIPTION(\"MediaTek MT7921S (SDIO) wireless driver\");\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-336-MODULE_AUTHOR(\"Sean Wang \u003csean.wang@mediatek.com\u003e\");\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c=16=mt7921s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c-19-\tstruct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c:20:\tenum mt7921_sdio_pkt_type type = MT7921_SDIO_CMD;\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c-21-\tenum mt76_mcuq_id txq = MT_MCUQ_WM;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c-38-\tif (cmd == MCU_CMD(FW_SCATTER))\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c:39:\t\ttype = MT7921_SDIO_FWDL;\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c-40-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c=6=enum mt7921_testmode_attr {\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:7:\tMT7921_TM_ATTR_UNSPEC,\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:8:\tMT7921_TM_ATTR_SET,\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:9:\tMT7921_TM_ATTR_QUERY,\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:10:\tMT7921_TM_ATTR_RSP,\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c-11-\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c-12-\t/* keep last */\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:13:\tNUM_MT7921_TM_ATTRS,\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:14:\tMT7921_TM_ATTR_MAX = NUM_MT7921_TM_ATTRS - 1,\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c-15-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c=23=struct mt7921_tm_evt {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c-27-\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:28:static const struct nla_policy mt7921_tm_policy[NUM_MT7921_TM_ATTRS] = {\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:29:\t[MT7921_TM_ATTR_SET] = NLA_POLICY_EXACT_LEN(sizeof(struct mt7921_tm_cmd)),\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:30:\t[MT7921_TM_ATTR_QUERY] = NLA_POLICY_EXACT_LEN(sizeof(struct mt7921_tm_cmd)),\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c-31-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c=34=mt7921_tm_set(struct mt792x_dev *dev, struct mt7921_tm_cmd *req)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c-48-\tif (req-\u003eaction == TM_SWITCH_MODE) {\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:49:\t\tif (req-\u003eparam0 == MT7921_TM_NORMAL)\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c-50-\t\t\tnormal = true;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c=111=int mt7921_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,\n\n"
}

55/2 2026/09/29 00:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 83573
							output: 41
							thoughts: 245
						

Thoughts:
**Analyzing the MediTek Wireless Driver Configuration**

Okay, let's break this down. I'm looking at how these MediaTek wireless drivers are compiled. I see that `mt7921-common.o` is built if `CONFIG_MT7921_COMMON` is enabled, and similarly, `mt7925-common.o` relies on `CONFIG_MT7925_COMMON`. Then, `mt792x-usb.o` is tied to `CONFIG_MT792x_USB`. I need to figure out the dependencies and relationships here. Specifically, I'm trying to determine what enables both `CONFIG_MT7921_COMMON` *and* `CONFIG_MT792x_USB`.

Aha! `CONFIG_MT7921U` seems to be the key, as it selects both `CONFIG_MT792x_USB` and `CONFIG_MT7921_COMMON`. And `CONFIG_MT7925U` selects `CONFIG_MT792x_USB` and `CONFIG_MT7925_COMMON`. I also have to check the dependencies. So `MT7921U` and `MT7925U` both depend on MAC80211 and USB. I'll need to confirm this by checking the `drivers/net/wireless/mediatek/mt76/Kconfig` file, which probably defines this logic.



56/2 2026/09/29 00:13 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/Kconfig",
  "FirstLine": 1,
  "LineCount": 50
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: BSD-3-Clause-Clear\n   2:\tconfig MT76_CORE\n   3:\t\ttristate\n   4:\t\tselect PAGE_POOL\n   5:\t\n   6:\tconfig MT76_LEDS\n   7:\t\tbool\n   8:\t\tdepends on MT76_CORE\n   9:\t\tdepends on LEDS_CLASS=y || MT76_CORE=LEDS_CLASS\n  10:\t\tdefault y\n  11:\t\n  12:\tconfig MT76_USB\n  13:\t\ttristate\n  14:\t\tdepends on MT76_CORE\n  15:\t\n  16:\tconfig MT76_SDIO\n  17:\t\ttristate\n  18:\t\tdepends on MT76_CORE\n  19:\t\n  20:\tconfig MT76x02_LIB\n  21:\t\ttristate\n  22:\t\tselect MT76_CORE\n  23:\t\n  24:\tconfig MT76x02_USB\n  25:\t\ttristate\n  26:\t\tselect MT76_USB\n  27:\t\n  28:\tconfig MT76_CONNAC_LIB\n  29:\t\ttristate\n  30:\t\tselect MT76_CORE\n  31:\t\n  32:\tconfig MT792x_LIB\n  33:\t\ttristate\n  34:\t\tselect MT76_CONNAC_LIB\n  35:\t\n  36:\tconfig MT792x_USB\n  37:\t\ttristate\n  38:\t\tselect MT76_USB\n  39:\t\n  40:\tconfig MT76_NPU\n  41:\t\ttristate\n  42:\t\tdepends on NET_AIROHA_NPU=y || MT76_CORE=NET_AIROHA_NPU\n  43:\t\n  44:\tsource \"drivers/net/wireless/mediatek/mt76/mt76x0/Kconfig\"\n  45:\tsource \"drivers/net/wireless/mediatek/mt76/mt76x2/Kconfig\"\n  46:\tsource \"drivers/net/wireless/mediatek/mt76/mt7603/Kconfig\"\n  47:\tsource \"drivers/net/wireless/mediatek/mt76/mt7615/Kconfig\"\n  48:\tsource \"drivers/net/wireless/mediatek/mt76/mt7915/Kconfig\"\n  49:\tsource \"drivers/net/wireless/mediatek/mt76/mt7921/Kconfig\"\n  50:\tsource \"drivers/net/wireless/mediatek/mt76/mt7996/Kconfig\"\n"
}

57/2 2026/09/29 00:13 llm patch-evaluator-compressor
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Reply:
### State of Workspace and Patch Under Review

HEAD commit `b3e77860ea864be0a7fa22c5bee4dfdd0ae0c668` modifies MediaTek wireless drivers (`mt7921`, `mt7925`, and shared USB helper `mt792x_usb`):
1. `drivers/net/wireless/mediatek/mt76/mt7921/mac.c`: Adds `MT76_REMOVED` check in `mt7921_mac_reset_work` at entry, in loop, and before clearing `MT76_RESET`.
2. `drivers/net/wireless/mediatek/mt76/mt7921/main.c`: Adds `MT76_REMOVED` check in `mt7921_abort_roc` to clear `MT76_STATE_ROC` and exit early without acquiring mutex/calling MCU.
3. `drivers/net/wireless/mediatek/mt76/mt7921/mcu.c`: Prevents `mt792x_reset` and error logging on response timeout in `mt7921_mcu_parse_response` if `MT76_MCU_RESET` or `MT76_REMOVED` is set.
4. `drivers/net/wireless/mediatek/mt76/mt7925/mac.c`: Adds `MT76_REMOVED` check in `mt7925_mac_reset_work` at entry.
5. `drivers/net/wireless/mediatek/mt76/mt7925/main.c`: Adds `MT76_REMOVED` check in `mt7925_abort_roc`.
6. `drivers/net/wireless/mediatek/mt76/mt7925/mcu.c`: Adds `MT76_MCU_RESET` and `MT76_REMOVED` checks in `mt7925_mcu_parse_response`.
7. `drivers/net/wireless/mediatek/mt76/mt792x_usb.c`: In `mt792xu_disconnect`, sets `MT76_REMOVED` at start instead of end; adds cancellations for `dev->mphy.mac_work`, `dev->pm.ps_work`, and `dev->pm.wake_work`.

---

### Approaches Tried & Results

1. **Driver Type & Reachability Analysis:**
   - Checked driver registration in `drivers/net/wireless/mediatek/mt76/mt7921/usb.c` and `drivers/net/wireless/mediatek/mt76/mt7925/usb.c`.
   - Identified that `mt7921u` and `mt7925u` are USB wireless devices accessible via USB emulation (syzkaller `syz_usb_connect` / `raw-gadget`).
   - Evaluated reachability rules: teardown/disconnect of USB devices via raw-gadget is reachable in syzkaller fuzzing environments, unlike physical PCI hotplug.
   - Result: `WorthFuzzing=true`.

2. **Kconfig Dependencies Inspection:**
   - Read `drivers/net/wireless/mediatek/mt76/mt7921/Kconfig` and `drivers/net/wireless/mediatek/mt76/mt7925/Kconfig`.
   - Found dependencies:
     - `MT7921U` depends on `MAC80211`, `USB`, selects `MT792x_USB`, `MT7921_COMMON`.
     - `MT7925U` depends on `MAC80211`, `USB`, selects `MT792x_USB`, `MT7925_COMMON`.
     - `MT7921_COMMON` and `MT7925_COMMON` select `MT792x_LIB` and `WANT_DEV_COREDUMP`.

3. **Symbol Export & Static Analysis:**
   - Checked symbol declarations in headers (`mt7921.h`, `mt7925.h`, `mt792x.h`).
   - `mt792xu_disconnect`, `mt7921_mac_reset_work`, `mt7921_mcu_parse_response`, `mt7925_mac_reset_work`, `mt7925_mcu_parse_response` are non-static / exported or declared in headers.
   - `mt7921_abort_roc` and `mt7925_abort_roc` are static functions called via `ieee80211_ops` callbacks `.cancel_remain_on_channel` (`mt7921_cancel_remain_on_channel`, `mt7925_cancel_remain_on_channel`).

4. **Dead-ends / Unproductive Queries:**
   - Attempted grep for `syzbot` / `syzkaller` strings inside driver source code comments; returned no matches (expected since commit logs are not in source files).

---

### Critical File Paths & Code Context

- **`drivers/net/wireless/mediatek/mt76/mt792x_usb.c`**:
```c
void mt792xu_disconnect(struct usb_interface *usb_intf)
{
	struct mt792x_dev *dev = usb_get_intfdata(usb_intf);

	if (!dev)
		return;

	set_bit(MT76_REMOVED, &dev->mphy.state);
	set_bit(MT76_RESET, &dev->mphy.state);
	set_bit(MT76_MCU_RESET, &dev->mphy.state);
	clear_bit(MT76_STATE_RUNNING, &dev->mphy.state);
	wake_up(&dev->mt76.mcu.wait);
	skb_queue_purge(&dev->mt76.mcu.res_q);

	cancel_work_sync(&dev->reset_work);
	cancel_work_sync(&dev->init_work);
	cancel_delayed_work_sync(&dev->mphy.mac_work);
	cancel_delayed_work_sync(&dev->pm.ps_work);
	cancel_work_sync(&dev->pm.wake_work);
	mt792xu_reset_work_cleanup(dev);
	if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state))
		return;

	mt76_unregister_device(&dev->mt76);
	mt792xu_cleanup(dev);

	usb_set_intfdata(usb_intf, NULL);

	mt76_free_device(&dev->mt76);
}
```

- **`drivers/net/wireless/mediatek/mt76/mt7921/mac.c`**: `mt7921_mac_reset_work`
- **`drivers/net/wireless/mediatek/mt76/mt7921/main.c`**: `mt7921_abort_roc`, `mt7921_cancel_remain_on_channel`
- **`drivers/net/wireless/mediatek/mt76/mt7921/mcu.c`**: `mt7921_mcu_parse_response`
- **`drivers/net/wireless/mediatek/mt76/mt7925/mac.c`**: `mt7925_mac_reset_work`
- **`drivers/net/wireless/mediatek/mt76/mt7925/main.c`**: `mt7925_abort_roc`, `mt7925_cancel_remain_on_channel`
- **`drivers/net/wireless/mediatek/mt76/mt7925/mcu.c`**: `mt7925_mcu_parse_response`

---

### Active Evaluation & Decisions

- **WorthFuzzing:** `true`
  - Changes fix race conditions during USB device disconnect and asynchronous work (`mac_reset_work`, `abort_roc`, MCU timeouts).
  - Code is reachable via virtual USB device emulation (`raw-gadget` / `syz_usb_connect`).
- **FocusSymbols:**
  - `mt792xu_disconnect`
  - `mt7921_mac_reset_work`
  - `mt7921_mcu_parse_response`
  - `mt7921_cancel_remain_on_channel`
  - `mt7925_mac_reset_work`
  - `mt7925_mcu_parse_response`
  - `mt7925_cancel_remain_on_channel`
- **EnableConfigs:**
  - `MT7921U`
  - `MT7925U`
  - `MT7921_COMMON`
  - `MT7925_COMMON`
  - `MT792x_USB`
  - `MAC80211`
  - `USB`

---

### Potential Loops / Next Actions

- Avoid re-reading files or repeating grep commands already completed (`mt792xu_disconnect`, Kconfig files, `init.c`, `mac.c`, `main.c`, `mcu.c`).
- Call `set-results` tool once with final results, then provide final summary explanation.

Tokens:
							input: 53366
							output: 2219
							thoughts: 2142
						

58/2 2026/09/29 00:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 27841
							output: 50
							thoughts: 0
						

59/2 2026/09/29 00:13 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/main.c",
  "FirstLine": 415,
  "LineCount": 40
}

Results:
{
  "Contents": " 415:\t\t\treturn 0;\n 416:\t\t}\n 417:\t\n 418:\t\tmt792x_mutex_acquire(phy-\u003edev);\n 419:\t\tif (test_and_clear_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate))\n 420:\t\t\terr = mt7921_mcu_abort_roc(phy, vif, phy-\u003eroc_token_id);\n 421:\t\tmt792x_mutex_release(phy-\u003edev);\n 422:\t\n 423:\t\treturn err;\n 424:\t}\n 425:\t\n 426:\tstatic int mt7921_set_roc(struct mt792x_phy *phy,\n 427:\t\t\t\t  struct mt792x_vif *vif,\n 428:\t\t\t\t  struct ieee80211_channel *chan,\n 429:\t\t\t\t  int duration,\n 430:\t\t\t\t  enum mt7921_roc_req type)\n 431:\t{\n 432:\t\tint err;\n 433:\t\n 434:\t\tif (test_and_set_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate))\n 435:\t\t\treturn -EBUSY;\n 436:\t\n 437:\t\tphy-\u003eroc_grant = false;\n 438:\t\n 439:\t\terr = mt7921_mcu_set_roc(phy, vif, chan, duration, type,\n 440:\t\t\t\t\t ++phy-\u003eroc_token_id);\n 441:\t\tif (err \u003c 0) {\n 442:\t\t\tclear_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate);\n 443:\t\t\tgoto out;\n 444:\t\t}\n 445:\t\n 446:\t\tif (!wait_event_timeout(phy-\u003eroc_wait, phy-\u003eroc_grant, HZ)) {\n 447:\t\t\tmt7921_mcu_abort_roc(phy, vif, phy-\u003eroc_token_id);\n 448:\t\t\tclear_bit(MT76_STATE_ROC, \u0026phy-\u003emt76-\u003estate);\n 449:\t\t\terr = -ETIMEDOUT;\n 450:\t\t}\n 451:\t\n 452:\tout:\n 453:\t\treturn err;\n 454:\t}\n"
}

60/2 2026/09/29 00:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 28540
							output: 23
							thoughts: 0
						

61/2 2026/09/29 00:13 tool grepper
0m Args:
{
  "Expression": "mt7921_abort_roc"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/main.c=387=void mt7921_roc_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-405-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:406:static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-407-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=473=static int mt7921_cancel_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-478-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:479:\treturn mt7921_abort_roc(phy, mvif);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-480-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1449=static void mt7921_mgd_complete_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1454-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1455:\tmt7921_abort_roc(mvif-\u003ephy, mvif);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1456-}\n"
}

62/2 2026/09/29 00:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 29072
							output: 23
							thoughts: 0
						

63/2 2026/09/29 00:14 tool grepper
0m Args:
{
  "Expression": "mt7925_abort_roc"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7925/main.c=533=void mt7925_roc_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-550-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:551:static int mt7925_abort_roc(struct mt792x_phy *phy,\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-552-\t\t\t    struct mt792x_bss_conf *mconf)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=647=static int mt7925_cancel_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-652-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:653:\treturn mt7925_abort_roc(phy, \u0026mvif-\u003ebss_conf);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-654-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=1174=mt7925_mac_set_links(struct mt76_dev *mdev, struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-1193-\t    (band == NL80211_BAND_5GHZ \u0026\u0026 secondary_band == NL80211_BAND_6GHZ)) {\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:1194:\t\tmt7925_abort_roc(mvif-\u003ephy, \u0026mvif-\u003ebss_conf);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-1195-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=2091=static void mt7925_mgd_complete_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2096-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:2097:\tmt7925_abort_roc(mvif-\u003ephy, \u0026mvif-\u003ebss_conf);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2098-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=2466=void mt7925_csa_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2501-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:2502:\t\tmt7925_abort_roc(mvif-\u003ephy, mconf);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2503-\t}\n"
}

64/2 2026/09/29 00:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 29994
							output: 27
							thoughts: 0
						

65/2 2026/09/29 00:14 tool grepper
0m Args:
{
  "Expression": "mt7921_cancel_remain_on_channel"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/main.c=456=static int mt7921_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-472-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:473:static int mt7921_cancel_remain_on_channel(struct ieee80211_hw *hw,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-474-\t\t\t\t\t   struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1553=const struct ieee80211_ops mt7921_ops = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1604-\t.remain_on_channel = mt7921_remain_on_channel,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1605:\t.cancel_remain_on_channel = mt7921_cancel_remain_on_channel,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1606-\t.add_chanctx = mt7921_add_chanctx,\n"
}

66/2 2026/09/29 00:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 30422
							output: 25
							thoughts: 0
						

67/2 2026/09/29 00:14 tool grepper
0m Args:
{
  "Expression": "mt7921_mac_reset_work"
}

Results:
{
  "Output": "drivers/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-198-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:199:\tINIT_WORK(\u0026dev-\u003ereset_work, mt7921_mac_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-200-\tINIT_WORK(\u0026dev-\u003einit_work, mt7921_init_work);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c=634=mt7921_vif_connect_iter(void *priv, u8 *mac,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-658-/* system error recovery */\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c:659:void mt7921_mac_reset_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-660-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h=269=void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-270-\t\t\t   struct ieee80211_sta *sta);\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:271:void mt7921_mac_reset_work(struct work_struct *work);\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h-272-int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,\n"
}

68/2 2026/09/29 00:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 31037
							output: 25
							thoughts: 0
						

69/2 2026/09/29 00:14 tool grepper
0m Args:
{
  "Expression": "mt7925_mac_reset_work"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7925/init.c=243=int mt7925_register_device(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-270-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:271:\tINIT_WORK(\u0026dev-\u003ereset_work, mt7925_mac_reset_work);\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-272-\tINIT_WORK(\u0026dev-\u003einit_work, mt7925_init_work);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=1473=mt7925_vif_connect_iter(void *priv, u8 *mac,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1510-/* system error recovery */\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1511:void mt7925_mac_reset_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1512-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h=307=void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-308-\t\t\t   struct ieee80211_sta *sta);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:309:void mt7925_mac_reset_work(struct work_struct *work);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-310-int mt7925e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,\n"
}

70/2 2026/09/29 00:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 31656
							output: 21
							thoughts: 0
						

71/2 2026/09/29 00:14 tool grepper
0m Args:
{
  "Expression": "mt792xu_disconnect"
}

Results:
{
  "Output": "drivers/net/wireless/mediatek/mt76/mt7921/usb.c=338=static struct usb_driver mt7921u_driver = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-341-\t.probe\t\t= mt7921u_probe,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:342:\t.disconnect\t= mt792xu_disconnect,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-343-#ifdef CONFIG_PM\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=355=static struct usb_driver mt7925u_driver = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-358-\t.probe\t\t= mt7925u_probe,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:359:\t.disconnect\t= mt792xu_disconnect,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-360-#ifdef CONFIG_PM\n--\ndrivers/net/wireless/mediatek/mt76/mt792x.h=611=void mt792xu_copy(struct mt76_dev *dev, u32 offset, const void *data, int len);\ndrivers/net/wireless/mediatek/mt76/mt792x.h:612:void mt792xu_disconnect(struct usb_interface *usb_intf);\ndrivers/net/wireless/mediatek/mt76/mt792x.h-613-void mt792xu_stop(struct ieee80211_hw *hw, bool suspend);\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c=495=EXPORT_SYMBOL_GPL(mt792xu_stop);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-496-\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:497:void mt792xu_disconnect(struct usb_interface *usb_intf)\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-498-{\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-526-}\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c:527:EXPORT_SYMBOL_GPL(mt792xu_disconnect);\ndrivers/net/wireless/mediatek/mt76/mt792x_usb.c-528-\n"
}

72/2 2026/09/29 00:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 32415
							output: 38
							thoughts: 0
						

73/2 2026/09/29 00:14 tool grepper
0m Args:
{
  "Expression": "config MT7925",
  "PathPrefix": "drivers/net/wireless/mediatek/mt76"
}

Results:
{
  "Output": "drivers/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"
}

74/2 2026/09/29 00:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 32773
							output: 47
							thoughts: 0
						

75/2 2026/09/29 00:14 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7925/Kconfig",
  "FirstLine": 1,
  "LineCount": 40
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: BSD-3-Clause-Clear\n   2:\tconfig MT7925_COMMON\n   3:\t\ttristate\n   4:\t\tselect MT792x_LIB\n   5:\t\tselect WANT_DEV_COREDUMP\n   6:\t\n   7:\tconfig MT7925E\n   8:\t\ttristate \"MediaTek MT7925E (PCIe) support\"\n   9:\t\tselect MT7925_COMMON\n  10:\t\tdepends on MAC80211\n  11:\t\tdepends on PCI\n  12:\t\thelp\n  13:\t\t  This adds support for MT7925-based wireless PCIe devices,\n  14:\t\t  which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n  15:\t\t  2x2:2SS 4096-QAM, 160MHz channels.\n  16:\t\n  17:\t\t  To compile this driver as a module, choose M here.\n  18:\t\n  19:\tconfig MT7925U\n  20:\t\ttristate \"MediaTek MT7925U (USB) support\"\n  21:\t\tselect MT792x_USB\n  22:\t\tselect MT7925_COMMON\n  23:\t\tdepends on MAC80211\n  24:\t\tdepends on USB\n  25:\t\thelp\n  26:\t\t  This adds support for MT7925-based wireless USB devices,\n  27:\t\t  which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n  28:\t\t  2x2:2SS 4096-QAM, 160MHz channels.\n  29:\t\n  30:\t\t  To compile this driver as a module, choose M here.\n"
}

76/2 2026/09/29 00:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 33302
							output: 311
							thoughts: 0
						

77/2 2026/09/29 00:14 tool set-results
0m Args:
{
  "EnableConfigs": [
    "MAC80211",
    "USB",
    "MT7921U",
    "MT7925U",
    "MT7921_COMMON",
    "MT7925_COMMON",
    "MT792x_USB"
  ],
  "FocusSymbols": [
    "mt792xu_disconnect",
    "mt7921_mac_reset_work",
    "mt7921_mcu_parse_response",
    "mt7921_cancel_remain_on_channel",
    "mt7925_mac_reset_work",
    "mt7925_mcu_parse_response",
    "mt7925_cancel_remain_on_channel"
  ],
  "Reasoning": "The patch modifies MediaTek mt7921, mt7925, and shared mt792x USB wireless drivers to properly handle MT76_REMOVED during device disconnect, work cancellation, MAC reset, abort ROC, and MCU parse response timeouts. The USB drivers (MT7921U and MT7925U) are accessible and testable via syzkaller through raw-gadget USB emulation (syz_usb_connect/disconnect). The changes alter control flow and work synchronization during device removal and reset operations, making them worth fuzzing.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "MAC80211",
    "USB",
    "MT7921U",
    "MT7925U",
    "MT7921_COMMON",
    "MT7925_COMMON",
    "MT792x_USB"
  ],
  "FocusSymbols": [
    "mt792xu_disconnect",
    "mt7921_mac_reset_work",
    "mt7921_mcu_parse_response",
    "mt7921_cancel_remain_on_channel",
    "mt7925_mac_reset_work",
    "mt7925_mcu_parse_response",
    "mt7925_cancel_remain_on_channel"
  ],
  "Reasoning": "The patch modifies MediaTek mt7921, mt7925, and shared mt792x USB wireless drivers to properly handle MT76_REMOVED during device disconnect, work cancellation, MAC reset, abort ROC, and MCU parse response timeouts. The USB drivers (MT7921U and MT7925U) are accessible and testable via syzkaller through raw-gadget USB emulation (syz_usb_connect/disconnect). The changes alter control flow and work synchronization during device removal and reset operations, making them worth fuzzing.",
  "WorthFuzzing": true
}

78/1 2026/09/29 00:14 action If
0m Args:
{
  "WorthFuzzing": true
}

Results:
null

79/2 2026/09/29 00:14 agent kmsan-evaluator
0m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch modifies state checks and teardown sequencing in the MediaTek mt76 wireless driver (mt7921, mt7925, and common USB code) to properly handle device removal (checking MT76_REMOVED, canceling work items earlier, and avoiding resets/commands on unplugged devices). These changes strictly deal with device teardown, cancellation of work queues, and prevention of use-after-free or race conditions during device disconnect. There are no allocations, no uninitialized variables or struct fields, no changes to buffer bounds or sizes, and no data transferred to user space. Such concurrency and lifetime issues are covered by KASAN and standard kernel debuggers; KMSAN is neither relevant nor required.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
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:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit b3e77860ea864be0a7fa22c5bee4dfdd0ae0c668
Author: syz-cluster <triage@syzkaller.com>
Date:   Tue Sep 29 00:10:40 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index e69978184f68c..7a43472db51bf 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -664,6 +664,9 @@ void mt7921_mac_reset_work(struct work_struct *work)
 	struct mt76_connac_pm *pm = &dev->pm;
 	int i, ret;
 
+	if (test_bit(MT76_REMOVED, &dev->mphy.state))
+		return;
+
 	dev_dbg(dev->mt76.dev, "chip reset\n");
 	set_bit(MT76_RESET, &dev->mphy.state);
 	dev->hw_full_reset = true;
@@ -674,6 +677,9 @@ void mt7921_mac_reset_work(struct work_struct *work)
 	cancel_work_sync(&pm->wake_work);
 
 	for (i = 0; i < 10; i++) {
+		if (test_bit(MT76_REMOVED, &dev->mphy.state))
+			goto out;
+
 		if (atomic_read(&dev->mt76.bus_hung))
 			return;
 
@@ -700,9 +706,13 @@ void mt7921_mac_reset_work(struct work_struct *work)
 		ieee80211_scan_completed(dev->mphy.hw, &info);
 	}
 
+out:
 	dev->hw_full_reset = false;
-	clear_bit(MT76_RESET, &dev->mphy.state);
 	pm->suspended = false;
+	if (test_bit(MT76_REMOVED, &dev->mphy.state))
+		return;
+
+	clear_bit(MT76_RESET, &dev->mphy.state);
 	ieee80211_wake_queues(hw);
 	ieee80211_iterate_active_interfaces(hw,
 					    IEEE80211_IFACE_ITER_RESUME_ALL,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 68a059504e838..f189a8a13be04 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -410,6 +410,11 @@ static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)
 	timer_delete_sync(&phy->roc_timer);
 	cancel_work_sync(&phy->roc_work);
 
+	if (test_bit(MT76_REMOVED, &phy->mt76->state)) {
+		clear_bit(MT76_STATE_ROC, &phy->mt76->state);
+		return 0;
+	}
+
 	mt792x_mutex_acquire(phy->dev);
 	if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
 		err = mt7921_mcu_abort_roc(phy, vif, phy->roc_token_id);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 40546005c743b..a1dd9d83fb80e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -20,9 +20,14 @@ int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
 	int ret = 0;
 
 	if (!skb) {
-		dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
-			cmd, seq);
-		mt792x_reset(mdev);
+		struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
+
+		if (!test_bit(MT76_MCU_RESET, &dev->mphy.state) &&
+		    !test_bit(MT76_REMOVED, &dev->mphy.state)) {
+			dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
+				cmd, seq);
+			mt792x_reset(mdev);
+		}
 
 		return -ETIMEDOUT;
 	}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 101f571b027f1..a48082ac091fc 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -1516,6 +1516,9 @@ void mt7925_mac_reset_work(struct work_struct *work)
 	struct mt76_connac_pm *pm = &dev->pm;
 	int i, ret;
 
+	if (test_bit(MT76_REMOVED, &dev->mphy.state))
+		return;
+
 	if (atomic_read(&dev->mt76.bus_hung))
 		return;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 5993b31e1aae4..c88219dd0a6a7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -556,6 +556,11 @@ static int mt7925_abort_roc(struct mt792x_phy *phy,
 	timer_delete_sync(&phy->roc_timer);
 	cancel_work_sync(&phy->roc_work);
 
+	if (test_bit(MT76_REMOVED, &phy->mt76->state)) {
+		clear_bit(MT76_STATE_ROC, &phy->mt76->state);
+		return 0;
+	}
+
 	mt792x_mutex_acquire(phy->dev);
 	if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
 		err = mt7925_mcu_abort_roc(phy, mconf, phy->roc_token_id);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index fa29c486a4553..211118f416468 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -27,8 +27,14 @@ int mt7925_mcu_parse_response(struct mt76_dev *mdev, int cmd,
 	int ret = 0;
 
 	if (!skb) {
-		dev_err(mdev->dev, "Message %08x (seq %d) timeout\n", cmd, seq);
-		mt792x_reset(mdev);
+		struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
+
+		if (!test_bit(MT76_MCU_RESET, &dev->mphy.state) &&
+		    !test_bit(MT76_REMOVED, &dev->mphy.state)) {
+			dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
+				cmd, seq);
+			mt792x_reset(mdev);
+		}
 
 		return -ETIMEDOUT;
 	}
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
index 850f6b2cfc4aa..b41903cfec40b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
@@ -501,6 +501,7 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)
 	if (!dev)
 		return;
 
+	set_bit(MT76_REMOVED, &dev->mphy.state);
 	set_bit(MT76_RESET, &dev->mphy.state);
 	set_bit(MT76_MCU_RESET, &dev->mphy.state);
 	clear_bit(MT76_STATE_RUNNING, &dev->mphy.state);
@@ -509,16 +510,15 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)
 
 	cancel_work_sync(&dev->reset_work);
 	cancel_work_sync(&dev->init_work);
-	mt76_worker_disable(&dev->mt76.tx_worker);
+	cancel_delayed_work_sync(&dev->mphy.mac_work);
+	cancel_delayed_work_sync(&dev->pm.ps_work);
+	cancel_work_sync(&dev->pm.wake_work);
 	mt792xu_reset_work_cleanup(dev);
-	if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state)) {
-		set_bit(MT76_REMOVED, &dev->mphy.state);
+	if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state))
 		return;
-	}
 
 	mt76_unregister_device(&dev->mt76);
 	mt792xu_cleanup(dev);
-	set_bit(MT76_REMOVED, &dev->mphy.state);
 
 	usb_set_intfdata(usb_intf, NULL);
 

80/3 2026/09/29 00:14 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 4907
							output: 50
							thoughts: 1476
						

Thoughts:
**KMSAN Assessment: Wireless Mediatek Driver Patch**

Okay, let's break this down. My goal is to determine if this patch series warrants a dedicated KMSAN fuzzing session. I need to figure out if it introduces or exposes any potential uninitialized memory risks.

First, I see this patch touches several files within the Mediatek MT7921 and MT7925 wireless drivers, and `mt792x_usb.c`. The changes seem focused on handling device disconnection, unbinding, and cleaning up race conditions, with a focus on preventing use-after-free, deadlock, and potential NULL dereferences during USB disconnects or chip resets.

Now, I'm going through the patch itself. I'm seeing a pattern of `test_bit(MT76_REMOVED, &dev->mphy.state)` checks throughout the code, within functions like `mt7921_mac_reset_work`, `mt7921_abort_roc`, `mt7921_mcu_parse_response` and similar for the mt7925. In the USB disconnect routine `mt792xu_disconnect`, I see `set_bit(MT76_REMOVED, &dev->mphy.state)` being moved to the beginning of the disconnection process and more work items being cancelled. These checks appear to be added to prevent further operations if the device is already being removed.

My criteria for needing a KMSAN run are pretty specific: introducing or modifying kernel structures sent to userspace with uninitialized fields, conditional logic that relies on uninitialized variables, allocation/initialization of complex data structures with potential uninitialized fields that can be read later, or changes to bounds checks/lengths that could lead to uninitialized memory access.

Looking at the code, it seems the patch is primarily about preventing existing race conditions and UAF bugs during device disconnect and reset, rather than introducing new memory initialization issues. The `dev` variable is properly initialized using `container_of`. The checks are all on atomic bit fields in `mphy.state`. No new buffers are introduced, and there are no changes to bounds or lengths. The code seems to be explicitly *preventing* operations on hardware or logging errors when a device has been unplugged. The fixes are targeted at use-after-free, device disconnect races and deadlock bugs which are more the domain of KASAN/LOCKDEP/generic sanitizers. KMSAN isn't the right tool here.

I'm double-checking, particularly around the `mt7921_mac_reset_work` function, scrutinizing the `goto out` label. The code is carefully guarding certain operations with checks for `MT76_REMOVED`, ensuring no further actions are taken when the device is being removed.

Therefore, after a thorough review, I'm confident in concluding that this patch series does *not* require a dedicated KMSAN fuzzing session. The focus is on fixing existing synchronization and race conditions rather than introducing risks related to uninitialized memory reads or leaks. `NeedsKMSAN=false`.



81/3 2026/09/29 00:14 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/mediatek/mt76/mt7921/mac.c",
  "FirstLine": 660,
  "LineCount": 55
}

Results:
{
  "Contents": " 660:\t{\n 661:\t\tstruct mt792x_dev *dev = container_of(work, struct mt792x_dev,\n 662:\t\t\t\t\t\t      reset_work);\n 663:\t\tstruct ieee80211_hw *hw = mt76_hw(dev);\n 664:\t\tstruct mt76_connac_pm *pm = \u0026dev-\u003epm;\n 665:\t\tint i, ret;\n 666:\t\n 667:\t\tif (test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state))\n 668:\t\t\treturn;\n 669:\t\n 670:\t\tdev_dbg(dev-\u003emt76.dev, \"chip reset\\n\");\n 671:\t\tset_bit(MT76_RESET, \u0026dev-\u003emphy.state);\n 672:\t\tdev-\u003ehw_full_reset = true;\n 673:\t\tieee80211_stop_queues(hw);\n 674:\t\n 675:\t\tcancel_delayed_work_sync(\u0026dev-\u003emphy.mac_work);\n 676:\t\tcancel_delayed_work_sync(\u0026pm-\u003eps_work);\n 677:\t\tcancel_work_sync(\u0026pm-\u003ewake_work);\n 678:\t\n 679:\t\tfor (i = 0; i \u003c 10; i++) {\n 680:\t\t\tif (test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state))\n 681:\t\t\t\tgoto out;\n 682:\t\n 683:\t\t\tif (atomic_read(\u0026dev-\u003emt76.bus_hung))\n 684:\t\t\t\treturn;\n 685:\t\n 686:\t\t\tmutex_lock(\u0026dev-\u003emt76.mutex);\n 687:\t\t\tret = mt792x_dev_reset(dev);\n 688:\t\t\tmutex_unlock(\u0026dev-\u003emt76.mutex);\n 689:\t\n 690:\t\t\tif (!ret)\n 691:\t\t\t\tbreak;\n 692:\t\t}\n 693:\t\n 694:\t\tif ((mt76_is_sdio(\u0026dev-\u003emt76) || mt76_is_usb(\u0026dev-\u003emt76)) \u0026\u0026\n 695:\t\t    atomic_read(\u0026dev-\u003emt76.bus_hung))\n 696:\t\t\treturn;\n 697:\t\n 698:\t\tif (i == 10)\n 699:\t\t\tdev_err(dev-\u003emt76.dev, \"chip reset failed\\n\");\n 700:\t\n 701:\t\tif (test_and_clear_bit(MT76_HW_SCANNING, \u0026dev-\u003emphy.state)) {\n 702:\t\t\tstruct cfg80211_scan_info info = {\n 703:\t\t\t\t.aborted = true,\n 704:\t\t\t};\n 705:\t\n 706:\t\t\tieee80211_scan_completed(dev-\u003emphy.hw, \u0026info);\n 707:\t\t}\n 708:\t\n 709:\tout:\n 710:\t\tdev-\u003ehw_full_reset = false;\n 711:\t\tpm-\u003esuspended = false;\n 712:\t\tif (test_bit(MT76_REMOVED, \u0026dev-\u003emphy.state))\n 713:\t\t\treturn;\n 714:\t\n"
}

82/3 2026/09/29 00:14 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 7988
							output: 175
							thoughts: 352
						

Thoughts:
**My Assessment of the MT7921 MAC Reset Handling**

Okay, let's break this down. In `mt7921_mac_reset_work`, the logic is designed to bail out early using the `MT76_REMOVED` flag. This makes sense; if the device has been disconnected, there's no point in continuing the reset sequence. The `if (test_bit(MT76_REMOVED, ...)) return;` check at the beginning of the `out:` label is the key here - it's a critical guard.

I then looked at how `abort_roc` is handled in both `mt7921/main.c` and `mt7925/main.c`. The pattern is the same: If the `MT76_REMOVED` bit is set, it clears the `MT76_STATE_ROC` bit and immediately returns. This further reinforces the strategy of short-circuiting operations on a disconnected device.

The overarching theme is consistent across these snippets: *protecting against use-after-free and preventing commands from being sent to a device that's in the process of being torn down, reset, or has been physically disconnected*. The changes are solely focused on device state flags (`MT76_REMOVED`, `MT76_RESET`, `MT76_MCU_RESET`, and `MT76_STATE_ROC`). It's all about managing the state machine during these transitions.

Given this analysis, I'm confident in concluding that these changes do *not* introduce any of the types of memory safety issues that KMSAN is designed to detect. There's no uninitialized memory being used, no buffer allocations, no memory copies to userspace, and no new uninitialized fields being introduced. Therefore, the `NeedsKMSAN` flag should definitely be `false`. The modifications are safe.



83/3 2026/09/29 00:14 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch modifies state checks and teardown sequencing in the MediaTek mt76 wireless driver (mt7921, mt7925, and common USB code) to properly handle device removal (checking MT76_REMOVED, canceling work items earlier, and avoiding resets/commands on unplugged devices). These changes strictly deal with device teardown, cancellation of work queues, and prevention of use-after-free or race conditions during device disconnect. There are no allocations, no uninitialized variables or struct fields, no changes to buffer bounds or sizes, and no data transferred to user space. Such concurrency and lifetime issues are covered by KASAN and standard kernel debuggers; KMSAN is neither relevant nor required.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch modifies state checks and teardown sequencing in the MediaTek mt76 wireless driver (mt7921, mt7925, and common USB code) to properly handle device removal (checking MT76_REMOVED, canceling work items earlier, and avoiding resets/commands on unplugged devices). These changes strictly deal with device teardown, cancellation of work queues, and prevention of use-after-free or race conditions during device disconnect. There are no allocations, no uninitialized variables or struct fields, no changes to buffer bounds or sizes, and no data transferred to user space. Such concurrency and lifetime issues are covered by KASAN and standard kernel debuggers; KMSAN is neither relevant nor required.",
  "NeedsKMSAN": false
}

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