AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/11/21 13:13 flow patch-triage
2m Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "KMSANReasoning": "",
  "NeedsKMSAN": false,
  "Reasoning": "The patch adds Device Tree bindings and a core MFD driver for the Airoha AN8855 Ethernet switch SoC. The driver binds via Device Tree (OF) over MDIO to interact with physical AN8855 ASIC registers. On amd64 in standard QEMU/GCE virtualized environments, this hardware is not emulated and Device Tree nodes for this chip are not present. Consequently, the modified code is structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

1/1 2026/11/21 13:13 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 83e3691b2cc9e34c36112f0df69cec44718dc1f9\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Sat Nov 21 13:13:02 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/Documentation/devicetree/bindings/mfd/airoha,an8855.yaml b/Documentation/devicetree/bindings/mfd/airoha,an8855.yaml\nnew file mode 100644\nindex 00000000000000..48127e956c9656\n--- /dev/null\n+++ b/Documentation/devicetree/bindings/mfd/airoha,an8855.yaml\n@@ -0,0 +1,176 @@\n+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)\n+%YAML 1.2\n+---\n+$id: http://devicetree.org/schemas/mfd/airoha,an8855.yaml#\n+$schema: http://devicetree.org/meta-schemas/core.yaml#\n+\n+title: Airoha AN8855 Switch SoC\n+\n+maintainers:\n+  - Christian Marangi \u003cansuelsmth@gmail.com\u003e\n+\n+description: \u003e\n+  Airoha AN8855 Switch is a SoC that expose various peripherals like an\n+  Ethernet Switch, a NVMEM provider and Ethernet PHYs.\n+\n+  It does also support i2c and timers but those are not currently\n+  supported/used.\n+\n+properties:\n+  compatible:\n+    const: airoha,an8855\n+\n+  reg:\n+    maxItems: 1\n+\n+  reset-gpios:\n+    maxItems: 1\n+\n+  efuse:\n+    type: object\n+    $ref: /schemas/nvmem/airoha,an8855-efuse.yaml\n+    description: EFUSE exposed by the Airoha AN8855 SoC\n+\n+  ethernet-switch:\n+    type: object\n+    $ref: /schemas/net/dsa/airoha,an8855-switch.yaml\n+    description: Switch exposed by the Airoha AN8855 SoC\n+\n+  mdio:\n+    type: object\n+    $ref: /schemas/net/mdio.yaml#\n+    description: MDIO exposed by the Airoha AN8855 SoC\n+    unevaluatedProperties: false\n+\n+required:\n+  - compatible\n+  - reg\n+  - mdio\n+  - ethernet-switch\n+\n+additionalProperties: false\n+\n+examples:\n+  - |\n+    #include \u003cdt-bindings/gpio/gpio.h\u003e\n+\n+    mdio {\n+        #address-cells = \u003c1\u003e;\n+        #size-cells = \u003c0\u003e;\n+\n+        soc@1 {\n+            compatible = \"airoha,an8855\";\n+            reg = \u003c1\u003e;\n+\n+            reset-gpios = \u003c\u0026pio 39 GPIO_ACTIVE_HIGH\u003e;\n+\n+            efuse {\n+                compatible = \"airoha,an8855-efuse\";\n+\n+                #nvmem-cell-cells = \u003c0\u003e;\n+\n+                nvmem-layout {\n+                    compatible = \"fixed-layout\";\n+                    #address-cells = \u003c1\u003e;\n+                    #size-cells = \u003c1\u003e;\n+\n+                    shift_sel_port0_tx_a: shift-sel-port0-tx-a@c {\n+                       reg = \u003c0xc 0x4\u003e;\n+                    };\n+\n+                    shift_sel_port0_tx_b: shift-sel-port0-tx-b@10 {\n+                        reg = \u003c0x10 0x4\u003e;\n+                    };\n+\n+                    shift_sel_port0_tx_c: shift-sel-port0-tx-c@14 {\n+                        reg = \u003c0x14 0x4\u003e;\n+                    };\n+\n+                    shift_sel_port0_tx_d: shift-sel-port0-tx-d@18 {\n+                       reg = \u003c0x18 0x4\u003e;\n+                    };\n+\n+                    shift_sel_port1_tx_a: shift-sel-port1-tx-a@1c {\n+                        reg = \u003c0x1c 0x4\u003e;\n+                    };\n+\n+                    shift_sel_port1_tx_b: shift-sel-port1-tx-b@20 {\n+                        reg = \u003c0x20 0x4\u003e;\n+                    };\n+\n+                    shift_sel_port1_tx_c: shift-sel-port1-tx-c@24 {\n+                       reg = \u003c0x24 0x4\u003e;\n+                    };\n+\n+                    shift_sel_port1_tx_d: shift-sel-port1-tx-d@28 {\n+                        reg = \u003c0x28 0x4\u003e;\n+                    };\n+                };\n+            };\n+\n+            ethernet-switch {\n+                compatible = \"airoha,an8855-switch\";\n+\n+                ports {\n+                    #address-cells = \u003c1\u003e;\n+                    #size-cells = \u003c0\u003e;\n+\n+                    port@0 {\n+                        reg = \u003c0\u003e;\n+                        label = \"lan1\";\n+                        phy-mode = \"internal\";\n+                        phy-handle = \u003c\u0026internal_phy1\u003e;\n+                    };\n+\n+                    port@1 {\n+                        reg = \u003c1\u003e;\n+                        label = \"lan2\";\n+                        phy-mode = \"internal\";\n+                        phy-handle = \u003c\u0026internal_phy2\u003e;\n+                    };\n+\n+                    port@5 {\n+                        reg = \u003c5\u003e;\n+                        label = \"cpu\";\n+                        ethernet = \u003c\u0026gmac0\u003e;\n+                        phy-mode = \"2500base-x\";\n+\n+                        fixed-link {\n+                            speed = \u003c2500\u003e;\n+                            full-duplex;\n+                            pause;\n+                        };\n+                    };\n+                };\n+            };\n+\n+            mdio {\n+                #address-cells = \u003c1\u003e;\n+                #size-cells = \u003c0\u003e;\n+\n+                internal_phy1: ethernet-phy@1 {\n+                  compatible = \"ethernet-phy-idc0ff.0410\",\n+                               \"ethernet-phy-ieee802.3-c22\";\n+                  reg = \u003c1\u003e;\n+\n+                  nvmem-cells = \u003c\u0026shift_sel_port0_tx_a\u003e,\n+                      \u003c\u0026shift_sel_port0_tx_b\u003e,\n+                      \u003c\u0026shift_sel_port0_tx_c\u003e,\n+                      \u003c\u0026shift_sel_port0_tx_d\u003e;\n+                  nvmem-cell-names = \"tx_a\", \"tx_b\", \"tx_c\", \"tx_d\";\n+                };\n+\n+                internal_phy2: ethernet-phy@2 {\n+                  compatible = \"ethernet-phy-idc0ff.0410\",\n+                               \"ethernet-phy-ieee802.3-c22\";\n+                  reg = \u003c2\u003e;\n+\n+                  nvmem-cells = \u003c\u0026shift_sel_port1_tx_a\u003e,\n+                      \u003c\u0026shift_sel_port1_tx_b\u003e,\n+                      \u003c\u0026shift_sel_port1_tx_c\u003e,\n+                      \u003c\u0026shift_sel_port1_tx_d\u003e;\n+                  nvmem-cell-names = \"tx_a\", \"tx_b\", \"tx_c\", \"tx_d\";\n+                };\n+            };\n+        };\n+    };\ndiff --git a/Documentation/devicetree/bindings/net/airoha,an8855-phy.yaml b/Documentation/devicetree/bindings/net/airoha,an8855-phy.yaml\nnew file mode 100644\nindex 00000000000000..d2f86116badf49\n--- /dev/null\n+++ b/Documentation/devicetree/bindings/net/airoha,an8855-phy.yaml\n@@ -0,0 +1,83 @@\n+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)\n+%YAML 1.2\n+---\n+$id: http://devicetree.org/schemas/net/airoha,an8855-phy.yaml#\n+$schema: http://devicetree.org/meta-schemas/core.yaml#\n+\n+title: Airoha AN8855 Switch Internal PHY\n+\n+maintainers:\n+  - Christian Marangi \u003cansuelsmth@gmail.com\u003e\n+\n+description: \u003e\n+  Airoha AN8855 is a 5-port Gigabit Switch that expose the Internal\n+  PHYs on the MDIO bus.\n+\n+  Each PHY might need to be calibrated to correctly work with the\n+  use of the eFUSE provided by the Switch SoC.\n+\n+allOf:\n+  - $ref: ethernet-phy.yaml#\n+\n+select:\n+  properties:\n+    compatible:\n+      contains:\n+        enum:\n+          - ethernet-phy-idc0ff.0410\n+  required:\n+    - compatible\n+\n+properties:\n+  reg:\n+    maxItems: 1\n+\n+  nvmem-cells:\n+    items:\n+      - description: phandle to SoC eFUSE tx_a\n+      - description: phandle to SoC eFUSE tx_b\n+      - description: phandle to SoC eFUSE tx_c\n+      - description: phandle to SoC eFUSE tx_d\n+\n+  nvmem-cell-names:\n+    items:\n+      - const: tx_a\n+      - const: tx_b\n+      - const: tx_c\n+      - const: tx_d\n+\n+required:\n+  - compatible\n+  - reg\n+\n+dependentRequired:\n+  nvmem-cells: [ nvmem-cell-names ]\n+\n+unevaluatedProperties: false\n+\n+examples:\n+  - |\n+    mdio {\n+        #address-cells = \u003c1\u003e;\n+        #size-cells = \u003c0\u003e;\n+\n+        ethernet-phy@1 {\n+            compatible = \"ethernet-phy-idc0ff.0410\",\n+                         \"ethernet-phy-ieee802.3-c45\";\n+\n+            reg = \u003c1\u003e;\n+        };\n+\n+        ethernet-phy@2 {\n+            compatible = \"ethernet-phy-idc0ff.0410\",\n+                         \"ethernet-phy-ieee802.3-c45\";\n+\n+            reg = \u003c2\u003e;\n+\n+            nvmem-cells = \u003c\u0026shift_sel_port0_tx_a\u003e,\n+                          \u003c\u0026shift_sel_port0_tx_b\u003e,\n+                          \u003c\u0026shift_sel_port0_tx_c\u003e,\n+                          \u003c\u0026shift_sel_port0_tx_d\u003e;\n+            nvmem-cell-names = \"tx_a\", \"tx_b\", \"tx_c\", \"tx_d\";\n+        };\n+    };\ndiff --git a/Documentation/devicetree/bindings/net/dsa/airoha,an8855-switch.yaml b/Documentation/devicetree/bindings/net/dsa/airoha,an8855-switch.yaml\nnew file mode 100644\nindex 00000000000000..5ad9b9e1398319\n--- /dev/null\n+++ b/Documentation/devicetree/bindings/net/dsa/airoha,an8855-switch.yaml\n@@ -0,0 +1,86 @@\n+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)\n+%YAML 1.2\n+---\n+$id: http://devicetree.org/schemas/net/dsa/airoha,an8855-switch.yaml#\n+$schema: http://devicetree.org/meta-schemas/core.yaml#\n+\n+title: Airoha AN8855 Gigabit Switch\n+\n+maintainers:\n+  - Christian Marangi \u003cansuelsmth@gmail.com\u003e\n+\n+description: \u003e\n+  Airoha AN8855 is a 5-port Gigabit Switch.\n+\n+  It does expose the 5 Internal PHYs on the MDIO bus and each port\n+  can access the Switch register space by configuring the PHY page.\n+\n+$ref: dsa.yaml#/$defs/ethernet-ports\n+\n+properties:\n+  compatible:\n+    const: airoha,an8855-switch\n+\n+required:\n+  - compatible\n+\n+unevaluatedProperties: false\n+\n+examples:\n+  - |\n+    ethernet-switch {\n+        compatible = \"airoha,an8855-switch\";\n+\n+        ports {\n+            #address-cells = \u003c1\u003e;\n+            #size-cells = \u003c0\u003e;\n+\n+            port@0 {\n+                reg = \u003c0\u003e;\n+                label = \"lan1\";\n+                phy-mode = \"internal\";\n+                phy-handle = \u003c\u0026internal_phy1\u003e;\n+            };\n+\n+            port@1 {\n+                reg = \u003c1\u003e;\n+                label = \"lan2\";\n+                phy-mode = \"internal\";\n+                phy-handle = \u003c\u0026internal_phy2\u003e;\n+            };\n+\n+            port@2 {\n+                reg = \u003c2\u003e;\n+                label = \"lan3\";\n+                phy-mode = \"internal\";\n+                phy-handle = \u003c\u0026internal_phy3\u003e;\n+            };\n+\n+            port@3 {\n+                reg = \u003c3\u003e;\n+                label = \"lan4\";\n+                phy-mode = \"internal\";\n+                phy-handle = \u003c\u0026internal_phy4\u003e;\n+            };\n+\n+            port@4 {\n+                reg = \u003c4\u003e;\n+                label = \"wan\";\n+                phy-mode = \"internal\";\n+                phy-handle = \u003c\u0026internal_phy5\u003e;\n+            };\n+\n+            port@5 {\n+                reg = \u003c5\u003e;\n+                label = \"cpu\";\n+                ethernet = \u003c\u0026gmac0\u003e;\n+                phy-mode = \"2500base-x\";\n+\n+                fixed-link {\n+                    speed = \u003c2500\u003e;\n+                    full-duplex;\n+                    pause;\n+                };\n+            };\n+        };\n+    };\ndiff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig\nindex 2b2b7bced40017..ba8c8971e12c50 100644\n--- a/drivers/mfd/Kconfig\n+++ b/drivers/mfd/Kconfig\n@@ -54,6 +54,20 @@ config MFD_ALTERA_SYSMGR\n \t  using regmap_mmio accesses for ARM32 parts and SMC calls to\n \t  EL3 for ARM64 parts.\n \n+config MFD_AIROHA_AN8855\n+\ttristate \"Airoha AN8855 Switch Core\"\n+\tselect MFD_CORE\n+\tselect REGMAP\n+\tselect PHYLIB\n+\tselect MDIO_REGMAP\n+\tdepends on NETDEVICES \u0026\u0026 OF\n+\thelp\n+\t  Support for the Airoha AN8855 Switch Core. This is an SoC\n+\t  that provides various peripherals, to count, i2c, an Ethrnet\n+\t  Switch, a CPU timer, GPIO, eFUSE.\n+\n+\t  Currently it provides a DSA switch and a NVMEM provider.\n+\n config MFD_ACT8945A\n \ttristate \"Active-semi ACT8945A\"\n \tselect MFD_CORE\ndiff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile\nindex 3765e6ebc72476..99f0bd236d92c3 100644\n--- a/drivers/mfd/Makefile\n+++ b/drivers/mfd/Makefile\n@@ -8,6 +8,7 @@ obj-$(CONFIG_MFD_88PM860X)\t+= 88pm860x.o\n obj-$(CONFIG_MFD_88PM800)\t+= 88pm800.o 88pm80x.o\n obj-$(CONFIG_MFD_88PM805)\t+= 88pm805.o 88pm80x.o\n obj-$(CONFIG_MFD_88PM886_PMIC)\t+= 88pm886.o\n+obj-$(CONFIG_MFD_AIROHA_AN8855)\t+= airoha-an8855.o\n obj-$(CONFIG_MFD_ACT8945A)\t+= act8945a.o\n obj-$(CONFIG_MFD_SM501)\t\t+= sm501.o\n obj-$(CONFIG_MFD_ASUS_TRANSFORMER_EC)\t+= asus-transformer-ec.o\ndiff --git a/drivers/mfd/airoha-an8855.c b/drivers/mfd/airoha-an8855.c\nnew file mode 100644\nindex 00000000000000..908b2676e35a61\n--- /dev/null\n+++ b/drivers/mfd/airoha-an8855.c\n@@ -0,0 +1,568 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Core driver for Airoha AN8855 Switch\n+ *\n+ * Copyright (C) 2024 Christian Marangi \u003cansuelsmth@gmail.com\u003e\n+ */\n+\n+#include \u003clinux/bitfield.h\u003e\n+#include \u003clinux/fwnode_mdio.h\u003e\n+#include \u003clinux/gpio/consumer.h\u003e\n+#include \u003clinux/mdio.h\u003e\n+#include \u003clinux/mdio/mdio-regmap.h\u003e\n+#include \u003clinux/mfd/core.h\u003e\n+#include \u003clinux/module.h\u003e\n+#include \u003clinux/of.h\u003e\n+#include \u003clinux/phy.h\u003e\n+#include \u003clinux/regmap.h\u003e\n+\n+/* Register for HW trap status */\n+#define AN8855_HWTRAP\t\t\t0x1000009c\n+\n+/*\n+ * Register of the Switch ID\n+ * (called Project ID in Documentation)\n+ */\n+#define AN8855_CREV\t\t\t0x10005000\n+#define   AN8855_ID\t\t\t0x8855 /* Switch ID */\n+\n+/*\n+ * Register for GPHY Power Down\n+ * Used to Toggle the Gigabit PHY power and enable them.\n+ */\n+#define AN8855_RG_GPHY_AFE_PWD\t\t0x1028c840\n+\n+/* MII Registers */\n+#define AN8855_PHY_SELECT_PAGE\t\t0x1f\n+#define   AN8855_PHY_PAGE\t\tGENMASK(2, 0)\n+#define   AN8855_PHY_PAGE_STANDARD\tFIELD_PREP_CONST(AN8855_PHY_PAGE, 0x0)\n+#define   AN8855_PHY_PAGE_EXTENDED_1\tFIELD_PREP_CONST(AN8855_PHY_PAGE, 0x1)\n+#define   AN8855_PHY_PAGE_EXTENDED_4\tFIELD_PREP_CONST(AN8855_PHY_PAGE, 0x4)\n+\n+/* MII Registers Page 4 */\n+#define AN8855_PBUS_MODE\t\t0x10\n+#define   AN8855_PBUS_MODE_ADDR_FIXED\t0x0\n+#define   AN8855_PBUS_MODE_ADDR_INCR\tBIT(15)\n+#define AN8855_PBUS_WR_ADDR_HIGH\t0x11\n+#define AN8855_PBUS_WR_ADDR_LOW\t\t0x12\n+#define AN8855_PBUS_WR_DATA_HIGH\t0x13\n+#define AN8855_PBUS_WR_DATA_LOW\t\t0x14\n+#define AN8855_PBUS_RD_ADDR_HIGH\t0x15\n+#define AN8855_PBUS_RD_ADDR_LOW\t\t0x16\n+#define AN8855_PBUS_RD_DATA_HIGH\t0x17\n+#define AN8855_PBUS_RD_DATA_LOW\t\t0x18\n+\n+#define AN8855_MAX_PHY_PORT\t\t5\n+\n+#define AN8855_MDIO_VAL(hi, lo)\t\t(((u32)(hi) \u003c\u003c 16) | (u16)(lo))\n+\n+struct an8855 {\n+\tstruct mii_bus *bus;\n+\tstruct mii_bus *phy_bus;\n+\tunsigned int switch_addr;\n+\tu16 current_page;\n+};\n+\n+struct an8855_phy {\n+\tu8 addr;\n+\tstruct an8855 *core;\n+};\n+\n+struct an8855_phy_bus {\n+\tstruct mii_bus *bus;\n+\tstruct fwnode_handle *node;\n+\tu8 addr;\n+};\n+\n+static const struct mfd_cell an8855_cells[] = {\n+\tMFD_CELL_OF(\"an8855-efuse\", NULL, NULL, 0, 0, \"airoha,an8855-efuse\"),\n+\tMFD_CELL_OF(\"an8855-switch\", NULL, NULL, 0, 0, \"airoha,an8855-switch\"),\n+};\n+\n+static int an8855_mii_set_page(struct an8855 *ddata, u8 addr,\n+\t\t\t       u8 page) __must_hold(\u0026ddata-\u003ebus-\u003emdio_lock)\n+{\n+\tstruct mii_bus *bus = ddata-\u003ebus;\n+\tint ret;\n+\n+\tret = __mdiobus_write(bus, addr, AN8855_PHY_SELECT_PAGE, page);\n+\tif (ret) {\n+\t\tdev_err_ratelimited(\u0026bus-\u003edev, \"Failed to set mii page\\n\");\n+\t\treturn ret;\n+\t}\n+\n+\t/* Cache current page if next MII read/write is for Switch page */\n+\tddata-\u003ecurrent_page = page;\n+\treturn 0;\n+}\n+\n+static int an8855_mii_read32(struct mii_bus *bus, u8 phy_id, u32 reg,\n+\t\t\t     u32 *val) __must_hold(\u0026bus-\u003emdio_lock)\n+{\n+\tint lo, hi, ret;\n+\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_MODE, AN8855_PBUS_MODE_ADDR_FIXED);\n+\tif (ret)\n+\t\tgoto err;\n+\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_RD_ADDR_HIGH, upper_16_bits(reg));\n+\tif (ret)\n+\t\tgoto err;\n+\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_RD_ADDR_LOW, lower_16_bits(reg));\n+\tif (ret)\n+\t\tgoto err;\n+\n+\thi = __mdiobus_read(bus, phy_id, AN8855_PBUS_RD_DATA_HIGH);\n+\tif (hi \u003c 0) {\n+\t\tret = hi;\n+\t\tgoto err;\n+\t}\n+\n+\tlo = __mdiobus_read(bus, phy_id, AN8855_PBUS_RD_DATA_LOW);\n+\tif (lo \u003c 0) {\n+\t\tret = lo;\n+\t\tgoto err;\n+\t}\n+\n+\t*val = AN8855_MDIO_VAL(hi, lo);\n+\n+\treturn 0;\n+err:\n+\tdev_err_ratelimited(\u0026bus-\u003edev, \"Failed to read register\\n\");\n+\treturn ret;\n+}\n+\n+/*\n+ * Protect concurrent access to phy page if switch address also\n+ * expose a PHY.\n+ */\n+static void an8855_regmap_lock(struct an8855 *ddata)\n+{\n+\tif (ddata-\u003ephy_bus)\n+\t\tmutex_lock(\u0026ddata-\u003ephy_bus-\u003emdio_lock);\n+\n+\tmutex_lock_nested(\u0026ddata-\u003ebus-\u003emdio_lock, MDIO_MUTEX_NESTED);\n+}\n+\n+static void an8855_regmap_unlock(struct an8855 *ddata)\n+{\n+\tmutex_unlock(\u0026ddata-\u003ebus-\u003emdio_lock);\n+\n+\tif (ddata-\u003ephy_bus)\n+\t\tmutex_unlock(\u0026ddata-\u003ephy_bus-\u003emdio_lock);\n+}\n+\n+static int an8855_regmap_read(void *ctx, uint32_t reg, uint32_t *val)\n+{\n+\tstruct an8855 *ddata = ctx;\n+\tstruct mii_bus *bus = ddata-\u003ebus;\n+\tu16 addr = ddata-\u003eswitch_addr;\n+\tint ret;\n+\n+\tan8855_regmap_lock(ddata);\n+\n+\tret = an8855_mii_set_page(ddata, addr, AN8855_PHY_PAGE_EXTENDED_4);\n+\tif (ret)\n+\t\tgoto exit;\n+\n+\tret = an8855_mii_read32(bus, addr, reg, val);\n+\n+exit:\n+\tan8855_regmap_unlock(ddata);\n+\n+\treturn ret;\n+}\n+\n+static int an8855_mii_write32(struct mii_bus *bus, u8 phy_id, u32 reg,\n+\t\t\t      u32 val) __must_hold(\u0026bus-\u003emdio_lock)\n+{\n+\tint ret;\n+\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_MODE, AN8855_PBUS_MODE_ADDR_FIXED);\n+\tif (ret)\n+\t\tgoto err;\n+\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_ADDR_HIGH, upper_16_bits(reg));\n+\tif (ret)\n+\t\tgoto err;\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_ADDR_LOW, lower_16_bits(reg));\n+\tif (ret)\n+\t\tgoto err;\n+\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_DATA_HIGH, upper_16_bits(val));\n+\tif (ret)\n+\t\tgoto err;\n+\n+\tret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_DATA_LOW, lower_16_bits(val));\n+\tif (ret)\n+\t\tgoto err;\n+\n+\treturn 0;\n+err:\n+\tdev_err_ratelimited(\u0026bus-\u003edev,\n+\t\t\t    \"Failed to write an8855 register\\n\");\n+\treturn ret;\n+}\n+\n+static int an8855_regmap_write(void *ctx, uint32_t reg, uint32_t val)\n+{\n+\tstruct an8855 *ddata = ctx;\n+\tstruct mii_bus *bus = ddata-\u003ebus;\n+\tu16 addr = ddata-\u003eswitch_addr;\n+\tint ret;\n+\n+\tan8855_regmap_lock(ddata);\n+\tret = an8855_mii_set_page(ddata, addr, AN8855_PHY_PAGE_EXTENDED_4);\n+\tif (ret)\n+\t\tgoto exit;\n+\n+\tret = an8855_mii_write32(bus, addr, reg, val);\n+\n+exit:\n+\tan8855_regmap_unlock(ddata);\n+\n+\treturn ret;\n+}\n+\n+static int an8855_regmap_update_bits(void *ctx, uint32_t reg, uint32_t mask,\n+\t\t\t\t     uint32_t write_val)\n+{\n+\tstruct an8855 *ddata = ctx;\n+\tstruct mii_bus *bus = ddata-\u003ebus;\n+\tu16 addr = ddata-\u003eswitch_addr;\n+\tu32 val;\n+\tint ret;\n+\n+\tan8855_regmap_lock(ddata);\n+\tret = an8855_mii_set_page(ddata, addr, AN8855_PHY_PAGE_EXTENDED_4);\n+\tif (ret)\n+\t\tgoto exit;\n+\n+\tret = an8855_mii_read32(bus, addr, reg, \u0026val);\n+\tif (ret)\n+\t\tgoto exit;\n+\n+\tval \u0026= ~mask;\n+\tval |= write_val \u0026 mask;\n+\tret = an8855_mii_write32(bus, addr, reg, val);\n+\n+exit:\n+\tan8855_regmap_unlock(ddata);\n+\n+\treturn ret;\n+}\n+\n+static const struct regmap_range an8855_readable_ranges[] = {\n+\tregmap_reg_range(0x10000000, 0x10000fff), /* SCU */\n+\tregmap_reg_range(0x10001000, 0x10001fff), /* RBUS */\n+\tregmap_reg_range(0x10002000, 0x10002fff), /* MCU */\n+\tregmap_reg_range(0x10005000, 0x10005fff), /* SYS SCU */\n+\tregmap_reg_range(0x10007000, 0x10007fff), /* I2C Slave */\n+\tregmap_reg_range(0x10008000, 0x10008fff), /* I2C Master */\n+\tregmap_reg_range(0x10009000, 0x10009fff), /* PDMA */\n+\tregmap_reg_range(0x1000a100, 0x1000a1ff), /* General Purpose Timer */\n+\tregmap_reg_range(0x1000a200, 0x1000a2ff), /* GPU timer */\n+\tregmap_reg_range(0x1000a300, 0x1000a3ff), /* GPIO */\n+\tregmap_reg_range(0x1000a400, 0x1000a5ff), /* EFUSE */\n+\tregmap_reg_range(0x1000c000, 0x1000cfff), /* GDMP CSR */\n+\tregmap_reg_range(0x10010000, 0x1001ffff), /* GDMP SRAM */\n+\tregmap_reg_range(0x10200000, 0x10203fff), /* Switch - ARL Global */\n+\tregmap_reg_range(0x10204000, 0x10207fff), /* Switch - BMU */\n+\tregmap_reg_range(0x10208000, 0x1020bfff), /* Switch - ARL Port */\n+\tregmap_reg_range(0x1020c000, 0x1020cfff), /* Switch - SCH */\n+\tregmap_reg_range(0x10210000, 0x10213fff), /* Switch - MAC */\n+\tregmap_reg_range(0x10214000, 0x10217fff), /* Switch - MIB */\n+\tregmap_reg_range(0x10218000, 0x1021bfff), /* Switch - Port Control */\n+\tregmap_reg_range(0x1021c000, 0x1021ffff), /* Switch - TOP */\n+\tregmap_reg_range(0x10220000, 0x1022ffff), /* SerDes */\n+\tregmap_reg_range(0x10286000, 0x10286fff), /* RG Batcher */\n+\tregmap_reg_range(0x1028c000, 0x1028ffff), /* ETHER_SYS */\n+\tregmap_reg_range(0x30000000, 0x37ffffff), /* I2C EEPROM */\n+\tregmap_reg_range(0x38000000, 0x3fffffff), /* BOOT_ROM */\n+\tregmap_reg_range(0xa0000000, 0xbfffffff), /* GPHY */\n+};\n+\n+static const struct regmap_access_table an8855_readable_table = {\n+\t.yes_ranges = an8855_readable_ranges,\n+\t.n_yes_ranges = ARRAY_SIZE(an8855_readable_ranges),\n+};\n+\n+static const struct regmap_config an8855_regmap_config = {\n+\t.name = \"switch\",\n+\t.reg_bits = 32,\n+\t.val_bits = 32,\n+\t.reg_stride = 4,\n+\t.max_register = 0xbfffffff,\n+\t.reg_read = an8855_regmap_read,\n+\t.reg_write = an8855_regmap_write,\n+\t.reg_update_bits = an8855_regmap_update_bits,\n+\t.disable_locking = true,\n+\t.rd_table = \u0026an8855_readable_table,\n+};\n+\n+static int an8855_regmap_phy_reset_page(struct an8855 *ddata,\n+\t\t\t\t\tint phy) __must_hold(\u0026ddata-\u003ebus-\u003emdio_lock)\n+{\n+\t/* Check PHY page only for addr shared with switch */\n+\tif (phy != ddata-\u003eswitch_addr)\n+\t\treturn 0;\n+\n+\t/* Don't restore page if it's not set to Switch page */\n+\tif (ddata-\u003ecurrent_page != AN8855_PHY_PAGE_EXTENDED_4)\n+\t\treturn 0;\n+\n+\t/*\n+\t * Restore page to 0, PHY might change page right after but that\n+\t * will be ignored as it won't be a switch page.\n+\t */\n+\treturn an8855_mii_set_page(ddata, phy, AN8855_PHY_PAGE_STANDARD);\n+}\n+\n+static int an8855_regmap_phy_read(void *ctx, uint32_t reg, uint32_t *val)\n+{\n+\tstruct an8855_phy *ddata = ctx;\n+\tstruct an8855 *core_ddata = ddata-\u003ecore;\n+\tstruct mii_bus *bus = core_ddata-\u003ebus;\n+\tu32 addr = ddata-\u003eaddr;\n+\tint ret;\n+\n+\tmutex_lock_nested(\u0026bus-\u003emdio_lock, MDIO_MUTEX_NESTED);\n+\tret = an8855_regmap_phy_reset_page(core_ddata, addr);\n+\tif (ret)\n+\t\tgoto exit;\n+\n+\tret = __mdiobus_read(bus, addr, reg);\n+\tif (ret \u003e= 0)\n+\t\t*val = ret;\n+\n+exit:\n+\tmutex_unlock(\u0026bus-\u003emdio_lock);\n+\n+\treturn ret \u003c 0 ? ret : 0;\n+}\n+\n+static int an8855_regmap_phy_write(void *ctx, uint32_t reg, uint32_t val)\n+{\n+\tstruct an8855_phy *ddata = ctx;\n+\tstruct an8855 *core_ddata = ddata-\u003ecore;\n+\tstruct mii_bus *bus = core_ddata-\u003ebus;\n+\tu32 addr = ddata-\u003eaddr;\n+\tint ret;\n+\n+\tmutex_lock_nested(\u0026bus-\u003emdio_lock, MDIO_MUTEX_NESTED);\n+\tret = an8855_regmap_phy_reset_page(core_ddata, addr);\n+\tif (ret)\n+\t\tgoto exit;\n+\n+\tret = __mdiobus_write(bus, addr, reg, val);\n+\n+exit:\n+\tmutex_unlock(\u0026bus-\u003emdio_lock);\n+\n+\treturn ret;\n+}\n+\n+static const struct regmap_config an8855_phy_regmap_config = {\n+\t.reg_bits = 16,\n+\t.val_bits = 16,\n+\t.reg_read = an8855_regmap_phy_read,\n+\t.reg_write = an8855_regmap_phy_write,\n+\t.disable_locking = true,\n+\t.max_register = 0x1f,\n+};\n+\n+static int an8855_read_switch_id(struct device *dev, struct regmap *regmap)\n+{\n+\tu32 id;\n+\tint ret;\n+\n+\tret = regmap_read(regmap, AN8855_CREV, \u0026id);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (id != AN8855_ID) {\n+\t\tdev_err(dev, \"Detected Switch ID %x but %x was expected\\n\",\n+\t\t\tid, AN8855_ID);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int an8855_phy_bus_register(struct device *dev, struct an8855 *ddata,\n+\t\t\t\t   struct fwnode_handle *phy_np,\n+\t\t\t\t   struct an8855_phy_bus *phy_bus_info)\n+{\n+\tstruct mdio_regmap_config mrc = { };\n+\tstruct an8855_phy *phy_ddata;\n+\tstruct regmap *regmap;\n+\tu32 addr, phy_offset;\n+\tstruct mii_bus *bus;\n+\tint ret;\n+\n+\tret = fwnode_property_read_u32(phy_np, \"reg\", \u0026addr);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tphy_offset = addr - ddata-\u003eswitch_addr;\n+\tif (phy_offset \u003e= AN8855_MAX_PHY_PORT)\n+\t\treturn -EINVAL;\n+\n+\tphy_ddata = devm_kzalloc(dev, sizeof(*phy_ddata), GFP_KERNEL);\n+\tif (!phy_ddata)\n+\t\treturn -ENOMEM;\n+\n+\tphy_ddata-\u003eaddr = addr;\n+\tphy_ddata-\u003ecore = ddata;\n+\n+\tregmap = devm_regmap_init(dev, NULL, phy_ddata, \u0026an8855_phy_regmap_config);\n+\tif (IS_ERR(regmap))\n+\t\treturn dev_err_probe(dev, PTR_ERR(regmap),\n+\t\t\t\t     \"phy%d regmap initialization failed\\n\",\n+\t\t\t\t      addr);\n+\n+\tmrc.regmap = regmap;\n+\tmrc.parent = dev;\n+\tmrc.valid_addr = addr;\n+\tsnprintf(mrc.name, MII_BUS_ID_SIZE, \"%s-phy%u\", dev_name(dev), addr);\n+\n+\tbus = devm_mdio_regmap_register(dev, \u0026mrc);\n+\tif (IS_ERR(bus))\n+\t\treturn PTR_ERR(bus);\n+\n+\tif (addr == ddata-\u003eswitch_addr)\n+\t\tddata-\u003ephy_bus = bus;\n+\n+\tphy_bus_info-\u003ebus = bus;\n+\tphy_bus_info-\u003eaddr = addr;\n+\tphy_bus_info-\u003enode = fwnode_handle_get(phy_np);\n+\n+\treturn 0;\n+}\n+\n+static int an8855_mdio_register(struct device *dev, struct an8855 *ddata,\n+\t\t\t\tstruct an8855_phy_bus *phy_bus_infos)\n+{\n+\tstruct fwnode_handle *mdio_np __free(fwnode_handle) = NULL;\n+\tint phy = 0;\n+\tint ret = 0;\n+\n+\tmdio_np = fwnode_get_named_child_node(dev_fwnode(dev), \"mdio\");\n+\tif (!mdio_np)\n+\t\treturn -ENODEV;\n+\n+\tfwnode_for_each_available_child_node_scoped(mdio_np, phy_np) {\n+\t\tif (phy \u003e= AN8855_MAX_PHY_PORT) {\n+\t\t\tret = -EINVAL;\n+\t\t\tgoto exit;\n+\t\t}\n+\n+\t\tret = an8855_phy_bus_register(dev, ddata, phy_np,\n+\t\t\t\t\t      \u0026phy_bus_infos[phy]);\n+\t\tif (ret)\n+\t\t\tgoto exit;\n+\n+\t\tphy++;\n+\t}\n+\n+exit:\n+\tif (ret) {\n+\t\twhile (phy--)\n+\t\t\tfwnode_handle_put(phy_bus_infos[phy].node);\n+\n+\t\treturn ret;\n+\t}\n+\n+\treturn phy;\n+}\n+\n+static int an8855_probe(struct mdio_device *mdiodev)\n+{\n+\tstruct an8855_phy_bus phy_bus_infos[AN8855_MAX_PHY_PORT] = { };\n+\tstruct device *dev = \u0026mdiodev-\u003edev;\n+\tstruct regmap *regmap;\n+\tstruct an8855 *ddata;\n+\tint num_phys;\n+\tint phy, ret;\n+\n+\tddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);\n+\tif (!ddata)\n+\t\treturn -ENOMEM;\n+\n+\tddata-\u003ebus = mdiodev-\u003ebus;\n+\tddata-\u003eswitch_addr = mdiodev-\u003eaddr;\n+\t/* No DMA for mdiobus, mute warning for DMA mask not set */\n+\tdev-\u003edma_mask = \u0026dev-\u003ecoherent_dma_mask;\n+\n+\t/* Register virtual MDIO for each PHY */\n+\tnum_phys = an8855_mdio_register(dev, ddata, phy_bus_infos);\n+\tif (num_phys \u003c 0)\n+\t\treturn num_phys;\n+\n+\tregmap = devm_regmap_init(dev, NULL, ddata, \u0026an8855_regmap_config);\n+\tif (IS_ERR(regmap)) {\n+\t\tret = PTR_ERR(regmap);\n+\t\tdev_err_probe(dev, ret, \"regmap initialization failed\\n\");\n+\t\tgoto err_put_fwnodes;\n+\t}\n+\n+\t/* Reset PHY page for switch address */\n+\tmutex_lock_nested(\u0026ddata-\u003ebus-\u003emdio_lock, MDIO_MUTEX_NESTED);\n+\tret = an8855_mii_set_page(ddata, ddata-\u003eswitch_addr,\n+\t\t\t\t  AN8855_PHY_PAGE_STANDARD);\n+\tmutex_unlock(\u0026ddata-\u003ebus-\u003emdio_lock);\n+\tif (ret)\n+\t\tgoto err_put_fwnodes;\n+\n+\tret = an8855_read_switch_id(dev, regmap);\n+\tif (ret)\n+\t\tgoto err_put_fwnodes;\n+\n+\t/* Release global PHY power down */\n+\tret = regmap_write(regmap, AN8855_RG_GPHY_AFE_PWD, 0x0);\n+\tif (ret)\n+\t\tgoto err_put_fwnodes;\n+\n+\t/* Register PHYs */\n+\tfor (phy = 0; phy \u003c num_phys; phy++) {\n+\t\tret = fwnode_mdiobus_register_phy(phy_bus_infos[phy].bus,\n+\t\t\t\t\t\t  phy_bus_infos[phy].node,\n+\t\t\t\t\t\t  phy_bus_infos[phy].addr);\n+\t\tfwnode_handle_put(phy_bus_infos[phy].node);\n+\t\tphy_bus_infos[phy].node = NULL;\n+\n+\t\tif (ret)\n+\t\t\tgoto err_put_fwnodes;\n+\t}\n+\n+\treturn devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, an8855_cells,\n+\t\t\t\t    ARRAY_SIZE(an8855_cells), NULL, 0,\n+\t\t\t\t    NULL);\n+\n+err_put_fwnodes:\n+\tfor (phy = 0; phy \u003c num_phys; phy++)\n+\t\tif (phy_bus_infos[phy].node)\n+\t\t\tfwnode_handle_put(phy_bus_infos[phy].node);\n+\n+\treturn ret;\n+}\n+\n+static const struct of_device_id an8855_of_match[] = {\n+\t{ .compatible = \"airoha,an8855\" },\n+\t{ /* sentinel */ }\n+};\n+MODULE_DEVICE_TABLE(of, an8855_of_match);\n+\n+static struct mdio_driver an8855_driver = {\n+\t.probe = an8855_probe,\n+\t.mdiodrv.driver = {\n+\t\t.name = \"an8855\",\n+\t\t.of_match_table = an8855_of_match,\n+\t},\n+};\n+mdio_module_driver(an8855_driver);\n+\n+MODULE_AUTHOR(\"Christian Marangi \u003cansuelsmth@gmail.com\u003e\");\n+MODULE_DESCRIPTION(\"Driver for Airoha AN8855\");\n+MODULE_LICENSE(\"GPL\");\n"
}

2/1 2026/11/21 13:13 agent patch-evaluator
2m Model:
core

Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch adds Device Tree bindings and a core MFD driver for the Airoha AN8855 Ethernet switch SoC. The driver binds via Device Tree (OF) over MDIO to interact with physical AN8855 ASIC registers. On amd64 in standard QEMU/GCE virtualized environments, this hardware is not emulated and Device Tree nodes for this chip are not present. Consequently, the modified code is structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

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 83e3691b2cc9e34c36112f0df69cec44718dc1f9
Author: syz-cluster <triage@syzkaller.com>
Date:   Sat Nov 21 13:13:02 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/devicetree/bindings/mfd/airoha,an8855.yaml b/Documentation/devicetree/bindings/mfd/airoha,an8855.yaml
new file mode 100644
index 00000000000000..48127e956c9656
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/airoha,an8855.yaml
@@ -0,0 +1,176 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/airoha,an8855.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha AN8855 Switch SoC
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+description: >
+  Airoha AN8855 Switch is a SoC that expose various peripherals like an
+  Ethernet Switch, a NVMEM provider and Ethernet PHYs.
+
+  It does also support i2c and timers but those are not currently
+  supported/used.
+
+properties:
+  compatible:
+    const: airoha,an8855
+
+  reg:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  efuse:
+    type: object
+    $ref: /schemas/nvmem/airoha,an8855-efuse.yaml
+    description: EFUSE exposed by the Airoha AN8855 SoC
+
+  ethernet-switch:
+    type: object
+    $ref: /schemas/net/dsa/airoha,an8855-switch.yaml
+    description: Switch exposed by the Airoha AN8855 SoC
+
+  mdio:
+    type: object
+    $ref: /schemas/net/mdio.yaml#
+    description: MDIO exposed by the Airoha AN8855 SoC
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - mdio
+  - ethernet-switch
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    mdio {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        soc@1 {
+            compatible = "airoha,an8855";
+            reg = <1>;
+
+            reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
+
+            efuse {
+                compatible = "airoha,an8855-efuse";
+
+                #nvmem-cell-cells = <0>;
+
+                nvmem-layout {
+                    compatible = "fixed-layout";
+                    #address-cells = <1>;
+                    #size-cells = <1>;
+
+                    shift_sel_port0_tx_a: shift-sel-port0-tx-a@c {
+                       reg = <0xc 0x4>;
+                    };
+
+                    shift_sel_port0_tx_b: shift-sel-port0-tx-b@10 {
+                        reg = <0x10 0x4>;
+                    };
+
+                    shift_sel_port0_tx_c: shift-sel-port0-tx-c@14 {
+                        reg = <0x14 0x4>;
+                    };
+
+                    shift_sel_port0_tx_d: shift-sel-port0-tx-d@18 {
+                       reg = <0x18 0x4>;
+                    };
+
+                    shift_sel_port1_tx_a: shift-sel-port1-tx-a@1c {
+                        reg = <0x1c 0x4>;
+                    };
+
+                    shift_sel_port1_tx_b: shift-sel-port1-tx-b@20 {
+                        reg = <0x20 0x4>;
+                    };
+
+                    shift_sel_port1_tx_c: shift-sel-port1-tx-c@24 {
+                       reg = <0x24 0x4>;
+                    };
+
+                    shift_sel_port1_tx_d: shift-sel-port1-tx-d@28 {
+                        reg = <0x28 0x4>;
+                    };
+                };
+            };
+
+            ethernet-switch {
+                compatible = "airoha,an8855-switch";
+
+                ports {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    port@0 {
+                        reg = <0>;
+                        label = "lan1";
+                        phy-mode = "internal";
+                        phy-handle = <&internal_phy1>;
+                    };
+
+                    port@1 {
+                        reg = <1>;
+                        label = "lan2";
+                        phy-mode = "internal";
+                        phy-handle = <&internal_phy2>;
+                    };
+
+                    port@5 {
+                        reg = <5>;
+                        label = "cpu";
+                        ethernet = <&gmac0>;
+                        phy-mode = "2500base-x";
+
+                        fixed-link {
+                            speed = <2500>;
+                            full-duplex;
+                            pause;
+                        };
+                    };
+                };
+            };
+
+            mdio {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                internal_phy1: ethernet-phy@1 {
+                  compatible = "ethernet-phy-idc0ff.0410",
+                               "ethernet-phy-ieee802.3-c22";
+                  reg = <1>;
+
+                  nvmem-cells = <&shift_sel_port0_tx_a>,
+                      <&shift_sel_port0_tx_b>,
+                      <&shift_sel_port0_tx_c>,
+                      <&shift_sel_port0_tx_d>;
+                  nvmem-cell-names = "tx_a", "tx_b", "tx_c", "tx_d";
+                };
+
+                internal_phy2: ethernet-phy@2 {
+                  compatible = "ethernet-phy-idc0ff.0410",
+                               "ethernet-phy-ieee802.3-c22";
+                  reg = <2>;
+
+                  nvmem-cells = <&shift_sel_port1_tx_a>,
+                      <&shift_sel_port1_tx_b>,
+                      <&shift_sel_port1_tx_c>,
+                      <&shift_sel_port1_tx_d>;
+                  nvmem-cell-names = "tx_a", "tx_b", "tx_c", "tx_d";
+                };
+            };
+        };
+    };
diff --git a/Documentation/devicetree/bindings/net/airoha,an8855-phy.yaml b/Documentation/devicetree/bindings/net/airoha,an8855-phy.yaml
new file mode 100644
index 00000000000000..d2f86116badf49
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/airoha,an8855-phy.yaml
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/airoha,an8855-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha AN8855 Switch Internal PHY
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+description: >
+  Airoha AN8855 is a 5-port Gigabit Switch that expose the Internal
+  PHYs on the MDIO bus.
+
+  Each PHY might need to be calibrated to correctly work with the
+  use of the eFUSE provided by the Switch SoC.
+
+allOf:
+  - $ref: ethernet-phy.yaml#
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - ethernet-phy-idc0ff.0410
+  required:
+    - compatible
+
+properties:
+  reg:
+    maxItems: 1
+
+  nvmem-cells:
+    items:
+      - description: phandle to SoC eFUSE tx_a
+      - description: phandle to SoC eFUSE tx_b
+      - description: phandle to SoC eFUSE tx_c
+      - description: phandle to SoC eFUSE tx_d
+
+  nvmem-cell-names:
+    items:
+      - const: tx_a
+      - const: tx_b
+      - const: tx_c
+      - const: tx_d
+
+required:
+  - compatible
+  - reg
+
+dependentRequired:
+  nvmem-cells: [ nvmem-cell-names ]
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mdio {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ethernet-phy@1 {
+            compatible = "ethernet-phy-idc0ff.0410",
+                         "ethernet-phy-ieee802.3-c45";
+
+            reg = <1>;
+        };
+
+        ethernet-phy@2 {
+            compatible = "ethernet-phy-idc0ff.0410",
+                         "ethernet-phy-ieee802.3-c45";
+
+            reg = <2>;
+
+            nvmem-cells = <&shift_sel_port0_tx_a>,
+                          <&shift_sel_port0_tx_b>,
+                          <&shift_sel_port0_tx_c>,
+                          <&shift_sel_port0_tx_d>;
+            nvmem-cell-names = "tx_a", "tx_b", "tx_c", "tx_d";
+        };
+    };
diff --git a/Documentation/devicetree/bindings/net/dsa/airoha,an8855-switch.yaml b/Documentation/devicetree/bindings/net/dsa/airoha,an8855-switch.yaml
new file mode 100644
index 00000000000000..5ad9b9e1398319
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/dsa/airoha,an8855-switch.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/dsa/airoha,an8855-switch.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha AN8855 Gigabit Switch
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+description: >
+  Airoha AN8855 is a 5-port Gigabit Switch.
+
+  It does expose the 5 Internal PHYs on the MDIO bus and each port
+  can access the Switch register space by configuring the PHY page.
+
+$ref: dsa.yaml#/$defs/ethernet-ports
+
+properties:
+  compatible:
+    const: airoha,an8855-switch
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    ethernet-switch {
+        compatible = "airoha,an8855-switch";
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                label = "lan1";
+                phy-mode = "internal";
+                phy-handle = <&internal_phy1>;
+            };
+
+            port@1 {
+                reg = <1>;
+                label = "lan2";
+                phy-mode = "internal";
+                phy-handle = <&internal_phy2>;
+            };
+
+            port@2 {
+                reg = <2>;
+                label = "lan3";
+                phy-mode = "internal";
+                phy-handle = <&internal_phy3>;
+            };
+
+            port@3 {
+                reg = <3>;
+                label = "lan4";
+                phy-mode = "internal";
+                phy-handle = <&internal_phy4>;
+            };
+
+            port@4 {
+                reg = <4>;
+                label = "wan";
+                phy-mode = "internal";
+                phy-handle = <&internal_phy5>;
+            };
+
+            port@5 {
+                reg = <5>;
+                label = "cpu";
+                ethernet = <&gmac0>;
+                phy-mode = "2500base-x";
+
+                fixed-link {
+                    speed = <2500>;
+                    full-duplex;
+                    pause;
+                };
+            };
+        };
+    };
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 2b2b7bced40017..ba8c8971e12c50 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -54,6 +54,20 @@ config MFD_ALTERA_SYSMGR
 	  using regmap_mmio accesses for ARM32 parts and SMC calls to
 	  EL3 for ARM64 parts.
 
+config MFD_AIROHA_AN8855
+	tristate "Airoha AN8855 Switch Core"
+	select MFD_CORE
+	select REGMAP
+	select PHYLIB
+	select MDIO_REGMAP
+	depends on NETDEVICES && OF
+	help
+	  Support for the Airoha AN8855 Switch Core. This is an SoC
+	  that provides various peripherals, to count, i2c, an Ethrnet
+	  Switch, a CPU timer, GPIO, eFUSE.
+
+	  Currently it provides a DSA switch and a NVMEM provider.
+
 config MFD_ACT8945A
 	tristate "Active-semi ACT8945A"
 	select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 3765e6ebc72476..99f0bd236d92c3 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_MFD_88PM860X)	+= 88pm860x.o
 obj-$(CONFIG_MFD_88PM800)	+= 88pm800.o 88pm80x.o
 obj-$(CONFIG_MFD_88PM805)	+= 88pm805.o 88pm80x.o
 obj-$(CONFIG_MFD_88PM886_PMIC)	+= 88pm886.o
+obj-$(CONFIG_MFD_AIROHA_AN8855)	+= airoha-an8855.o
 obj-$(CONFIG_MFD_ACT8945A)	+= act8945a.o
 obj-$(CONFIG_MFD_SM501)		+= sm501.o
 obj-$(CONFIG_MFD_ASUS_TRANSFORMER_EC)	+= asus-transformer-ec.o
diff --git a/drivers/mfd/airoha-an8855.c b/drivers/mfd/airoha-an8855.c
new file mode 100644
index 00000000000000..908b2676e35a61
--- /dev/null
+++ b/drivers/mfd/airoha-an8855.c
@@ -0,0 +1,568 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Core driver for Airoha AN8855 Switch
+ *
+ * Copyright (C) 2024 Christian Marangi <ansuelsmth@gmail.com>
+ */
+
+#include <linux/bitfield.h>
+#include <linux/fwnode_mdio.h>
+#include <linux/gpio/consumer.h>
+#include <linux/mdio.h>
+#include <linux/mdio/mdio-regmap.h>
+#include <linux/mfd/core.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/phy.h>
+#include <linux/regmap.h>
+
+/* Register for HW trap status */
+#define AN8855_HWTRAP			0x1000009c
+
+/*
+ * Register of the Switch ID
+ * (called Project ID in Documentation)
+ */
+#define AN8855_CREV			0x10005000
+#define   AN8855_ID			0x8855 /* Switch ID */
+
+/*
+ * Register for GPHY Power Down
+ * Used to Toggle the Gigabit PHY power and enable them.
+ */
+#define AN8855_RG_GPHY_AFE_PWD		0x1028c840
+
+/* MII Registers */
+#define AN8855_PHY_SELECT_PAGE		0x1f
+#define   AN8855_PHY_PAGE		GENMASK(2, 0)
+#define   AN8855_PHY_PAGE_STANDARD	FIELD_PREP_CONST(AN8855_PHY_PAGE, 0x0)
+#define   AN8855_PHY_PAGE_EXTENDED_1	FIELD_PREP_CONST(AN8855_PHY_PAGE, 0x1)
+#define   AN8855_PHY_PAGE_EXTENDED_4	FIELD_PREP_CONST(AN8855_PHY_PAGE, 0x4)
+
+/* MII Registers Page 4 */
+#define AN8855_PBUS_MODE		0x10
+#define   AN8855_PBUS_MODE_ADDR_FIXED	0x0
+#define   AN8855_PBUS_MODE_ADDR_INCR	BIT(15)
+#define AN8855_PBUS_WR_ADDR_HIGH	0x11
+#define AN8855_PBUS_WR_ADDR_LOW		0x12
+#define AN8855_PBUS_WR_DATA_HIGH	0x13
+#define AN8855_PBUS_WR_DATA_LOW		0x14
+#define AN8855_PBUS_RD_ADDR_HIGH	0x15
+#define AN8855_PBUS_RD_ADDR_LOW		0x16
+#define AN8855_PBUS_RD_DATA_HIGH	0x17
+#define AN8855_PBUS_RD_DATA_LOW		0x18
+
+#define AN8855_MAX_PHY_PORT		5
+
+#define AN8855_MDIO_VAL(hi, lo)		(((u32)(hi) << 16) | (u16)(lo))
+
+struct an8855 {
+	struct mii_bus *bus;
+	struct mii_bus *phy_bus;
+	unsigned int switch_addr;
+	u16 current_page;
+};
+
+struct an8855_phy {
+	u8 addr;
+	struct an8855 *core;
+};
+
+struct an8855_phy_bus {
+	struct mii_bus *bus;
+	struct fwnode_handle *node;
+	u8 addr;
+};
+
+static const struct mfd_cell an8855_cells[] = {
+	MFD_CELL_OF("an8855-efuse", NULL, NULL, 0, 0, "airoha,an8855-efuse"),
+	MFD_CELL_OF("an8855-switch", NULL, NULL, 0, 0, "airoha,an8855-switch"),
+};
+
+static int an8855_mii_set_page(struct an8855 *ddata, u8 addr,
+			       u8 page) __must_hold(&ddata->bus->mdio_lock)
+{
+	struct mii_bus *bus = ddata->bus;
+	int ret;
+
+	ret = __mdiobus_write(bus, addr, AN8855_PHY_SELECT_PAGE, page);
+	if (ret) {
+		dev_err_ratelimited(&bus->dev, "Failed to set mii page\n");
+		return ret;
+	}
+
+	/* Cache current page if next MII read/write is for Switch page */
+	ddata->current_page = page;
+	return 0;
+}
+
+static int an8855_mii_read32(struct mii_bus *bus, u8 phy_id, u32 reg,
+			     u32 *val) __must_hold(&bus->mdio_lock)
+{
+	int lo, hi, ret;
+
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_MODE, AN8855_PBUS_MODE_ADDR_FIXED);
+	if (ret)
+		goto err;
+
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_RD_ADDR_HIGH, upper_16_bits(reg));
+	if (ret)
+		goto err;
+
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_RD_ADDR_LOW, lower_16_bits(reg));
+	if (ret)
+		goto err;
+
+	hi = __mdiobus_read(bus, phy_id, AN8855_PBUS_RD_DATA_HIGH);
+	if (hi < 0) {
+		ret = hi;
+		goto err;
+	}
+
+	lo = __mdiobus_read(bus, phy_id, AN8855_PBUS_RD_DATA_LOW);
+	if (lo < 0) {
+		ret = lo;
+		goto err;
+	}
+
+	*val = AN8855_MDIO_VAL(hi, lo);
+
+	return 0;
+err:
+	dev_err_ratelimited(&bus->dev, "Failed to read register\n");
+	return ret;
+}
+
+/*
+ * Protect concurrent access to phy page if switch address also
+ * expose a PHY.
+ */
+static void an8855_regmap_lock(struct an8855 *ddata)
+{
+	if (ddata->phy_bus)
+		mutex_lock(&ddata->phy_bus->mdio_lock);
+
+	mutex_lock_nested(&ddata->bus->mdio_lock, MDIO_MUTEX_NESTED);
+}
+
+static void an8855_regmap_unlock(struct an8855 *ddata)
+{
+	mutex_unlock(&ddata->bus->mdio_lock);
+
+	if (ddata->phy_bus)
+		mutex_unlock(&ddata->phy_bus->mdio_lock);
+}
+
+static int an8855_regmap_read(void *ctx, uint32_t reg, uint32_t *val)
+{
+	struct an8855 *ddata = ctx;
+	struct mii_bus *bus = ddata->bus;
+	u16 addr = ddata->switch_addr;
+	int ret;
+
+	an8855_regmap_lock(ddata);
+
+	ret = an8855_mii_set_page(ddata, addr, AN8855_PHY_PAGE_EXTENDED_4);
+	if (ret)
+		goto exit;
+
+	ret = an8855_mii_read32(bus, addr, reg, val);
+
+exit:
+	an8855_regmap_unlock(ddata);
+
+	return ret;
+}
+
+static int an8855_mii_write32(struct mii_bus *bus, u8 phy_id, u32 reg,
+			      u32 val) __must_hold(&bus->mdio_lock)
+{
+	int ret;
+
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_MODE, AN8855_PBUS_MODE_ADDR_FIXED);
+	if (ret)
+		goto err;
+
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_ADDR_HIGH, upper_16_bits(reg));
+	if (ret)
+		goto err;
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_ADDR_LOW, lower_16_bits(reg));
+	if (ret)
+		goto err;
+
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_DATA_HIGH, upper_16_bits(val));
+	if (ret)
+		goto err;
+
+	ret = __mdiobus_write(bus, phy_id, AN8855_PBUS_WR_DATA_LOW, lower_16_bits(val));
+	if (ret)
+		goto err;
+
+	return 0;
+err:
+	dev_err_ratelimited(&bus->dev,
+			    "Failed to write an8855 register\n");
+	return ret;
+}
+
+static int an8855_regmap_write(void *ctx, uint32_t reg, uint32_t val)
+{
+	struct an8855 *ddata = ctx;
+	struct mii_bus *bus = ddata->bus;
+	u16 addr = ddata->switch_addr;
+	int ret;
+
+	an8855_regmap_lock(ddata);
+	ret = an8855_mii_set_page(ddata, addr, AN8855_PHY_PAGE_EXTENDED_4);
+	if (ret)
+		goto exit;
+
+	ret = an8855_mii_write32(bus, addr, reg, val);
+
+exit:
+	an8855_regmap_unlock(ddata);
+
+	return ret;
+}
+
+static int an8855_regmap_update_bits(void *ctx, uint32_t reg, uint32_t mask,
+				     uint32_t write_val)
+{
+	struct an8855 *ddata = ctx;
+	struct mii_bus *bus = ddata->bus;
+	u16 addr = ddata->switch_addr;
+	u32 val;
+	int ret;
+
+	an8855_regmap_lock(ddata);
+	ret = an8855_mii_set_page(ddata, addr, AN8855_PHY_PAGE_EXTENDED_4);
+	if (ret)
+		goto exit;
+
+	ret = an8855_mii_read32(bus, addr, reg, &val);
+	if (ret)
+		goto exit;
+
+	val &= ~mask;
+	val |= write_val & mask;
+	ret = an8855_mii_write32(bus, addr, reg, val);
+
+exit:
+	an8855_regmap_unlock(ddata);
+
+	return ret;
+}
+
+static const struct regmap_range an8855_readable_ranges[] = {
+	regmap_reg_range(0x10000000, 0x10000fff), /* SCU */
+	regmap_reg_range(0x10001000, 0x10001fff), /* RBUS */
+	regmap_reg_range(0x10002000, 0x10002fff), /* MCU */
+	regmap_reg_range(0x10005000, 0x10005fff), /* SYS SCU */
+	regmap_reg_range(0x10007000, 0x10007fff), /* I2C Slave */
+	regmap_reg_range(0x10008000, 0x10008fff), /* I2C Master */
+	regmap_reg_range(0x10009000, 0x10009fff), /* PDMA */
+	regmap_reg_range(0x1000a100, 0x1000a1ff), /* General Purpose Timer */
+	regmap_reg_range(0x1000a200, 0x1000a2ff), /* GPU timer */
+	regmap_reg_range(0x1000a300, 0x1000a3ff), /* GPIO */
+	regmap_reg_range(0x1000a400, 0x1000a5ff), /* EFUSE */
+	regmap_reg_range(0x1000c000, 0x1000cfff), /* GDMP CSR */
+	regmap_reg_range(0x10010000, 0x1001ffff), /* GDMP SRAM */
+	regmap_reg_range(0x10200000, 0x10203fff), /* Switch - ARL Global */
+	regmap_reg_range(0x10204000, 0x10207fff), /* Switch - BMU */
+	regmap_reg_range(0x10208000, 0x1020bfff), /* Switch - ARL Port */
+	regmap_reg_range(0x1020c000, 0x1020cfff), /* Switch - SCH */
+	regmap_reg_range(0x10210000, 0x10213fff), /* Switch - MAC */
+	regmap_reg_range(0x10214000, 0x10217fff), /* Switch - MIB */
+	regmap_reg_range(0x10218000, 0x1021bfff), /* Switch - Port Control */
+	regmap_reg_range(0x1021c000, 0x1021ffff), /* Switch - TOP */
+	regmap_reg_range(0x10220000, 0x1022ffff), /* SerDes */
+	regmap_reg_range(0x10286000, 0x10286fff), /* RG Batcher */
+	regmap_reg_range(0x1028c000, 0x1028ffff), /* ETHER_SYS */
+	regmap_reg_range(0x30000000, 0x37ffffff), /* I2C EEPROM */
+	regmap_reg_range(0x38000000, 0x3fffffff), /* BOOT_ROM */
+	regmap_reg_range(0xa0000000, 0xbfffffff), /* GPHY */
+};
+
+static const struct regmap_access_table an8855_readable_table = {
+	.yes_ranges = an8855_readable_ranges,
+	.n_yes_ranges = ARRAY_SIZE(an8855_readable_ranges),
+};
+
+static const struct regmap_config an8855_regmap_config = {
+	.name = "switch",
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = 4,
+	.max_register = 0xbfffffff,
+	.reg_read = an8855_regmap_read,
+	.reg_write = an8855_regmap_write,
+	.reg_update_bits = an8855_regmap_update_bits,
+	.disable_locking = true,
+	.rd_table = &an8855_readable_table,
+};
+
+static int an8855_regmap_phy_reset_page(struct an8855 *ddata,
+					int phy) __must_hold(&ddata->bus->mdio_lock)
+{
+	/* Check PHY page only for addr shared with switch */
+	if (phy != ddata->switch_addr)
+		return 0;
+
+	/* Don't restore page if it's not set to Switch page */
+	if (ddata->current_page != AN8855_PHY_PAGE_EXTENDED_4)
+		return 0;
+
+	/*
+	 * Restore page to 0, PHY might change page right after but that
+	 * will be ignored as it won't be a switch page.
+	 */
+	return an8855_mii_set_page(ddata, phy, AN8855_PHY_PAGE_STANDARD);
+}
+
+static int an8855_regmap_phy_read(void *ctx, uint32_t reg, uint32_t *val)
+{
+	struct an8855_phy *ddata = ctx;
+	struct an8855 *core_ddata = ddata->core;
+	struct mii_bus *bus = core_ddata->bus;
+	u32 addr = ddata->addr;
+	int ret;
+
+	mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
+	ret = an8855_regmap_phy_reset_page(core_ddata, addr);
+	if (ret)
+		goto exit;
+
+	ret = __mdiobus_read(bus, addr, reg);
+	if (ret >= 0)
+		*val = ret;
+
+exit:
+	mutex_unlock(&bus->mdio_lock);
+
+	return ret < 0 ? ret : 0;
+}
+
+static int an8855_regmap_phy_write(void *ctx, uint32_t reg, uint32_t val)
+{
+	struct an8855_phy *ddata = ctx;
+	struct an8855 *core_ddata = ddata->core;
+	struct mii_bus *bus = core_ddata->bus;
+	u32 addr = ddata->addr;
+	int ret;
+
+	mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
+	ret = an8855_regmap_phy_reset_page(core_ddata, addr);
+	if (ret)
+		goto exit;
+
+	ret = __mdiobus_write(bus, addr, reg, val);
+
+exit:
+	mutex_unlock(&bus->mdio_lock);
+
+	return ret;
+}
+
+static const struct regmap_config an8855_phy_regmap_config = {
+	.reg_bits = 16,
+	.val_bits = 16,
+	.reg_read = an8855_regmap_phy_read,
+	.reg_write = an8855_regmap_phy_write,
+	.disable_locking = true,
+	.max_register = 0x1f,
+};
+
+static int an8855_read_switch_id(struct device *dev, struct regmap *regmap)
+{
+	u32 id;
+	int ret;
+
+	ret = regmap_read(regmap, AN8855_CREV, &id);
+	if (ret)
+		return ret;
+
+	if (id != AN8855_ID) {
+		dev_err(dev, "Detected Switch ID %x but %x was expected\n",
+			id, AN8855_ID);
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
+static int an8855_phy_bus_register(struct device *dev, struct an8855 *ddata,
+				   struct fwnode_handle *phy_np,
+				   struct an8855_phy_bus *phy_bus_info)
+{
+	struct mdio_regmap_config mrc = { };
+	struct an8855_phy *phy_ddata;
+	struct regmap *regmap;
+	u32 addr, phy_offset;
+	struct mii_bus *bus;
+	int ret;
+
+	ret = fwnode_property_read_u32(phy_np, "reg", &addr);
+	if (ret)
+		return ret;
+
+	phy_offset = addr - ddata->switch_addr;
+	if (phy_offset >= AN8855_MAX_PHY_PORT)
+		return -EINVAL;
+
+	phy_ddata = devm_kzalloc(dev, sizeof(*phy_ddata), GFP_KERNEL);
+	if (!phy_ddata)
+		return -ENOMEM;
+
+	phy_ddata->addr = addr;
+	phy_ddata->core = ddata;
+
+	regmap = devm_regmap_init(dev, NULL, phy_ddata, &an8855_phy_regmap_config);
+	if (IS_ERR(regmap))
+		return dev_err_probe(dev, PTR_ERR(regmap),
+				     "phy%d regmap initialization failed\n",
+				      addr);
+
+	mrc.regmap = regmap;
+	mrc.parent = dev;
+	mrc.valid_addr = addr;
+	snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-phy%u", dev_name(dev), addr);
+
+	bus = devm_mdio_regmap_register(dev, &mrc);
+	if (IS_ERR(bus))
+		return PTR_ERR(bus);
+
+	if (addr == ddata->switch_addr)
+		ddata->phy_bus = bus;
+
+	phy_bus_info->bus = bus;
+	phy_bus_info->addr = addr;
+	phy_bus_info->node = fwnode_handle_get(phy_np);
+
+	return 0;
+}
+
+static int an8855_mdio_register(struct device *dev, struct an8855 *ddata,
+				struct an8855_phy_bus *phy_bus_infos)
+{
+	struct fwnode_handle *mdio_np __free(fwnode_handle) = NULL;
+	int phy = 0;
+	int ret = 0;
+
+	mdio_np = fwnode_get_named_child_node(dev_fwnode(dev), "mdio");
+	if (!mdio_np)
+		return -ENODEV;
+
+	fwnode_for_each_available_child_node_scoped(mdio_np, phy_np) {
+		if (phy >= AN8855_MAX_PHY_PORT) {
+			ret = -EINVAL;
+			goto exit;
+		}
+
+		ret = an8855_phy_bus_register(dev, ddata, phy_np,
+					      &phy_bus_infos[phy]);
+		if (ret)
+			goto exit;
+
+		phy++;
+	}
+
+exit:
+	if (ret) {
+		while (phy--)
+			fwnode_handle_put(phy_bus_infos[phy].node);
+
+		return ret;
+	}
+
+	return phy;
+}
+
+static int an8855_probe(struct mdio_device *mdiodev)
+{
+	struct an8855_phy_bus phy_bus_infos[AN8855_MAX_PHY_PORT] = { };
+	struct device *dev = &mdiodev->dev;
+	struct regmap *regmap;
+	struct an8855 *ddata;
+	int num_phys;
+	int phy, ret;
+
+	ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
+	if (!ddata)
+		return -ENOMEM;
+
+	ddata->bus = mdiodev->bus;
+	ddata->switch_addr = mdiodev->addr;
+	/* No DMA for mdiobus, mute warning for DMA mask not set */
+	dev->dma_mask = &dev->coherent_dma_mask;
+
+	/* Register virtual MDIO for each PHY */
+	num_phys = an8855_mdio_register(dev, ddata, phy_bus_infos);
+	if (num_phys < 0)
+		return num_phys;
+
+	regmap = devm_regmap_init(dev, NULL, ddata, &an8855_regmap_config);
+	if (IS_ERR(regmap)) {
+		ret = PTR_ERR(regmap);
+		dev_err_probe(dev, ret, "regmap initialization failed\n");
+		goto err_put_fwnodes;
+	}
+
+	/* Reset PHY page for switch address */
+	mutex_lock_nested(&ddata->bus->mdio_lock, MDIO_MUTEX_NESTED);
+	ret = an8855_mii_set_page(ddata, ddata->switch_addr,
+				  AN8855_PHY_PAGE_STANDARD);
+	mutex_unlock(&ddata->bus->mdio_lock);
+	if (ret)
+		goto err_put_fwnodes;
+
+	ret = an8855_read_switch_id(dev, regmap);
+	if (ret)
+		goto err_put_fwnodes;
+
+	/* Release global PHY power down */
+	ret = regmap_write(regmap, AN8855_RG_GPHY_AFE_PWD, 0x0);
+	if (ret)
+		goto err_put_fwnodes;
+
+	/* Register PHYs */
+	for (phy = 0; phy < num_phys; phy++) {
+		ret = fwnode_mdiobus_register_phy(phy_bus_infos[phy].bus,
+						  phy_bus_infos[phy].node,
+						  phy_bus_infos[phy].addr);
+		fwnode_handle_put(phy_bus_infos[phy].node);
+		phy_bus_infos[phy].node = NULL;
+
+		if (ret)
+			goto err_put_fwnodes;
+	}
+
+	return devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, an8855_cells,
+				    ARRAY_SIZE(an8855_cells), NULL, 0,
+				    NULL);
+
+err_put_fwnodes:
+	for (phy = 0; phy < num_phys; phy++)
+		if (phy_bus_infos[phy].node)
+			fwnode_handle_put(phy_bus_infos[phy].node);
+
+	return ret;
+}
+
+static const struct of_device_id an8855_of_match[] = {
+	{ .compatible = "airoha,an8855" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, an8855_of_match);
+
+static struct mdio_driver an8855_driver = {
+	.probe = an8855_probe,
+	.mdiodrv.driver = {
+		.name = "an8855",
+		.of_match_table = an8855_of_match,
+	},
+};
+mdio_module_driver(an8855_driver);
+
+MODULE_AUTHOR("Christian Marangi <ansuelsmth@gmail.com>");
+MODULE_DESCRIPTION("Driver for Airoha AN8855");
+MODULE_LICENSE("GPL");

3/2 2026/11/21 13:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 14507
							output: 33
							thoughts: 1039
						

Thoughts:
**Fuzzing Feasibility Analysis: Airoha AN8855 Switch Driver**

Okay, let's break this down. We have a patch adding Device Tree bindings and a driver for the Airoha AN8855 switch SoC, PHY, and related components. This includes new bindings (`airoha,an8855.yaml`), Kconfig options (`MFD_AIROHA_AN8855`), Makefile entries, and the core C driver (`airoha-an8855.c`). The driver is registered as an MDIO driver.

My initial thought is to assess whether this merits syzkaller fuzzing. The target architecture is amd64, which is a key consideration. The driver relies on `NETDEVICES && OF`. The registration using `mdio_module_driver` is typical for MDIO drivers, which are often instantiated via Device Tree (`OF`), potentially using `of_mdiobus_register`.

Now, the crucial question: can syzkaller (or userspace, for that matter) dynamically create these MDIO devices on amd64 within a QEMU environment? That's the crux of it. We need to determine if this is a hardware-specific SoC/OF-only scenario, effectively making it unreachable in a standard fuzzing setup.

I'm referencing the "WHEN TO RETURN WorthFuzzing=false" criteria. Specifically, the "Structurally unreachable hardware" section is relevant. We need to ensure this isn't like those vendor-specific PCIe switches or SmartNICs that *require* specific physical hardware not emulated in QEMU.

The question then becomes: can we manipulate MDIO devices on amd64 through sysfs, netlink, configfs, or Device Tree overlays? Can OF even be enabled on x86/amd64? Or, more specifically, can we create an OF node dynamically? Let me quickly search to confirm.

Okay, let's examine the driver code itself. We see `an8855_driver` has an `of_match_table` (`an8855_of_match`) but *no* `id_table`. This `of_match_table` indicates Device Tree matching. So, let's use `grepper` to determine how the MDIO bus matches drivers to devices. The matching mechanism is key here. Can an MDIO driver like this be probed or created via our fuzzing method? Is this device reachable, without physically provisioning it? This is still my outstanding question.



4/2 2026/11/21 13:13 tool grepper
0m Args:
{
  "Expression": "mdio_bus_match",
  "PathPrefixes": [
    "drivers/net/phy/"
  ]
}

Results:
{
  "Output": "drivers/net/phy/mdio_bus_provider.c=238=const struct class mdio_bus_class = {\n--\ndrivers/net/phy/mdio_bus_provider.c-244-/**\ndrivers/net/phy/mdio_bus_provider.c:245: * mdio_bus_match - determine if given MDIO driver supports the given\ndrivers/net/phy/mdio_bus_provider.c-246- *\t\t    MDIO device\n--\ndrivers/net/phy/mdio_bus_provider.c-254- */\ndrivers/net/phy/mdio_bus_provider.c:255:static int mdio_bus_match(struct device *dev, const struct device_driver *drv)\ndrivers/net/phy/mdio_bus_provider.c-256-{\n--\ndrivers/net/phy/mdio_bus_provider.c=300=const struct bus_type mdio_bus_type = {\n--\ndrivers/net/phy/mdio_bus_provider.c-302-\t.dev_groups\t= mdio_bus_device_statistics_groups,\ndrivers/net/phy/mdio_bus_provider.c:303:\t.match\t\t= mdio_bus_match,\ndrivers/net/phy/mdio_bus_provider.c-304-\t.uevent\t\t= mdio_uevent,\n"
}

5/2 2026/11/21 13:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 16468
							output: 42
							thoughts: 29
						

Thoughts:
Okay, let's dive into this. Here's my summary, taking the first-person perspective as requested:

**Diving into the MDIO Bus Match**

Alright, time to get my hands dirty. I'm going to take a closer look at the `mdio_bus_match` function. I remember seeing that one in `drivers/net/phy/mdio_bus_provider.c`. I'm going to want to understand exactly how the system determines if a particular PHY driver is compatible with a given MDIO bus. I'll need to remember the typical matching process; does it look at device IDs, platform data, or some combination? I need to analyze its input parameters and how it handles potential mismatches. I wonder if there are any subtle bugs or inefficiencies that I can spot while I'm at it. Let's start by dissecting the code and seeing what it's really doing under the hood.



6/2 2026/11/21 13:13 tool read-file
0m Args:
{
  "File": "drivers/net/phy/mdio_bus_provider.c",
  "FirstLine": 245,
  "LineCount": 50
}

Results:
{
  "Contents": " 245:\t * mdio_bus_match - determine if given MDIO driver supports the given\n 246:\t *\t\t    MDIO device\n 247:\t * @dev: target MDIO device\n 248:\t * @drv: given MDIO driver\n 249:\t *\n 250:\t * Return: 1 if the driver supports the device, 0 otherwise\n 251:\t *\n 252:\t * Description: This may require calling the devices own match function,\n 253:\t *   since different classes of MDIO devices have different match criteria.\n 254:\t */\n 255:\tstatic int mdio_bus_match(struct device *dev, const struct device_driver *drv)\n 256:\t{\n 257:\t\tconst struct mdio_driver *mdiodrv = to_mdio_driver(drv);\n 258:\t\tstruct mdio_device *mdio = to_mdio_device(dev);\n 259:\t\n 260:\t\t/* Both the driver and device must type-match */\n 261:\t\tif (!(mdiodrv-\u003emdiodrv.flags \u0026 MDIO_DEVICE_IS_PHY) !=\n 262:\t\t    !(mdio-\u003eflags \u0026 MDIO_DEVICE_FLAG_PHY))\n 263:\t\t\treturn 0;\n 264:\t\n 265:\t\tif (of_driver_match_device(dev, drv))\n 266:\t\t\treturn 1;\n 267:\t\n 268:\t\tif (mdio-\u003ebus_match)\n 269:\t\t\treturn mdio-\u003ebus_match(dev, drv);\n 270:\t\n 271:\t\treturn 0;\n 272:\t}\n 273:\t\n 274:\tstatic int mdio_uevent(const struct device *dev, struct kobj_uevent_env *env)\n 275:\t{\n 276:\t\tint rc;\n 277:\t\n 278:\t\t/* Some devices have extra OF data and an OF-style MODALIAS */\n 279:\t\trc = of_device_uevent_modalias(dev, env);\n 280:\t\tif (rc != -ENODEV)\n 281:\t\t\treturn rc;\n 282:\t\n 283:\t\treturn 0;\n 284:\t}\n 285:\t\n 286:\tstatic const struct attribute *const mdio_bus_device_statistics_attrs[] = {\n 287:\t\t\u0026dev_attr_mdio_bus_device_transfers.attr.attr,\n 288:\t\t\u0026dev_attr_mdio_bus_device_errors.attr.attr,\n 289:\t\t\u0026dev_attr_mdio_bus_device_writes.attr.attr,\n 290:\t\t\u0026dev_attr_mdio_bus_device_reads.attr.attr,\n 291:\t\tNULL,\n 292:\t};\n 293:\t\n 294:\tstatic const struct attribute_group mdio_bus_device_statistics_group = {\n"
}

7/2 2026/11/21 13:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 17534
							output: 46
							thoughts: 76
						

Thoughts:
Here's my thought process, as requested:

**Deconstructing the MDIO Device Matching**

Okay, so I'm looking at `mdio_bus_match`. It appears to be the core function determining if a driver is compatible with a device on the MDIO bus. The code starts with a call to `of_driver_match_device`. Right, that's the standard device tree matching function. It's essentially checking if the device's Device Tree bindings align with the driver's compatible strings. If they match, the function returns 1, signaling a successful match. Simple enough.

But now I need to back up and understand how these `mdio_device`s are actually *created* in the first place. I need to understand the source of the data they're matching against! I'm going to search for the creation point, likely through a registration process. So, I need to look for functions like `mdio_device_register` or potentially `mdio_device_create` in the kernel source. That should give me the entry point for understanding the complete picture. I'm assuming that the device data, which `of_driver_match_device` uses, is populated during these device creation steps. That's where I need to start.



8/2 2026/11/21 13:13 tool grepper
0m Args:
{
  "Expression": "mdio_device_register|mdio_device_create|of_mdiobus_register",
  "PathPrefixes": [
    "drivers/net/"
  ]
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 622 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (83 files in total):\ndrivers/net/dsa/dsa_loop.c:2\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c:1\ndrivers/net/dsa/microchip/ksz_common.c:1\ndrivers/net/dsa/microchip/lan937x_main.c:1\ndrivers/net/dsa/motorcomm/mdio_bus.c:2\ndrivers/net/dsa/mt7530.c:1\ndrivers/net/dsa/mv88e6xxx/chip.c:1\ndrivers/net/dsa/mxl862xx/mxl862xx.c:1\ndrivers/net/dsa/netc/netc_main.c:1\ndrivers/net/dsa/ocelot/seville_vsc9953.c:1\ndrivers/net/dsa/qca/ar9331.c:1\ndrivers/net/dsa/qca/qca8k-8xxx.c:1\ndrivers/net/dsa/realtek/rtl83xx.c:1\ndrivers/net/dsa/rzn1_a5psw.c:1\ndrivers/net/dsa/sja1105/sja1105_mdio.c:2\ndrivers/net/ethernet/actions/owl-emac.c:1\ndrivers/net/ethernet/altera/altera_tse_main.c:1\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c:1\ndrivers/net/ethernet/arc/emac_mdio.c:1\ndrivers/net/ethernet/atheros/ag71xx.c:1\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c:1\ndrivers/net/ethernet/broadcom/genet/bcmmii.c:1\ndrivers/net/ethernet/cadence/macb_main.c:2\ndrivers/net/ethernet/engleder/tsnep_main.c:1\ndrivers/net/ethernet/faraday/ftgmac100.c:1\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c:1\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c:1\ndrivers/net/ethernet/freescale/fec_main.c:1\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c:1\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:1\ndrivers/net/ethernet/freescale/fs_enet/mii-fec.c:1\ndrivers/net/ethernet/freescale/fsl_pq_mdio.c:1\ndrivers/net/ethernet/freescale/xgmac_mdio.c:1\ndrivers/net/ethernet/hisilicon/hix5hd2_gmac.c:1\ndrivers/net/ethernet/hisilicon/hns_mdio.c:1\ndrivers/net/ethernet/ibm/emac/core.c:1\ndrivers/net/ethernet/marvell/mvmdio.c:2\ndrivers/net/ethernet/mediatek/mtk_eth_soc.c:1\ndrivers/net/ethernet/mediatek/mtk_star_emac.c:1\ndrivers/net/ethernet/ni/nixge.c:1\ndrivers/net/ethernet/nxp/lpc_eth.c:1\ndrivers/net/ethernet/qualcomm/emac/emac-phy.c:1\ndrivers/net/ethernet/renesas/ravb_main.c:1\ndrivers/net/ethernet/renesas/rswitch_main.c:1\ndrivers/net/ethernet/renesas/rtsn.c:1\ndrivers/net/ethernet/renesas/sh_eth.c:1\ndrivers/net/ethernet/socionext/netsec.c:1\ndrivers/net/ethernet/socionext/sni_ave.c:1\ndrivers/net/ethernet/spacemit/k1_emac.c:1\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:1\n... and 33 more files\n\ndrivers/net/dsa/dsa_loop.c=446=static int __init dsa_loop_create_switch_mdiodev(void)\n--\ndrivers/net/dsa/dsa_loop.c-466-\ndrivers/net/dsa/dsa_loop.c:467:\tswitch_mdiodev = mdio_device_create(bus, 31);\ndrivers/net/dsa/dsa_loop.c-468-\tif (IS_ERR(switch_mdiodev))\n--\ndrivers/net/dsa/dsa_loop.c-473-\ndrivers/net/dsa/dsa_loop.c:474:\tret = mdio_device_register(switch_mdiodev);\ndrivers/net/dsa/dsa_loop.c-475-\tif (ret)\n--\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c=187=static int gswip_mdio(struct gswip_priv *priv)\n--\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c-213-\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c:214:\terr = devm_of_mdiobus_register(dev, bus, mdio_np);\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c-215-\n--\ndrivers/net/dsa/microchip/ksz_common.c=2407=int ksz_mdio_register(struct ksz_device *dev)\n--\ndrivers/net/dsa/microchip/ksz_common.c-2478-\ndrivers/net/dsa/microchip/ksz_common.c:2479:\tret = devm_of_mdiobus_register(ds-\u003edev, bus, mdio_np);\ndrivers/net/dsa/microchip/ksz_common.c-2480-\tif (ret) {\n--\ndrivers/net/dsa/microchip/lan937x_main.c=685=static int lan937x_mdio_register(struct ksz_device *dev)\n--\ndrivers/net/dsa/microchip/lan937x_main.c-755-\ndrivers/net/dsa/microchip/lan937x_main.c:756:\tret = devm_of_mdiobus_register(ds-\u003edev, bus, mdio_np);\ndrivers/net/dsa/microchip/lan937x_main.c-757-\tif (ret)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c=144=int yt921x_mbus_int_init(struct yt921x_priv *priv, struct device_node *mnp)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c-161-\ndrivers/net/dsa/motorcomm/mdio_bus.c:162:\tres = devm_of_mdiobus_register(dev, mbus, mnp);\ndrivers/net/dsa/motorcomm/mdio_bus.c-163-\tif (res)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c=274=int yt921x_mbus_ext_init(struct yt921x_priv *priv, struct device_node *mnp)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c-291-\ndrivers/net/dsa/motorcomm/mdio_bus.c:292:\tres = devm_of_mdiobus_register(dev, mbus, mnp);\ndrivers/net/dsa/motorcomm/mdio_bus.c-293-\tif (res)\n--\ndrivers/net/dsa/mt7530.c=2331=mt7530_setup_mdio(struct mt7530_priv *priv)\n--\ndrivers/net/dsa/mt7530.c-2366-\ndrivers/net/dsa/mt7530.c:2367:\tret = devm_of_mdiobus_register(dev, bus, mnp);\ndrivers/net/dsa/mt7530.c-2368-\tif (ret) {\n--\ndrivers/net/dsa/mv88e6xxx/chip.c=3843=static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,\n--\ndrivers/net/dsa/mv88e6xxx/chip.c-3896-\ndrivers/net/dsa/mv88e6xxx/chip.c:3897:\terr = of_mdiobus_register(bus, np);\ndrivers/net/dsa/mv88e6xxx/chip.c-3898-\tif (err) {\n--\ndrivers/net/dsa/mxl862xx/mxl862xx.c=267=static int mxl862xx_setup_mdio(struct dsa_switch *ds)\n--\ndrivers/net/dsa/mxl862xx/mxl862xx.c-292-\ndrivers/net/dsa/mxl862xx/mxl862xx.c:293:\tret = devm_of_mdiobus_register(dev, bus, mdio_np);\ndrivers/net/dsa/mxl862xx/mxl862xx.c-294-\tof_node_put(mdio_np);\n--\ndrivers/net/dsa/netc/netc_main.c=149=static int netc_port_create_emdio_bus(struct netc_port *np,\n--\ndrivers/net/dsa/netc/netc_main.c-179-\ndrivers/net/dsa/netc/netc_main.c:180:\terr = devm_of_mdiobus_register(dev, bus, node);\ndrivers/net/dsa/netc/netc_main.c-181-\tif (err)\n--\ndrivers/net/dsa/ocelot/seville_vsc9953.c=878=static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot)\n--\ndrivers/net/dsa/ocelot/seville_vsc9953.c-902-\t/* Needed in order to initialize the bus mutex lock */\ndrivers/net/dsa/ocelot/seville_vsc9953.c:903:\trc = devm_of_mdiobus_register(dev, bus, NULL);\ndrivers/net/dsa/ocelot/seville_vsc9953.c-904-\tif (rc \u003c 0) {\n--\ndrivers/net/dsa/qca/ar9331.c=357=static int ar9331_sw_mbus_init(struct ar9331_sw_priv *priv)\n--\ndrivers/net/dsa/qca/ar9331.c-381-\ndrivers/net/dsa/qca/ar9331.c:382:\tret = devm_of_mdiobus_register(dev, mbus, mnp);\ndrivers/net/dsa/qca/ar9331.c-383-\tof_node_put(mnp);\n--\ndrivers/net/dsa/qca/qca8k-8xxx.c=959=qca8k_mdio_register(struct qca8k_priv *priv)\n--\ndrivers/net/dsa/qca/qca8k-8xxx.c-998-\ndrivers/net/dsa/qca/qca8k-8xxx.c:999:\tret = devm_of_mdiobus_register(dev, bus, mdio);\ndrivers/net/dsa/qca/qca8k-8xxx.c-1000-\n--\ndrivers/net/dsa/realtek/rtl83xx.c=91=int rtl83xx_setup_user_mdio(struct dsa_switch *ds)\n--\ndrivers/net/dsa/realtek/rtl83xx.c-120-\ndrivers/net/dsa/realtek/rtl83xx.c:121:\tret = devm_of_mdiobus_register(priv-\u003edev, bus, mdio_np);\ndrivers/net/dsa/realtek/rtl83xx.c-122-\tif (ret) {\n--\ndrivers/net/dsa/rzn1_a5psw.c=1117=static int a5psw_probe_mdio(struct a5psw *a5psw, struct device_node *node)\n--\ndrivers/net/dsa/rzn1_a5psw.c-1143-\ndrivers/net/dsa/rzn1_a5psw.c:1144:\treturn devm_of_mdiobus_register(dev, bus, node);\ndrivers/net/dsa/rzn1_a5psw.c-1145-}\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c=258=static int sja1105_mdiobus_base_tx_register(struct sja1105_private *priv,\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c-287-\ndrivers/net/dsa/sja1105/sja1105_mdio.c:288:\trc = of_mdiobus_register(bus, np);\ndrivers/net/dsa/sja1105/sja1105_mdio.c-289-\tif (rc) {\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c=312=static int sja1105_mdiobus_base_t1_register(struct sja1105_private *priv,\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c-343-\ndrivers/net/dsa/sja1105/sja1105_mdio.c:344:\trc = of_mdiobus_register(bus, np);\ndrivers/net/dsa/sja1105/sja1105_mdio.c-345-\tif (rc) {\n--\ndrivers/net/ethernet/actions/owl-emac.c=1319=static int owl_emac_mdio_init(struct net_device *netdev)\n--\ndrivers/net/ethernet/actions/owl-emac.c-1343-\ndrivers/net/ethernet/actions/owl-emac.c:1344:\tret = devm_of_mdiobus_register(dev, priv-\u003emii, mdio_node);\ndrivers/net/ethernet/actions/owl-emac.c-1345-\n--\ndrivers/net/ethernet/altera/altera_tse_main.c=121=static int altera_tse_mdio_create(struct net_device *dev, unsigned int id)\n--\ndrivers/net/ethernet/altera/altera_tse_main.c-157-\ndrivers/net/ethernet/altera/altera_tse_main.c:158:\tret = of_mdiobus_register(mdio, mdio_node);\ndrivers/net/ethernet/altera/altera_tse_main.c-159-\tif (ret != 0) {\n--\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c=888=static int xgene_mdiobus_register(struct xgene_enet_pdata *pdata,\n--\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c-912-\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c:913:\t\tret = of_mdiobus_register(mdio, mdio_np);\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c-914-\t\tof_node_put(mdio_np);\n--\ndrivers/net/ethernet/arc/emac_mdio.c=131=int arc_mdio_probe(struct arc_emac_priv *priv)\n--\ndrivers/net/ethernet/arc/emac_mdio.c-172-\ndrivers/net/ethernet/arc/emac_mdio.c:173:\terror = of_mdiobus_register(bus, mdio_node);\ndrivers/net/ethernet/arc/emac_mdio.c-174-\tof_node_put(mdio_node);\n--\ndrivers/net/ethernet/atheros/ag71xx.c=683=static int ag71xx_mdio_probe(struct ag71xx *ag)\n--\ndrivers/net/ethernet/atheros/ag71xx.c-723-\tmnp = of_get_child_by_name(np, \"mdio\");\ndrivers/net/ethernet/atheros/ag71xx.c:724:\terr = devm_of_mdiobus_register(dev, mii_bus, mnp);\ndrivers/net/ethernet/atheros/ag71xx.c-725-\tof_node_put(mnp);\n--\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c=211=struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac)\n--\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c-235-\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c:236:\terr = of_mdiobus_register(mii_bus, np);\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c-237-\tof_node_put(np);\n--\ndrivers/net/ethernet/broadcom/genet/bcmmii.c=193=int bcmgenet_mii_config(struct net_device *dev, bool init)\n--\ndrivers/net/ethernet/broadcom/genet/bcmmii.c-233-\t\tphy_name = \"external RvMII\";\ndrivers/net/ethernet/broadcom/genet/bcmmii.c:234:\t\t/* of_mdiobus_register took care of reading the 'max-speed'\ndrivers/net/ethernet/broadcom/genet/bcmmii.c-235-\t\t * PHY property for us, effectively limiting the PHY supported\n--\ndrivers/net/ethernet/cadence/macb_main.c=1181=static int macb_mdiobus_register(struct macb *bp, struct device_node *mdio_np)\n--\ndrivers/net/ethernet/cadence/macb_main.c-1188-\tif (mdio_np)\ndrivers/net/ethernet/cadence/macb_main.c:1189:\t\treturn of_mdiobus_register(bp-\u003emii_bus, mdio_np);\ndrivers/net/ethernet/cadence/macb_main.c-1190-\n--\ndrivers/net/ethernet/cadence/macb_main.c-1202-\ndrivers/net/ethernet/cadence/macb_main.c:1203:\t\t\treturn of_mdiobus_register(bp-\u003emii_bus, np);\ndrivers/net/ethernet/cadence/macb_main.c-1204-\t\t}\n--\ndrivers/net/ethernet/engleder/tsnep_main.c=2423=static int tsnep_mdio_init(struct tsnep_adapter *adapter)\n--\ndrivers/net/ethernet/engleder/tsnep_main.c-2454-\ndrivers/net/ethernet/engleder/tsnep_main.c:2455:\tretval = of_mdiobus_register(adapter-\u003emdiobus, np);\ndrivers/net/ethernet/engleder/tsnep_main.c-2456-\n--\ndrivers/net/ethernet/faraday/ftgmac100.c=1734=static int ftgmac100_setup_mdio(struct net_device *netdev)\n--\ndrivers/net/ethernet/faraday/ftgmac100.c-1769-\ndrivers/net/ethernet/faraday/ftgmac100.c:1770:\terr = devm_of_mdiobus_register(priv-\u003edev, priv-\u003emii_bus, mdio_np);\ndrivers/net/ethernet/faraday/ftgmac100.c-1771-\tof_node_put(mdio_np);\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c=36=static int enetc_pci_mdio_probe(struct pci_dev *pdev,\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c-90-\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c:91:\terr = of_mdiobus_register(bus, dev-\u003eof_node);\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c-92-\tif (err)\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c=284=static int enetc_mdio_probe(struct enetc_pf *pf, struct device_node *np)\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c-310-\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c:311:\terr = of_mdiobus_register(bus, np);\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c-312-\tif (err)\n--\ndrivers/net/ethernet/freescale/fec_main.c=3042=static int fec_enet_mii_init(struct platform_device *pdev)\n--\ndrivers/net/ethernet/freescale/fec_main.c-3160-\ndrivers/net/ethernet/freescale/fec_main.c:3161:\terr = of_mdiobus_register(fep-\u003emii_bus, node);\ndrivers/net/ethernet/freescale/fec_main.c-3162-\tif (err)\n--\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c=65=static int mpc52xx_fec_mdio_probe(struct platform_device *of)\n--\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c-105-\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c:106:\terr = of_mdiobus_register(bus, np);\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c-107-\tif (err)\n--\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c=149=static int fs_enet_mdio_probe(struct platform_device *ofdev)\n--\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c-175-\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:176:\tret = of_mdiobus_register(new_bus, ofdev-\u003edev.of_node);\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c-177-\tif (ret)\n--\n\n"
}

9/2 2026/11/21 13:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 24131
							output: 31
							thoughts: 62
						

Thoughts:
**Analyzing the Driver Registration**

Okay, here's what's running through my mind. I see `an8855_driver` is being registered, specifically using `mdio_module_driver(an8855_driver);`. That's the registration function, that's clear enough. But, the function name, `mdio_module_driver`, is unfamiliar and a key point of investigation here. I need to understand what this `mdio_module_driver` actually *does*. Is it a macro? A function pointer assignment? An initialization routine?

My next step is to get some more information by performing a grep, right? Let's search the codebase for `mdio_module_driver` and see how it is defined or used elsewhere. That should tell me everything I need to know about its role in the system.



10/2 2026/11/21 13:13 tool grepper
0m Args:
{
  "Expression": "#define mdio_module_driver",
  "PathPrefixes": [
    "include/"
  ]
}

Results:
{
  "Output": "include/linux/mdio.h=696=struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr);\n--\ninclude/linux/mdio.h-705- */\ninclude/linux/mdio.h:706:#define mdio_module_driver(_mdio_driver) \\\ninclude/linux/mdio.h-707-\tmodule_driver(_mdio_driver, mdio_driver_register, mdio_driver_unregister)\n"
}

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

Args:
null

Results:
null

Tokens:
							input: 24539
							output: 32
							thoughts: 83
						

Thoughts:
Here's my thought process, as requested:

**Navigating the MDIO Driver Registration**

Okay, so I'm looking at `mdio_driver_register`. My understanding is that this function is how we get the driver hooked up to the `mdio_bus_type`. Makes sense. Now, the next logical question is: What devices are actually bound to this `mdio_bus_type`? I need to figure out what uses this `mdio_bus_type` to connect and operate. To find that out I'll need to go hunting for its use. I should start by checking out either `of_mdiobus_register` or `of_mdiobus_child_is_phy`, probably in the `drivers/net/mdio/of_mdio.c` file. Those seem like the likely candidates for how the device-tree binds to the MDIO bus. Let's see what they tell us.



12/2 2026/11/21 13:14 tool grepper
0m Args:
{
  "Expression": "of_mdiobus_register",
  "PathPrefixes": [
    "drivers/net/"
  ]
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 533 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (77 files in total):\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c:1\ndrivers/net/dsa/microchip/ksz_common.c:1\ndrivers/net/dsa/microchip/lan937x_main.c:1\ndrivers/net/dsa/motorcomm/mdio_bus.c:2\ndrivers/net/dsa/mt7530.c:1\ndrivers/net/dsa/mv88e6xxx/chip.c:1\ndrivers/net/dsa/mxl862xx/mxl862xx.c:1\ndrivers/net/dsa/netc/netc_main.c:1\ndrivers/net/dsa/ocelot/seville_vsc9953.c:1\ndrivers/net/dsa/qca/ar9331.c:1\ndrivers/net/dsa/qca/qca8k-8xxx.c:1\ndrivers/net/dsa/realtek/rtl83xx.c:1\ndrivers/net/dsa/rzn1_a5psw.c:1\ndrivers/net/dsa/sja1105/sja1105_mdio.c:2\ndrivers/net/ethernet/actions/owl-emac.c:1\ndrivers/net/ethernet/altera/altera_tse_main.c:1\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c:1\ndrivers/net/ethernet/arc/emac_mdio.c:1\ndrivers/net/ethernet/atheros/ag71xx.c:1\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c:1\ndrivers/net/ethernet/broadcom/genet/bcmmii.c:1\ndrivers/net/ethernet/cadence/macb_main.c:2\ndrivers/net/ethernet/engleder/tsnep_main.c:1\ndrivers/net/ethernet/faraday/ftgmac100.c:1\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c:1\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c:1\ndrivers/net/ethernet/freescale/fec_main.c:1\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c:1\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:1\ndrivers/net/ethernet/freescale/fs_enet/mii-fec.c:1\ndrivers/net/ethernet/freescale/fsl_pq_mdio.c:1\ndrivers/net/ethernet/freescale/xgmac_mdio.c:1\ndrivers/net/ethernet/hisilicon/hix5hd2_gmac.c:1\ndrivers/net/ethernet/hisilicon/hns_mdio.c:1\ndrivers/net/ethernet/ibm/emac/core.c:1\ndrivers/net/ethernet/marvell/mvmdio.c:2\ndrivers/net/ethernet/mediatek/mtk_eth_soc.c:1\ndrivers/net/ethernet/mediatek/mtk_star_emac.c:1\ndrivers/net/ethernet/ni/nixge.c:1\ndrivers/net/ethernet/nxp/lpc_eth.c:1\ndrivers/net/ethernet/qualcomm/emac/emac-phy.c:1\ndrivers/net/ethernet/renesas/ravb_main.c:1\ndrivers/net/ethernet/renesas/rswitch_main.c:1\ndrivers/net/ethernet/renesas/rtsn.c:1\ndrivers/net/ethernet/renesas/sh_eth.c:1\ndrivers/net/ethernet/socionext/netsec.c:1\ndrivers/net/ethernet/socionext/sni_ave.c:1\ndrivers/net/ethernet/spacemit/k1_emac.c:1\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:1\ndrivers/net/ethernet/sunplus/spl2sw_mdio.c:1\n... and 27 more files\n\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c=187=static int gswip_mdio(struct gswip_priv *priv)\n--\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c-213-\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c:214:\terr = devm_of_mdiobus_register(dev, bus, mdio_np);\ndrivers/net/dsa/lantiq/lantiq_gswip_common.c-215-\n--\ndrivers/net/dsa/microchip/ksz_common.c=2407=int ksz_mdio_register(struct ksz_device *dev)\n--\ndrivers/net/dsa/microchip/ksz_common.c-2478-\ndrivers/net/dsa/microchip/ksz_common.c:2479:\tret = devm_of_mdiobus_register(ds-\u003edev, bus, mdio_np);\ndrivers/net/dsa/microchip/ksz_common.c-2480-\tif (ret) {\n--\ndrivers/net/dsa/microchip/lan937x_main.c=685=static int lan937x_mdio_register(struct ksz_device *dev)\n--\ndrivers/net/dsa/microchip/lan937x_main.c-755-\ndrivers/net/dsa/microchip/lan937x_main.c:756:\tret = devm_of_mdiobus_register(ds-\u003edev, bus, mdio_np);\ndrivers/net/dsa/microchip/lan937x_main.c-757-\tif (ret)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c=144=int yt921x_mbus_int_init(struct yt921x_priv *priv, struct device_node *mnp)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c-161-\ndrivers/net/dsa/motorcomm/mdio_bus.c:162:\tres = devm_of_mdiobus_register(dev, mbus, mnp);\ndrivers/net/dsa/motorcomm/mdio_bus.c-163-\tif (res)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c=274=int yt921x_mbus_ext_init(struct yt921x_priv *priv, struct device_node *mnp)\n--\ndrivers/net/dsa/motorcomm/mdio_bus.c-291-\ndrivers/net/dsa/motorcomm/mdio_bus.c:292:\tres = devm_of_mdiobus_register(dev, mbus, mnp);\ndrivers/net/dsa/motorcomm/mdio_bus.c-293-\tif (res)\n--\ndrivers/net/dsa/mt7530.c=2331=mt7530_setup_mdio(struct mt7530_priv *priv)\n--\ndrivers/net/dsa/mt7530.c-2366-\ndrivers/net/dsa/mt7530.c:2367:\tret = devm_of_mdiobus_register(dev, bus, mnp);\ndrivers/net/dsa/mt7530.c-2368-\tif (ret) {\n--\ndrivers/net/dsa/mv88e6xxx/chip.c=3843=static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,\n--\ndrivers/net/dsa/mv88e6xxx/chip.c-3896-\ndrivers/net/dsa/mv88e6xxx/chip.c:3897:\terr = of_mdiobus_register(bus, np);\ndrivers/net/dsa/mv88e6xxx/chip.c-3898-\tif (err) {\n--\ndrivers/net/dsa/mxl862xx/mxl862xx.c=267=static int mxl862xx_setup_mdio(struct dsa_switch *ds)\n--\ndrivers/net/dsa/mxl862xx/mxl862xx.c-292-\ndrivers/net/dsa/mxl862xx/mxl862xx.c:293:\tret = devm_of_mdiobus_register(dev, bus, mdio_np);\ndrivers/net/dsa/mxl862xx/mxl862xx.c-294-\tof_node_put(mdio_np);\n--\ndrivers/net/dsa/netc/netc_main.c=149=static int netc_port_create_emdio_bus(struct netc_port *np,\n--\ndrivers/net/dsa/netc/netc_main.c-179-\ndrivers/net/dsa/netc/netc_main.c:180:\terr = devm_of_mdiobus_register(dev, bus, node);\ndrivers/net/dsa/netc/netc_main.c-181-\tif (err)\n--\ndrivers/net/dsa/ocelot/seville_vsc9953.c=878=static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot)\n--\ndrivers/net/dsa/ocelot/seville_vsc9953.c-902-\t/* Needed in order to initialize the bus mutex lock */\ndrivers/net/dsa/ocelot/seville_vsc9953.c:903:\trc = devm_of_mdiobus_register(dev, bus, NULL);\ndrivers/net/dsa/ocelot/seville_vsc9953.c-904-\tif (rc \u003c 0) {\n--\ndrivers/net/dsa/qca/ar9331.c=357=static int ar9331_sw_mbus_init(struct ar9331_sw_priv *priv)\n--\ndrivers/net/dsa/qca/ar9331.c-381-\ndrivers/net/dsa/qca/ar9331.c:382:\tret = devm_of_mdiobus_register(dev, mbus, mnp);\ndrivers/net/dsa/qca/ar9331.c-383-\tof_node_put(mnp);\n--\ndrivers/net/dsa/qca/qca8k-8xxx.c=959=qca8k_mdio_register(struct qca8k_priv *priv)\n--\ndrivers/net/dsa/qca/qca8k-8xxx.c-998-\ndrivers/net/dsa/qca/qca8k-8xxx.c:999:\tret = devm_of_mdiobus_register(dev, bus, mdio);\ndrivers/net/dsa/qca/qca8k-8xxx.c-1000-\n--\ndrivers/net/dsa/realtek/rtl83xx.c=91=int rtl83xx_setup_user_mdio(struct dsa_switch *ds)\n--\ndrivers/net/dsa/realtek/rtl83xx.c-120-\ndrivers/net/dsa/realtek/rtl83xx.c:121:\tret = devm_of_mdiobus_register(priv-\u003edev, bus, mdio_np);\ndrivers/net/dsa/realtek/rtl83xx.c-122-\tif (ret) {\n--\ndrivers/net/dsa/rzn1_a5psw.c=1117=static int a5psw_probe_mdio(struct a5psw *a5psw, struct device_node *node)\n--\ndrivers/net/dsa/rzn1_a5psw.c-1143-\ndrivers/net/dsa/rzn1_a5psw.c:1144:\treturn devm_of_mdiobus_register(dev, bus, node);\ndrivers/net/dsa/rzn1_a5psw.c-1145-}\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c=258=static int sja1105_mdiobus_base_tx_register(struct sja1105_private *priv,\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c-287-\ndrivers/net/dsa/sja1105/sja1105_mdio.c:288:\trc = of_mdiobus_register(bus, np);\ndrivers/net/dsa/sja1105/sja1105_mdio.c-289-\tif (rc) {\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c=312=static int sja1105_mdiobus_base_t1_register(struct sja1105_private *priv,\n--\ndrivers/net/dsa/sja1105/sja1105_mdio.c-343-\ndrivers/net/dsa/sja1105/sja1105_mdio.c:344:\trc = of_mdiobus_register(bus, np);\ndrivers/net/dsa/sja1105/sja1105_mdio.c-345-\tif (rc) {\n--\ndrivers/net/ethernet/actions/owl-emac.c=1319=static int owl_emac_mdio_init(struct net_device *netdev)\n--\ndrivers/net/ethernet/actions/owl-emac.c-1343-\ndrivers/net/ethernet/actions/owl-emac.c:1344:\tret = devm_of_mdiobus_register(dev, priv-\u003emii, mdio_node);\ndrivers/net/ethernet/actions/owl-emac.c-1345-\n--\ndrivers/net/ethernet/altera/altera_tse_main.c=121=static int altera_tse_mdio_create(struct net_device *dev, unsigned int id)\n--\ndrivers/net/ethernet/altera/altera_tse_main.c-157-\ndrivers/net/ethernet/altera/altera_tse_main.c:158:\tret = of_mdiobus_register(mdio, mdio_node);\ndrivers/net/ethernet/altera/altera_tse_main.c-159-\tif (ret != 0) {\n--\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c=888=static int xgene_mdiobus_register(struct xgene_enet_pdata *pdata,\n--\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c-912-\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c:913:\t\tret = of_mdiobus_register(mdio, mdio_np);\ndrivers/net/ethernet/apm/xgene/xgene_enet_hw.c-914-\t\tof_node_put(mdio_np);\n--\ndrivers/net/ethernet/arc/emac_mdio.c=131=int arc_mdio_probe(struct arc_emac_priv *priv)\n--\ndrivers/net/ethernet/arc/emac_mdio.c-172-\ndrivers/net/ethernet/arc/emac_mdio.c:173:\terror = of_mdiobus_register(bus, mdio_node);\ndrivers/net/ethernet/arc/emac_mdio.c-174-\tof_node_put(mdio_node);\n--\ndrivers/net/ethernet/atheros/ag71xx.c=683=static int ag71xx_mdio_probe(struct ag71xx *ag)\n--\ndrivers/net/ethernet/atheros/ag71xx.c-723-\tmnp = of_get_child_by_name(np, \"mdio\");\ndrivers/net/ethernet/atheros/ag71xx.c:724:\terr = devm_of_mdiobus_register(dev, mii_bus, mnp);\ndrivers/net/ethernet/atheros/ag71xx.c-725-\tof_node_put(mnp);\n--\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c=211=struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac)\n--\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c-235-\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c:236:\terr = of_mdiobus_register(mii_bus, np);\ndrivers/net/ethernet/broadcom/bgmac-bcma-mdio.c-237-\tof_node_put(np);\n--\ndrivers/net/ethernet/broadcom/genet/bcmmii.c=193=int bcmgenet_mii_config(struct net_device *dev, bool init)\n--\ndrivers/net/ethernet/broadcom/genet/bcmmii.c-233-\t\tphy_name = \"external RvMII\";\ndrivers/net/ethernet/broadcom/genet/bcmmii.c:234:\t\t/* of_mdiobus_register took care of reading the 'max-speed'\ndrivers/net/ethernet/broadcom/genet/bcmmii.c-235-\t\t * PHY property for us, effectively limiting the PHY supported\n--\ndrivers/net/ethernet/cadence/macb_main.c=1181=static int macb_mdiobus_register(struct macb *bp, struct device_node *mdio_np)\n--\ndrivers/net/ethernet/cadence/macb_main.c-1188-\tif (mdio_np)\ndrivers/net/ethernet/cadence/macb_main.c:1189:\t\treturn of_mdiobus_register(bp-\u003emii_bus, mdio_np);\ndrivers/net/ethernet/cadence/macb_main.c-1190-\n--\ndrivers/net/ethernet/cadence/macb_main.c-1202-\ndrivers/net/ethernet/cadence/macb_main.c:1203:\t\t\treturn of_mdiobus_register(bp-\u003emii_bus, np);\ndrivers/net/ethernet/cadence/macb_main.c-1204-\t\t}\n--\ndrivers/net/ethernet/engleder/tsnep_main.c=2423=static int tsnep_mdio_init(struct tsnep_adapter *adapter)\n--\ndrivers/net/ethernet/engleder/tsnep_main.c-2454-\ndrivers/net/ethernet/engleder/tsnep_main.c:2455:\tretval = of_mdiobus_register(adapter-\u003emdiobus, np);\ndrivers/net/ethernet/engleder/tsnep_main.c-2456-\n--\ndrivers/net/ethernet/faraday/ftgmac100.c=1734=static int ftgmac100_setup_mdio(struct net_device *netdev)\n--\ndrivers/net/ethernet/faraday/ftgmac100.c-1769-\ndrivers/net/ethernet/faraday/ftgmac100.c:1770:\terr = devm_of_mdiobus_register(priv-\u003edev, priv-\u003emii_bus, mdio_np);\ndrivers/net/ethernet/faraday/ftgmac100.c-1771-\tof_node_put(mdio_np);\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c=36=static int enetc_pci_mdio_probe(struct pci_dev *pdev,\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c-90-\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c:91:\terr = of_mdiobus_register(bus, dev-\u003eof_node);\ndrivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c-92-\tif (err)\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c=284=static int enetc_mdio_probe(struct enetc_pf *pf, struct device_node *np)\n--\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c-310-\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c:311:\terr = of_mdiobus_register(bus, np);\ndrivers/net/ethernet/freescale/enetc/enetc_pf_common.c-312-\tif (err)\n--\ndrivers/net/ethernet/freescale/fec_main.c=3042=static int fec_enet_mii_init(struct platform_device *pdev)\n--\ndrivers/net/ethernet/freescale/fec_main.c-3160-\ndrivers/net/ethernet/freescale/fec_main.c:3161:\terr = of_mdiobus_register(fep-\u003emii_bus, node);\ndrivers/net/ethernet/freescale/fec_main.c-3162-\tif (err)\n--\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c=65=static int mpc52xx_fec_mdio_probe(struct platform_device *of)\n--\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c-105-\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c:106:\terr = of_mdiobus_register(bus, np);\ndrivers/net/ethernet/freescale/fec_mpc52xx_phy.c-107-\tif (err)\n--\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c=149=static int fs_enet_mdio_probe(struct platform_device *ofdev)\n--\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c-175-\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:176:\tret = of_mdiobus_register(new_bus, ofdev-\u003edev.of_node);\ndrivers/net/ethernet/freescale/fs_enet/mii-bitbang.c-177-\tif (ret)\n--\ndrivers/net/ethernet/freescale/fs_enet/mii-fec.c=97=static int fs_enet_mdio_probe(struct platform_device *ofdev)\n--\ndrivers/net/ethernet/freescale/fs_enet/mii-fec.c-166-\ndrivers/net/ethernet/freescale/fs_enet/mii-fec.c:167:\tret = of_mdiobus_register(new_bus, ofdev-\u003edev.of_node);\ndrivers/net/ethernet/freescale/fs_enet/mii-fec.c-168-\tif (ret)\n--\ndrivers/net/ethernet/freescale/fsl_pq_mdio.c=409=static int fsl_pq_mdio_probe(struct platform_device *pdev)\n--\ndrivers/net/ethernet/freescale/fsl_pq_mdio.c-493-\ndrivers/net/ethernet/freescale/fsl_pq_mdio.c:494:\terr = of_mdiobus_register(new_bus, np);\n\n"
}

13/2 2026/11/21 13:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 31122
							output: 42
							thoughts: 36
						

Thoughts:
Here's a breakdown of my thought process as I delve into `drivers/net/mdio/of_mdio.c` to examine `of_mdiobus_register`:

**Diving into of_mdiobus_register**

Alright, time to crack open the hood and see what's actually happening within `of_mdiobus_register`. Let's assume I already have a firm understanding of MDIO buses and the role of device trees within the Linux kernel, so I'm skipping the basics. I expect this function is responsible for registering an MDIO bus instance, likely parsed from the device tree information. I'm primarily interested in how it hooks into the core MDIO subsystem and any specific OF-related (Open Firmware) configuration it handles. I'll need to identify the key data structures involved, such as the `mdio_bus` and potentially any custom structs related to OF. I'll be particularly watchful for error handling - this is a critical registration function, so I want to understand how it deals with potential failures in device tree parsing or MDIO bus initialization. I'll be looking for references to `of_device_id` and the related matching mechanism, since this is a critical component of device-tree driven driver initialization. I expect to confirm any details that may be relevant to my area of expertise.



14/2 2026/11/21 13:14 tool grepper
0m Args:
{
  "Expression": "int of_mdiobus_register",
  "PathPrefixes": [
    "drivers/net/mdio/of_mdio.c"
  ]
}

Results:
{
  "Output": "drivers/net/mdio/of_mdio.c=44=EXPORT_SYMBOL(of_mdiobus_phy_device_register);\ndrivers/net/mdio/of_mdio.c-45-\ndrivers/net/mdio/of_mdio.c:46:static int of_mdiobus_register_phy(struct mii_bus *mdio,\ndrivers/net/mdio/of_mdio.c-47-\t\t\t\t    struct device_node *child, u32 addr)\n--\ndrivers/net/mdio/of_mdio.c-51-\ndrivers/net/mdio/of_mdio.c:52:static int of_mdiobus_register_device(struct mii_bus *mdio,\ndrivers/net/mdio/of_mdio.c-53-\t\t\t\t      struct device_node *child, u32 addr)\n"
}

15/2 2026/11/21 13:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 31708
							output: 40
							thoughts: 29
						

Thoughts:
Okay, let's dive into this. Here's my take on those lines of code:

**Analyzing `drivers/net/mdio/of_mdio.c` (Lines 46-130)**

Alright, so I'm focusing on lines 46 through 130 in `of_mdio.c` within the `drivers/net/mdio` directory. My understanding is that this file likely handles the Open Firmware (OF) bindings for MDIO (Management Data Input/Output) bus drivers. Given the file name and the target directory, it's pretty clear this section pertains to the initialization and binding of MDIO devices described in the device tree.

I'm betting the code here is centered on parsing the device tree entries to discover and configure MDIO buses and the PHYs connected to them. I expect it's going to be looking for specific properties within the device tree node that define the MDIO bus parameters – things like the clock frequency, the bus address (if applicable), and of course, the interrupt information, if any. The initial sections would be handling `platform_driver` registration, and potentially, the probe and remove functions for these devices.

I'm guessing this portion of the code is responsible for mapping device tree information to a `mdio_bus` structure. The probe function, I presume, will be creating a `mdio_bus` instance and initializing it. This could involve setting up the clock, requesting any necessary resources (like memory regions or interrupts), and then registering the bus with the MDIO core. It is the responsibility of the code to validate the device tree properties and handle errors if any of the mandatory properties are missing or malformed.

Furthermore, I expect to see logic that iterates through child nodes of the MDIO bus node in the device tree, looking for PHYs. For each PHY, the code will likely create a `phy_device` structure and then attach that PHY to the MDIO bus, essentially adding them to the global MDIO registry.
I'm also expecting that this section implements the handling of different MDIO bus implementations through the device tree bindings. I'm keen to see the specifics of the driver and what options the bus has, if any.
Essentially, I'm expecting this is a bridge: taking the generic MDIO concepts and concretizing them based on a system's particular hardware configuration defined within the device tree. And I'm looking for the robust error handling that should be present at this level. Let's see how well it's done...



16/2 2026/11/21 13:14 tool read-file
0m Args:
{
  "File": "drivers/net/mdio/of_mdio.c",
  "FirstLine": 46,
  "LineCount": 80
}

Results:
{
  "Contents": "  46:\tstatic int of_mdiobus_register_phy(struct mii_bus *mdio,\n  47:\t\t\t\t\t    struct device_node *child, u32 addr)\n  48:\t{\n  49:\t\treturn fwnode_mdiobus_register_phy(mdio, of_fwnode_handle(child), addr);\n  50:\t}\n  51:\t\n  52:\tstatic int of_mdiobus_register_device(struct mii_bus *mdio,\n  53:\t\t\t\t\t      struct device_node *child, u32 addr)\n  54:\t{\n  55:\t\tstruct fwnode_handle *fwnode = of_fwnode_handle(child);\n  56:\t\tstruct mdio_device *mdiodev;\n  57:\t\tint rc;\n  58:\t\n  59:\t\tmdiodev = mdio_device_create(mdio, addr);\n  60:\t\tif (IS_ERR(mdiodev))\n  61:\t\t\treturn PTR_ERR(mdiodev);\n  62:\t\n  63:\t\t/* Associate the OF node with the device structure so it\n  64:\t\t * can be looked up later.\n  65:\t\t */\n  66:\t\tdevice_set_node(\u0026mdiodev-\u003edev, fwnode_handle_get(fwnode));\n  67:\t\n  68:\t\t/* All data is now stored in the mdiodev struct; register it. */\n  69:\t\trc = mdio_device_register(mdiodev);\n  70:\t\tif (rc) {\n  71:\t\t\tmdio_device_free(mdiodev);\n  72:\t\t\treturn rc;\n  73:\t\t}\n  74:\t\n  75:\t\tdev_dbg(\u0026mdio-\u003edev, \"registered mdio device %pOFn at address %i\\n\",\n  76:\t\t\tchild, addr);\n  77:\t\treturn 0;\n  78:\t}\n  79:\t\n  80:\t/* The following is a list of PHY compatible strings which appear in\n  81:\t * some DTBs. The compatible string is never matched against a PHY\n  82:\t * driver, so is pointless. We only expect devices which are not PHYs\n  83:\t * to have a compatible string, so they can be matched to an MDIO\n  84:\t * driver.  Encourage users to upgrade their DT blobs to remove these.\n  85:\t */\n  86:\tstatic const struct of_device_id whitelist_phys[] = {\n  87:\t\t{ .compatible = \"brcm,40nm-ephy\" },\n  88:\t\t{ .compatible = \"broadcom,bcm5241\" },\n  89:\t\t{ .compatible = \"marvell,88E1111\", },\n  90:\t\t{ .compatible = \"marvell,88e1116\", },\n  91:\t\t{ .compatible = \"marvell,88e1118\", },\n  92:\t\t{ .compatible = \"marvell,88e1145\", },\n  93:\t\t{ .compatible = \"marvell,88e1149r\", },\n  94:\t\t{ .compatible = \"marvell,88e1310\", },\n  95:\t\t{ .compatible = \"marvell,88E1510\", },\n  96:\t\t{ .compatible = \"marvell,88E1514\", },\n  97:\t\t{ .compatible = \"moxa,moxart-rtl8201cp\", },\n  98:\t\t{}\n  99:\t};\n 100:\t\n 101:\t/*\n 102:\t * Return true if the child node is for a phy. It must either:\n 103:\t * o Compatible string of \"ethernet-phy-idX.X\"\n 104:\t * o Compatible string of \"ethernet-phy-ieee802.3-c45\"\n 105:\t * o Compatible string of \"ethernet-phy-ieee802.3-c22\"\n 106:\t * o In the white list above (and issue a warning)\n 107:\t * o No compatibility string\n 108:\t *\n 109:\t * A device which is not a phy is expected to have a compatible string\n 110:\t * indicating what sort of device it is.\n 111:\t */\n 112:\tbool of_mdiobus_child_is_phy(struct device_node *child)\n 113:\t{\n 114:\t\tu32 phy_id;\n 115:\t\n 116:\t\tif (of_get_phy_id(child, \u0026phy_id) != -EINVAL)\n 117:\t\t\treturn true;\n 118:\t\n 119:\t\tif (of_device_is_compatible(child, \"ethernet-phy-ieee802.3-c45\"))\n 120:\t\t\treturn true;\n 121:\t\n 122:\t\tif (of_device_is_compatible(child, \"ethernet-phy-ieee802.3-c22\"))\n 123:\t\t\treturn true;\n 124:\t\n 125:\t\tif (of_match_node(whitelist_phys, child)) {\n"
}

17/2 2026/11/21 13:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 33667
							output: 34
							thoughts: 336
						

Thoughts:
**My MDIO Bus Musings**

Okay, so I'm looking at this `of_mdiobus_register_device` function and it's registering `mdio_device` for non-PHY children within the Device Tree. My mind immediately jumps to a fundamental question: what *creates* the MDIO bus in the first place? And can this happen in a virtualized environment like QEMU or Google Compute Engine?

My immediate thought is, can QEMU realistically emulate an MDIO bus with a specific device like the `airoha,an8855`? Hold on... the `airoha,an8855` is a specific hardware SoC, a dedicated switch with Ethernet, NVMEM, and PHYs.  Hmm, does QEMU even emulate *that* specific chip? No, it doesn't. 

But, wait, that doesn't necessarily rule out an MDIO bus in QEMU entirely. Could a standard network card emulation, like e1000 or virtio, or even something dummy, expose an MDIO bus in QEMU? I need to check if these typical QEMU network devices create Device Tree child nodes for MDIO buses.

Now, a critical point pops up: the target architecture is amd64/x86. Does QEMU use Device Tree (OF) on amd64 at all? I need to be sure. Thinking about a standard x86_64 QEMU VM, like the ones used by Syzkaller, doesn't it typically boot with ACPI, not OF/Device Tree? That's right!

So, the next logical question is: is CONFIG_OF even enabled on x86_64? I need to check the `arch/x86/Kconfig` file and search for `select OF` or `config OF`. This could be a dead end for my initial question!



18/2 2026/11/21 13:14 tool grepper
0m Args:
{
  "Expression": "\\bOF\\b",
  "PathPrefixes": [
    "arch/x86/Kconfig"
  ]
}

Results:
{
  "Output": "arch/x86/Kconfig=666=config X86_INTEL_CE\n--\narch/x86/Kconfig-673-\tselect X86_REBOOTFIXUPS\narch/x86/Kconfig:674:\tselect OF\narch/x86/Kconfig-675-\tselect OF_EARLY_FLATTREE\n--\narch/x86/Kconfig=1506=config NUMA\n--\narch/x86/Kconfig-1510-\tselect USE_PERCPU_NUMA_NODE_ID\narch/x86/Kconfig:1511:\tselect OF_NUMA if OF\narch/x86/Kconfig-1512-\thelp\n--\narch/x86/Kconfig=2992=config OLPC\n--\narch/x86/Kconfig-2996-\tselect GPIOLIB_LEGACY\narch/x86/Kconfig:2997:\tselect OF\narch/x86/Kconfig-2998-\tselect OF_PROMTREE\n"
}

19/2 2026/11/21 13:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 34723
							output: 35
							thoughts: 467
						

Thoughts:
**Analyzing the AN8855 Driver in an x86/QEMU Context**

Okay, let's break this down. First, glancing at `arch/x86/Kconfig`, I see that Device Tree (OF) is conditionally enabled – specifically, dependent on things like `X86_INTEL_CE` or `OLPC`, or even explicitly enabled through `OF_UNITTEST` or manual configuration. Then, I see this `MFD_AIROHA_AN8855` driver has a dependency on both `NETDEVICES` *and* `OF`.

Now, the question is, even if OF *is* enabled, can the `an8855_probe` function *ever* actually be hit on an amd64 system, particularly within a QEMU environment? Let's refresh our memory on what the `an8855` driver even *is*. Oh right, it's an MFD driver for an Airoha AN8855 Switch SoC. Okay, let me peek at the driver's structure: it uses a standard `mdio_driver` structure with a probe function (`an8855_probe`) and an OF match table (`an8855_of_match`). Crucially, the driver registers itself as an MDIO driver.

So the *core* question here is this:  Can any device with the "airoha,an8855" compatible string be successfully probed within QEMU on an x86 system? Does QEMU even *support* emulating this device via the Device Tree? Does it have any inherent support for emulating an MDIO bus?

The next step is to examine what syzkaller might be able to do here. Can syzkaller probe MDIO devices, load OF overlays, or perhaps even mock MDIO devices? I should start by searching for any syzkaller support for MDIO devices or Device Tree overlays.

Assuming no obvious syzkaller support is found, I need to evaluate whether there's a usable userspace interface for dynamically creating an `mdio_device`. I'll grep the kernel source for `mdio_device_register`. From the earlier grep, I see that the kernel uses this function in `drivers/net/dsa/dsa_loop.c`, `drivers/net/mdio/of_mdio.c`, `drivers/net/phy/mdio_bus.c` and `drivers/net/phy/mdio_device.c`. That means the focus should now be on understanding what is happening in the `dsa_loop.c` and `mdio_bus.c` and `mdio_device.c` source code files. This investigation could be helpful in figuring out how MDIO devices are configured on these architectures, what the potential setup and pitfalls might be.



20/2 2026/11/21 13:14 tool grepper
0m Args:
{
  "Expression": "EXPORT_SYMBOL.*mdio_device_register",
  "PathPrefixes": [
    "drivers/net/"
  ]
}

Results:
{
  "Output": "drivers/net/phy/mdio_device.c=151=int mdio_device_register(struct mdio_device *mdiodev)\n--\ndrivers/net/phy/mdio_device.c-172-}\ndrivers/net/phy/mdio_device.c:173:EXPORT_SYMBOL(mdio_device_register);\ndrivers/net/phy/mdio_device.c-174-\n"
}

21/2 2026/11/21 13:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 35953
							output: 21
							thoughts: 14
						

Thoughts:
Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person:

**Investigating the MDIO Registration**

Alright, so the task at hand is to understand the calling context for `mdio_device_register`. That function is fundamental to our understanding of the MDIO bus, and seeing *who* is responsible for registering MDIO devices is crucial. This is particularly relevant if we are looking into performance issues or potential driver conflicts involving the MDIO subsystem. I want to trace the registration calls specifically. Digging into this will reveal the drivers or subsystems that are taking ownership of the MDIO resources. This is something I'll need to do if I want to thoroughly diagnose or debug an MDIO-related problem, understand device interaction, or optimize MDIO bus performance in a given system. Let's start by identifying the call sites.



22/2 2026/11/21 13:14 tool grepper
0m Args:
{
  "Expression": "mdio_device_register\\("
}

Results:
{
  "Output": "drivers/net/dsa/dsa_loop.c=446=static int __init dsa_loop_create_switch_mdiodev(void)\n--\ndrivers/net/dsa/dsa_loop.c-473-\ndrivers/net/dsa/dsa_loop.c:474:\tret = mdio_device_register(switch_mdiodev);\ndrivers/net/dsa/dsa_loop.c-475-\tif (ret)\n--\ndrivers/net/mdio/of_mdio.c=52=static int of_mdiobus_register_device(struct mii_bus *mdio,\n--\ndrivers/net/mdio/of_mdio.c-68-\t/* All data is now stored in the mdiodev struct; register it. */\ndrivers/net/mdio/of_mdio.c:69:\trc = mdio_device_register(mdiodev);\ndrivers/net/mdio/of_mdio.c-70-\tif (rc) {\n--\ndrivers/net/pcs/pcs-xpcs-plat.c=381=static int xpcs_plat_init_dev(struct dw_xpcs_plat *pxpcs)\n--\ndrivers/net/pcs/pcs-xpcs-plat.c-400-\ndrivers/net/pcs/pcs-xpcs-plat.c:401:\tret = mdio_device_register(mdiodev);\ndrivers/net/pcs/pcs-xpcs-plat.c-402-\tif (ret) {\n--\ndrivers/net/phy/air_en8811h.c=1131=static int an8811hb_probe(struct phy_device *phydev)\n--\ndrivers/net/phy/air_en8811h.c-1154-\ndrivers/net/phy/air_en8811h.c:1155:\tret = mdio_device_register(mdiodev);\ndrivers/net/phy/air_en8811h.c-1156-\tif (ret)\n--\ndrivers/net/phy/mdio_device.c=143=EXPORT_SYMBOL(mdio_device_create);\n--\ndrivers/net/phy/mdio_device.c-150- */\ndrivers/net/phy/mdio_device.c:151:int mdio_device_register(struct mdio_device *mdiodev)\ndrivers/net/phy/mdio_device.c-152-{\n--\ndrivers/net/phy/mdio_device.c=173=EXPORT_SYMBOL(mdio_device_register);\n--\ndrivers/net/phy/mdio_device.c-180- * This doesn't free the mdio_device itself, it merely reverses the effects\ndrivers/net/phy/mdio_device.c:181: * of mdio_device_register(). Use mdio_device_free() to free the device\ndrivers/net/phy/mdio_device.c-182- * after calling this function.\n--\ninclude/linux/mdio.h=95=struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);\ninclude/linux/mdio.h:96:int mdio_device_register(struct mdio_device *mdiodev);\ninclude/linux/mdio.h-97-void mdio_device_remove(struct mdio_device *mdiodev);\n"
}

23/2 2026/11/21 13:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 37036
							output: 126
							thoughts: 2261
						

Thoughts:
**Analysis of Code Reachability for Fuzzing Eligibility**

Okay, let's break this down. First, I see a proposed patch that includes a driver (`airoha-an8855.c`) along with device tree bindings and Kconfig modifications. My initial thought is to trace the function `mdio_device_register`, and the only call-sites seem to be in `dsa_loop.c`, `of_mdio.c`, `pcs-xpcs-plat.c`, and `air_en8811h.c`. That quickly leads me to the question of *how* `of_mdiobus_register_device` could be called with the relevant compatible string. Based on my understanding, that requires a Device Tree node, specifically `"airoha,an8855"`, matching the driver. I then check the devicetree bindings, confirming that this is an Airoha AN8855 Switch SoC, a physical embedded networking chip.

Now, I need to apply the fuzzing criteria. I review the instructions, specifically sections 2 and 3. Section 2 is key, outlining scenarios where we *should not* fuzz. I immediately focus on "Structurally unreachable hardware" – vendor-specific devices requiring physical hardware not emulated in standard QEMU. That, combined with "Code paths exclusive to architectures other than the target architecture" are the main areas of concern.

The AN8855 is an external MDIO-connected Ethernet switch chip, and the target is amd64. Device Tree is not used in standard QEMU/GCE environments on amd64, which is using ACPI. I ask myself if syzkaller can instantiate MDIO devices, but the answer is no, since there is no userspace virtual MDIO bus creation interface. Even if there was, the driver matches strictly by Device Tree `of_driver_match_device`.

I check the driver code itself. It accesses a hardware register over MDIO and checks a specific ID. This *absolutely* requires the physical Airoha AN8855 ASIC. It's not something that can be emulated or triggered by any standard means within a QEMU environment on amd64, meaning that these code changes will fall under the criteria for structurally unreachable hardware, as well as unreachable execution paths for the amd64 architecture.

Let's do a complete final review of the files in the patch: Documentation, build config, and the driver for the external physical ASIC / switch SoC.

I re-examine the relevant sections of the instructions. The "REACHABILITY IS THE PRIMARY GATE" principle is the most critical: fuzzing requires executable code in standard virtualized environments. This patch clearly fails that test.

Therefore, `WorthFuzzing` should be `false`. `EnableConfigs` and `FocusSymbols` are empty. The reasoning? The patch adds a driver and devicetree bindings for a physical Airoha AN8855 switch SoC. The driver operates over an MDIO bus and binds exclusively via Device Tree, requiring physical ASIC hardware. It is not possible to instantiate or execute this code within standard QEMU virtualized environments on amd64. Therefore, the modified code is structurally unreachable.

All checks are done! Let's call `set-results`.



24/2 2026/11/21 13:15 tool set-results
0m Args:
{
  "EnableConfigs": [],
  "FocusSymbols": [],
  "Reasoning": "The patch adds Device Tree bindings and a core MFD driver for the Airoha AN8855 Ethernet switch SoC. The driver binds via Device Tree (OF) over MDIO to interact with physical AN8855 ASIC registers. On amd64 in standard QEMU/GCE virtualized environments, this hardware is not emulated and Device Tree nodes for this chip are not present. Consequently, the modified code is structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch adds Device Tree bindings and a core MFD driver for the Airoha AN8855 Ethernet switch SoC. The driver binds via Device Tree (OF) over MDIO to interact with physical AN8855 ASIC registers. On amd64 in standard QEMU/GCE virtualized environments, this hardware is not emulated and Device Tree nodes for this chip are not present. Consequently, the modified code is structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

25/1 2026/11/21 13:15 action If
0m Args:
{
  "WorthFuzzing": false
}

Results:
null

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)