AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/07/25 10:03 flow patch-triage
2m Args:
null

Results:
{
  "EnableConfigs": [
    "MDIO_REALTEK_RTL9300",
    "COMPILE_TEST",
    "PHYLIB",
    "MFD_SYSCON"
  ],
  "FocusSymbols": [
    "phy_attach_direct",
    "phy_detach",
    "otto_emdio_probe",
    "otto_emdio_notify_phy_attach",
    "otto_emdio_notify_phy_detach"
  ],
  "Reasoning": "The patch adds support for Realtek Otto Switches Ethernet MDIO Controller (RTL8380, RTL8390) and introduces hardware polling support. It modifies core PHY code (phy_device.c) to add notify_phy_attach and notify_phy_detach callbacks to struct mii_bus, which are invoked from phy_attach_direct and phy_detach. These core changes are highly reachable and functional. The MDIO driver changes are also reachable if the driver is enabled.",
  "WorthFuzzing": true
}

1/1 2026/07/25 10:03 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 7bebf64b016ec401783c0bcc72a022261172ee9e\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Sat Jul 25 10:03:24 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml\nindex 271e05bae9c574..67e0b23a8470ea 100644\n--- a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml\n+++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml\n@@ -4,7 +4,7 @@\n $id: http://devicetree.org/schemas/net/realtek,rtl9301-mdio.yaml#\n $schema: http://devicetree.org/meta-schemas/core.yaml#\n \n-title: Realtek RTL9300 MDIO Controller\n+title: Realtek Otto Switches Ethernet MDIO Controller\n \n maintainers:\n   - Chris Packham \u003cchris.packham@alliedtelesis.co.nz\u003e\n@@ -12,6 +12,16 @@ maintainers:\n properties:\n   compatible:\n     oneOf:\n+      - items:\n+          - enum:\n+              - realtek,rtl8381-mdio\n+              - realtek,rtl8382-mdio\n+          - const: realtek,rtl8380-mdio\n+      - items:\n+          - enum:\n+              - realtek,rtl8392-mdio\n+              - realtek,rtl8393-mdio\n+          - const: realtek,rtl8391-mdio\n       - items:\n           - enum:\n               - realtek,rtl9302b-mdio\n@@ -24,6 +34,8 @@ properties:\n               - realtek,rtl9313-mdio\n           - const: realtek,rtl9311-mdio\n       - enum:\n+          - realtek,rtl8380-mdio\n+          - realtek,rtl8391-mdio\n           - realtek,rtl9301-mdio\n           - realtek,rtl9311-mdio\n \ndiff --git a/drivers/net/mdio/mdio-realtek-rtl9300.c b/drivers/net/mdio/mdio-realtek-rtl9300.c\nindex afd52a1cd7f831..7b747828535ce4 100644\n--- a/drivers/net/mdio/mdio-realtek-rtl9300.c\n+++ b/drivers/net/mdio/mdio-realtek-rtl9300.c\n@@ -35,6 +35,81 @@\n  *\n  * The driver works out the mapping based on the MDIO bus described in device tree and phandles on\n  * the ethernet-ports property.\n+ *\n+ * The devices have a hardware polling unit that runs in the background without any CPU load. It\n+ * constantly scans the MDIO bus and the attached PHYs and updates the MAC status registers.\n+ *\n+ * How does the polling work?\n+ *\n+ * Each device has a SMI_POLL_CTRL register. A per-port bitmask decides if the hardware polling of\n+ * the associated bus/address is active or not. The hardware runs a tight loop over this and for\n+ * each set polling bit it issues a status check for the PHY. Attaching a logic analyzer to the\n+ * MDIO bus of an RTL8380 and RTL8393 gives the following commands (in kernel notation):\n+ *\n+ *\tRTL8380\t\t\t\tRTL8393\n+ *\t---------------------------\t---------------------------\n+ *\tphy_write(phy, 31, 0x0);\tphy_read(phy, 0);\n+ *\tphy_write(phy, 13, 0x7);\tphy_read(phy, 1);\n+ *\tphy_write(phy, 14, 0x3c);\tphy_read(phy, 4);\n+ *\tphy_write(phy, 13, 0x8007);\tphy_read(phy, 5);\n+ *\tphy_read(phy, 14);\t\tphy_read(phy, 6);\n+ *\tphy_write(phy, 13, 0x7);\tphy_read(phy, 9);\n+ *\tphy_write(phy, 14, 0x3d);\tphy_read(phy, 10);\n+ *\tphy_write(phy, 13, 0x8007);\tphy_read(phy, 15);\n+ *\tphy_read(phy, 14);\t\tphy_write(phy, 13, 0x7);\n+ *\tphy_read(phy, 9);\t\tphy_write(phy, 14, 0x3c);\n+ *\tphy_read(phy, 10);\t\tphy_write(phy, 13, 0x4007);\n+ *\tphy_read(phy, 15);\t\tphy_read(phy, 14);\n+ *\tphy_read(phy, 0);\t\tphy_write(phy, 13, 0x7);\n+ *\tphy_read(phy, 1);\t\tphy_write(phy, 14, 0x3d);\n+ *\tphy_read(phy, 4);\t\tphy_write(phy, 13, 0x4007);\n+ *\tphy_read(phy, 5);\t\tphy_read(phy, 14);\n+ *\tphy_read(phy, 6);\n+ *\n+ * After one PHY status is read, the polling engine goes over to the next PHY. If one bus is fully\n+ * scanned it switches over to the next bus. Basically the polling system is always busy and the\n+ * MAC state is updated in real-time.\n+ *\n+ * This is a glimpse look at the complexity of the polling and leaves out the C45 case and the MAC\n+ * register update logic afterwards. Important to note:\n+ *\n+ * - 100 MBit downshifts (broken cables) are identified and propagated to the MAC correctly\n+ * - Access to MDIO_AN_EEE_ADV and MDIO_AN_EEE_LPABLE works via C45 over C22.\n+ * - It is unclear if these sequences change for different PHYs.\n+ * - Access to Realtek reserved register 26 (link speed) has not yet been seen.\n+ *\n+ * How does MDIO access from kernel work?\n+ *\n+ * When issuing MDIO accesses via an MMIO based interface the final write to the command register\n+ * sets a \"run command now\" bit. Between two polling sequences for different PHYs the hardware\n+ * checks if a user command needs to run and sends it onto the bus. Afterwards it simply continues\n+ * its polling work. Inspecting the command sequence for a paged read on the logic analyzer gives:\n+ *\n+ *\tRTL8380\t\t\t\tRTL8393\n+ *\t---------------------------\t---------------------------\n+ *\tphy_write(phy, 31, page);\tphy_write(phy, 31, page);\n+ *\tphy_write(phy, reg, value);\tphy_write(phy, reg, value);\n+ *\t\t\t\t\tphy_write(phy, 31, 0);\n+ *\n+ * What does this mean?\n+ *\n+ * There are slight differences in polling and PHY access between the models but the challenge\n+ * stays the same. On the one hand that greatly simplifies the MAC layer, on the other hand it\n+ * has some implications for the kernel PHY subsystem.\n+ *\n+ * - Without the polling and a proper MAC status, some of the link handling features do not work.\n+ *   Especially an unpopulated MAC_LINK_STS register cancels operations to other MAC registers.\n+ * - The Realtek page register 31 is magically modified in the background so that polling will\n+ *   read the right data. On the RTL838x polling simply resets it to zero. Other devices seem\n+ *   to track the page access \"magically\" in the background.\n+ * - A C45 over C22 kernel access sequence is most likely to fail because chances are high that\n+ *   the polling engine overwrites registers 13/14 in between.\n+ * - PHY firmware loading can have issues. Especially if a PHY is designed to expect a clean\n+ *   sequence of registers and values without deviation.\n+ * - An access to one PHY will need to wait for the next free slot of the polling engine.\n+ *\n+ * Conclusion: The Realtek MDIO bus driver PHY access must know and handle any interference that\n+ * arises from the above described hardware polling.\n  */\n \n #include \u003clinux/bitfield.h\u003e\n@@ -50,6 +125,50 @@\n #include \u003clinux/property.h\u003e\n #include \u003clinux/regmap.h\u003e\n \n+#define RTL8380_NUM_BUSES\t\t\t1\n+#define RTL8380_NUM_PAGES\t\t\t4096\n+#define RTL8380_NUM_PORTS\t\t\t28\n+#define RTL8380_SMI_GLB_CTRL\t\t\t0xa100\n+#define   RTL8380_SMI_PHY_PATCH_DONE\t\tBIT(15)\n+#define RTL8380_SMI_ACCESS_PHY_CTRL_0\t\t0xa1b8\n+#define RTL8380_SMI_ACCESS_PHY_CTRL_1\t\t0xa1bc\n+#define   RTL8380_PHY_CTRL_REG_ADDR\t\tGENMASK(24, 20)\n+#define   RTL8380_PHY_CTRL_PARK_PAGE\t\tGENMASK(19, 15)\n+#define   RTL8380_PHY_CTRL_MAIN_PAGE\t\tGENMASK(14, 3)\n+#define   RTL8380_PHY_CTRL_WRITE\t\tBIT(2)\n+#define   RTL8380_PHY_CTRL_READ\t\t\t0\n+#define   RTL8380_PHY_CTRL_TYPE_C45\t\tBIT(1)\n+#define   RTL8380_PHY_CTRL_TYPE_C22\t\t0\n+#define   RTL8380_PHY_CTRL_FAIL\t\t\t0 /* no fail indicator */\n+#define RTL8380_SMI_ACCESS_PHY_CTRL_2\t\t0xa1c0\n+#define   RTL8380_PHY_CTRL_INDATA\t\tGENMASK(31, 16)\n+#define   RTL8380_PHY_CTRL_DATA\t\t\tGENMASK(15, 0)\n+#define RTL8380_SMI_ACCESS_PHY_CTRL_3\t\t0xa1c4\n+#define RTL8380_SMI_POLL_CTRL\t\t\t0xa17c\n+#define RTL8380_SMI_PORT0_5_ADDR_CTRL\t\t0xa1c8\n+\n+#define RTL8390_NUM_BUSES\t\t\t2\n+#define RTL8390_NUM_PAGES\t\t\t8192\n+#define RTL8390_NUM_PORTS\t\t\t52\n+#define RTL8390_BCAST_PHYID_CTRL\t\t0x03ec\n+#define RTL8390_PHYREG_ACCESS_CTRL\t\t0x03dc\n+#define   RTL8390_PHY_CTRL_REG_ADDR\t\tGENMASK(9, 5)\n+#define   RTL8390_PHY_CTRL_MAIN_PAGE\t\tGENMASK(22, 10)\n+#define   RTL8390_PHY_CTRL_FAIL\t\t\tBIT(1)\n+#define   RTL8390_PHY_CTRL_WRITE\t\tBIT(3)\n+#define   RTL8390_PHY_CTRL_READ\t\t\t0\n+#define   RTL8390_PHY_CTRL_TYPE_C45\t\tBIT(2)\n+#define   RTL8390_PHY_CTRL_TYPE_C22\t\t0\n+#define RTL8390_PHYREG_CTRL\t\t\t0x03e0\n+#define   RTL8390_PHY_CTRL_EXT_PAGE\t\tGENMASK(8, 0)\n+#define RTL8390_PHYREG_DATA_CTRL\t\t0x03f0\n+#define   RTL8390_PHY_CTRL_INDATA\t\tGENMASK(31, 16)\n+#define   RTL8390_PHY_CTRL_DATA\t\t\tGENMASK(15, 0)\n+#define RTL8390_PHYREG_MMD_CTRL\t\t\t0x03f4\n+#define RTL8390_PHYREG_PORT_CTRL_LOW\t\t0x03e4\n+#define RTL8390_PHYREG_PORT_CTRL_HIGH\t\t0x03e8\n+#define RTL8390_SMI_PORT_POLLING_CTRL\t\t0x03fc\n+\n #define RTL9300_NUM_BUSES\t\t\t4\n #define RTL9300_NUM_PAGES\t\t\t4096\n #define RTL9300_NUM_PORTS\t\t\t28\n@@ -70,6 +189,7 @@\n #define   RTL9300_PHY_CTRL_INDATA\t\tGENMASK(31, 16)\n #define   RTL9300_PHY_CTRL_DATA\t\t\tGENMASK(15, 0)\n #define RTL9300_SMI_ACCESS_PHY_CTRL_3\t\t0xcb7c\n+#define RTL9300_SMI_POLL_CTRL\t\t\t0xca90\n #define RTL9300_SMI_PORT0_5_ADDR_CTRL\t\t0xcb80\n \n #define RTL9310_NUM_BUSES\t\t\t4\n@@ -95,11 +215,13 @@\n #define   RTL9310_PHY_CTRL_INDATA\t\tGENMASK(15, 0)\n #define RTL9310_SMI_INDRT_ACCESS_MMD_CTRL\t0x0c18\n #define RTL9310_SMI_PORT_ADDR_CTRL\t\t0x0c74\n+#define RTL9310_SMI_PORT_POLLING_CTRL\t\t0x0ccc\n #define RTL9310_SMI_PORT_POLLING_SEL\t\t0x0c9c\n \n #define PHY_CTRL_CMD\t\t\t\tBIT(0)\n #define PHY_CTRL_MMD_DEVAD\t\t\tGENMASK(20, 16)\n #define PHY_CTRL_MMD_REG\t\t\tGENMASK(15, 0)\n+#define PHY_VENDOR_REALTEK\t\t\t0x001cc800\n \n #define MAP_ADDRS_PER_REG\t\t\t6\n #define MAP_BITS_PER_ADDR\t\t\t5\n@@ -125,7 +247,9 @@ struct otto_emdio_priv {\n \tconst struct otto_emdio_info *info;\n \tstruct regmap *regmap;\n \tstruct mutex lock; /* protect HW access */\n+\tDECLARE_BITMAP(phy_poll, MAX_PORTS);\n \tDECLARE_BITMAP(valid_ports, MAX_PORTS);\n+\tu16 page[MAX_PORTS];\n \tu8 smi_bus[MAX_PORTS];\n \tu8 smi_addr[MAX_PORTS];\n \tbool smi_bus_is_c45[MAX_SMI_BUSSES];\n@@ -142,6 +266,7 @@ struct otto_emdio_info {\n \tu8 num_buses;\n \tu8 num_ports;\n \tu16 num_pages;\n+\tu32 poll_ctrl;\n \tint (*setup_controller)(struct otto_emdio_priv *priv);\n \tint (*read_c22)(struct mii_bus *bus, int port, int regnum, u32 *value);\n \tint (*read_c45)(struct mii_bus *bus, int port, int dev_addr, int regnum, u32 *value);\n@@ -177,6 +302,12 @@ static struct otto_emdio_priv *otto_emdio_bus_to_priv(struct mii_bus *bus)\n \treturn chan-\u003epriv;\n }\n \n+static int otto_emdio_set_port_polling(struct otto_emdio_priv *priv, int port, bool active)\n+{\n+\treturn regmap_assign_bits(priv-\u003eregmap, priv-\u003einfo-\u003epoll_ctrl + (port / 32) * 4,\n+\t\t\t\t  BIT(port % 32), active);\n+}\n+\n static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,\n \t\t\t      struct otto_emdio_cmd_regs *cmd_data)\n {\n@@ -185,9 +316,9 @@ static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,\n \tu32 cmdstate;\n \tint ret;\n \n-\t/* Defensive pre check just in case something goes horrible wrong */\n+\t/* Defensive pre check just in case something goes horribly wrong */\n \tret = regmap_read_poll_timeout(priv-\u003eregmap, info-\u003ecmd_regs.c22_data,\n-\t\t\t\t       cmdstate, !(cmdstate \u0026 PHY_CTRL_CMD), 10, 1000);\n+\t\t\t\t       cmdstate, !(cmdstate \u0026 PHY_CTRL_CMD), 10, 10000);\n \tif (ret)\n \t\treturn ret;\n \n@@ -227,7 +358,7 @@ static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,\n \t\treturn ret;\n \n \tret = regmap_read_poll_timeout(priv-\u003eregmap, info-\u003ecmd_regs.c22_data,\n-\t\t\t\t       cmdstate, !(cmdstate \u0026 PHY_CTRL_CMD), 10, 1000);\n+\t\t\t\t       cmdstate, !(cmdstate \u0026 PHY_CTRL_CMD), 10, 10000);\n \tif (ret)\n \t\treturn ret;\n \n@@ -264,13 +395,123 @@ static int otto_emdio_write_cmd(struct mii_bus *bus, u32 cmd,\n \treturn otto_emdio_run_cmd(bus, cmd | priv-\u003einfo-\u003ecmd_write, cmd_data);\n }\n \n+static int otto_emdio_8380_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)\n+{\n+\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c22_data\t= FIELD_PREP(RTL8380_PHY_CTRL_REG_ADDR, regnum) |\n+\t\t\t\t  FIELD_PREP(RTL8380_PHY_CTRL_PARK_PAGE, 0x1f) |\n+\t\t\t\t  FIELD_PREP(RTL8380_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n+\t\t.io_data\t= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, port),\n+\t};\n+\n+\treturn otto_emdio_read_cmd(bus, RTL8380_PHY_CTRL_TYPE_C22, \u0026cmd_data,\n+\t\t\t\t   RTL8380_PHY_CTRL_DATA, value);\n+}\n+\n+static int otto_emdio_8380_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)\n+{\n+\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c22_data\t= FIELD_PREP(RTL8380_PHY_CTRL_REG_ADDR, regnum) |\n+\t\t\t\t  FIELD_PREP(RTL8380_PHY_CTRL_PARK_PAGE, 0x1f) |\n+\t\t\t\t  FIELD_PREP(RTL8380_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n+\t\t.io_data\t= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, value),\n+\t\t.port_mask_low\t= BIT(port),\n+\t};\n+\n+\treturn otto_emdio_write_cmd(bus, RTL8380_PHY_CTRL_TYPE_C22, \u0026cmd_data);\n+}\n+\n+static int otto_emdio_8380_read_c45(struct mii_bus *bus, int port,\n+\t\t\t\t    int dev_addr, int regnum, u32 *value)\n+{\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n+\t\t\t\t  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),\n+\t\t.io_data\t= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, port),\n+\t};\n+\n+\treturn otto_emdio_read_cmd(bus, RTL8380_PHY_CTRL_TYPE_C45, \u0026cmd_data,\n+\t\t\t\t   RTL8380_PHY_CTRL_DATA, value);\n+}\n+\n+static int otto_emdio_8380_write_c45(struct mii_bus *bus, int port,\n+\t\t\t\t     int dev_addr, int regnum, u16 value)\n+{\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n+\t\t\t\t  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),\n+\t\t.io_data\t= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, value),\n+\t\t.port_mask_low\t= BIT(port),\n+\t};\n+\n+\treturn otto_emdio_write_cmd(bus, RTL8380_PHY_CTRL_TYPE_C45, \u0026cmd_data);\n+}\n+\n+static int otto_emdio_8390_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)\n+{\n+\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c22_data\t= FIELD_PREP(RTL8390_PHY_CTRL_REG_ADDR, regnum) |\n+\t\t\t\t  FIELD_PREP(RTL8390_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n+\t\t.ext_page\t= FIELD_PREP(RTL8390_PHY_CTRL_EXT_PAGE, 0x1ff),\n+\t\t.io_data\t= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, port),\n+\t};\n+\n+\treturn otto_emdio_read_cmd(bus, RTL8390_PHY_CTRL_TYPE_C22, \u0026cmd_data,\n+\t\t\t\t   RTL8390_PHY_CTRL_DATA, value);\n+}\n+\n+static int otto_emdio_8390_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)\n+{\n+\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c22_data\t= FIELD_PREP(RTL8390_PHY_CTRL_REG_ADDR, regnum) |\n+\t\t\t\t  FIELD_PREP(RTL8390_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n+\t\t.ext_page\t= FIELD_PREP(RTL8390_PHY_CTRL_EXT_PAGE, 0x1ff),\n+\t\t.io_data\t= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, value),\n+\t\t.port_mask_high\t= (u32)(BIT_ULL(port) \u003e\u003e 32),\n+\t\t.port_mask_low\t= (u32)(BIT_ULL(port)),\n+\t};\n+\n+\treturn otto_emdio_write_cmd(bus, RTL8390_PHY_CTRL_TYPE_C22, \u0026cmd_data);\n+}\n+\n+static int otto_emdio_8390_read_c45(struct mii_bus *bus, int port,\n+\t\t\t\t    int dev_addr, int regnum, u32 *value)\n+{\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n+\t\t\t\t  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),\n+\t\t.io_data\t= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, port),\n+\t};\n+\n+\treturn otto_emdio_read_cmd(bus, RTL8390_PHY_CTRL_TYPE_C45, \u0026cmd_data,\n+\t\t\t\t   RTL8390_PHY_CTRL_DATA, value);\n+}\n+\n+static int otto_emdio_8390_write_c45(struct mii_bus *bus, int port,\n+\t\t\t\t     int dev_addr, int regnum, u16 value)\n+{\n+\tstruct otto_emdio_cmd_regs cmd_data = {\n+\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n+\t\t\t\t  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),\n+\t\t.io_data\t= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, value),\n+\t\t.port_mask_high\t= (u32)(BIT_ULL(port) \u003e\u003e 32),\n+\t\t.port_mask_low\t= (u32)(BIT_ULL(port)),\n+\t};\n+\n+\treturn otto_emdio_write_cmd(bus, RTL8390_PHY_CTRL_TYPE_C45, \u0026cmd_data);\n+}\n+\n static int otto_emdio_9300_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)\n {\n \tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\n \tstruct otto_emdio_cmd_regs cmd_data = {\n \t\t.c22_data\t= FIELD_PREP(RTL9300_PHY_CTRL_REG_ADDR, regnum) |\n \t\t\t\t  FIELD_PREP(RTL9300_PHY_CTRL_PARK_PAGE, 0x1f) |\n-\t\t\t\t  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),\n+\t\t\t\t  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n \t\t.io_data\t= FIELD_PREP(RTL9300_PHY_CTRL_INDATA, port),\n \t};\n \n@@ -284,7 +525,7 @@ static int otto_emdio_9300_write_c22(struct mii_bus *bus, int port, int regnum,\n \tstruct otto_emdio_cmd_regs cmd_data = {\n \t\t.c22_data\t= FIELD_PREP(RTL9300_PHY_CTRL_REG_ADDR, regnum) |\n \t\t\t\t  FIELD_PREP(RTL9300_PHY_CTRL_PARK_PAGE, 0x1f) |\n-\t\t\t\t  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),\n+\t\t\t\t  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n \t\t.io_data\t= FIELD_PREP(RTL9300_PHY_CTRL_INDATA, value),\n \t\t.port_mask_low\t= BIT(port),\n \t};\n@@ -324,7 +565,7 @@ static int otto_emdio_9310_read_c22(struct mii_bus *bus, int port, int regnum, u\n \tstruct otto_emdio_cmd_regs cmd_data = {\n \t\t.broadcast\t= FIELD_PREP(RTL9310_BC_PORT_ID, port),\n \t\t.c22_data\t= FIELD_PREP(RTL9310_PHY_CTRL_REG_ADDR, regnum) |\n-\t\t\t\t  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),\n+\t\t\t\t  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n \t};\n \n \treturn otto_emdio_read_cmd(bus, RTL9310_PHY_CTRL_TYPE_C22, \u0026cmd_data,\n@@ -336,7 +577,7 @@ static int otto_emdio_9310_write_c22(struct mii_bus *bus, int port, int regnum,\n \tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\n \tstruct otto_emdio_cmd_regs cmd_data = {\n \t\t.c22_data\t= FIELD_PREP(RTL9310_PHY_CTRL_REG_ADDR, regnum) |\n-\t\t\t\t  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),\n+\t\t\t\t  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, priv-\u003epage[port]),\n \t\t.io_data\t= FIELD_PREP(RTL9310_PHY_CTRL_INDATA, value),\n \t\t.port_mask_high\t= (u32)(BIT_ULL(port) \u003e\u003e 32),\n \t\t.port_mask_low\t= (u32)(BIT_ULL(port)),\n@@ -382,8 +623,12 @@ static int otto_emdio_read_c22(struct mii_bus *bus, int phy_id, int regnum)\n \tif (port \u003c 0)\n \t\treturn port;\n \n-\tscoped_guard(mutex, \u0026priv-\u003elock)\n+\tscoped_guard(mutex, \u0026priv-\u003elock) {\n+\t\tif (regnum == 31)\n+\t\t\treturn priv-\u003epage[port];\n+\n \t\tret = priv-\u003einfo-\u003eread_c22(bus, port, regnum, \u0026value);\n+\t}\n \n \treturn ret ? ret : value;\n }\n@@ -397,8 +642,17 @@ static int otto_emdio_write_c22(struct mii_bus *bus, int phy_id, int regnum, u16\n \tif (port \u003c 0)\n \t\treturn port;\n \n-\tscoped_guard(mutex, \u0026priv-\u003elock)\n+\tscoped_guard(mutex, \u0026priv-\u003elock) {\n+\t\tif (regnum == 31) {\n+\t\t\tif (value \u003e= RAW_PAGE(priv))\n+\t\t\t\treturn -EINVAL;\n+\n+\t\t\tpriv-\u003epage[port] = value;\n+\t\t\treturn 0;\n+\t\t}\n+\n \t\tret = priv-\u003einfo-\u003ewrite_c22(bus, port, regnum, value);\n+\t}\n \n \treturn ret;\n }\n@@ -471,6 +725,15 @@ static int otto_emdio_setup_topology(struct otto_emdio_priv *priv)\n \treturn 0;\n }\n \n+static int otto_emdio_8380_setup_controller(struct otto_emdio_priv *priv)\n+{\n+\t/*\n+\t * PHY_PATCH_DONE enables PHY control via SoC. This is required for PHY access, including\n+\t * patching and must be set before the PHYs are probed.\n+\t */\n+\treturn regmap_set_bits(priv-\u003eregmap, RTL8380_SMI_GLB_CTRL, RTL8380_SMI_PHY_PATCH_DONE);\n+}\n+\n static int otto_emdio_9300_setup_controller(struct otto_emdio_priv *priv)\n {\n \tu32 glb_ctrl_mask = 0, glb_ctrl_val = 0;\n@@ -507,6 +770,51 @@ static int otto_emdio_9310_setup_controller(struct otto_emdio_priv *priv)\n \treturn 0;\n }\n \n+static int otto_emdio_notify_phy_attach(struct phy_device *phydev)\n+{\n+\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(phydev-\u003emdio.bus);\n+\tint port = otto_emdio_phy_to_port(phydev-\u003emdio.bus, phydev-\u003emdio.addr);\n+\tstruct otto_emdio_chan *chan = phydev-\u003emdio.bus-\u003epriv;\n+\tint ret;\n+\n+\tif (port \u003c 0)\n+\t\treturn port;\n+\n+\tif (!priv-\u003esmi_bus_is_c45[chan-\u003emdio_bus] \u0026\u0026\n+\t    (!phy_id_compare_vendor(phydev-\u003ephy_id, PHY_VENDOR_REALTEK))) {\n+\t\tphydev_err(phydev, \"Only Realtek PHYs allowed on C22 bus\\n\");\n+\t\treturn -EOPNOTSUPP;\n+\t}\n+\n+\tscoped_guard(mutex, \u0026priv-\u003elock) {\n+\t\tret = otto_emdio_set_port_polling(priv, port, true);\n+\t\tif (!ret)\n+\t\t\t__set_bit(port, priv-\u003ephy_poll);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static void otto_emdio_notify_phy_detach(struct phy_device *phydev)\n+{\n+\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(phydev-\u003emdio.bus);\n+\tint port = otto_emdio_phy_to_port(phydev-\u003emdio.bus, phydev-\u003emdio.addr);\n+\tstruct mii_bus *bus = phydev-\u003emdio.bus;\n+\tint ret;\n+\n+\tif (port \u003c 0)\n+\t\treturn;\n+\n+\tscoped_guard(mutex, \u0026priv-\u003elock) {\n+\t\tret = otto_emdio_set_port_polling(priv, port, false);\n+\t\tif (!ret)\n+\t\t\t__clear_bit(port, priv-\u003ephy_poll);\n+\t}\n+\n+\tif (ret)\n+\t\tdev_err(bus-\u003eparent, \"failed to disable polling for port %d\\n\", port);\n+}\n+\n static int otto_emdio_probe_one(struct device *dev, struct otto_emdio_priv *priv,\n \t\t\t\t struct fwnode_handle *node)\n {\n@@ -536,6 +844,9 @@ static int otto_emdio_probe_one(struct device *dev, struct otto_emdio_priv *priv\n \t\tbus-\u003ewrite = otto_emdio_write_c22;\n \t}\n \tbus-\u003eparent = dev;\n+\tbus-\u003enotify_phy_attach = otto_emdio_notify_phy_attach;\n+\tbus-\u003enotify_phy_detach = otto_emdio_notify_phy_detach;\n+\n \tchan = bus-\u003epriv;\n \tchan-\u003emdio_bus = mdio_bus;\n \tchan-\u003epriv = priv;\n@@ -652,6 +963,19 @@ static int otto_emdio_map_ports(struct device *dev)\n \treturn err;\n }\n \n+static int otto_emdio_init_polling(struct otto_emdio_priv *priv)\n+{\n+\tint err;\n+\n+\tfor (int port = 0; port \u003c priv-\u003einfo-\u003enum_ports; port++) {\n+\t\terr = otto_emdio_set_port_polling(priv, port, false);\n+\t\tif (err)\n+\t\t\treturn err;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int otto_emdio_probe(struct platform_device *pdev)\n {\n \tstruct device *dev = \u0026pdev-\u003edev;\n@@ -671,6 +995,10 @@ static int otto_emdio_probe(struct platform_device *pdev)\n \tif (IS_ERR(priv-\u003eregmap))\n \t\treturn PTR_ERR(priv-\u003eregmap);\n \n+\terr = otto_emdio_init_polling(priv);\n+\tif (err)\n+\t\treturn err;\n+\n \tplatform_set_drvdata(pdev, priv);\n \n \terr = otto_emdio_map_ports(dev);\n@@ -696,6 +1024,51 @@ static int otto_emdio_probe(struct platform_device *pdev)\n \treturn 0;\n }\n \n+static const struct otto_emdio_info otto_emdio_8380_info = {\n+\t.addr_map_base = RTL8380_SMI_PORT0_5_ADDR_CTRL,\n+\t.cmd_fail = RTL8380_PHY_CTRL_FAIL,\n+\t.cmd_read = RTL8380_PHY_CTRL_READ,\n+\t.cmd_write = RTL8380_PHY_CTRL_WRITE,\n+\t.cmd_regs = {\n+\t\t.c22_data = RTL8380_SMI_ACCESS_PHY_CTRL_1,\n+\t\t.c45_data = RTL8380_SMI_ACCESS_PHY_CTRL_3,\n+\t\t.io_data = RTL8380_SMI_ACCESS_PHY_CTRL_2,\n+\t\t.port_mask_low = RTL8380_SMI_ACCESS_PHY_CTRL_0,\n+\t},\n+\t.num_buses = RTL8380_NUM_BUSES,\n+\t.num_pages = RTL8380_NUM_PAGES,\n+\t.num_ports = RTL8380_NUM_PORTS,\n+\t.poll_ctrl = RTL8380_SMI_POLL_CTRL,\n+\t.setup_controller = otto_emdio_8380_setup_controller,\n+\t.read_c22 = otto_emdio_8380_read_c22,\n+\t.read_c45 = otto_emdio_8380_read_c45,\n+\t.write_c22 = otto_emdio_8380_write_c22,\n+\t.write_c45 = otto_emdio_8380_write_c45,\n+};\n+\n+static const struct otto_emdio_info otto_emdio_8390_info = {\n+\t.cmd_fail = RTL8390_PHY_CTRL_FAIL,\n+\t.cmd_read = RTL8390_PHY_CTRL_READ,\n+\t.cmd_write = RTL8390_PHY_CTRL_WRITE,\n+\t.cmd_regs = {\n+\t\t.broadcast = RTL8390_BCAST_PHYID_CTRL,\n+\t\t.c22_data = RTL8390_PHYREG_ACCESS_CTRL,\n+\t\t.c45_data = RTL8390_PHYREG_MMD_CTRL,\n+\t\t.ext_page = RTL8390_PHYREG_CTRL,\n+\t\t.io_data = RTL8390_PHYREG_DATA_CTRL,\n+\t\t.port_mask_low = RTL8390_PHYREG_PORT_CTRL_LOW,\n+\t\t.port_mask_high = RTL8390_PHYREG_PORT_CTRL_HIGH,\n+\t},\n+\t.num_buses = RTL8390_NUM_BUSES,\n+\t.num_pages = RTL8390_NUM_PAGES,\n+\t.num_ports = RTL8390_NUM_PORTS,\n+\t.poll_ctrl = RTL8390_SMI_PORT_POLLING_CTRL,\n+\t.read_c22 = otto_emdio_8390_read_c22,\n+\t.read_c45 = otto_emdio_8390_read_c45,\n+\t.write_c22 = otto_emdio_8390_write_c22,\n+\t.write_c45 = otto_emdio_8390_write_c45,\n+};\n+\n static const struct otto_emdio_info otto_emdio_9300_info = {\n \t.addr_map_base = RTL9300_SMI_PORT0_5_ADDR_CTRL,\n \t.bus_map_base = RTL9300_SMI_PORT0_15_POLLING_SEL,\n@@ -711,6 +1084,7 @@ static const struct otto_emdio_info otto_emdio_9300_info = {\n \t.num_buses = RTL9300_NUM_BUSES,\n \t.num_ports = RTL9300_NUM_PORTS,\n \t.num_pages = RTL9300_NUM_PAGES,\n+\t.poll_ctrl = RTL9300_SMI_POLL_CTRL,\n \t.setup_controller = otto_emdio_9300_setup_controller,\n \t.read_c22 = otto_emdio_9300_read_c22,\n \t.read_c45 = otto_emdio_9300_read_c45,\n@@ -736,6 +1110,7 @@ static const struct otto_emdio_info otto_emdio_9310_info = {\n \t.num_buses = RTL9310_NUM_BUSES,\n \t.num_pages = RTL9310_NUM_PAGES,\n \t.num_ports = RTL9310_NUM_PORTS,\n+\t.poll_ctrl = RTL9310_SMI_PORT_POLLING_CTRL,\n \t.setup_controller = otto_emdio_9310_setup_controller,\n \t.read_c22 = otto_emdio_9310_read_c22,\n \t.read_c45 = otto_emdio_9310_read_c45,\n@@ -744,6 +1119,8 @@ static const struct otto_emdio_info otto_emdio_9310_info = {\n };\n \n static const struct of_device_id otto_emdio_ids[] = {\n+\t{ .compatible = \"realtek,rtl8380-mdio\", .data = \u0026otto_emdio_8380_info },\n+\t{ .compatible = \"realtek,rtl8391-mdio\", .data = \u0026otto_emdio_8390_info },\n \t{ .compatible = \"realtek,rtl9301-mdio\", .data = \u0026otto_emdio_9300_info },\n \t{ .compatible = \"realtek,rtl9311-mdio\", .data = \u0026otto_emdio_9310_info },\n \t{}\ndiff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c\nindex 94b2e85e00a379..38b31fc272d7d1 100644\n--- a/drivers/net/phy/phy_device.c\n+++ b/drivers/net/phy/phy_device.c\n@@ -1734,6 +1734,95 @@ static bool phy_drv_supports_irq(const struct phy_driver *phydrv)\n \treturn phydrv-\u003econfig_intr \u0026\u0026 phydrv-\u003ehandle_interrupt;\n }\n \n+static void __phy_detach(struct phy_device *phydev, bool notify_bus)\n+{\n+\tstruct net_device *dev = phydev-\u003eattached_dev;\n+\tstruct module *ndev_owner = NULL;\n+\tstruct mii_bus *bus;\n+\n+\tif (phydev-\u003edevlink) {\n+\t\tdevice_link_del(phydev-\u003edevlink);\n+\t\tphydev-\u003edevlink = NULL;\n+\t}\n+\n+\tif (phydev-\u003esysfs_links) {\n+\t\tif (dev)\n+\t\t\tsysfs_remove_link(\u0026dev-\u003edev.kobj, \"phydev\");\n+\t\tsysfs_remove_link(\u0026phydev-\u003emdio.dev.kobj, \"attached_dev\");\n+\t}\n+\n+\tif (!phydev-\u003eattached_dev)\n+\t\tsysfs_remove_file(\u0026phydev-\u003emdio.dev.kobj,\n+\t\t\t\t  \u0026dev_attr_phy_standalone.attr);\n+\n+\tphy_suspend(phydev);\n+\tif (dev) {\n+\t\tstruct hwtstamp_provider *hwprov;\n+\n+\t\t/* hwprov may technically be protected by ops lock but\n+\t\t * not for devices with a phydev, see phy_link_topo_add_phy()\n+\t\t */\n+\t\thwprov = rtnl_dereference(dev-\u003ehwprov);\n+\t\t/* Disable timestamp if it is the one selected */\n+\t\tif (hwprov \u0026\u0026 hwprov-\u003ephydev == phydev) {\n+\t\t\trcu_assign_pointer(dev-\u003ehwprov, NULL);\n+\t\t\tkfree_rcu(hwprov, rcu_head);\n+\t\t}\n+\n+\t\tphydev-\u003eattached_dev-\u003ephydev = NULL;\n+\t\tphydev-\u003eattached_dev = NULL;\n+\t\tphy_link_topo_del_phy(dev, phydev);\n+\t}\n+\n+\tphydev-\u003ephy_link_change = NULL;\n+\tphydev-\u003ephylink = NULL;\n+\n+\tif (notify_bus \u0026\u0026 phydev-\u003emdio.bus-\u003enotify_phy_detach)\n+\t\tphydev-\u003emdio.bus-\u003enotify_phy_detach(phydev);\n+\n+\tif (phydev-\u003emdio.dev.driver)\n+\t\tmodule_put(phydev-\u003emdio.dev.driver-\u003eowner);\n+\n+\t/* If the device had no specific driver before (i.e. - it\n+\t * was using the generic driver), we unbind the device\n+\t * from the generic driver so that there's a chance a\n+\t * real driver could be loaded\n+\t */\n+\tif (phydev-\u003eis_genphy_driven) {\n+\t\tdevice_release_driver(\u0026phydev-\u003emdio.dev);\n+\t\tphydev-\u003eis_genphy_driven = 0;\n+\t}\n+\n+\t/* Assert the reset signal */\n+\tphy_device_reset(phydev, 1);\n+\n+\t/*\n+\t * The phydev might go away on the put_device() below, so avoid\n+\t * a use-after-free bug by reading the underlying bus first.\n+\t */\n+\tbus = phydev-\u003emdio.bus;\n+\n+\tput_device(\u0026phydev-\u003emdio.dev);\n+\tif (dev)\n+\t\tndev_owner = dev-\u003edev.parent-\u003edriver-\u003eowner;\n+\tif (ndev_owner != bus-\u003eowner)\n+\t\tmodule_put(bus-\u003eowner);\n+}\n+\n+/**\n+ * phy_detach - detach a PHY device from its network device\n+ * @phydev: target phy_device struct\n+ *\n+ * This detaches the phy device from its network device and the phy\n+ * driver, and drops the reference count taken in phy_attach_direct().\n+ */\n+void phy_detach(struct phy_device *phydev)\n+{\n+\t/* cleanup including bus notification */\n+\t__phy_detach(phydev, true);\n+}\n+EXPORT_SYMBOL(phy_detach);\n+\n /**\n  * phy_attach_direct - attach a network device to a given PHY device pointer\n  * @dev: network device to attach\n@@ -1876,6 +1965,12 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,\n \tif (err)\n \t\tgoto error;\n \n+\tif (phydev-\u003emdio.bus-\u003enotify_phy_attach) {\n+\t\terr = phydev-\u003emdio.bus-\u003enotify_phy_attach(phydev);\n+\t\tif (err)\n+\t\t\tgoto error;\n+\t}\n+\n \tphy_resume(phydev);\n \n \t/**\n@@ -1890,8 +1985,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,\n \treturn err;\n \n error:\n-\t/* phy_detach() does all of the cleanup below */\n-\tphy_detach(phydev);\n+\t/* cleanup without bus notification */\n+\t__phy_detach(phydev, false);\n \treturn err;\n \n error_module_put:\n@@ -1906,86 +2001,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,\n }\n EXPORT_SYMBOL(phy_attach_direct);\n \n-/**\n- * phy_detach - detach a PHY device from its network device\n- * @phydev: target phy_device struct\n- *\n- * This detaches the phy device from its network device and the phy\n- * driver, and drops the reference count taken in phy_attach_direct().\n- */\n-void phy_detach(struct phy_device *phydev)\n-{\n-\tstruct net_device *dev = phydev-\u003eattached_dev;\n-\tstruct module *ndev_owner = NULL;\n-\tstruct mii_bus *bus;\n-\n-\tif (phydev-\u003edevlink) {\n-\t\tdevice_link_del(phydev-\u003edevlink);\n-\t\tphydev-\u003edevlink = NULL;\n-\t}\n-\n-\tif (phydev-\u003esysfs_links) {\n-\t\tif (dev)\n-\t\t\tsysfs_remove_link(\u0026dev-\u003edev.kobj, \"phydev\");\n-\t\tsysfs_remove_link(\u0026phydev-\u003emdio.dev.kobj, \"attached_dev\");\n-\t}\n-\n-\tif (!phydev-\u003eattached_dev)\n-\t\tsysfs_remove_file(\u0026phydev-\u003emdio.dev.kobj,\n-\t\t\t\t  \u0026dev_attr_phy_standalone.attr);\n-\n-\tphy_suspend(phydev);\n-\tif (dev) {\n-\t\tstruct hwtstamp_provider *hwprov;\n-\n-\t\t/* hwprov may technically be protected by ops lock but\n-\t\t * not for devices with a phydev, see phy_link_topo_add_phy()\n-\t\t */\n-\t\thwprov = rtnl_dereference(dev-\u003ehwprov);\n-\t\t/* Disable timestamp if it is the one selected */\n-\t\tif (hwprov \u0026\u0026 hwprov-\u003ephydev == phydev) {\n-\t\t\trcu_assign_pointer(dev-\u003ehwprov, NULL);\n-\t\t\tkfree_rcu(hwprov, rcu_head);\n-\t\t}\n-\n-\t\tphydev-\u003eattached_dev-\u003ephydev = NULL;\n-\t\tphydev-\u003eattached_dev = NULL;\n-\t\tphy_link_topo_del_phy(dev, phydev);\n-\t}\n-\n-\tphydev-\u003ephy_link_change = NULL;\n-\tphydev-\u003ephylink = NULL;\n-\n-\tif (phydev-\u003emdio.dev.driver)\n-\t\tmodule_put(phydev-\u003emdio.dev.driver-\u003eowner);\n-\n-\t/* If the device had no specific driver before (i.e. - it\n-\t * was using the generic driver), we unbind the device\n-\t * from the generic driver so that there's a chance a\n-\t * real driver could be loaded\n-\t */\n-\tif (phydev-\u003eis_genphy_driven) {\n-\t\tdevice_release_driver(\u0026phydev-\u003emdio.dev);\n-\t\tphydev-\u003eis_genphy_driven = 0;\n-\t}\n-\n-\t/* Assert the reset signal */\n-\tphy_device_reset(phydev, 1);\n-\n-\t/*\n-\t * The phydev might go away on the put_device() below, so avoid\n-\t * a use-after-free bug by reading the underlying bus first.\n-\t */\n-\tbus = phydev-\u003emdio.bus;\n-\n-\tput_device(\u0026phydev-\u003emdio.dev);\n-\tif (dev)\n-\t\tndev_owner = dev-\u003edev.parent-\u003edriver-\u003eowner;\n-\tif (ndev_owner != bus-\u003eowner)\n-\t\tmodule_put(bus-\u003eowner);\n-}\n-EXPORT_SYMBOL(phy_detach);\n-\n int phy_suspend(struct phy_device *phydev)\n {\n \tstruct net_device *netdev = phydev-\u003eattached_dev;\ndiff --git a/include/linux/phy.h b/include/linux/phy.h\nindex 11092c3175b3de..849dd43a11b4e9 100644\n--- a/include/linux/phy.h\n+++ b/include/linux/phy.h\n@@ -376,6 +376,24 @@ struct mii_bus {\n \t\t\t int regnum, u16 val);\n \t/** @reset: Perform a reset of the bus */\n \tint (*reset)(struct mii_bus *bus);\n+\t/**\n+\t * @notify_phy_attach: Perform post-attach handling for MDIO bus\n+\t *   drivers. Called in phy_attach_direct() right after phy_init_hw()\n+\t *   and before phy_resume(). At this point, the PHY is still\n+\t *   suspended, and @phydev-\u003eattached_dev may be NULL (e.g. for\n+\t *   standalone PHYs). Runs in process context and may sleep. Return\n+\t *   0 on success or a negative errno on failure (which aborts the\n+\t *   attach sequence).\n+\t */\n+\tint (*notify_phy_attach)(struct phy_device *phydev);\n+\t/**\n+\t * @notify_phy_detach: Perform pre-detach handling for MDIO bus\n+\t *   drivers. Called in phy_detach() after phy_suspend() and link\n+\t *   cleanup, but before driver unbind and device reference release.\n+\t *   Runs in process context and may sleep. Only invoked if\n+\t *   @notify_phy_attach was previously called and succeeded.\n+\t */\n+\tvoid (*notify_phy_detach)(struct phy_device *phydev);\n \n \t/** @stats: Statistic counters per device on the bus */\n \tstruct mdio_bus_stats stats[PHY_MAX_ADDR];\n"
}

2/1 2026/07/25 10:03 agent patch-evaluator
2m Model:
best-expensive

Args:
null

Results:
{
  "EnableConfigs": [
    "MDIO_REALTEK_RTL9300",
    "COMPILE_TEST",
    "PHYLIB",
    "MFD_SYSCON"
  ],
  "FocusSymbols": [
    "phy_attach_direct",
    "phy_detach",
    "otto_emdio_probe",
    "otto_emdio_notify_phy_attach",
    "otto_emdio_notify_phy_detach"
  ],
  "Reasoning": "The patch adds support for Realtek Otto Switches Ethernet MDIO Controller (RTL8380, RTL8390) and introduces hardware polling support. It modifies core PHY code (phy_device.c) to add notify_phy_attach and notify_phy_detach callbacks to struct mii_bus, which are invoked from phy_attach_direct and phy_detach. These core changes are highly reachable and functional. The MDIO driver changes are also reachable if the driver is enabled.",
  "WorthFuzzing": true
}

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

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

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

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

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


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

Prompt:
For your convenience, here is the diff of the changes:
commit 7bebf64b016ec401783c0bcc72a022261172ee9e
Author: syz-cluster <triage@syzkaller.com>
Date:   Sat Jul 25 10:03:24 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
index 271e05bae9c574..67e0b23a8470ea 100644
--- a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/net/realtek,rtl9301-mdio.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Realtek RTL9300 MDIO Controller
+title: Realtek Otto Switches Ethernet MDIO Controller
 
 maintainers:
   - Chris Packham <chris.packham@alliedtelesis.co.nz>
@@ -12,6 +12,16 @@ maintainers:
 properties:
   compatible:
     oneOf:
+      - items:
+          - enum:
+              - realtek,rtl8381-mdio
+              - realtek,rtl8382-mdio
+          - const: realtek,rtl8380-mdio
+      - items:
+          - enum:
+              - realtek,rtl8392-mdio
+              - realtek,rtl8393-mdio
+          - const: realtek,rtl8391-mdio
       - items:
           - enum:
               - realtek,rtl9302b-mdio
@@ -24,6 +34,8 @@ properties:
               - realtek,rtl9313-mdio
           - const: realtek,rtl9311-mdio
       - enum:
+          - realtek,rtl8380-mdio
+          - realtek,rtl8391-mdio
           - realtek,rtl9301-mdio
           - realtek,rtl9311-mdio
 
diff --git a/drivers/net/mdio/mdio-realtek-rtl9300.c b/drivers/net/mdio/mdio-realtek-rtl9300.c
index afd52a1cd7f831..7b747828535ce4 100644
--- a/drivers/net/mdio/mdio-realtek-rtl9300.c
+++ b/drivers/net/mdio/mdio-realtek-rtl9300.c
@@ -35,6 +35,81 @@
  *
  * The driver works out the mapping based on the MDIO bus described in device tree and phandles on
  * the ethernet-ports property.
+ *
+ * The devices have a hardware polling unit that runs in the background without any CPU load. It
+ * constantly scans the MDIO bus and the attached PHYs and updates the MAC status registers.
+ *
+ * How does the polling work?
+ *
+ * Each device has a SMI_POLL_CTRL register. A per-port bitmask decides if the hardware polling of
+ * the associated bus/address is active or not. The hardware runs a tight loop over this and for
+ * each set polling bit it issues a status check for the PHY. Attaching a logic analyzer to the
+ * MDIO bus of an RTL8380 and RTL8393 gives the following commands (in kernel notation):
+ *
+ *	RTL8380				RTL8393
+ *	---------------------------	---------------------------
+ *	phy_write(phy, 31, 0x0);	phy_read(phy, 0);
+ *	phy_write(phy, 13, 0x7);	phy_read(phy, 1);
+ *	phy_write(phy, 14, 0x3c);	phy_read(phy, 4);
+ *	phy_write(phy, 13, 0x8007);	phy_read(phy, 5);
+ *	phy_read(phy, 14);		phy_read(phy, 6);
+ *	phy_write(phy, 13, 0x7);	phy_read(phy, 9);
+ *	phy_write(phy, 14, 0x3d);	phy_read(phy, 10);
+ *	phy_write(phy, 13, 0x8007);	phy_read(phy, 15);
+ *	phy_read(phy, 14);		phy_write(phy, 13, 0x7);
+ *	phy_read(phy, 9);		phy_write(phy, 14, 0x3c);
+ *	phy_read(phy, 10);		phy_write(phy, 13, 0x4007);
+ *	phy_read(phy, 15);		phy_read(phy, 14);
+ *	phy_read(phy, 0);		phy_write(phy, 13, 0x7);
+ *	phy_read(phy, 1);		phy_write(phy, 14, 0x3d);
+ *	phy_read(phy, 4);		phy_write(phy, 13, 0x4007);
+ *	phy_read(phy, 5);		phy_read(phy, 14);
+ *	phy_read(phy, 6);
+ *
+ * After one PHY status is read, the polling engine goes over to the next PHY. If one bus is fully
+ * scanned it switches over to the next bus. Basically the polling system is always busy and the
+ * MAC state is updated in real-time.
+ *
+ * This is a glimpse look at the complexity of the polling and leaves out the C45 case and the MAC
+ * register update logic afterwards. Important to note:
+ *
+ * - 100 MBit downshifts (broken cables) are identified and propagated to the MAC correctly
+ * - Access to MDIO_AN_EEE_ADV and MDIO_AN_EEE_LPABLE works via C45 over C22.
+ * - It is unclear if these sequences change for different PHYs.
+ * - Access to Realtek reserved register 26 (link speed) has not yet been seen.
+ *
+ * How does MDIO access from kernel work?
+ *
+ * When issuing MDIO accesses via an MMIO based interface the final write to the command register
+ * sets a "run command now" bit. Between two polling sequences for different PHYs the hardware
+ * checks if a user command needs to run and sends it onto the bus. Afterwards it simply continues
+ * its polling work. Inspecting the command sequence for a paged read on the logic analyzer gives:
+ *
+ *	RTL8380				RTL8393
+ *	---------------------------	---------------------------
+ *	phy_write(phy, 31, page);	phy_write(phy, 31, page);
+ *	phy_write(phy, reg, value);	phy_write(phy, reg, value);
+ *					phy_write(phy, 31, 0);
+ *
+ * What does this mean?
+ *
+ * There are slight differences in polling and PHY access between the models but the challenge
+ * stays the same. On the one hand that greatly simplifies the MAC layer, on the other hand it
+ * has some implications for the kernel PHY subsystem.
+ *
+ * - Without the polling and a proper MAC status, some of the link handling features do not work.
+ *   Especially an unpopulated MAC_LINK_STS register cancels operations to other MAC registers.
+ * - The Realtek page register 31 is magically modified in the background so that polling will
+ *   read the right data. On the RTL838x polling simply resets it to zero. Other devices seem
+ *   to track the page access "magically" in the background.
+ * - A C45 over C22 kernel access sequence is most likely to fail because chances are high that
+ *   the polling engine overwrites registers 13/14 in between.
+ * - PHY firmware loading can have issues. Especially if a PHY is designed to expect a clean
+ *   sequence of registers and values without deviation.
+ * - An access to one PHY will need to wait for the next free slot of the polling engine.
+ *
+ * Conclusion: The Realtek MDIO bus driver PHY access must know and handle any interference that
+ * arises from the above described hardware polling.
  */
 
 #include <linux/bitfield.h>
@@ -50,6 +125,50 @@
 #include <linux/property.h>
 #include <linux/regmap.h>
 
+#define RTL8380_NUM_BUSES			1
+#define RTL8380_NUM_PAGES			4096
+#define RTL8380_NUM_PORTS			28
+#define RTL8380_SMI_GLB_CTRL			0xa100
+#define   RTL8380_SMI_PHY_PATCH_DONE		BIT(15)
+#define RTL8380_SMI_ACCESS_PHY_CTRL_0		0xa1b8
+#define RTL8380_SMI_ACCESS_PHY_CTRL_1		0xa1bc
+#define   RTL8380_PHY_CTRL_REG_ADDR		GENMASK(24, 20)
+#define   RTL8380_PHY_CTRL_PARK_PAGE		GENMASK(19, 15)
+#define   RTL8380_PHY_CTRL_MAIN_PAGE		GENMASK(14, 3)
+#define   RTL8380_PHY_CTRL_WRITE		BIT(2)
+#define   RTL8380_PHY_CTRL_READ			0
+#define   RTL8380_PHY_CTRL_TYPE_C45		BIT(1)
+#define   RTL8380_PHY_CTRL_TYPE_C22		0
+#define   RTL8380_PHY_CTRL_FAIL			0 /* no fail indicator */
+#define RTL8380_SMI_ACCESS_PHY_CTRL_2		0xa1c0
+#define   RTL8380_PHY_CTRL_INDATA		GENMASK(31, 16)
+#define   RTL8380_PHY_CTRL_DATA			GENMASK(15, 0)
+#define RTL8380_SMI_ACCESS_PHY_CTRL_3		0xa1c4
+#define RTL8380_SMI_POLL_CTRL			0xa17c
+#define RTL8380_SMI_PORT0_5_ADDR_CTRL		0xa1c8
+
+#define RTL8390_NUM_BUSES			2
+#define RTL8390_NUM_PAGES			8192
+#define RTL8390_NUM_PORTS			52
+#define RTL8390_BCAST_PHYID_CTRL		0x03ec
+#define RTL8390_PHYREG_ACCESS_CTRL		0x03dc
+#define   RTL8390_PHY_CTRL_REG_ADDR		GENMASK(9, 5)
+#define   RTL8390_PHY_CTRL_MAIN_PAGE		GENMASK(22, 10)
+#define   RTL8390_PHY_CTRL_FAIL			BIT(1)
+#define   RTL8390_PHY_CTRL_WRITE		BIT(3)
+#define   RTL8390_PHY_CTRL_READ			0
+#define   RTL8390_PHY_CTRL_TYPE_C45		BIT(2)
+#define   RTL8390_PHY_CTRL_TYPE_C22		0
+#define RTL8390_PHYREG_CTRL			0x03e0
+#define   RTL8390_PHY_CTRL_EXT_PAGE		GENMASK(8, 0)
+#define RTL8390_PHYREG_DATA_CTRL		0x03f0
+#define   RTL8390_PHY_CTRL_INDATA		GENMASK(31, 16)
+#define   RTL8390_PHY_CTRL_DATA			GENMASK(15, 0)
+#define RTL8390_PHYREG_MMD_CTRL			0x03f4
+#define RTL8390_PHYREG_PORT_CTRL_LOW		0x03e4
+#define RTL8390_PHYREG_PORT_CTRL_HIGH		0x03e8
+#define RTL8390_SMI_PORT_POLLING_CTRL		0x03fc
+
 #define RTL9300_NUM_BUSES			4
 #define RTL9300_NUM_PAGES			4096
 #define RTL9300_NUM_PORTS			28
@@ -70,6 +189,7 @@
 #define   RTL9300_PHY_CTRL_INDATA		GENMASK(31, 16)
 #define   RTL9300_PHY_CTRL_DATA			GENMASK(15, 0)
 #define RTL9300_SMI_ACCESS_PHY_CTRL_3		0xcb7c
+#define RTL9300_SMI_POLL_CTRL			0xca90
 #define RTL9300_SMI_PORT0_5_ADDR_CTRL		0xcb80
 
 #define RTL9310_NUM_BUSES			4
@@ -95,11 +215,13 @@
 #define   RTL9310_PHY_CTRL_INDATA		GENMASK(15, 0)
 #define RTL9310_SMI_INDRT_ACCESS_MMD_CTRL	0x0c18
 #define RTL9310_SMI_PORT_ADDR_CTRL		0x0c74
+#define RTL9310_SMI_PORT_POLLING_CTRL		0x0ccc
 #define RTL9310_SMI_PORT_POLLING_SEL		0x0c9c
 
 #define PHY_CTRL_CMD				BIT(0)
 #define PHY_CTRL_MMD_DEVAD			GENMASK(20, 16)
 #define PHY_CTRL_MMD_REG			GENMASK(15, 0)
+#define PHY_VENDOR_REALTEK			0x001cc800
 
 #define MAP_ADDRS_PER_REG			6
 #define MAP_BITS_PER_ADDR			5
@@ -125,7 +247,9 @@ struct otto_emdio_priv {
 	const struct otto_emdio_info *info;
 	struct regmap *regmap;
 	struct mutex lock; /* protect HW access */
+	DECLARE_BITMAP(phy_poll, MAX_PORTS);
 	DECLARE_BITMAP(valid_ports, MAX_PORTS);
+	u16 page[MAX_PORTS];
 	u8 smi_bus[MAX_PORTS];
 	u8 smi_addr[MAX_PORTS];
 	bool smi_bus_is_c45[MAX_SMI_BUSSES];
@@ -142,6 +266,7 @@ struct otto_emdio_info {
 	u8 num_buses;
 	u8 num_ports;
 	u16 num_pages;
+	u32 poll_ctrl;
 	int (*setup_controller)(struct otto_emdio_priv *priv);
 	int (*read_c22)(struct mii_bus *bus, int port, int regnum, u32 *value);
 	int (*read_c45)(struct mii_bus *bus, int port, int dev_addr, int regnum, u32 *value);
@@ -177,6 +302,12 @@ static struct otto_emdio_priv *otto_emdio_bus_to_priv(struct mii_bus *bus)
 	return chan->priv;
 }
 
+static int otto_emdio_set_port_polling(struct otto_emdio_priv *priv, int port, bool active)
+{
+	return regmap_assign_bits(priv->regmap, priv->info->poll_ctrl + (port / 32) * 4,
+				  BIT(port % 32), active);
+}
+
 static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,
 			      struct otto_emdio_cmd_regs *cmd_data)
 {
@@ -185,9 +316,9 @@ static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,
 	u32 cmdstate;
 	int ret;
 
-	/* Defensive pre check just in case something goes horrible wrong */
+	/* Defensive pre check just in case something goes horribly wrong */
 	ret = regmap_read_poll_timeout(priv->regmap, info->cmd_regs.c22_data,
-				       cmdstate, !(cmdstate & PHY_CTRL_CMD), 10, 1000);
+				       cmdstate, !(cmdstate & PHY_CTRL_CMD), 10, 10000);
 	if (ret)
 		return ret;
 
@@ -227,7 +358,7 @@ static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,
 		return ret;
 
 	ret = regmap_read_poll_timeout(priv->regmap, info->cmd_regs.c22_data,
-				       cmdstate, !(cmdstate & PHY_CTRL_CMD), 10, 1000);
+				       cmdstate, !(cmdstate & PHY_CTRL_CMD), 10, 10000);
 	if (ret)
 		return ret;
 
@@ -264,13 +395,123 @@ static int otto_emdio_write_cmd(struct mii_bus *bus, u32 cmd,
 	return otto_emdio_run_cmd(bus, cmd | priv->info->cmd_write, cmd_data);
 }
 
+static int otto_emdio_8380_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)
+{
+	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c22_data	= FIELD_PREP(RTL8380_PHY_CTRL_REG_ADDR, regnum) |
+				  FIELD_PREP(RTL8380_PHY_CTRL_PARK_PAGE, 0x1f) |
+				  FIELD_PREP(RTL8380_PHY_CTRL_MAIN_PAGE, priv->page[port]),
+		.io_data	= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, port),
+	};
+
+	return otto_emdio_read_cmd(bus, RTL8380_PHY_CTRL_TYPE_C22, &cmd_data,
+				   RTL8380_PHY_CTRL_DATA, value);
+}
+
+static int otto_emdio_8380_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)
+{
+	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c22_data	= FIELD_PREP(RTL8380_PHY_CTRL_REG_ADDR, regnum) |
+				  FIELD_PREP(RTL8380_PHY_CTRL_PARK_PAGE, 0x1f) |
+				  FIELD_PREP(RTL8380_PHY_CTRL_MAIN_PAGE, priv->page[port]),
+		.io_data	= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, value),
+		.port_mask_low	= BIT(port),
+	};
+
+	return otto_emdio_write_cmd(bus, RTL8380_PHY_CTRL_TYPE_C22, &cmd_data);
+}
+
+static int otto_emdio_8380_read_c45(struct mii_bus *bus, int port,
+				    int dev_addr, int regnum, u32 *value)
+{
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c45_data	= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |
+				  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),
+		.io_data	= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, port),
+	};
+
+	return otto_emdio_read_cmd(bus, RTL8380_PHY_CTRL_TYPE_C45, &cmd_data,
+				   RTL8380_PHY_CTRL_DATA, value);
+}
+
+static int otto_emdio_8380_write_c45(struct mii_bus *bus, int port,
+				     int dev_addr, int regnum, u16 value)
+{
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c45_data	= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |
+				  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),
+		.io_data	= FIELD_PREP(RTL8380_PHY_CTRL_INDATA, value),
+		.port_mask_low	= BIT(port),
+	};
+
+	return otto_emdio_write_cmd(bus, RTL8380_PHY_CTRL_TYPE_C45, &cmd_data);
+}
+
+static int otto_emdio_8390_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)
+{
+	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c22_data	= FIELD_PREP(RTL8390_PHY_CTRL_REG_ADDR, regnum) |
+				  FIELD_PREP(RTL8390_PHY_CTRL_MAIN_PAGE, priv->page[port]),
+		.ext_page	= FIELD_PREP(RTL8390_PHY_CTRL_EXT_PAGE, 0x1ff),
+		.io_data	= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, port),
+	};
+
+	return otto_emdio_read_cmd(bus, RTL8390_PHY_CTRL_TYPE_C22, &cmd_data,
+				   RTL8390_PHY_CTRL_DATA, value);
+}
+
+static int otto_emdio_8390_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)
+{
+	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c22_data	= FIELD_PREP(RTL8390_PHY_CTRL_REG_ADDR, regnum) |
+				  FIELD_PREP(RTL8390_PHY_CTRL_MAIN_PAGE, priv->page[port]),
+		.ext_page	= FIELD_PREP(RTL8390_PHY_CTRL_EXT_PAGE, 0x1ff),
+		.io_data	= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, value),
+		.port_mask_high	= (u32)(BIT_ULL(port) >> 32),
+		.port_mask_low	= (u32)(BIT_ULL(port)),
+	};
+
+	return otto_emdio_write_cmd(bus, RTL8390_PHY_CTRL_TYPE_C22, &cmd_data);
+}
+
+static int otto_emdio_8390_read_c45(struct mii_bus *bus, int port,
+				    int dev_addr, int regnum, u32 *value)
+{
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c45_data	= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |
+				  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),
+		.io_data	= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, port),
+	};
+
+	return otto_emdio_read_cmd(bus, RTL8390_PHY_CTRL_TYPE_C45, &cmd_data,
+				   RTL8390_PHY_CTRL_DATA, value);
+}
+
+static int otto_emdio_8390_write_c45(struct mii_bus *bus, int port,
+				     int dev_addr, int regnum, u16 value)
+{
+	struct otto_emdio_cmd_regs cmd_data = {
+		.c45_data	= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |
+				  FIELD_PREP(PHY_CTRL_MMD_REG, regnum),
+		.io_data	= FIELD_PREP(RTL8390_PHY_CTRL_INDATA, value),
+		.port_mask_high	= (u32)(BIT_ULL(port) >> 32),
+		.port_mask_low	= (u32)(BIT_ULL(port)),
+	};
+
+	return otto_emdio_write_cmd(bus, RTL8390_PHY_CTRL_TYPE_C45, &cmd_data);
+}
+
 static int otto_emdio_9300_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)
 {
 	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);
 	struct otto_emdio_cmd_regs cmd_data = {
 		.c22_data	= FIELD_PREP(RTL9300_PHY_CTRL_REG_ADDR, regnum) |
 				  FIELD_PREP(RTL9300_PHY_CTRL_PARK_PAGE, 0x1f) |
-				  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),
+				  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, priv->page[port]),
 		.io_data	= FIELD_PREP(RTL9300_PHY_CTRL_INDATA, port),
 	};
 
@@ -284,7 +525,7 @@ static int otto_emdio_9300_write_c22(struct mii_bus *bus, int port, int regnum,
 	struct otto_emdio_cmd_regs cmd_data = {
 		.c22_data	= FIELD_PREP(RTL9300_PHY_CTRL_REG_ADDR, regnum) |
 				  FIELD_PREP(RTL9300_PHY_CTRL_PARK_PAGE, 0x1f) |
-				  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),
+				  FIELD_PREP(RTL9300_PHY_CTRL_MAIN_PAGE, priv->page[port]),
 		.io_data	= FIELD_PREP(RTL9300_PHY_CTRL_INDATA, value),
 		.port_mask_low	= BIT(port),
 	};
@@ -324,7 +565,7 @@ static int otto_emdio_9310_read_c22(struct mii_bus *bus, int port, int regnum, u
 	struct otto_emdio_cmd_regs cmd_data = {
 		.broadcast	= FIELD_PREP(RTL9310_BC_PORT_ID, port),
 		.c22_data	= FIELD_PREP(RTL9310_PHY_CTRL_REG_ADDR, regnum) |
-				  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),
+				  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, priv->page[port]),
 	};
 
 	return otto_emdio_read_cmd(bus, RTL9310_PHY_CTRL_TYPE_C22, &cmd_data,
@@ -336,7 +577,7 @@ static int otto_emdio_9310_write_c22(struct mii_bus *bus, int port, int regnum,
 	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);
 	struct otto_emdio_cmd_regs cmd_data = {
 		.c22_data	= FIELD_PREP(RTL9310_PHY_CTRL_REG_ADDR, regnum) |
-				  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, RAW_PAGE(priv)),
+				  FIELD_PREP(RTL9310_PHY_CTRL_MAIN_PAGE, priv->page[port]),
 		.io_data	= FIELD_PREP(RTL9310_PHY_CTRL_INDATA, value),
 		.port_mask_high	= (u32)(BIT_ULL(port) >> 32),
 		.port_mask_low	= (u32)(BIT_ULL(port)),
@@ -382,8 +623,12 @@ static int otto_emdio_read_c22(struct mii_bus *bus, int phy_id, int regnum)
 	if (port < 0)
 		return port;
 
-	scoped_guard(mutex, &priv->lock)
+	scoped_guard(mutex, &priv->lock) {
+		if (regnum == 31)
+			return priv->page[port];
+
 		ret = priv->info->read_c22(bus, port, regnum, &value);
+	}
 
 	return ret ? ret : value;
 }
@@ -397,8 +642,17 @@ static int otto_emdio_write_c22(struct mii_bus *bus, int phy_id, int regnum, u16
 	if (port < 0)
 		return port;
 
-	scoped_guard(mutex, &priv->lock)
+	scoped_guard(mutex, &priv->lock) {
+		if (regnum == 31) {
+			if (value >= RAW_PAGE(priv))
+				return -EINVAL;
+
+			priv->page[port] = value;
+			return 0;
+		}
+
 		ret = priv->info->write_c22(bus, port, regnum, value);
+	}
 
 	return ret;
 }
@@ -471,6 +725,15 @@ static int otto_emdio_setup_topology(struct otto_emdio_priv *priv)
 	return 0;
 }
 
+static int otto_emdio_8380_setup_controller(struct otto_emdio_priv *priv)
+{
+	/*
+	 * PHY_PATCH_DONE enables PHY control via SoC. This is required for PHY access, including
+	 * patching and must be set before the PHYs are probed.
+	 */
+	return regmap_set_bits(priv->regmap, RTL8380_SMI_GLB_CTRL, RTL8380_SMI_PHY_PATCH_DONE);
+}
+
 static int otto_emdio_9300_setup_controller(struct otto_emdio_priv *priv)
 {
 	u32 glb_ctrl_mask = 0, glb_ctrl_val = 0;
@@ -507,6 +770,51 @@ static int otto_emdio_9310_setup_controller(struct otto_emdio_priv *priv)
 	return 0;
 }
 
+static int otto_emdio_notify_phy_attach(struct phy_device *phydev)
+{
+	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(phydev->mdio.bus);
+	int port = otto_emdio_phy_to_port(phydev->mdio.bus, phydev->mdio.addr);
+	struct otto_emdio_chan *chan = phydev->mdio.bus->priv;
+	int ret;
+
+	if (port < 0)
+		return port;
+
+	if (!priv->smi_bus_is_c45[chan->mdio_bus] &&
+	    (!phy_id_compare_vendor(phydev->phy_id, PHY_VENDOR_REALTEK))) {
+		phydev_err(phydev, "Only Realtek PHYs allowed on C22 bus\n");
+		return -EOPNOTSUPP;
+	}
+
+	scoped_guard(mutex, &priv->lock) {
+		ret = otto_emdio_set_port_polling(priv, port, true);
+		if (!ret)
+			__set_bit(port, priv->phy_poll);
+	}
+
+	return ret;
+}
+
+static void otto_emdio_notify_phy_detach(struct phy_device *phydev)
+{
+	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(phydev->mdio.bus);
+	int port = otto_emdio_phy_to_port(phydev->mdio.bus, phydev->mdio.addr);
+	struct mii_bus *bus = phydev->mdio.bus;
+	int ret;
+
+	if (port < 0)
+		return;
+
+	scoped_guard(mutex, &priv->lock) {
+		ret = otto_emdio_set_port_polling(priv, port, false);
+		if (!ret)
+			__clear_bit(port, priv->phy_poll);
+	}
+
+	if (ret)
+		dev_err(bus->parent, "failed to disable polling for port %d\n", port);
+}
+
 static int otto_emdio_probe_one(struct device *dev, struct otto_emdio_priv *priv,
 				 struct fwnode_handle *node)
 {
@@ -536,6 +844,9 @@ static int otto_emdio_probe_one(struct device *dev, struct otto_emdio_priv *priv
 		bus->write = otto_emdio_write_c22;
 	}
 	bus->parent = dev;
+	bus->notify_phy_attach = otto_emdio_notify_phy_attach;
+	bus->notify_phy_detach = otto_emdio_notify_phy_detach;
+
 	chan = bus->priv;
 	chan->mdio_bus = mdio_bus;
 	chan->priv = priv;
@@ -652,6 +963,19 @@ static int otto_emdio_map_ports(struct device *dev)
 	return err;
 }
 
+static int otto_emdio_init_polling(struct otto_emdio_priv *priv)
+{
+	int err;
+
+	for (int port = 0; port < priv->info->num_ports; port++) {
+		err = otto_emdio_set_port_polling(priv, port, false);
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
 static int otto_emdio_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -671,6 +995,10 @@ static int otto_emdio_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->regmap))
 		return PTR_ERR(priv->regmap);
 
+	err = otto_emdio_init_polling(priv);
+	if (err)
+		return err;
+
 	platform_set_drvdata(pdev, priv);
 
 	err = otto_emdio_map_ports(dev);
@@ -696,6 +1024,51 @@ static int otto_emdio_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct otto_emdio_info otto_emdio_8380_info = {
+	.addr_map_base = RTL8380_SMI_PORT0_5_ADDR_CTRL,
+	.cmd_fail = RTL8380_PHY_CTRL_FAIL,
+	.cmd_read = RTL8380_PHY_CTRL_READ,
+	.cmd_write = RTL8380_PHY_CTRL_WRITE,
+	.cmd_regs = {
+		.c22_data = RTL8380_SMI_ACCESS_PHY_CTRL_1,
+		.c45_data = RTL8380_SMI_ACCESS_PHY_CTRL_3,
+		.io_data = RTL8380_SMI_ACCESS_PHY_CTRL_2,
+		.port_mask_low = RTL8380_SMI_ACCESS_PHY_CTRL_0,
+	},
+	.num_buses = RTL8380_NUM_BUSES,
+	.num_pages = RTL8380_NUM_PAGES,
+	.num_ports = RTL8380_NUM_PORTS,
+	.poll_ctrl = RTL8380_SMI_POLL_CTRL,
+	.setup_controller = otto_emdio_8380_setup_controller,
+	.read_c22 = otto_emdio_8380_read_c22,
+	.read_c45 = otto_emdio_8380_read_c45,
+	.write_c22 = otto_emdio_8380_write_c22,
+	.write_c45 = otto_emdio_8380_write_c45,
+};
+
+static const struct otto_emdio_info otto_emdio_8390_info = {
+	.cmd_fail = RTL8390_PHY_CTRL_FAIL,
+	.cmd_read = RTL8390_PHY_CTRL_READ,
+	.cmd_write = RTL8390_PHY_CTRL_WRITE,
+	.cmd_regs = {
+		.broadcast = RTL8390_BCAST_PHYID_CTRL,
+		.c22_data = RTL8390_PHYREG_ACCESS_CTRL,
+		.c45_data = RTL8390_PHYREG_MMD_CTRL,
+		.ext_page = RTL8390_PHYREG_CTRL,
+		.io_data = RTL8390_PHYREG_DATA_CTRL,
+		.port_mask_low = RTL8390_PHYREG_PORT_CTRL_LOW,
+		.port_mask_high = RTL8390_PHYREG_PORT_CTRL_HIGH,
+	},
+	.num_buses = RTL8390_NUM_BUSES,
+	.num_pages = RTL8390_NUM_PAGES,
+	.num_ports = RTL8390_NUM_PORTS,
+	.poll_ctrl = RTL8390_SMI_PORT_POLLING_CTRL,
+	.read_c22 = otto_emdio_8390_read_c22,
+	.read_c45 = otto_emdio_8390_read_c45,
+	.write_c22 = otto_emdio_8390_write_c22,
+	.write_c45 = otto_emdio_8390_write_c45,
+};
+
 static const struct otto_emdio_info otto_emdio_9300_info = {
 	.addr_map_base = RTL9300_SMI_PORT0_5_ADDR_CTRL,
 	.bus_map_base = RTL9300_SMI_PORT0_15_POLLING_SEL,
@@ -711,6 +1084,7 @@ static const struct otto_emdio_info otto_emdio_9300_info = {
 	.num_buses = RTL9300_NUM_BUSES,
 	.num_ports = RTL9300_NUM_PORTS,
 	.num_pages = RTL9300_NUM_PAGES,
+	.poll_ctrl = RTL9300_SMI_POLL_CTRL,
 	.setup_controller = otto_emdio_9300_setup_controller,
 	.read_c22 = otto_emdio_9300_read_c22,
 	.read_c45 = otto_emdio_9300_read_c45,
@@ -736,6 +1110,7 @@ static const struct otto_emdio_info otto_emdio_9310_info = {
 	.num_buses = RTL9310_NUM_BUSES,
 	.num_pages = RTL9310_NUM_PAGES,
 	.num_ports = RTL9310_NUM_PORTS,
+	.poll_ctrl = RTL9310_SMI_PORT_POLLING_CTRL,
 	.setup_controller = otto_emdio_9310_setup_controller,
 	.read_c22 = otto_emdio_9310_read_c22,
 	.read_c45 = otto_emdio_9310_read_c45,
@@ -744,6 +1119,8 @@ static const struct otto_emdio_info otto_emdio_9310_info = {
 };
 
 static const struct of_device_id otto_emdio_ids[] = {
+	{ .compatible = "realtek,rtl8380-mdio", .data = &otto_emdio_8380_info },
+	{ .compatible = "realtek,rtl8391-mdio", .data = &otto_emdio_8390_info },
 	{ .compatible = "realtek,rtl9301-mdio", .data = &otto_emdio_9300_info },
 	{ .compatible = "realtek,rtl9311-mdio", .data = &otto_emdio_9310_info },
 	{}
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 94b2e85e00a379..38b31fc272d7d1 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1734,6 +1734,95 @@ static bool phy_drv_supports_irq(const struct phy_driver *phydrv)
 	return phydrv->config_intr && phydrv->handle_interrupt;
 }
 
+static void __phy_detach(struct phy_device *phydev, bool notify_bus)
+{
+	struct net_device *dev = phydev->attached_dev;
+	struct module *ndev_owner = NULL;
+	struct mii_bus *bus;
+
+	if (phydev->devlink) {
+		device_link_del(phydev->devlink);
+		phydev->devlink = NULL;
+	}
+
+	if (phydev->sysfs_links) {
+		if (dev)
+			sysfs_remove_link(&dev->dev.kobj, "phydev");
+		sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev");
+	}
+
+	if (!phydev->attached_dev)
+		sysfs_remove_file(&phydev->mdio.dev.kobj,
+				  &dev_attr_phy_standalone.attr);
+
+	phy_suspend(phydev);
+	if (dev) {
+		struct hwtstamp_provider *hwprov;
+
+		/* hwprov may technically be protected by ops lock but
+		 * not for devices with a phydev, see phy_link_topo_add_phy()
+		 */
+		hwprov = rtnl_dereference(dev->hwprov);
+		/* Disable timestamp if it is the one selected */
+		if (hwprov && hwprov->phydev == phydev) {
+			rcu_assign_pointer(dev->hwprov, NULL);
+			kfree_rcu(hwprov, rcu_head);
+		}
+
+		phydev->attached_dev->phydev = NULL;
+		phydev->attached_dev = NULL;
+		phy_link_topo_del_phy(dev, phydev);
+	}
+
+	phydev->phy_link_change = NULL;
+	phydev->phylink = NULL;
+
+	if (notify_bus && phydev->mdio.bus->notify_phy_detach)
+		phydev->mdio.bus->notify_phy_detach(phydev);
+
+	if (phydev->mdio.dev.driver)
+		module_put(phydev->mdio.dev.driver->owner);
+
+	/* If the device had no specific driver before (i.e. - it
+	 * was using the generic driver), we unbind the device
+	 * from the generic driver so that there's a chance a
+	 * real driver could be loaded
+	 */
+	if (phydev->is_genphy_driven) {
+		device_release_driver(&phydev->mdio.dev);
+		phydev->is_genphy_driven = 0;
+	}
+
+	/* Assert the reset signal */
+	phy_device_reset(phydev, 1);
+
+	/*
+	 * The phydev might go away on the put_device() below, so avoid
+	 * a use-after-free bug by reading the underlying bus first.
+	 */
+	bus = phydev->mdio.bus;
+
+	put_device(&phydev->mdio.dev);
+	if (dev)
+		ndev_owner = dev->dev.parent->driver->owner;
+	if (ndev_owner != bus->owner)
+		module_put(bus->owner);
+}
+
+/**
+ * phy_detach - detach a PHY device from its network device
+ * @phydev: target phy_device struct
+ *
+ * This detaches the phy device from its network device and the phy
+ * driver, and drops the reference count taken in phy_attach_direct().
+ */
+void phy_detach(struct phy_device *phydev)
+{
+	/* cleanup including bus notification */
+	__phy_detach(phydev, true);
+}
+EXPORT_SYMBOL(phy_detach);
+
 /**
  * phy_attach_direct - attach a network device to a given PHY device pointer
  * @dev: network device to attach
@@ -1876,6 +1965,12 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 	if (err)
 		goto error;
 
+	if (phydev->mdio.bus->notify_phy_attach) {
+		err = phydev->mdio.bus->notify_phy_attach(phydev);
+		if (err)
+			goto error;
+	}
+
 	phy_resume(phydev);
 
 	/**
@@ -1890,8 +1985,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 	return err;
 
 error:
-	/* phy_detach() does all of the cleanup below */
-	phy_detach(phydev);
+	/* cleanup without bus notification */
+	__phy_detach(phydev, false);
 	return err;
 
 error_module_put:
@@ -1906,86 +2001,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 }
 EXPORT_SYMBOL(phy_attach_direct);
 
-/**
- * phy_detach - detach a PHY device from its network device
- * @phydev: target phy_device struct
- *
- * This detaches the phy device from its network device and the phy
- * driver, and drops the reference count taken in phy_attach_direct().
- */
-void phy_detach(struct phy_device *phydev)
-{
-	struct net_device *dev = phydev->attached_dev;
-	struct module *ndev_owner = NULL;
-	struct mii_bus *bus;
-
-	if (phydev->devlink) {
-		device_link_del(phydev->devlink);
-		phydev->devlink = NULL;
-	}
-
-	if (phydev->sysfs_links) {
-		if (dev)
-			sysfs_remove_link(&dev->dev.kobj, "phydev");
-		sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev");
-	}
-
-	if (!phydev->attached_dev)
-		sysfs_remove_file(&phydev->mdio.dev.kobj,
-				  &dev_attr_phy_standalone.attr);
-
-	phy_suspend(phydev);
-	if (dev) {
-		struct hwtstamp_provider *hwprov;
-
-		/* hwprov may technically be protected by ops lock but
-		 * not for devices with a phydev, see phy_link_topo_add_phy()
-		 */
-		hwprov = rtnl_dereference(dev->hwprov);
-		/* Disable timestamp if it is the one selected */
-		if (hwprov && hwprov->phydev == phydev) {
-			rcu_assign_pointer(dev->hwprov, NULL);
-			kfree_rcu(hwprov, rcu_head);
-		}
-
-		phydev->attached_dev->phydev = NULL;
-		phydev->attached_dev = NULL;
-		phy_link_topo_del_phy(dev, phydev);
-	}
-
-	phydev->phy_link_change = NULL;
-	phydev->phylink = NULL;
-
-	if (phydev->mdio.dev.driver)
-		module_put(phydev->mdio.dev.driver->owner);
-
-	/* If the device had no specific driver before (i.e. - it
-	 * was using the generic driver), we unbind the device
-	 * from the generic driver so that there's a chance a
-	 * real driver could be loaded
-	 */
-	if (phydev->is_genphy_driven) {
-		device_release_driver(&phydev->mdio.dev);
-		phydev->is_genphy_driven = 0;
-	}
-
-	/* Assert the reset signal */
-	phy_device_reset(phydev, 1);
-
-	/*
-	 * The phydev might go away on the put_device() below, so avoid
-	 * a use-after-free bug by reading the underlying bus first.
-	 */
-	bus = phydev->mdio.bus;
-
-	put_device(&phydev->mdio.dev);
-	if (dev)
-		ndev_owner = dev->dev.parent->driver->owner;
-	if (ndev_owner != bus->owner)
-		module_put(bus->owner);
-}
-EXPORT_SYMBOL(phy_detach);
-
 int phy_suspend(struct phy_device *phydev)
 {
 	struct net_device *netdev = phydev->attached_dev;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 11092c3175b3de..849dd43a11b4e9 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -376,6 +376,24 @@ struct mii_bus {
 			 int regnum, u16 val);
 	/** @reset: Perform a reset of the bus */
 	int (*reset)(struct mii_bus *bus);
+	/**
+	 * @notify_phy_attach: Perform post-attach handling for MDIO bus
+	 *   drivers. Called in phy_attach_direct() right after phy_init_hw()
+	 *   and before phy_resume(). At this point, the PHY is still
+	 *   suspended, and @phydev->attached_dev may be NULL (e.g. for
+	 *   standalone PHYs). Runs in process context and may sleep. Return
+	 *   0 on success or a negative errno on failure (which aborts the
+	 *   attach sequence).
+	 */
+	int (*notify_phy_attach)(struct phy_device *phydev);
+	/**
+	 * @notify_phy_detach: Perform pre-detach handling for MDIO bus
+	 *   drivers. Called in phy_detach() after phy_suspend() and link
+	 *   cleanup, but before driver unbind and device reference release.
+	 *   Runs in process context and may sleep. Only invoked if
+	 *   @notify_phy_attach was previously called and succeeded.
+	 */
+	void (*notify_phy_detach)(struct phy_device *phydev);
 
 	/** @stats: Statistic counters per device on the bus */
 	struct mdio_bus_stats stats[PHY_MAX_ADDR];

3/2 2026/07/25 10:03 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 15434
							output: 27
							thoughts: 505
						

Thoughts:
**Analyzing the Scope and Reachability of a PHY Patch**

Okay, so I've got a patch here that's touching a few key areas related to PHY handling and a specific Realtek MDIO controller, specifically aimed at adding support for some of their Otto Switches. Let's break down the implications, especially regarding fuzzing opportunities.

First off, I see it's modifying the device tree binding, the MDIO driver (`mdio-realtek-rtl9300.c`), core PHY code (`phy_device.c`), and the core PHY header (`phy.h`). My immediate thought is, what's the broader impact beyond this specific Realtek hardware?

The core PHY changes in `phy_device.c` are definitely interesting. We're seeing the introduction of `notify_phy_attach` and `notify_phy_detach` callbacks to the `mii_bus` structure. Looking at the code, it looks like `__phy_detach` is getting pulled out and used in more places. `phy_attach_direct` now includes a call to `notify_phy_attach`, and `phy_detach` calls `__phy_detach`, which in turn, *conditionally* calls `notify_phy_detach`. These are generic PHY functions, so they're used everywhere.

Originally, I thought these new callbacks were only relevant to the Realtek MDIO driver, but they're added to the `mii_bus` which makes them available to any network driver. *Any* network driver can use this. These core changes are definitely worth a fuzzing consideration, as `phy_attach_direct` and `phy_detach` are heavily used and the modifications affect them.

Now, let's turn our attention to `mdio-realtek-rtl9300.c`. This is a platform driver, so it's a bit more specific. Can it be fuzzed? Being an MDIO driver, it probably interacts directly with the hardware through MDIO registers. I'll need to check if the `CONFIG_MDIO_REALTEK_RTL9300` Kconfig option is enabled to know for sure if it's even compiled in. If it's enabled, we've got an interesting target for fuzzing.



4/2 2026/07/25 10:03 tool grepper
0m Args:
{
  "Expression": "MDIO_REALTEK_RTL9300"
}

Results:
{
  "Output": "drivers/net/mdio/Kconfig=166=config MDIO_IPQ8064\n--\ndrivers/net/mdio/Kconfig-173-\ndrivers/net/mdio/Kconfig:174:config MDIO_REALTEK_RTL9300\ndrivers/net/mdio/Kconfig-175-\ttristate \"Realtek RTL9300 MDIO interface support\"\n--\ndrivers/net/mdio/Makefile=23=obj-$(CONFIG_MDIO_PIC64HPSC)\t\t+= mdio-pic64hpsc.o\ndrivers/net/mdio/Makefile:24:obj-$(CONFIG_MDIO_REALTEK_RTL9300)\t+= mdio-realtek-rtl9300.o\ndrivers/net/mdio/Makefile-25-obj-$(CONFIG_MDIO_REGMAP)\t\t+= mdio-regmap.o\n"
}

5/2 2026/07/25 10:03 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 16687
							output: 28
							thoughts: 22
						

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

**Assessing the Landscape: `MDIO_REALTEK_RTL9300` Dependencies**

Okay, time to dive into the dependencies of `MDIO_REALTEK_RTL9300`. It's crucial, as always, to understand the foundational layers upon which this component relies. This will dictate its integration strategy, potential troubleshooting areas, and ultimately, the scope of any modifications or optimizations I might undertake. I need to know: are there any implicit dependencies I should keep in mind, or any documented ones? Are these dependencies well-maintained? Where are their sources, which versions are supported, and are there known conflicts? I'll probably start by grepping the code for its name, its associated header files, and any related configuration files to construct a dependency tree. From there, I can assess the impact of changes in the broader system. I'm thinking I'll create a mental map of this dependency ecosystem and keep it in mind as I begin, this will pay dividends later.



6/2 2026/07/25 10:03 tool grepper
0m Args:
{
  "Expression": "config MDIO_REALTEK_RTL9300"
}

Results:
{
  "Output": "drivers/net/mdio/Kconfig=166=config MDIO_IPQ8064\n--\ndrivers/net/mdio/Kconfig-173-\ndrivers/net/mdio/Kconfig:174:config MDIO_REALTEK_RTL9300\ndrivers/net/mdio/Kconfig-175-\ttristate \"Realtek RTL9300 MDIO interface support\"\n"
}

7/2 2026/07/25 10:03 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 17077
							output: 37
							thoughts: 22
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into the MDIO Kconfig**

Okay, time to get my hands dirty. I'm going to jump into the `drivers/net/mdio/Kconfig` file. I'm specifically interested in what's going on around line 174. I'm assuming that it is the most likely location for a configuration option or dependency that I need to clarify, or where some important logic resides. I'll need to see the context there to understand how it's defined and any relevant conditional logic. Let's see what gems we can find in the configuration.



8/2 2026/07/25 10:03 tool read-file
0m Args:
{
  "File": "drivers/net/mdio/Kconfig",
  "FirstLine": 165,
  "LineCount": 20
}

Results:
{
  "Contents": " 165:\t\n 166:\tconfig MDIO_IPQ8064\n 167:\t\ttristate \"Qualcomm IPQ8064 MDIO interface support\"\n 168:\t\tdepends on HAS_IOMEM \u0026\u0026 OF_MDIO\n 169:\t\tdepends on MFD_SYSCON\n 170:\t\thelp\n 171:\t\t  This driver supports the MDIO interface found in the network\n 172:\t\t  interface units of the IPQ8064 SoC\n 173:\t\n 174:\tconfig MDIO_REALTEK_RTL9300\n 175:\t\ttristate \"Realtek RTL9300 MDIO interface support\"\n 176:\t\tdepends on MACH_REALTEK_RTL || COMPILE_TEST\n 177:\t\thelp\n 178:\t\t  This driver supports the MDIO interface found in the Realtek\n 179:\t\t  RTL9300 family of Ethernet switches with integrated SoC.\n 180:\t\n 181:\tconfig MDIO_REGMAP\n 182:\t\ttristate\n 183:\t\thelp\n 184:\t\t  This driver allows using MDIO devices that are not sitting on a\n"
}

9/2 2026/07/25 10:03 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 17602
							output: 19
							thoughts: 229
						

Thoughts:
**Fuzzing Target Identification**

Okay, so this functionality is guarded by either `MACH_REALTEK_RTL` or `COMPILE_TEST` preprocessor definitions. That means I can easily enable it for fuzzing by just defining `COMPILE_TEST`. Excellent.

Right, I'm confident the core changes in `phy_device.c` are fully functional and easily accessible. `phy_attach_direct` and `phy_detach` are heavily utilized, which is promising. I see the refactoring where `phy_detach` was split into `__phy_detach`, and calls to `notify_phy_attach` and `notify_phy_detach` were added. Given these changes, this is a prime target for fuzzing.

Now, let's pinpoint some specific functions to focus on. `phy_attach_direct` and `phy_detach` are definitely strong candidates, given their widespread use and the recent changes. Additionally, I should consider `otto_emdio_probe`, `otto_emdio_notify_phy_attach`, and `otto_emdio_notify_phy_detach`.

I'll start by examining `phy_attach_direct` and `phy_detach` in `drivers/net/phy/phy_device.c` in more detail.



10/2 2026/07/25 10:03 tool grepper
0m Args:
{
  "Expression": "phy_attach_direct"
}

Results:
{
  "Output": "Documentation/networking/phy-link-topology.rst=85=These function are already hooked into the phylib subsystem, so all PHYs that\nDocumentation/networking/phy-link-topology.rst:86:are linked to a net_device through :c:func:`phy_attach_direct` will automatically\nDocumentation/networking/phy-link-topology.rst-87-join the netdev's topology.\n--\nDocumentation/networking/sfp-phylink.rst=74=this documentation.\n--\nDocumentation/networking/sfp-phylink.rst-165-   For the most part, ``flags`` can be zero; these flags are passed to\nDocumentation/networking/sfp-phylink.rst:166:   the phy_attach_direct() inside this function call if a PHY is specified\nDocumentation/networking/sfp-phylink.rst-167-   in the DT node ``node``.\n--\ndrivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c=931=static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)\n--\ndrivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c-982-\ndrivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:983:\tret = phy_attach_direct(pdata-\u003enetdev, phydev, phydev-\u003edev_flags,\ndrivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c-984-\t\t\t\tPHY_INTERFACE_MODE_SGMII);\ndrivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c-985-\tif (ret) {\ndrivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:986:\t\tnetdev_err(pdata-\u003enetdev, \"phy_attach_direct failed\\n\");\ndrivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c-987-\t\tphy_device_remove(phydev);\n--\ndrivers/net/ethernet/hisilicon/hns/hns_enet.c=1159=int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)\n--\ndrivers/net/ethernet/hisilicon/hns/hns_enet.c-1180-\t} else {\ndrivers/net/ethernet/hisilicon/hns/hns_enet.c:1181:\t\tret = phy_attach_direct(ndev, phy_dev, 0, h-\u003ephy_if);\ndrivers/net/ethernet/hisilicon/hns/hns_enet.c-1182-\t}\n--\ndrivers/net/phy/phy_device.c=1225=int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,\n--\ndrivers/net/phy/phy_device.c-1233-\ndrivers/net/phy/phy_device.c:1234:\trc = phy_attach_direct(dev, phydev, phydev-\u003edev_flags, interface);\ndrivers/net/phy/phy_device.c-1235-\tif (rc)\n--\ndrivers/net/phy/phy_device.c=1737=static void __phy_detach(struct phy_device *phydev, bool notify_bus)\n--\ndrivers/net/phy/phy_device.c-1816- * This detaches the phy device from its network device and the phy\ndrivers/net/phy/phy_device.c:1817: * driver, and drops the reference count taken in phy_attach_direct().\ndrivers/net/phy/phy_device.c-1818- */\n--\ndrivers/net/phy/phy_device.c=1824=EXPORT_SYMBOL(phy_detach);\n--\ndrivers/net/phy/phy_device.c-1826-/**\ndrivers/net/phy/phy_device.c:1827: * phy_attach_direct - attach a network device to a given PHY device pointer\ndrivers/net/phy/phy_device.c-1828- * @dev: network device to attach\n--\ndrivers/net/phy/phy_device.c-1840- */\ndrivers/net/phy/phy_device.c:1841:int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,\ndrivers/net/phy/phy_device.c-1842-\t\t      u32 flags, phy_interface_t interface)\n--\ndrivers/net/phy/phy_device.c-2001-}\ndrivers/net/phy/phy_device.c:2002:EXPORT_SYMBOL(phy_attach_direct);\ndrivers/net/phy/phy_device.c-2003-\n--\ndrivers/net/phy/phylink.c=2203=static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy,\n--\ndrivers/net/phy/phylink.c-2218-\ndrivers/net/phy/phylink.c:2219:\treturn phy_attach_direct(pl-\u003enetdev, phy, flags, interface);\ndrivers/net/phy/phylink.c-2220-}\n--\ndrivers/net/phy/phylink.c-2227- * Connect @phy to the phylink instance specified by @pl by calling\ndrivers/net/phy/phylink.c:2228: * phy_attach_direct(). Configure the @phy according to the MAC driver's\ndrivers/net/phy/phylink.c-2229- * capabilities, start the PHYLIB state machine and enable any interrupts\n--\ndrivers/net/phy/phylink.c=2289=int phylink_fwnode_phy_connect(struct phylink *pl,\n--\ndrivers/net/phy/phylink.c-2322-\ndrivers/net/phy/phylink.c:2323:\tret = phy_attach_direct(pl-\u003enetdev, phy_dev, flags,\ndrivers/net/phy/phylink.c-2324-\t\t\t\tpl-\u003elink_interface);\n--\ninclude/linux/phy.h=363=struct mii_bus {\n--\ninclude/linux/phy.h-380-\t * @notify_phy_attach: Perform post-attach handling for MDIO bus\ninclude/linux/phy.h:381:\t *   drivers. Called in phy_attach_direct() right after phy_init_hw()\ninclude/linux/phy.h-382-\t *   and before phy_resume(). At this point, the PHY is still\n--\ninclude/linux/phy.h=2187=struct phy_device *phy_find_next(struct mii_bus *bus, struct phy_device *pos);\ninclude/linux/phy.h:2188:int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,\ninclude/linux/phy.h-2189-\t\t      u32 flags, phy_interface_t interface);\n"
}

11/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 19885
							output: 27
							thoughts: 232
						

Thoughts:
**Analyzing Kbuild Dependencies**

Okay, so I've been looking over these code changes, specifically in `phy_device.c` and `mdio-realtek-rtl9300.c`. It's pretty clear that the changes in `phy_device.c` are straightforward and reachable. However, the `mdio-realtek-rtl9300.c` stuff is a bit more conditional. I can reach that code path *if* I enable `MDIO_REALTEK_RTL9300`.

Now, the important question is: what other configurations does `MDIO_REALTEK_RTL9300` depend on? Let's trace those dependencies. It looks like it boils down to `MACH_REALTEK_RTL || COMPILE_TEST`. So, I've got two clear paths here to enable `MDIO_REALTEK_RTL9300`: I can either enable `COMPILE_TEST` along with it, or I can just list both `MDIO_REALTEK_RTL9300` and `COMPILE_TEST`. Either way, I'm covered.

Hang on a second… Right, the prompt specifically wants me to pay attention to "depends on" lines in the Kconfig files, focusing on any non-standard parent subsystem configs that are *needed* for a static build into vmlinux. Okay, so I should be looking for those dependencies, and listing those dependencies in my `EnableConfigs` output. It also tells me not to prefix them with `CONFIG_`. Just need to re-check `drivers/net/mdio/Kconfig` to make sure I haven't missed anything.



12/2 2026/07/25 10:04 tool grepper
0m Args:
{
  "Expression": "MDIO_REALTEK_RTL9300"
}

Results:
{
  "Output": "drivers/net/mdio/Kconfig=166=config MDIO_IPQ8064\n--\ndrivers/net/mdio/Kconfig-173-\ndrivers/net/mdio/Kconfig:174:config MDIO_REALTEK_RTL9300\ndrivers/net/mdio/Kconfig-175-\ttristate \"Realtek RTL9300 MDIO interface support\"\n--\ndrivers/net/mdio/Makefile=23=obj-$(CONFIG_MDIO_PIC64HPSC)\t\t+= mdio-pic64hpsc.o\ndrivers/net/mdio/Makefile:24:obj-$(CONFIG_MDIO_REALTEK_RTL9300)\t+= mdio-realtek-rtl9300.o\ndrivers/net/mdio/Makefile-25-obj-$(CONFIG_MDIO_REGMAP)\t\t+= mdio-regmap.o\n"
}

13/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 20747
							output: 20
							thoughts: 18
						

Thoughts:
Here's my take on those thoughts:

**Analyzing the MDIO Kconfig Dependency Tree**

Okay, time to dig into the `drivers/net/mdio/Kconfig` file. I need to understand its parent configuration dependencies. This is crucial for figuring out how the MDIO driver's options are exposed and how they interact with the rest of the network stack. I'm going to quickly scan the file to trace back what settings *enable* or *disable* the MDIO driver, and by extension, specific MDIO controllers. Knowing the dependencies helps pinpoint potential conflicts and understand the bigger picture of the network configuration. I need to be able to trace the decisions that affect whether MDIO support gets compiled into the kernel. This also lets me understand how other subsystems depend on the MDIO configuration.



14/2 2026/07/25 10:04 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "menuconfig MDIO_DEVICE"
}

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

15/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 20966
							output: 35
							thoughts: 18
						

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

**Kconfig Dive**

Alright, time to dive in. My immediate thought is to start at the top of the `drivers/net/mdio/Kconfig` file. Given the context, I'm likely trying to understand the configuration options related to MDIO drivers within the kernel. Checking the Kconfig is the first logical step. It will give me a quick overview of what options are available, their dependencies, and any default settings. This will set the stage for further investigation, whether it's understanding the nuances of a specific MDIO controller implementation or resolving a build issue. Grabbing this initial overview is the quickest way to ground myself in what’s configurable at this level. Let's see what we can find.



16/2 2026/07/25 10:04 tool read-file
0m Args:
{
  "File": "drivers/net/mdio/Kconfig",
  "FirstLine": 1,
  "LineCount": 20
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# MDIO Layer Configuration\n   4:\t#\n   5:\t\n   6:\tmenu \"MDIO controller drivers\"\n   7:\t\tdepends on PHYLIB\n   8:\t\n   9:\tconfig FWNODE_MDIO\n  10:\t\tdef_tristate (ACPI || OF) || COMPILE_TEST\n  11:\t\thelp\n  12:\t\t  FWNODE MDIO bus (Ethernet PHY) accessors\n  13:\t\n  14:\tconfig OF_MDIO\n  15:\t\tdef_tristate OF\n  16:\t\tselect FIXED_PHY\n  17:\t\thelp\n  18:\t\t  OpenFirmware MDIO bus (Ethernet PHY) accessors\n  19:\t\n  20:\tconfig ACPI_MDIO\n"
}

17/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 21412
							output: 19
							thoughts: 136
						

Thoughts:
**Analyzing the RTL9300 MDIO Driver Configuration**

Okay, so I'm looking at this configuration and immediately the dependency on `PHYLIB` jumps out. That's a given; it's practically ubiquitous in these sorts of setups. I'll make sure `MDIO_REALTEK_RTL9300`, `COMPILE_TEST`, and of course `PHYLIB` are included. Although `PHYLIB` is likely enabled by default, I'll explicitly include it for clarity.

Now, let me just double-check if there are any *other* dependencies for `MDIO_REALTEK_RTL9300`. Ah, yes, it depends on `MACH_REALTEK_RTL` *or* `COMPILE_TEST`. Excellent, so if `COMPILE_TEST` is enabled, that covers everything. That simplifies things.

To be absolutely certain about the implementation details, I'll quickly glance at `mdio-realtek-rtl9300.c` itself. I need to refresh my memory and pinpoint any crucial functions or specific logic the configuration hinges upon. This will make certain that the chosen config options and dependencies are adequate.



18/2 2026/07/25 10:04 tool grepper
0m Args:
{
  "Expression": "otto_emdio_"
}

Results:
{
  "Output": "drivers/net/mdio/mdio-realtek-rtl9300.c-234-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:235:struct otto_emdio_cmd_regs {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-236-\tu32 c22_data;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-245-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:246:struct otto_emdio_priv {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:247:\tconst struct otto_emdio_info *info;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-248-\tstruct regmap *regmap;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-258-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:259:struct otto_emdio_info {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-260-\tu32 addr_map_base;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-264-\tu32 cmd_write;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:265:\tstruct otto_emdio_cmd_regs cmd_regs;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-266-\tu8 num_buses;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-269-\tu32 poll_ctrl;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:270:\tint (*setup_controller)(struct otto_emdio_priv *priv);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-271-\tint (*read_c22)(struct mii_bus *bus, int port, int regnum, u32 *value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-276-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:277:struct otto_emdio_chan {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:278:\tstruct otto_emdio_priv *priv;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-279-\tu8 mdio_bus;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-281-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:282:static int otto_emdio_phy_to_port(struct mii_bus *bus, int phy_id)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-283-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:284:\tstruct otto_emdio_chan *chan = bus-\u003epriv;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:285:\tstruct otto_emdio_priv *priv;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-286-\tint i;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-297-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:298:static struct otto_emdio_priv *otto_emdio_bus_to_priv(struct mii_bus *bus)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-299-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:300:\tstruct otto_emdio_chan *chan = bus-\u003epriv;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-301-\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-304-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:305:static int otto_emdio_set_port_polling(struct otto_emdio_priv *priv, int port, bool active)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-306-{\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-310-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:311:static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:312:\t\t\t      struct otto_emdio_cmd_regs *cmd_data)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-313-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:314:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:315:\tconst struct otto_emdio_info *info = priv-\u003einfo;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-316-\tu32 cmdstate;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-367-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:368:static int otto_emdio_read_cmd(struct mii_bus *bus, u32 cmd,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:369:\t\t\t       struct otto_emdio_cmd_regs *cmd_data, u32 mask, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-370-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:371:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-372-\tint ret;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-374-\tlockdep_assert_held(\u0026priv-\u003elock);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:375:\tret = otto_emdio_run_cmd(bus, cmd | priv-\u003einfo-\u003ecmd_read, cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-376-\tif (ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-387-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:388:static int otto_emdio_write_cmd(struct mii_bus *bus, u32 cmd,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:389:\t\t\t\tstruct otto_emdio_cmd_regs *cmd_data)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-390-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:391:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-392-\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-394-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:395:\treturn otto_emdio_run_cmd(bus, cmd | priv-\u003einfo-\u003ecmd_write, cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-396-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-397-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:398:static int otto_emdio_8380_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-399-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:400:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:401:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-402-\t\t.c22_data\t= FIELD_PREP(RTL8380_PHY_CTRL_REG_ADDR, regnum) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-407-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:408:\treturn otto_emdio_read_cmd(bus, RTL8380_PHY_CTRL_TYPE_C22, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-409-\t\t\t\t   RTL8380_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-411-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:412:static int otto_emdio_8380_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-413-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:414:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:415:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-416-\t\t.c22_data\t= FIELD_PREP(RTL8380_PHY_CTRL_REG_ADDR, regnum) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-422-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:423:\treturn otto_emdio_write_cmd(bus, RTL8380_PHY_CTRL_TYPE_C22, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-424-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-425-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:426:static int otto_emdio_8380_read_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-427-\t\t\t\t    int dev_addr, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-428-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:429:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-430-\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-434-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:435:\treturn otto_emdio_read_cmd(bus, RTL8380_PHY_CTRL_TYPE_C45, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-436-\t\t\t\t   RTL8380_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-438-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:439:static int otto_emdio_8380_write_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-440-\t\t\t\t     int dev_addr, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-441-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:442:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-443-\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-448-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:449:\treturn otto_emdio_write_cmd(bus, RTL8380_PHY_CTRL_TYPE_C45, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-450-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-451-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:452:static int otto_emdio_8390_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-453-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:454:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:455:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-456-\t\t.c22_data\t= FIELD_PREP(RTL8390_PHY_CTRL_REG_ADDR, regnum) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-461-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:462:\treturn otto_emdio_read_cmd(bus, RTL8390_PHY_CTRL_TYPE_C22, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-463-\t\t\t\t   RTL8390_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-465-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:466:static int otto_emdio_8390_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-467-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:468:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:469:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-470-\t\t.c22_data\t= FIELD_PREP(RTL8390_PHY_CTRL_REG_ADDR, regnum) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-477-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:478:\treturn otto_emdio_write_cmd(bus, RTL8390_PHY_CTRL_TYPE_C22, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-479-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-480-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:481:static int otto_emdio_8390_read_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-482-\t\t\t\t    int dev_addr, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-483-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:484:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-485-\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-489-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:490:\treturn otto_emdio_read_cmd(bus, RTL8390_PHY_CTRL_TYPE_C45, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-491-\t\t\t\t   RTL8390_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-493-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:494:static int otto_emdio_8390_write_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-495-\t\t\t\t     int dev_addr, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-496-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:497:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-498-\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-504-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:505:\treturn otto_emdio_write_cmd(bus, RTL8390_PHY_CTRL_TYPE_C45, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-506-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-507-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:508:static int otto_emdio_9300_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-509-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:510:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:511:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-512-\t\t.c22_data\t= FIELD_PREP(RTL9300_PHY_CTRL_REG_ADDR, regnum) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-517-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:518:\treturn otto_emdio_read_cmd(bus, RTL9300_PHY_CTRL_TYPE_C22, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-519-\t\t\t\t   RTL9300_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-521-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:522:static int otto_emdio_9300_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-523-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:524:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:525:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-526-\t\t.c22_data\t= FIELD_PREP(RTL9300_PHY_CTRL_REG_ADDR, regnum) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-532-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:533:\treturn otto_emdio_write_cmd(bus, RTL9300_PHY_CTRL_TYPE_C22, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-534-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-535-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:536:static int otto_emdio_9300_read_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-537-\t\t\t\t    int dev_addr, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-538-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:539:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-540-\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-544-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:545:\treturn otto_emdio_read_cmd(bus, RTL9300_PHY_CTRL_TYPE_C45, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-546-\t\t\t\t   RTL9300_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-548-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:549:static int otto_emdio_9300_write_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-550-\t\t\t\t     int dev_addr, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-551-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:552:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-553-\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-558-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:559:\treturn otto_emdio_write_cmd(bus, RTL9300_PHY_CTRL_TYPE_C45, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-560-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-561-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:562:static int otto_emdio_9310_read_c22(struct mii_bus *bus, int port, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-563-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:564:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:565:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-566-\t\t.broadcast\t= FIELD_PREP(RTL9310_BC_PORT_ID, port),\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-570-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:571:\treturn otto_emdio_read_cmd(bus, RTL9310_PHY_CTRL_TYPE_C22, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-572-\t\t\t\t   RTL9310_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-574-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:575:static int otto_emdio_9310_write_c22(struct mii_bus *bus, int port, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-576-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:577:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:578:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-579-\t\t.c22_data\t= FIELD_PREP(RTL9310_PHY_CTRL_REG_ADDR, regnum) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-585-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:586:\treturn otto_emdio_write_cmd(bus, RTL9310_PHY_CTRL_TYPE_C22, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-587-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-588-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:589:static int otto_emdio_9310_read_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-590-\t\t\t\t    int dev_addr, int regnum, u32 *value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-591-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:592:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-593-\t\t.broadcast\t= FIELD_PREP(RTL9310_BC_PORT_ID, port),\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-597-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:598:\treturn otto_emdio_read_cmd(bus, RTL9310_PHY_CTRL_TYPE_C45, \u0026cmd_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-599-\t\t\t\t   RTL9310_PHY_CTRL_DATA, value);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-601-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:602:static int otto_emdio_9310_write_c45(struct mii_bus *bus, int port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-603-\t\t\t\t     int dev_addr, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-604-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:605:\tstruct otto_emdio_cmd_regs cmd_data = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-606-\t\t.c45_data\t= FIELD_PREP(PHY_CTRL_MMD_DEVAD, dev_addr) |\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-612-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:613:\treturn otto_emdio_write_cmd(bus, RTL9310_PHY_CTRL_TYPE_C45, \u0026cmd_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-614-}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-615-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:616:static int otto_emdio_read_c22(struct mii_bus *bus, int phy_id, int regnum)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-617-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:618:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-619-\tint ret, port;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-621-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:622:\tport = otto_emdio_phy_to_port(bus, phy_id);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-623-\tif (port \u003c 0)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-635-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:636:static int otto_emdio_write_c22(struct mii_bus *bus, int phy_id, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-637-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:638:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-639-\tint ret, port;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-640-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:641:\tport = otto_emdio_phy_to_port(bus, phy_id);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-642-\tif (port \u003c 0)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-659-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:660:static int otto_emdio_read_c45(struct mii_bus *bus, int phy_id, int dev_addr, int regnum)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-661-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:662:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-663-\tint ret, port;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-665-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:666:\tport = otto_emdio_phy_to_port(bus, phy_id);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-667-\tif (port \u003c 0)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-675-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:676:static int otto_emdio_write_c45(struct mii_bus *bus, int phy_id,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-677-\t\t\t\tint dev_addr, int regnum, u16 value)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-678-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:679:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-680-\tint ret, port;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-681-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:682:\tport = otto_emdio_phy_to_port(bus, phy_id);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-683-\tif (port \u003c 0)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-691-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:692:static int otto_emdio_write_mapping(struct otto_emdio_priv *priv, u32 base, u32 port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-693-\t\t\t\t    u32 vals_per_reg, u32 bits_per_val, u32 value)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-701-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:702:static int otto_emdio_setup_topology(struct otto_emdio_priv *priv)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-703-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:704:\tconst struct otto_emdio_info *info = priv-\u003einfo;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-705-\tu32 port;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-709-\t\tif (info-\u003ebus_map_base) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:710:\t\t\tret = otto_emdio_write_mapping(priv, info-\u003ebus_map_base, port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-711-\t\t\t\t\t\t       MAP_BUSES_PER_REG, MAP_BITS_PER_BUS,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-716-\t\tif (info-\u003eaddr_map_base) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:717:\t\t\tret = otto_emdio_write_mapping(priv, info-\u003eaddr_map_base, port,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-718-\t\t\t\t\t\t       MAP_ADDRS_PER_REG, MAP_BITS_PER_ADDR,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-727-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:728:static int otto_emdio_8380_setup_controller(struct otto_emdio_priv *priv)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-729-{\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-736-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:737:static int otto_emdio_9300_setup_controller(struct otto_emdio_priv *priv)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-738-{\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-756-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:757:static int otto_emdio_9310_setup_controller(struct otto_emdio_priv *priv)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-758-{\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-772-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:773:static int otto_emdio_notify_phy_attach(struct phy_device *phydev)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-774-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:775:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(phydev-\u003emdio.bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:776:\tint port = otto_emdio_phy_to_port(phydev-\u003emdio.bus, phydev-\u003emdio.addr);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:777:\tstruct otto_emdio_chan *chan = phydev-\u003emdio.bus-\u003epriv;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-778-\tint ret;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-789-\tscoped_guard(mutex, \u0026priv-\u003elock) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:790:\t\tret = otto_emdio_set_port_polling(priv, port, true);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-791-\t\tif (!ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-797-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:798:static void otto_emdio_notify_phy_detach(struct phy_device *phydev)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-799-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:800:\tstruct otto_emdio_priv *priv = otto_emdio_bus_to_priv(phydev-\u003emdio.bus);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:801:\tint port = otto_emdio_phy_to_port(phydev-\u003emdio.bus, phydev-\u003emdio.addr);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-802-\tstruct mii_bus *bus = phydev-\u003emdio.bus;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-808-\tscoped_guard(mutex, \u0026priv-\u003elock) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:809:\t\tret = otto_emdio_set_port_polling(priv, port, false);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-810-\t\tif (!ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-817-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:818:static int otto_emdio_probe_one(struct device *dev, struct otto_emdio_priv *priv,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-819-\t\t\t\t struct fwnode_handle *node)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-820-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:821:\tstruct otto_emdio_chan *chan;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-822-\tstruct mii_bus *bus;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-839-\tif (priv-\u003esmi_bus_is_c45[mdio_bus]) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:840:\t\tbus-\u003eread_c45 = otto_emdio_read_c45;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:841:\t\tbus-\u003ewrite_c45 = otto_emdio_write_c45;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-842-\t} else {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:843:\t\tbus-\u003eread = otto_emdio_read_c22;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:844:\t\tbus-\u003ewrite = otto_emdio_write_c22;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-845-\t}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-846-\tbus-\u003eparent = dev;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:847:\tbus-\u003enotify_phy_attach = otto_emdio_notify_phy_attach;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:848:\tbus-\u003enotify_phy_detach = otto_emdio_notify_phy_detach;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-849-\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-862-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:863:static struct device_node *otto_emdio_get_bus_node(struct device_node *dn)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-864-{\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-881- */\ndrivers/net/mdio/mdio-realtek-rtl9300.c:882:static int otto_emdio_map_ports(struct device *dev)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-883-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c-884-\tstruct device_node *ports_dn, *phy_dn, *bus_dn, *ctrl_dn;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:885:\tstruct otto_emdio_priv *priv = dev_get_drvdata(dev);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-886-\tstruct device *parent = dev-\u003eparent;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-902-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:903:\t\tbus_dn = otto_emdio_get_bus_node(phy_dn);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-904-\t\tif (!bus_dn)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-965-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:966:static int otto_emdio_init_polling(struct otto_emdio_priv *priv)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-967-{\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-970-\tfor (int port = 0; port \u003c priv-\u003einfo-\u003enum_ports; port++) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:971:\t\terr = otto_emdio_set_port_polling(priv, port, false);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-972-\t\tif (err)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-978-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:979:static int otto_emdio_probe(struct platform_device *pdev)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-980-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c-981-\tstruct device *dev = \u0026pdev-\u003edev;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:982:\tstruct otto_emdio_priv *priv;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-983-\tint err;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-997-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:998:\terr = otto_emdio_init_polling(priv);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-999-\tif (err)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1003-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1004:\terr = otto_emdio_map_ports(dev);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1005-\tif (err)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1007-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1008:\terr = otto_emdio_setup_topology(priv);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1009-\tif (err)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1018-\tdevice_for_each_child_node_scoped(dev, child) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1019:\t\terr = otto_emdio_probe_one(dev, priv, child);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1020-\t\tif (err)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1026-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1027:static const struct otto_emdio_info otto_emdio_8380_info = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1028-\t.addr_map_base = RTL8380_SMI_PORT0_5_ADDR_CTRL,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1041-\t.poll_ctrl = RTL8380_SMI_POLL_CTRL,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1042:\t.setup_controller = otto_emdio_8380_setup_controller,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1043:\t.read_c22 = otto_emdio_8380_read_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1044:\t.read_c45 = otto_emdio_8380_read_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1045:\t.write_c22 = otto_emdio_8380_write_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1046:\t.write_c45 = otto_emdio_8380_write_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1047-};\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1048-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1049:static const struct otto_emdio_info otto_emdio_8390_info = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1050-\t.cmd_fail = RTL8390_PHY_CTRL_FAIL,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1065-\t.poll_ctrl = RTL8390_SMI_PORT_POLLING_CTRL,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1066:\t.read_c22 = otto_emdio_8390_read_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1067:\t.read_c45 = otto_emdio_8390_read_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1068:\t.write_c22 = otto_emdio_8390_write_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1069:\t.write_c45 = otto_emdio_8390_write_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1070-};\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1071-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1072:static const struct otto_emdio_info otto_emdio_9300_info = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1073-\t.addr_map_base = RTL9300_SMI_PORT0_5_ADDR_CTRL,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1087-\t.poll_ctrl = RTL9300_SMI_POLL_CTRL,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1088:\t.setup_controller = otto_emdio_9300_setup_controller,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1089:\t.read_c22 = otto_emdio_9300_read_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1090:\t.read_c45 = otto_emdio_9300_read_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1091:\t.write_c22 = otto_emdio_9300_write_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1092:\t.write_c45 = otto_emdio_9300_write_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1093-};\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1094-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1095:static const struct otto_emdio_info otto_emdio_9310_info = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1096-\t.addr_map_base = RTL9310_SMI_PORT_ADDR_CTRL,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1113-\t.poll_ctrl = RTL9310_SMI_PORT_POLLING_CTRL,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1114:\t.setup_controller = otto_emdio_9310_setup_controller,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1115:\t.read_c22 = otto_emdio_9310_read_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1116:\t.read_c45 = otto_emdio_9310_read_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1117:\t.write_c22 = otto_emdio_9310_write_c22,\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1118:\t.write_c45 = otto_emdio_9310_write_c45,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1119-};\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1120-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1121:static const struct of_device_id otto_emdio_ids[] = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1122:\t{ .compatible = \"realtek,rtl8380-mdio\", .data = \u0026otto_emdio_8380_info },\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1123:\t{ .compatible = \"realtek,rtl8391-mdio\", .data = \u0026otto_emdio_8390_info },\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1124:\t{ .compatible = \"realtek,rtl9301-mdio\", .data = \u0026otto_emdio_9300_info },\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1125:\t{ .compatible = \"realtek,rtl9311-mdio\", .data = \u0026otto_emdio_9310_info },\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1126-\t{}\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1127-};\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1128:MODULE_DEVICE_TABLE(of, otto_emdio_ids);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1129-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1130:static struct platform_driver otto_emdio_driver = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1131:\t.probe = otto_emdio_probe,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1132-\t.driver = {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1133-\t\t.name = \"mdio-rtl9300\",\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1134:\t\t.of_match_table = otto_emdio_ids,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1135-\t},\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1137-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:1138:module_platform_driver(otto_emdio_driver);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-1139-\n"
}

19/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 37465
							output: 17
							thoughts: 753
						

Thoughts:
**Analyzing the Reachability and Fuzzing Potential of the Realtek Otto Switch MDIO Controller Driver**

Okay, here's my breakdown of what we've got here. First, I'm thinking about the key functions. We need to zero in on: `phy_attach_direct`, `phy_detach`, `otto_emdio_probe`, `otto_emdio_notify_phy_attach`, and `otto_emdio_notify_phy_detach`. Now, `otto_emdio_notify_phy_attach` is static, which is usually a red flag, but wait... it's being passed as a function pointer! Same goes for `otto_emdio_notify_phy_detach`. These aren't inlined since they are used as function pointers, so they're valid targets. `otto_emdio_probe` is a platform driver probe function, and those are almost always passed as function pointers too, making it a good choice. `phy_attach_direct` and `phy_detach` are already exported symbols, so that's a definite win.

The prompt specified preferring non-static, non-inlined API entrypoints and these fit the bill.

Now, as far as configs go, I'm pretty sure `MDIO_REALTEK_RTL9300` should be sufficient, along with `COMPILE_TEST` which is dependent.

I've double-checked `phy_attach_direct` and `phy_detach` in `drivers/net/phy/phy_device.c` – they are indeed exported symbols, just as expected.

Here's my distilled summary of the analysis:

*   **WorthFuzzing:** True - this looks promising for fuzzing.
*   **FocusSymbols:**
    *   `phy_attach_direct`
    *   `phy_detach`
    *   `otto_emdio_probe`
    *   `otto_emdio_notify_phy_attach`
    *   `otto_emdio_notify_phy_detach`
*   **EnableConfigs:**
    *   `MDIO_REALTEK_RTL9300`
    *   `COMPILE_TEST`
    *   `PHYLIB` - Included for possible dependency.
*   **Reasoning:** The changes introduce support for the Realtek Otto Switches Ethernet MDIO Controller and polling support. The PHY code changes, especially the addition of the `notify_phy_attach` and `notify_phy_detach` callbacks, called from `phy_attach_direct` and `phy_detach`, are highly relevant and reachable core functionalities. The MDIO driver changes are also reachable when the driver is enabled.
    Even though the notify functions are static, they are being assigned as function pointers, making them fair game.

I've double checked the dependencies. It looks like `MDIO_REALTEK_RTL9300` depends on `MACH_REALTEK_RTL || COMPILE_TEST`, which validates the need for `COMPILE_TEST`. And, while `PHYLIB` isn't directly required for the MDIO driver itself, it's typically enabled by default or selected by various network drivers, so it is safer to include it. Alright, I'm confident in this.



20/2 2026/07/25 10:04 tool grepper
0m Args:
{
  "Expression": "config PHYLIB"
}

Results:
{
  "Output": "drivers/net/phy/Kconfig=6=config PHYLINK\n--\ndrivers/net/phy/Kconfig-14-\ndrivers/net/phy/Kconfig:15:menuconfig PHYLIB\ndrivers/net/phy/Kconfig-16-\ttristate \"PHY Device support and infrastructure\"\n--\ndrivers/net/phy/Kconfig=46=config OPEN_ALLIANCE_HELPERS\n--\ndrivers/net/phy/Kconfig-48-\ndrivers/net/phy/Kconfig:49:config PHYLIB_LEDS\ndrivers/net/phy/Kconfig-50-\tdef_bool OF\n"
}

21/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 39103
							output: 37
							thoughts: 109
						

Thoughts:
**Examining the PHYLIB Configuration**

Okay, so `PHYLIB`, that's definitely a `menuconfig` option, so we can include that without any issues. Good. Now, looking at the configurations we have, we've got `MDIO_REALTEK_RTL9300`, `COMPILE_TEST`, and, of course, `PHYLIB` itself. Right, let's just make sure `MDIO_REALTEK_RTL9300` doesn't have any hidden dependencies or prerequisites. It's using `regmap`, which *should* be selected automatically, but it's always good to double-check. Time to dive back into `drivers/net/mdio/Kconfig` and make certain everything's in order.



22/2 2026/07/25 10:04 tool read-file
0m Args:
{
  "File": "drivers/net/mdio/Kconfig",
  "FirstLine": 170,
  "LineCount": 20
}

Results:
{
  "Contents": " 170:\t\thelp\n 171:\t\t  This driver supports the MDIO interface found in the network\n 172:\t\t  interface units of the IPQ8064 SoC\n 173:\t\n 174:\tconfig MDIO_REALTEK_RTL9300\n 175:\t\ttristate \"Realtek RTL9300 MDIO interface support\"\n 176:\t\tdepends on MACH_REALTEK_RTL || COMPILE_TEST\n 177:\t\thelp\n 178:\t\t  This driver supports the MDIO interface found in the Realtek\n 179:\t\t  RTL9300 family of Ethernet switches with integrated SoC.\n 180:\t\n 181:\tconfig MDIO_REGMAP\n 182:\t\ttristate\n 183:\t\thelp\n 184:\t\t  This driver allows using MDIO devices that are not sitting on a\n 185:\t\t  regular MDIO bus, but still exposes the standard 802.3 register\n 186:\t\t  layout. It's regmap-based so that it can be used on integrated,\n 187:\t\t  memory-mapped PHYs, SPI PHYs and so on. A new virtual MDIO bus is\n 188:\t\t  created, and its read/write operations are mapped to the underlying\n 189:\t\t  regmap. Users willing to use this driver must explicitly select\n"
}

23/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 39779
							output: 24
							thoughts: 105
						

Thoughts:
**Analyzing the Dependency on REGMAP in the RTL9300 Driver**

Okay, so I'm digging into this code and I'm not seeing a direct `#define` that checks for `REGMAP` being explicitly selected. However, my immediate thought is that `regmap` is almost always a given in a project of this nature, so perhaps it's assumed. But, is it *guaranteed*?

Hold on... I'm seeing functions like `regmap_read_poll_timeout` and `regmap_assign_bits` being used specifically within the `MDIO_REALTEK_RTL9300` implementation. That's a strong indicator. If `REGMAP` *isn't* selected during the build process, these functions would almost certainly result in compilation errors. That's the key question, isn't it? Will the build choke if `REGMAP` is missing?

Alright, time to confirm my suspicion. I need to take a look at the include statements within `drivers/net/mdio/mdio-realtek-rtl9300.c` to see precisely what headers it's pulling in and what they depend upon. That'll be the smoking gun.



24/2 2026/07/25 10:04 tool grepper
0m Args:
{
  "Expression": "#include \u003clinux/regmap.h\u003e"
}

Results:
{
  "Output": "\nFull output is too long, showing 500 out of 11405 lines.\nUse more precise expression if possible.\n\narch/arm/mach-alpine/alpine_cpu_pm.c-10-#include \u003clinux/of_address.h\u003e\narch/arm/mach-alpine/alpine_cpu_pm.c:11:#include \u003clinux/regmap.h\u003e\narch/arm/mach-alpine/alpine_cpu_pm.c-12-#include \u003clinux/mfd/syscon.h\u003e\n--\narch/arm/mach-artpec/board-artpec6.c-15-#include \u003clinux/clk-provider.h\u003e\narch/arm/mach-artpec/board-artpec6.c:16:#include \u003clinux/regmap.h\u003e\narch/arm/mach-artpec/board-artpec6.c-17-#include \u003clinux/smp.h\u003e\n--\narch/arm/mach-bcm/platsmp-brcmstb.c-15-#include \u003clinux/printk.h\u003e\narch/arm/mach-bcm/platsmp-brcmstb.c:16:#include \u003clinux/regmap.h\u003e\narch/arm/mach-bcm/platsmp-brcmstb.c-17-#include \u003clinux/smp.h\u003e\n--\narch/arm/mach-davinci/da850.c-16-#include \u003clinux/platform_device.h\u003e\narch/arm/mach-davinci/da850.c:17:#include \u003clinux/regmap.h\u003e\narch/arm/mach-davinci/da850.c-18-#include \u003clinux/regulator/consumer.h\u003e\n--\narch/arm/mach-davinci/da8xx.h-15-#include \u003clinux/reboot.h\u003e\narch/arm/mach-davinci/da8xx.h:16:#include \u003clinux/regmap.h\u003e\narch/arm/mach-davinci/da8xx.h-17-\n--\narch/arm/mach-imx/anatop.c-11-#include \u003clinux/mfd/syscon.h\u003e\narch/arm/mach-imx/anatop.c:12:#include \u003clinux/regmap.h\u003e\narch/arm/mach-imx/anatop.c-13-#include \"common.h\"\n--\narch/arm/mach-imx/mach-imx6q.c-11-#include \u003clinux/phy.h\u003e\narch/arm/mach-imx/mach-imx6q.c:12:#include \u003clinux/regmap.h\u003e\narch/arm/mach-imx/mach-imx6q.c-13-#include \u003clinux/micrel_phy.h\u003e\n--\narch/arm/mach-imx/mach-imx6sl.c-9-#include \u003clinux/mfd/syscon/imx6q-iomuxc-gpr.h\u003e\narch/arm/mach-imx/mach-imx6sl.c:10:#include \u003clinux/regmap.h\u003e\narch/arm/mach-imx/mach-imx6sl.c-11-#include \u003casm/mach/arch.h\u003e\n--\narch/arm/mach-imx/mach-imx6sx.c-7-#include \u003clinux/of_platform.h\u003e\narch/arm/mach-imx/mach-imx6sx.c:8:#include \u003clinux/regmap.h\u003e\narch/arm/mach-imx/mach-imx6sx.c-9-#include \u003clinux/mfd/syscon.h\u003e\n--\narch/arm/mach-imx/mach-imx7d.c-9-#include \u003clinux/phy.h\u003e\narch/arm/mach-imx/mach-imx7d.c:10:#include \u003clinux/regmap.h\u003e\narch/arm/mach-imx/mach-imx7d.c-11-\n--\narch/arm/mach-imx/mach-imx7ulp.c-10-#include \u003clinux/of_platform.h\u003e\narch/arm/mach-imx/mach-imx7ulp.c:11:#include \u003clinux/regmap.h\u003e\narch/arm/mach-imx/mach-imx7ulp.c-12-#include \u003casm/mach/arch.h\u003e\n--\narch/arm/mach-imx/pm-imx6.c-19-#include \u003clinux/platform_device.h\u003e\narch/arm/mach-imx/pm-imx6.c:20:#include \u003clinux/regmap.h\u003e\narch/arm/mach-imx/pm-imx6.c-21-#include \u003clinux/suspend.h\u003e\n--\narch/arm/mach-meson/platsmp.c-11-#include \u003clinux/of_address.h\u003e\narch/arm/mach-meson/platsmp.c:12:#include \u003clinux/regmap.h\u003e\narch/arm/mach-meson/platsmp.c-13-#include \u003clinux/reset.h\u003e\n--\narch/arm/mach-omap2/control.c-14-#include \u003clinux/of_address.h\u003e\narch/arm/mach-omap2/control.c:15:#include \u003clinux/regmap.h\u003e\narch/arm/mach-omap2/control.c-16-#include \u003clinux/mfd/syscon.h\u003e\n--\narch/arm/mach-omap2/display.c-21-#include \u003clinux/mfd/syscon.h\u003e\narch/arm/mach-omap2/display.c:22:#include \u003clinux/regmap.h\u003e\narch/arm/mach-omap2/display.c-23-\n--\narch/arm/mach-rockchip/platsmp.c-12-#include \u003clinux/of_address.h\u003e\narch/arm/mach-rockchip/platsmp.c:13:#include \u003clinux/regmap.h\u003e\narch/arm/mach-rockchip/platsmp.c-14-#include \u003clinux/mfd/syscon.h\u003e\n--\narch/arm/mach-rockchip/pm.c-11-#include \u003clinux/of_address.h\u003e\narch/arm/mach-rockchip/pm.c:12:#include \u003clinux/regmap.h\u003e\narch/arm/mach-rockchip/pm.c-13-#include \u003clinux/suspend.h\u003e\n--\narch/arm/mach-versatile/integrator_ap.c-16-#include \u003clinux/mfd/syscon.h\u003e\narch/arm/mach-versatile/integrator_ap.c:17:#include \u003clinux/regmap.h\u003e\narch/arm/mach-versatile/integrator_ap.c-18-\n--\narch/arm/mach-versatile/integrator_cp.c-12-#include \u003clinux/sched_clock.h\u003e\narch/arm/mach-versatile/integrator_cp.c:13:#include \u003clinux/regmap.h\u003e\narch/arm/mach-versatile/integrator_cp.c-14-#include \u003clinux/mfd/syscon.h\u003e\n--\narch/arm/mach-versatile/platsmp-realview.c-8-#include \u003clinux/of_address.h\u003e\narch/arm/mach-versatile/platsmp-realview.c:9:#include \u003clinux/regmap.h\u003e\narch/arm/mach-versatile/platsmp-realview.c-10-#include \u003clinux/mfd/syscon.h\u003e\n--\narch/arm/mach-zynq/slcr.c-11-#include \u003clinux/of_address.h\u003e\narch/arm/mach-zynq/slcr.c:12:#include \u003clinux/regmap.h\u003e\narch/arm/mach-zynq/slcr.c-13-#include \"common.h\"\n--\ndrivers/acpi/pmic/intel_pmic.c-10-#include \u003clinux/mfd/intel_soc_pmic.h\u003e\ndrivers/acpi/pmic/intel_pmic.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/acpi/pmic/intel_pmic.c-12-#include \u003cacpi/acpi_lpat.h\u003e\n--\ndrivers/acpi/pmic/intel_pmic_bxtwc.c-10-#include \u003clinux/mfd/intel_soc_pmic.h\u003e\ndrivers/acpi/pmic/intel_pmic_bxtwc.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/acpi/pmic/intel_pmic_bxtwc.c-12-#include \u003clinux/platform_device.h\u003e\n--\ndrivers/acpi/pmic/intel_pmic_bytcrc.c-11-#include \u003clinux/platform_device.h\u003e\ndrivers/acpi/pmic/intel_pmic_bytcrc.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/acpi/pmic/intel_pmic_bytcrc.c-13-#include \"intel_pmic.h\"\n--\ndrivers/acpi/pmic/intel_pmic_chtcrc.c-11-#include \u003clinux/platform_device.h\u003e\ndrivers/acpi/pmic/intel_pmic_chtcrc.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/acpi/pmic/intel_pmic_chtcrc.c-13-#include \"intel_pmic.h\"\n--\ndrivers/acpi/pmic/intel_pmic_chtwc.c-13-#include \u003clinux/platform_device.h\u003e\ndrivers/acpi/pmic/intel_pmic_chtwc.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/acpi/pmic/intel_pmic_chtwc.c-15-#include \"intel_pmic.h\"\n--\ndrivers/acpi/pmic/intel_pmic_xpower.c-10-#include \u003clinux/mfd/axp20x.h\u003e\ndrivers/acpi/pmic/intel_pmic_xpower.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/acpi/pmic/intel_pmic_xpower.c-12-#include \u003clinux/platform_device.h\u003e\n--\ndrivers/acpi/pmic/tps68470_pmic.c-15-#include \u003clinux/platform_device.h\u003e\ndrivers/acpi/pmic/tps68470_pmic.c:16:#include \u003clinux/regmap.h\u003e\ndrivers/acpi/pmic/tps68470_pmic.c-17-\n--\ndrivers/ata/ahci_imx.c-12-#include \u003clinux/property.h\u003e\ndrivers/ata/ahci_imx.c:13:#include \u003clinux/regmap.h\u003e\ndrivers/ata/ahci_imx.c-14-#include \u003clinux/ahci_platform.h\u003e\n--\ndrivers/ata/ahci_mtk.c-16-#include \u003clinux/pm.h\u003e\ndrivers/ata/ahci_mtk.c:17:#include \u003clinux/regmap.h\u003e\ndrivers/ata/ahci_mtk.c-18-#include \u003clinux/reset.h\u003e\n--\ndrivers/ata/pata_ixp4xx_cf.c-21-#include \u003clinux/platform_device.h\u003e\ndrivers/ata/pata_ixp4xx_cf.c:22:#include \u003clinux/regmap.h\u003e\ndrivers/ata/pata_ixp4xx_cf.c-23-#include \u003cscsi/scsi_host.h\u003e\n--\ndrivers/ata/sata_gemini.c-11-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/ata/sata_gemini.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/ata/sata_gemini.c-13-#include \u003clinux/delay.h\u003e\n--\ndrivers/auxdisplay/img-ascii-lcd.c-13-#include \u003clinux/property.h\u003e\ndrivers/auxdisplay/img-ascii-lcd.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/auxdisplay/img-ascii-lcd.c-15-#include \u003clinux/slab.h\u003e\n--\ndrivers/auxdisplay/max6959.c-18-#include \u003clinux/pm.h\u003e\ndrivers/auxdisplay/max6959.c:19:#include \u003clinux/regmap.h\u003e\ndrivers/auxdisplay/max6959.c-20-#include \u003clinux/types.h\u003e\n--\ndrivers/base/regmap/internal.h-13-#include \u003clinux/device.h\u003e\ndrivers/base/regmap/internal.h:14:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/internal.h-15-#include \u003clinux/fs.h\u003e\n--\ndrivers/base/regmap/regmap-ac97.c-11-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-ac97.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-ac97.c-13-#include \u003clinux/slab.h\u003e\n--\ndrivers/base/regmap/regmap-fsi.c-10-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-fsi.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-fsi.c-12-\n--\ndrivers/base/regmap/regmap-i2c.c-8-\ndrivers/base/regmap/regmap-i2c.c:9:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-i2c.c-10-#include \u003clinux/i2c.h\u003e\n--\ndrivers/base/regmap/regmap-i3c.c-4-#include \u003clinux/array_size.h\u003e\ndrivers/base/regmap/regmap-i3c.c:5:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-i3c.c-6-#include \u003clinux/i3c/device.h\u003e\n--\ndrivers/base/regmap/regmap-irq.c-16-#include \u003clinux/pm_runtime.h\u003e\ndrivers/base/regmap/regmap-irq.c:17:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-irq.c-18-#include \u003clinux/slab.h\u003e\n--\ndrivers/base/regmap/regmap-mdio.c-5-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-mdio.c:6:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-mdio.c-7-\n--\ndrivers/base/regmap/regmap-mmio.c-10-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-mmio.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-mmio.c-12-#include \u003clinux/slab.h\u003e\n--\ndrivers/base/regmap/regmap-ram.c-12-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-ram.c:13:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-ram.c-14-#include \u003clinux/slab.h\u003e\n--\ndrivers/base/regmap/regmap-raw-ram.c-12-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-raw-ram.c:13:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-raw-ram.c-14-#include \u003clinux/slab.h\u003e\n--\ndrivers/base/regmap/regmap-sccb.c-5-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-sccb.c:6:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-sccb.c-7-\n--\ndrivers/base/regmap/regmap-sdw-mbq.c-9-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-sdw-mbq.c:10:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-sdw-mbq.c-11-#include \u003clinux/soundwire/sdw.h\u003e\n--\ndrivers/base/regmap/regmap-sdw.c-6-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-sdw.c:7:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-sdw.c-8-#include \u003clinux/soundwire/sdw.h\u003e\n--\ndrivers/base/regmap/regmap-slimbus.c-3-\ndrivers/base/regmap/regmap-slimbus.c:4:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-slimbus.c-5-#include \u003clinux/slimbus.h\u003e\n--\ndrivers/base/regmap/regmap-spi-avmm.c-7-#include \u003clinux/module.h\u003e\ndrivers/base/regmap/regmap-spi-avmm.c:8:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-spi-avmm.c-9-#include \u003clinux/spi/spi.h\u003e\n--\ndrivers/base/regmap/regmap-spi.c-8-\ndrivers/base/regmap/regmap-spi.c:9:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-spi.c-10-#include \u003clinux/spi/spi.h\u003e\n--\ndrivers/base/regmap/regmap-spmi.c-10-\ndrivers/base/regmap/regmap-spmi.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-spmi.c-12-#include \u003clinux/spmi.h\u003e\n--\ndrivers/base/regmap/regmap-w1.c-7-\ndrivers/base/regmap/regmap-w1.c:8:#include \u003clinux/regmap.h\u003e\ndrivers/base/regmap/regmap-w1.c-9-#include \u003clinux/module.h\u003e\n--\ndrivers/bluetooth/btintel.c-10-#include \u003clinux/firmware.h\u003e\ndrivers/bluetooth/btintel.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/bluetooth/btintel.c-12-#include \u003clinux/string_choices.h\u003e\n--\ndrivers/bus/arm-integrator-lm.c-21-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/bus/arm-integrator-lm.c:22:#include \u003clinux/regmap.h\u003e\ndrivers/bus/arm-integrator-lm.c-23-\n--\ndrivers/bus/da8xx-mstpri.c-14-#include \u003clinux/io.h\u003e\ndrivers/bus/da8xx-mstpri.c:15:#include \u003clinux/regmap.h\u003e\ndrivers/bus/da8xx-mstpri.c-16-\n--\ndrivers/bus/imx-aipstz.c-10-#include \u003clinux/pm_runtime.h\u003e\ndrivers/bus/imx-aipstz.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/bus/imx-aipstz.c-12-\n--\ndrivers/bus/imx-weim.c-19-#include \u003clinux/mfd/syscon/imx6q-iomuxc-gpr.h\u003e\ndrivers/bus/imx-weim.c:20:#include \u003clinux/regmap.h\u003e\ndrivers/bus/imx-weim.c-21-\n--\ndrivers/bus/intel-ixp4xx-eb.c-18-#include \u003clinux/platform_device.h\u003e\ndrivers/bus/intel-ixp4xx-eb.c:19:#include \u003clinux/regmap.h\u003e\ndrivers/bus/intel-ixp4xx-eb.c-20-\n--\ndrivers/bus/qcom-ssc-block-bus.c-13-#include \u003clinux/pm_runtime.h\u003e\ndrivers/bus/qcom-ssc-block-bus.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/bus/qcom-ssc-block-bus.c-15-#include \u003clinux/reset.h\u003e\n--\ndrivers/bus/sunxi-rsb.c-45-#include \u003clinux/pm_runtime.h\u003e\ndrivers/bus/sunxi-rsb.c:46:#include \u003clinux/regmap.h\u003e\ndrivers/bus/sunxi-rsb.c-47-#include \u003clinux/reset.h\u003e\n--\ndrivers/char/hw_random/ks-sa-rng.c-18-#include \u003clinux/err.h\u003e\ndrivers/char/hw_random/ks-sa-rng.c:19:#include \u003clinux/regmap.h\u003e\ndrivers/char/hw_random/ks-sa-rng.c-20-#include \u003clinux/mfd/syscon.h\u003e\n--\ndrivers/char/ipmi/kcs_bmc_aspeed.c-18-#include \u003clinux/poll.h\u003e\ndrivers/char/ipmi/kcs_bmc_aspeed.c:19:#include \u003clinux/regmap.h\u003e\ndrivers/char/ipmi/kcs_bmc_aspeed.c-20-#include \u003clinux/sched.h\u003e\n--\ndrivers/char/ipmi/kcs_bmc_npcm7xx.c-16-#include \u003clinux/platform_device.h\u003e\ndrivers/char/ipmi/kcs_bmc_npcm7xx.c:17:#include \u003clinux/regmap.h\u003e\ndrivers/char/ipmi/kcs_bmc_npcm7xx.c-18-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/actions/owl-common.c-11-#include \u003clinux/platform_device.h\u003e\ndrivers/clk/actions/owl-common.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-common.c-13-\n--\ndrivers/clk/actions/owl-common.h-14-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/actions/owl-common.h:15:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-common.h-16-\n--\ndrivers/clk/actions/owl-composite.c-11-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/actions/owl-composite.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-composite.c-13-\n--\ndrivers/clk/actions/owl-divider.c-11-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/actions/owl-divider.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-divider.c-13-\n--\ndrivers/clk/actions/owl-factor.c-11-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/actions/owl-factor.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-factor.c-13-\n--\ndrivers/clk/actions/owl-gate.c-11-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/actions/owl-gate.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-gate.c-13-\n--\ndrivers/clk/actions/owl-mux.c-11-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/actions/owl-mux.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-mux.c-13-\n--\ndrivers/clk/actions/owl-reset.c-8-#include \u003clinux/delay.h\u003e\ndrivers/clk/actions/owl-reset.c:9:#include \u003clinux/regmap.h\u003e\ndrivers/clk/actions/owl-reset.c-10-#include \u003clinux/reset-controller.h\u003e\n--\ndrivers/clk/aspeed/clk-aspeed.c-9-#include \u003clinux/platform_device.h\u003e\ndrivers/clk/aspeed/clk-aspeed.c:10:#include \u003clinux/regmap.h\u003e\ndrivers/clk/aspeed/clk-aspeed.c-11-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/aspeed/clk-ast2600.c-9-#include \u003clinux/platform_device.h\u003e\ndrivers/clk/aspeed/clk-ast2600.c:10:#include \u003clinux/regmap.h\u003e\ndrivers/clk/aspeed/clk-ast2600.c-11-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/at91/clk-audio-pll.c-37-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-audio-pll.c:38:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-audio-pll.c-39-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/at91/clk-generated.c-14-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-generated.c:15:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-generated.c-16-\n--\ndrivers/clk/at91/clk-h32mx.c-13-#include \u003clinux/of.h\u003e\ndrivers/clk/at91/clk-h32mx.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-h32mx.c-15-#include \u003clinux/mfd/syscon.h\u003e\n--\ndrivers/clk/at91/clk-i2s-mux.c-11-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-i2s-mux.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-i2s-mux.c-13-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/at91/clk-main.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-main.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-main.c-12-\n--\ndrivers/clk/at91/clk-master.c-11-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-master.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-master.c-13-\n--\ndrivers/clk/at91/clk-peripheral.c-12-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-peripheral.c:13:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-peripheral.c-14-\n--\ndrivers/clk/at91/clk-pll.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-pll.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-pll.c-12-\n--\ndrivers/clk/at91/clk-plldiv.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-plldiv.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-plldiv.c-12-\n--\ndrivers/clk/at91/clk-programmable.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-programmable.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-programmable.c-12-\n--\ndrivers/clk/at91/clk-sam9x60-pll.c-13-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-sam9x60-pll.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-sam9x60-pll.c-15-\n--\ndrivers/clk/at91/clk-slow.c-12-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-slow.c:13:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-slow.c-14-\n--\ndrivers/clk/at91/clk-smd.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-smd.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-smd.c-12-\n--\ndrivers/clk/at91/clk-system.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-system.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-system.c-12-\n--\ndrivers/clk/at91/clk-usb.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-usb.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-usb.c-12-\n--\ndrivers/clk/at91/clk-utmi.c-10-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/clk-utmi.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/clk-utmi.c-12-#include \u003csoc/at91/atmel-sfr.h\u003e\n--\ndrivers/clk/at91/dt-compat.c-5-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/at91/dt-compat.c:6:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/dt-compat.c-7-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/at91/pmc.c-13-#include \u003clinux/platform_device.h\u003e\ndrivers/clk/at91/pmc.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/pmc.c-15-#include \u003clinux/syscore_ops.h\u003e\n--\ndrivers/clk/at91/pmc.h-12-#include \u003clinux/irqdomain.h\u003e\ndrivers/clk/at91/pmc.h:13:#include \u003clinux/regmap.h\u003e\ndrivers/clk/at91/pmc.h-14-#include \u003clinux/spinlock.h\u003e\n--\ndrivers/clk/bcm/clk-bcm53573-ilp.c-11-#include \u003clinux/of_address.h\u003e\ndrivers/clk/bcm/clk-bcm53573-ilp.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/bcm/clk-bcm53573-ilp.c-13-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-axm5516.c-16-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/clk-axm5516.c:17:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-axm5516.c-18-#include \u003cdt-bindings/clock/lsi,axm5516-clks.h\u003e\n--\ndrivers/clk/clk-bd718x7.c-12-#include \u003clinux/clkdev.h\u003e\ndrivers/clk/clk-bd718x7.c:13:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-bd718x7.c-14-\n--\ndrivers/clk/clk-cdce706.c-17-#include \u003clinux/rational.h\u003e\ndrivers/clk/clk-cdce706.c:18:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-cdce706.c-19-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-cdce925.c-17-#include \u003clinux/i2c.h\u003e\ndrivers/clk/clk-cdce925.c:18:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-cdce925.c-19-#include \u003clinux/regulator/consumer.h\u003e\n--\ndrivers/clk/clk-cs2000-cp.c-13-#include \u003clinux/module.h\u003e\ndrivers/clk/clk-cs2000-cp.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-cs2000-cp.c-15-\n--\ndrivers/clk/clk-en7523.c-9-#include \u003clinux/property.h\u003e\ndrivers/clk/clk-en7523.c:10:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-en7523.c-11-#include \u003clinux/reset-controller.h\u003e\n--\ndrivers/clk/clk-ep93xx.c-15-#include \u003clinux/platform_device.h\u003e\ndrivers/clk/clk-ep93xx.c:16:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-ep93xx.c-17-#include \u003clinux/spinlock.h\u003e\n--\ndrivers/clk/clk-gemini.c-18-#include \u003clinux/mfd/syscon.h\u003e\ndrivers/clk/clk-gemini.c:19:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-gemini.c-20-#include \u003clinux/spinlock.h\u003e\n--\ndrivers/clk/clk-hi655x.c-11-#include \u003clinux/platform_device.h\u003e\ndrivers/clk/clk-hi655x.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-hi655x.c-13-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-lmk04832.c-18-#include \u003clinux/module.h\u003e\ndrivers/clk/clk-lmk04832.c:19:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-lmk04832.c-20-#include \u003clinux/spi/spi.h\u003e\n--\ndrivers/clk/clk-lochnagar.c-16-#include \u003clinux/property.h\u003e\ndrivers/clk/clk-lochnagar.c:17:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-lochnagar.c-18-\n--\ndrivers/clk/clk-max77686.c-19-#include \u003clinux/of.h\u003e\ndrivers/clk/clk-max77686.c:20:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-max77686.c-21-\n--\ndrivers/clk/clk-renesas-pcie.c-18-#include \u003clinux/of.h\u003e\ndrivers/clk/clk-renesas-pcie.c:19:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-renesas-pcie.c-20-\n--\ndrivers/clk/clk-rp1.c-9-#include \u003clinux/clk-provider.h\u003e\ndrivers/clk/clk-rp1.c:10:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-rp1.c-11-#include \u003clinux/math64.h\u003e\n--\ndrivers/clk/clk-s2mps11.c-10-#include \u003clinux/clkdev.h\u003e\ndrivers/clk/clk-s2mps11.c:11:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-s2mps11.c-12-#include \u003clinux/clk-provider.h\u003e\n--\ndrivers/clk/clk-si514.c-13-#include \u003clinux/i2c.h\u003e\ndrivers/clk/clk-si514.c:14:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-si514.c-15-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-si521xx.c-20-#include \u003clinux/of.h\u003e\ndrivers/clk/clk-si521xx.c:21:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-si521xx.c-22-\n--\ndrivers/clk/clk-si5341.c-20-#include \u003clinux/module.h\u003e\ndrivers/clk/clk-si5341.c:21:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-si5341.c-22-#include \u003clinux/regulator/consumer.h\u003e\n--\ndrivers/clk/clk-si5351.c-25-#include \u003clinux/platform_data/si5351.h\u003e\ndrivers/clk/clk-si5351.c:26:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-si5351.c-27-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-si544.c-12-#include \u003clinux/i2c.h\u003e\ndrivers/clk/clk-si544.c:13:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-si544.c-14-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-si570.c-17-#include \u003clinux/i2c.h\u003e\ndrivers/clk/clk-si570.c:18:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-si570.c-19-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-stm32f4.c-17-#include \u003clinux/of_address.h\u003e\ndrivers/clk/clk-stm32f4.c:18:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-stm32f4.c-19-#include \u003clinux/mfd/syscon.h\u003e\n--\ndrivers/clk/clk-stm32h7.c-15-#include \u003clinux/spinlock.h\u003e\ndrivers/clk/clk-stm32h7.c:16:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-stm32h7.c-17-\n--\ndrivers/clk/clk-tps68470.c-23-#include \u003clinux/platform_data/tps68470.h\u003e\ndrivers/clk/clk-tps68470.c:24:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-tps68470.c-25-\n--\ndrivers/clk/clk-versaclock3.c-11-#include \u003clinux/module.h\u003e\ndrivers/clk/clk-versaclock3.c:12:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-versaclock3.c-13-\n--\ndrivers/clk/clk-versaclock5.c-21-#include \u003clinux/property.h\u003e\ndrivers/clk/clk-versaclock5.c:22:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-versaclock5.c-23-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/clk-versaclock7.c-17-#include \u003clinux/property.h\u003e\ndrivers/clk/clk-versaclock7.c:18:#include \u003clinux/regmap.h\u003e\ndrivers/clk/clk-versaclock7.c-19-#include \u003clinux/swab.h\u003e\n--\ndrivers/clk/davinci/da8xx-cfgchip.c-17-#include \u003clinux/property.h\u003e\ndrivers/clk/davinci/da8xx-cfgchip.c:18:#include \u003clinux/regmap.h\u003e\ndrivers/clk/davinci/da8xx-cfgchip.c-19-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/davinci/pll.c-23-#include \u003clinux/property.h\u003e\ndrivers/clk/davinci/pll.c:24:#include \u003clinux/regmap.h\u003e\ndrivers/clk/davinci/pll.c-25-#include \u003clinux/slab.h\u003e\n--\ndrivers/clk/davinci/pll.h-13-#include \u003clinux/of.h\u003e\ndrivers/clk/davinci/pll.h:14:#include \u003clinux/regmap.h\u003e\ndrivers/clk/davinci/pll.h-15-#include \u003clinux/types.h\u003e\n--\ndrivers/clk/davinci/psc.c-25-#include \u003clinux/pm_domain.h\u003e\ndrivers/clk/davinci/psc.c:26:#include \u003clinux/regmap.h\u003e\ndrivers/clk/davinci/psc.c-27-#include \u003clinux/reset-controller.h\u003e\n--\ndrivers/clk/hisilicon/clk-hi6220-stub.c-17-#include \u003clinux/platform_device.h\u003e\ndrivers/clk/hisilicon/clk-hi6220-stub.c:18:#include \u003clinux/regmap.h\u003e\ndrivers/clk/hisilicon/clk-hi6220-stub.c-19-\n--\n\n"
}

25/2 2026/07/25 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 50617
							output: 23
							thoughts: 306
						

Thoughts:
**Analyzing the REGMAP Configuration**

Okay, so `REGMAP` is selected through various dependencies. My initial thought was that `MDIO_REALTEK_RTL9300` didn't explicitly select it, but it seemed to work fine without a direct dependency, which is strange. Then I realized `MDIO_REALTEK_RTL9300` actually uses `regmap_read_poll_timeout` from `linux/regmap.h`.

The logical approach, I figured, was to just enable `MDIO_REALTEK_RTL9300` and let Kbuild sort out any implicit selections. Kbuild would either resolve the dependency on `REGMAP`, or the build would fail if `REGMAP` wasn't enabled at all. To be sure, I checked the `drivers/net/mdio/Kconfig` file to see if `MDIO_REALTEK_RTL9300` directly selected `REGMAP`, but it didn't. Then I remembered that `MDIO_REGMAP` selects `REGMAP`, which is related, but not the direct dependency of `MDIO_REALTEK_RTL9300`.

To be safe, I thought about adding `REGMAP` to EnableConfigs, just to ensure it's there. But then I remembered that `REGMAP` isn't a user-visible config; it doesn't have a prompt. So, I can't enable it directly through `set-results`. However, if it's a valid config, syzkaller should handle it.

Now, wait a minute, `REGMAP` might be selected by `MACH_REALTEK_RTL`! Let's check `MACH_REALTEK_RTL` to see if that's the link.



26/2 2026/07/25 10:05 tool grepper
0m Args:
{
  "Expression": "config MACH_REALTEK_RTL"
}

Results:
{
  "Output": "arch/mips/Kconfig=682=config RALINK\n--\narch/mips/Kconfig-699-\narch/mips/Kconfig:700:config MACH_REALTEK_RTL\narch/mips/Kconfig-701-\tbool \"Realtek RTL838x/RTL839x based machines\"\n"
}

27/2 2026/07/25 10:05 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 51445
							output: 35
							thoughts: 19
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into the MIPS Kernel Configuration**

Okay, let's zero in on `arch/mips/Kconfig`, specifically around line 700. I suspect there's a particular configuration option or block of related options I need to understand better. Given my experience, I'm probably looking for something related to either processor features, architecture-specific optimizations, or maybe even debugging/tracing options that are conditional on other settings. I'm keeping an eye out for potential conflicts or dependencies that could be impacting the current issue I'm investigating. I expect to parse the conditionals, see how they fit into the broader MIPS architecture support, and potentially identify the reason behind a build or runtime problem. Hopefully, I'll identify a variable or configuration I haven't come across before. It's often helpful to refresh one's mind with the source code directly.



28/2 2026/07/25 10:05 tool read-file
0m Args:
{
  "File": "arch/mips/Kconfig",
  "FirstLine": 695,
  "LineCount": 20
}

Results:
{
  "Contents": " 695:\t\tselect SYS_SUPPORTS_ZBOOT\n 696:\t\tselect SYS_HAS_EARLY_PRINTK\n 697:\t\tselect ARCH_HAS_RESET_CONTROLLER\n 698:\t\tselect RESET_CONTROLLER\n 699:\t\n 700:\tconfig MACH_REALTEK_RTL\n 701:\t\tbool \"Realtek RTL838x/RTL839x based machines\"\n 702:\t\tselect MIPS_GENERIC\n 703:\t\tselect MACH_GENERIC_CORE\n 704:\t\tselect DMA_NONCOHERENT\n 705:\t\tselect IRQ_MIPS_CPU\n 706:\t\tselect CSRC_R4K\n 707:\t\tselect CEVT_R4K\n 708:\t\tselect SYS_HAS_CPU_MIPS32_R1\n 709:\t\tselect SYS_HAS_CPU_MIPS32_R2\n 710:\t\tselect SYS_SUPPORTS_BIG_ENDIAN\n 711:\t\tselect SYS_SUPPORTS_32BIT_KERNEL\n 712:\t\tselect SYS_SUPPORTS_MIPS16\n 713:\t\tselect SYS_SUPPORTS_MULTITHREADING\n 714:\t\tselect SYS_SUPPORTS_VPE_LOADER\n"
}

29/2 2026/07/25 10:05 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 52035
							output: 37
							thoughts: 94
						

Thoughts:
**Debugging a Potential Configuration Issue**

Okay, so the system isn't picking up `REGMAP`. That's not good. Let's dig deeper. I need to figure out what's going on. First, I'll check if `MDIO_REALTEK_RTL9300` is the culprit. Does *it* select `REGMAP`? Ah, right. I remember, `MDIO_REALTEK_RTL9300` is a *platform* driver. Hmm, I must be getting the configurations confused.

Hold on, I think the problem is that `MDIO_REGMAP` is a distinct configuration option in itself. Better double-check the `drivers/net/mdio/Kconfig` file again. I need to make sure I'm following the correct dependencies and relationships here. I need to ensure I'm getting the right Kconfig selections.



30/2 2026/07/25 10:05 tool read-file
0m Args:
{
  "File": "drivers/net/mdio/Kconfig",
  "FirstLine": 170,
  "LineCount": 20
}

Results:
{
  "Contents": " 170:\t\thelp\n 171:\t\t  This driver supports the MDIO interface found in the network\n 172:\t\t  interface units of the IPQ8064 SoC\n 173:\t\n 174:\tconfig MDIO_REALTEK_RTL9300\n 175:\t\ttristate \"Realtek RTL9300 MDIO interface support\"\n 176:\t\tdepends on MACH_REALTEK_RTL || COMPILE_TEST\n 177:\t\thelp\n 178:\t\t  This driver supports the MDIO interface found in the Realtek\n 179:\t\t  RTL9300 family of Ethernet switches with integrated SoC.\n 180:\t\n 181:\tconfig MDIO_REGMAP\n 182:\t\ttristate\n 183:\t\thelp\n 184:\t\t  This driver allows using MDIO devices that are not sitting on a\n 185:\t\t  regular MDIO bus, but still exposes the standard 802.3 register\n 186:\t\t  layout. It's regmap-based so that it can be used on integrated,\n 187:\t\t  memory-mapped PHYs, SPI PHYs and so on. A new virtual MDIO bus is\n 188:\t\t  created, and its read/write operations are mapped to the underlying\n 189:\t\t  regmap. Users willing to use this driver must explicitly select\n"
}

31/2 2026/07/25 10:05 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 52726
							output: 18
							thoughts: 84
						

Thoughts:
**Delving into the RTL9300's Register Mapping**

Okay, so I'm looking at the `MDIO_REALTEK_RTL9300` driver. My initial thought is, "Wait, this thing leverages `regmap`! That's interesting; I need to understand how it's getting its `REGMAP`." My mind immediately jumps to the connection between this MDIO driver and the broader system control framework. Could `MFD_SYSCON` be responsible for providing or configuring the `REGMAP` instance? It's a plausible link. Let's delve directly into the code. I need to examine `drivers/net/mdio/mdio-realtek-rtl9300.c` to pinpoint how this `regmap` is being initialized. I need to find the `regmap_init` call (or something equivalent) to trace the flow. This is going to give me the critical clue.



32/2 2026/07/25 10:05 tool grepper
0m Args:
{
  "Expression": "regmap_init"
}

Results:
{
  "Output": "\nFull output is too long, showing 500 out of 11137 lines.\nUse more precise expression if possible.\n\narch/arm/mach-rockchip/platsmp.c=208=static int __init rockchip_smp_prepare_pmu(void)\n--\narch/arm/mach-rockchip/platsmp.c-244-\narch/arm/mach-rockchip/platsmp.c:245:\tpmu = regmap_init_mmio(NULL, pmu_base, \u0026rockchip_pmu_regmap_config);\narch/arm/mach-rockchip/platsmp.c-246-\tif (IS_ERR(pmu)) {\n--\ndrivers/auxdisplay/max6959.c=116=static int max6959_i2c_probe(struct i2c_client *client)\n--\ndrivers/auxdisplay/max6959.c-125-\ndrivers/auxdisplay/max6959.c:126:\tpriv-\u003eregmap = devm_regmap_init_i2c(client, \u0026max6959_regmap_config);\ndrivers/auxdisplay/max6959.c-127-\tif (IS_ERR(priv-\u003eregmap))\n--\ndrivers/base/regmap/internal.h=324=struct regmap_ram_data {\n--\ndrivers/base/regmap/internal.h-335- */\ndrivers/base/regmap/internal.h:336:struct regmap *__regmap_init_ram(struct device *dev,\ndrivers/base/regmap/internal.h-337-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/internal.h-341-\ndrivers/base/regmap/internal.h:342:#define regmap_init_ram(dev, config, data)\t\t\t\t\t\\\ndrivers/base/regmap/internal.h:343:\t__regmap_lockdep_wrapper(__regmap_init_ram, #dev, dev, config, data)\ndrivers/base/regmap/internal.h-344-\ndrivers/base/regmap/internal.h:345:struct regmap *__regmap_init_raw_ram(struct device *dev,\ndrivers/base/regmap/internal.h-346-\t\t\t\t     const struct regmap_config *config,\n--\ndrivers/base/regmap/internal.h-350-\ndrivers/base/regmap/internal.h:351:#define regmap_init_raw_ram(dev, config, data)\t\t\t\t\\\ndrivers/base/regmap/internal.h:352:\t__regmap_lockdep_wrapper(__regmap_init_raw_ram, #dev, dev, config, data)\ndrivers/base/regmap/internal.h-353-\n--\ndrivers/base/regmap/regmap-ac97.c=64=static const struct regmap_bus ac97_regmap_bus = {\n--\ndrivers/base/regmap/regmap-ac97.c-68-\ndrivers/base/regmap/regmap-ac97.c:69:struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,\ndrivers/base/regmap/regmap-ac97.c-70-\t\t\t\t  const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-ac97.c-73-{\ndrivers/base/regmap/regmap-ac97.c:74:\treturn __regmap_init(\u0026ac97-\u003edev, \u0026ac97_regmap_bus, ac97, config,\ndrivers/base/regmap/regmap-ac97.c-75-\t\t\t     lock_key, lock_name);\ndrivers/base/regmap/regmap-ac97.c-76-}\ndrivers/base/regmap/regmap-ac97.c:77:EXPORT_SYMBOL_GPL(__regmap_init_ac97);\ndrivers/base/regmap/regmap-ac97.c-78-\ndrivers/base/regmap/regmap-ac97.c:79:struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,\ndrivers/base/regmap/regmap-ac97.c-80-\t\t\t\t       const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-ac97.c-83-{\ndrivers/base/regmap/regmap-ac97.c:84:\treturn __devm_regmap_init(\u0026ac97-\u003edev, \u0026ac97_regmap_bus, ac97, config,\ndrivers/base/regmap/regmap-ac97.c-85-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-ac97.c-86-}\ndrivers/base/regmap/regmap-ac97.c:87:EXPORT_SYMBOL_GPL(__devm_regmap_init_ac97);\ndrivers/base/regmap/regmap-ac97.c-88-\n--\ndrivers/base/regmap/regmap-fsi.c=152=static const struct regmap_bus *regmap_get_fsi_bus(struct fsi_device *fsi_dev,\n--\ndrivers/base/regmap/regmap-fsi.c-205-\ndrivers/base/regmap/regmap-fsi.c:206:struct regmap *__regmap_init_fsi(struct fsi_device *fsi_dev, const struct regmap_config *config,\ndrivers/base/regmap/regmap-fsi.c-207-\t\t\t\t struct lock_class_key *lock_key, const char *lock_name)\n--\ndrivers/base/regmap/regmap-fsi.c-213-\ndrivers/base/regmap/regmap-fsi.c:214:\treturn __regmap_init(\u0026fsi_dev-\u003edev, bus, fsi_dev-\u003eslave, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-fsi.c-215-}\ndrivers/base/regmap/regmap-fsi.c:216:EXPORT_SYMBOL_GPL(__regmap_init_fsi);\ndrivers/base/regmap/regmap-fsi.c-217-\ndrivers/base/regmap/regmap-fsi.c:218:struct regmap *__devm_regmap_init_fsi(struct fsi_device *fsi_dev,\ndrivers/base/regmap/regmap-fsi.c-219-\t\t\t\t      const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-fsi.c-226-\ndrivers/base/regmap/regmap-fsi.c:227:\treturn __devm_regmap_init(\u0026fsi_dev-\u003edev, bus, fsi_dev-\u003eslave, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-fsi.c-228-}\ndrivers/base/regmap/regmap-fsi.c:229:EXPORT_SYMBOL_GPL(__devm_regmap_init_fsi);\ndrivers/base/regmap/regmap-fsi.c-230-\n--\ndrivers/base/regmap/regmap-i2c.c=350=static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,\n--\ndrivers/base/regmap/regmap-i2c.c-418-\ndrivers/base/regmap/regmap-i2c.c:419:struct regmap *__regmap_init_i2c(struct i2c_client *i2c,\ndrivers/base/regmap/regmap-i2c.c-420-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-i2c.c-428-\ndrivers/base/regmap/regmap-i2c.c:429:\treturn __regmap_init(\u0026i2c-\u003edev, bus, \u0026i2c-\u003edev, config,\ndrivers/base/regmap/regmap-i2c.c-430-\t\t\t     lock_key, lock_name);\ndrivers/base/regmap/regmap-i2c.c-431-}\ndrivers/base/regmap/regmap-i2c.c:432:EXPORT_SYMBOL_GPL(__regmap_init_i2c);\ndrivers/base/regmap/regmap-i2c.c-433-\ndrivers/base/regmap/regmap-i2c.c:434:struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,\ndrivers/base/regmap/regmap-i2c.c-435-\t\t\t\t      const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-i2c.c-443-\ndrivers/base/regmap/regmap-i2c.c:444:\treturn __devm_regmap_init(\u0026i2c-\u003edev, bus, \u0026i2c-\u003edev, config,\ndrivers/base/regmap/regmap-i2c.c-445-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-i2c.c-446-}\ndrivers/base/regmap/regmap-i2c.c:447:EXPORT_SYMBOL_GPL(__devm_regmap_init_i2c);\ndrivers/base/regmap/regmap-i2c.c-448-\n--\ndrivers/base/regmap/regmap-i3c.c=44=static const struct regmap_bus regmap_i3c = {\n--\ndrivers/base/regmap/regmap-i3c.c-48-\ndrivers/base/regmap/regmap-i3c.c:49:struct regmap *__regmap_init_i3c(struct i3c_device *i3c,\ndrivers/base/regmap/regmap-i3c.c-50-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-i3c.c-53-{\ndrivers/base/regmap/regmap-i3c.c:54:\treturn __regmap_init(\u0026i3c-\u003edev, \u0026regmap_i3c, \u0026i3c-\u003edev, config,\ndrivers/base/regmap/regmap-i3c.c-55-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-i3c.c-56-}\ndrivers/base/regmap/regmap-i3c.c:57:EXPORT_SYMBOL_GPL(__regmap_init_i3c);\ndrivers/base/regmap/regmap-i3c.c-58-\ndrivers/base/regmap/regmap-i3c.c:59:struct regmap *__devm_regmap_init_i3c(struct i3c_device *i3c,\ndrivers/base/regmap/regmap-i3c.c-60-\t\t\t\t      const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-i3c.c-63-{\ndrivers/base/regmap/regmap-i3c.c:64:\treturn __devm_regmap_init(\u0026i3c-\u003edev, \u0026regmap_i3c, \u0026i3c-\u003edev, config,\ndrivers/base/regmap/regmap-i3c.c-65-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-i3c.c-66-}\ndrivers/base/regmap/regmap-i3c.c:67:EXPORT_SYMBOL_GPL(__devm_regmap_init_i3c);\ndrivers/base/regmap/regmap-i3c.c-68-\n--\ndrivers/base/regmap/regmap-kunit.c=183=static struct regmap *gen_regmap(struct kunit *test,\n--\ndrivers/base/regmap/regmap-kunit.c-234-\ndrivers/base/regmap/regmap-kunit.c:235:\tret = regmap_init_ram(priv-\u003edev, config, *data);\ndrivers/base/regmap/regmap-kunit.c-236-\tif (IS_ERR(ret))\n--\ndrivers/base/regmap/regmap-kunit.c=1738=static struct regmap *gen_raw_regmap(struct kunit *test,\n--\ndrivers/base/regmap/regmap-kunit.c-1797-\ndrivers/base/regmap/regmap-kunit.c:1798:\tret = regmap_init_raw_ram(priv-\u003edev, config, *data);\ndrivers/base/regmap/regmap-kunit.c-1799-\tif (IS_ERR(ret))\n--\ndrivers/base/regmap/regmap-mdio.c=80=static const struct regmap_bus regmap_mdio_c45_bus = {\n--\ndrivers/base/regmap/regmap-mdio.c-84-\ndrivers/base/regmap/regmap-mdio.c:85:struct regmap *__regmap_init_mdio(struct mdio_device *mdio_dev,\ndrivers/base/regmap/regmap-mdio.c-86-\tconst struct regmap_config *config, struct lock_class_key *lock_key,\n--\ndrivers/base/regmap/regmap-mdio.c-97-\ndrivers/base/regmap/regmap-mdio.c:98:\treturn __regmap_init(\u0026mdio_dev-\u003edev, bus, mdio_dev, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-mdio.c-99-}\ndrivers/base/regmap/regmap-mdio.c:100:EXPORT_SYMBOL_GPL(__regmap_init_mdio);\ndrivers/base/regmap/regmap-mdio.c-101-\ndrivers/base/regmap/regmap-mdio.c:102:struct regmap *__devm_regmap_init_mdio(struct mdio_device *mdio_dev,\ndrivers/base/regmap/regmap-mdio.c-103-\tconst struct regmap_config *config, struct lock_class_key *lock_key,\n--\ndrivers/base/regmap/regmap-mdio.c-114-\ndrivers/base/regmap/regmap-mdio.c:115:\treturn __devm_regmap_init(\u0026mdio_dev-\u003edev, bus, mdio_dev, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-mdio.c-116-}\ndrivers/base/regmap/regmap-mdio.c:117:EXPORT_SYMBOL_GPL(__devm_regmap_init_mdio);\ndrivers/base/regmap/regmap-mdio.c-118-\n--\ndrivers/base/regmap/regmap-mmio.c=407=static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,\n--\ndrivers/base/regmap/regmap-mmio.c-554-\ndrivers/base/regmap/regmap-mmio.c:555:struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id,\ndrivers/base/regmap/regmap-mmio.c-556-\t\t\t\t      void __iomem *regs,\n--\ndrivers/base/regmap/regmap-mmio.c-566-\ndrivers/base/regmap/regmap-mmio.c:567:\treturn __regmap_init(dev, \u0026regmap_mmio, ctx, config,\ndrivers/base/regmap/regmap-mmio.c-568-\t\t\t     lock_key, lock_name);\ndrivers/base/regmap/regmap-mmio.c-569-}\ndrivers/base/regmap/regmap-mmio.c:570:EXPORT_SYMBOL_GPL(__regmap_init_mmio_clk);\ndrivers/base/regmap/regmap-mmio.c-571-\ndrivers/base/regmap/regmap-mmio.c:572:struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,\ndrivers/base/regmap/regmap-mmio.c-573-\t\t\t\t\t   const char *clk_id,\n--\ndrivers/base/regmap/regmap-mmio.c-584-\ndrivers/base/regmap/regmap-mmio.c:585:\treturn __devm_regmap_init(dev, \u0026regmap_mmio, ctx, config,\ndrivers/base/regmap/regmap-mmio.c-586-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-mmio.c-587-}\ndrivers/base/regmap/regmap-mmio.c:588:EXPORT_SYMBOL_GPL(__devm_regmap_init_mmio_clk);\ndrivers/base/regmap/regmap-mmio.c-589-\n--\ndrivers/base/regmap/regmap-ram.c=49=static const struct regmap_bus regmap_ram = {\n--\ndrivers/base/regmap/regmap-ram.c-55-\ndrivers/base/regmap/regmap-ram.c:56:struct regmap *__regmap_init_ram(struct device *dev,\ndrivers/base/regmap/regmap-ram.c-57-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-ram.c-78-\ndrivers/base/regmap/regmap-ram.c:79:\tmap = __regmap_init(dev, \u0026regmap_ram, data, config,\ndrivers/base/regmap/regmap-ram.c-80-\t\t\t    lock_key, lock_name);\n--\ndrivers/base/regmap/regmap-ram.c-87-}\ndrivers/base/regmap/regmap-ram.c:88:EXPORT_SYMBOL_GPL(__regmap_init_ram);\ndrivers/base/regmap/regmap-ram.c-89-\n--\ndrivers/base/regmap/regmap-raw-ram.c=102=static const struct regmap_bus regmap_raw_ram = {\n--\ndrivers/base/regmap/regmap-raw-ram.c-109-\ndrivers/base/regmap/regmap-raw-ram.c:110:struct regmap *__regmap_init_raw_ram(struct device *dev,\ndrivers/base/regmap/regmap-raw-ram.c-111-\t\t\t\t     const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-raw-ram.c-135-\ndrivers/base/regmap/regmap-raw-ram.c:136:\tmap = __regmap_init(dev, \u0026regmap_raw_ram, data, config,\ndrivers/base/regmap/regmap-raw-ram.c-137-\t\t\t    lock_key, lock_name);\n--\ndrivers/base/regmap/regmap-raw-ram.c-140-}\ndrivers/base/regmap/regmap-raw-ram.c:141:EXPORT_SYMBOL_GPL(__regmap_init_raw_ram);\ndrivers/base/regmap/regmap-raw-ram.c-142-\n--\ndrivers/base/regmap/regmap-sccb.c=88=static const struct regmap_bus *regmap_get_sccb_bus(struct i2c_client *i2c,\n--\ndrivers/base/regmap/regmap-sccb.c-97-\ndrivers/base/regmap/regmap-sccb.c:98:struct regmap *__regmap_init_sccb(struct i2c_client *i2c,\ndrivers/base/regmap/regmap-sccb.c-99-\t\t\t\t  const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-sccb.c-107-\ndrivers/base/regmap/regmap-sccb.c:108:\treturn __regmap_init(\u0026i2c-\u003edev, bus, \u0026i2c-\u003edev, config,\ndrivers/base/regmap/regmap-sccb.c-109-\t\t\t     lock_key, lock_name);\ndrivers/base/regmap/regmap-sccb.c-110-}\ndrivers/base/regmap/regmap-sccb.c:111:EXPORT_SYMBOL_GPL(__regmap_init_sccb);\ndrivers/base/regmap/regmap-sccb.c-112-\ndrivers/base/regmap/regmap-sccb.c:113:struct regmap *__devm_regmap_init_sccb(struct i2c_client *i2c,\ndrivers/base/regmap/regmap-sccb.c-114-\t\t\t\t       const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-sccb.c-122-\ndrivers/base/regmap/regmap-sccb.c:123:\treturn __devm_regmap_init(\u0026i2c-\u003edev, bus, \u0026i2c-\u003edev, config,\ndrivers/base/regmap/regmap-sccb.c-124-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-sccb.c-125-}\ndrivers/base/regmap/regmap-sccb.c:126:EXPORT_SYMBOL_GPL(__devm_regmap_init_sccb);\ndrivers/base/regmap/regmap-sccb.c-127-\n--\ndrivers/base/regmap/regmap-sdw-mbq.c=210=regmap_sdw_mbq_gen_context(struct device *dev,\n--\ndrivers/base/regmap/regmap-sdw-mbq.c-232-\ndrivers/base/regmap/regmap-sdw-mbq.c:233:struct regmap *__regmap_init_sdw_mbq(struct device *dev, struct sdw_slave *sdw,\ndrivers/base/regmap/regmap-sdw-mbq.c-234-\t\t\t\t     const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-sdw-mbq.c-249-\ndrivers/base/regmap/regmap-sdw-mbq.c:250:\treturn __regmap_init(dev, \u0026regmap_sdw_mbq, ctx,\ndrivers/base/regmap/regmap-sdw-mbq.c-251-\t\t\t     config, lock_key, lock_name);\ndrivers/base/regmap/regmap-sdw-mbq.c-252-}\ndrivers/base/regmap/regmap-sdw-mbq.c:253:EXPORT_SYMBOL_GPL(__regmap_init_sdw_mbq);\ndrivers/base/regmap/regmap-sdw-mbq.c-254-\ndrivers/base/regmap/regmap-sdw-mbq.c:255:struct regmap *__devm_regmap_init_sdw_mbq(struct device *dev, struct sdw_slave *sdw,\ndrivers/base/regmap/regmap-sdw-mbq.c-256-\t\t\t\t\t  const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-sdw-mbq.c-271-\ndrivers/base/regmap/regmap-sdw-mbq.c:272:\treturn __devm_regmap_init(dev, \u0026regmap_sdw_mbq, ctx,\ndrivers/base/regmap/regmap-sdw-mbq.c-273-\t\t\t\t  config, lock_key, lock_name);\ndrivers/base/regmap/regmap-sdw-mbq.c-274-}\ndrivers/base/regmap/regmap-sdw-mbq.c:275:EXPORT_SYMBOL_GPL(__devm_regmap_init_sdw_mbq);\ndrivers/base/regmap/regmap-sdw-mbq.c-276-\n--\ndrivers/base/regmap/regmap-sdw.c=53=static int regmap_sdw_config_check(const struct regmap_config *config)\n--\ndrivers/base/regmap/regmap-sdw.c-68-\ndrivers/base/regmap/regmap-sdw.c:69:struct regmap *__regmap_init_sdw(struct sdw_slave *sdw,\ndrivers/base/regmap/regmap-sdw.c-70-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-sdw.c-79-\ndrivers/base/regmap/regmap-sdw.c:80:\treturn __regmap_init(\u0026sdw-\u003edev, \u0026regmap_sdw,\ndrivers/base/regmap/regmap-sdw.c-81-\t\t\t\u0026sdw-\u003edev, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-sdw.c-82-}\ndrivers/base/regmap/regmap-sdw.c:83:EXPORT_SYMBOL_GPL(__regmap_init_sdw);\ndrivers/base/regmap/regmap-sdw.c-84-\ndrivers/base/regmap/regmap-sdw.c:85:struct regmap *__devm_regmap_init_sdw(struct sdw_slave *sdw,\ndrivers/base/regmap/regmap-sdw.c-86-\t\t\t\t      const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-sdw.c-95-\ndrivers/base/regmap/regmap-sdw.c:96:\treturn __devm_regmap_init(\u0026sdw-\u003edev, \u0026regmap_sdw,\ndrivers/base/regmap/regmap-sdw.c-97-\t\t\t\u0026sdw-\u003edev, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-sdw.c-98-}\ndrivers/base/regmap/regmap-sdw.c:99:EXPORT_SYMBOL_GPL(__devm_regmap_init_sdw);\ndrivers/base/regmap/regmap-sdw.c-100-\n--\ndrivers/base/regmap/regmap-slimbus.c=32=static const struct regmap_bus *regmap_get_slimbus(struct slim_device *slim,\n--\ndrivers/base/regmap/regmap-slimbus.c-40-\ndrivers/base/regmap/regmap-slimbus.c:41:struct regmap *__regmap_init_slimbus(struct slim_device *slimbus,\ndrivers/base/regmap/regmap-slimbus.c-42-\t\t\t\t     const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-slimbus.c-50-\ndrivers/base/regmap/regmap-slimbus.c:51:\treturn __regmap_init(\u0026slimbus-\u003edev, bus, slimbus, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-slimbus.c-52-}\ndrivers/base/regmap/regmap-slimbus.c:53:EXPORT_SYMBOL_GPL(__regmap_init_slimbus);\ndrivers/base/regmap/regmap-slimbus.c-54-\ndrivers/base/regmap/regmap-slimbus.c:55:struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,\ndrivers/base/regmap/regmap-slimbus.c-56-\t\t\t\t\t  const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-slimbus.c-64-\ndrivers/base/regmap/regmap-slimbus.c:65:\treturn __devm_regmap_init(\u0026slimbus-\u003edev, bus, slimbus, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-slimbus.c-66-}\ndrivers/base/regmap/regmap-slimbus.c:67:EXPORT_SYMBOL_GPL(__devm_regmap_init_slimbus);\ndrivers/base/regmap/regmap-slimbus.c-68-\n--\ndrivers/base/regmap/regmap-spi-avmm.c=656=static const struct regmap_bus regmap_spi_avmm_bus = {\n--\ndrivers/base/regmap/regmap-spi-avmm.c-666-\ndrivers/base/regmap/regmap-spi-avmm.c:667:struct regmap *__regmap_init_spi_avmm(struct spi_device *spi,\ndrivers/base/regmap/regmap-spi-avmm.c-668-\t\t\t\t      const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spi-avmm.c-678-\ndrivers/base/regmap/regmap-spi-avmm.c:679:\tmap = __regmap_init(\u0026spi-\u003edev, \u0026regmap_spi_avmm_bus,\ndrivers/base/regmap/regmap-spi-avmm.c-680-\t\t\t    bridge, config, lock_key, lock_name);\n--\ndrivers/base/regmap/regmap-spi-avmm.c-687-}\ndrivers/base/regmap/regmap-spi-avmm.c:688:EXPORT_SYMBOL_GPL(__regmap_init_spi_avmm);\ndrivers/base/regmap/regmap-spi-avmm.c-689-\ndrivers/base/regmap/regmap-spi-avmm.c:690:struct regmap *__devm_regmap_init_spi_avmm(struct spi_device *spi,\ndrivers/base/regmap/regmap-spi-avmm.c-691-\t\t\t\t\t   const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spi-avmm.c-701-\ndrivers/base/regmap/regmap-spi-avmm.c:702:\tmap = __devm_regmap_init(\u0026spi-\u003edev, \u0026regmap_spi_avmm_bus,\ndrivers/base/regmap/regmap-spi-avmm.c-703-\t\t\t\t bridge, config, lock_key, lock_name);\n--\ndrivers/base/regmap/regmap-spi-avmm.c-710-}\ndrivers/base/regmap/regmap-spi-avmm.c:711:EXPORT_SYMBOL_GPL(__devm_regmap_init_spi_avmm);\ndrivers/base/regmap/regmap-spi-avmm.c-712-\n--\ndrivers/base/regmap/regmap-spi.c=112=static const struct regmap_bus *regmap_get_spi_bus(struct spi_device *spi,\n--\ndrivers/base/regmap/regmap-spi.c-138-\ndrivers/base/regmap/regmap-spi.c:139:struct regmap *__regmap_init_spi(struct spi_device *spi,\ndrivers/base/regmap/regmap-spi.c-140-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spi.c-148-\ndrivers/base/regmap/regmap-spi.c:149:\treturn __regmap_init(\u0026spi-\u003edev, bus, \u0026spi-\u003edev, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-spi.c-150-}\ndrivers/base/regmap/regmap-spi.c:151:EXPORT_SYMBOL_GPL(__regmap_init_spi);\ndrivers/base/regmap/regmap-spi.c-152-\ndrivers/base/regmap/regmap-spi.c:153:struct regmap *__devm_regmap_init_spi(struct spi_device *spi,\ndrivers/base/regmap/regmap-spi.c-154-\t\t\t\t      const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spi.c-162-\ndrivers/base/regmap/regmap-spi.c:163:\treturn __devm_regmap_init(\u0026spi-\u003edev, bus, \u0026spi-\u003edev, config, lock_key, lock_name);\ndrivers/base/regmap/regmap-spi.c-164-}\ndrivers/base/regmap/regmap-spi.c:165:EXPORT_SYMBOL_GPL(__devm_regmap_init_spi);\ndrivers/base/regmap/regmap-spi.c-166-\n--\ndrivers/base/regmap/regmap-spmi.c=77=static const struct regmap_bus regmap_spmi_base = {\n--\ndrivers/base/regmap/regmap-spmi.c-84-\ndrivers/base/regmap/regmap-spmi.c:85:struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev,\ndrivers/base/regmap/regmap-spmi.c-86-\t\t\t\t       const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spmi.c-89-{\ndrivers/base/regmap/regmap-spmi.c:90:\treturn __regmap_init(\u0026sdev-\u003edev, \u0026regmap_spmi_base, sdev, config,\ndrivers/base/regmap/regmap-spmi.c-91-\t\t\t     lock_key, lock_name);\ndrivers/base/regmap/regmap-spmi.c-92-}\ndrivers/base/regmap/regmap-spmi.c:93:EXPORT_SYMBOL_GPL(__regmap_init_spmi_base);\ndrivers/base/regmap/regmap-spmi.c-94-\ndrivers/base/regmap/regmap-spmi.c:95:struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *sdev,\ndrivers/base/regmap/regmap-spmi.c-96-\t\t\t\t\t    const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spmi.c-99-{\ndrivers/base/regmap/regmap-spmi.c:100:\treturn __devm_regmap_init(\u0026sdev-\u003edev, \u0026regmap_spmi_base, sdev, config,\ndrivers/base/regmap/regmap-spmi.c-101-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-spmi.c-102-}\ndrivers/base/regmap/regmap-spmi.c:103:EXPORT_SYMBOL_GPL(__devm_regmap_init_spmi_base);\ndrivers/base/regmap/regmap-spmi.c-104-\n--\ndrivers/base/regmap/regmap-spmi.c=197=static const struct regmap_bus regmap_spmi_ext = {\n--\ndrivers/base/regmap/regmap-spmi.c-204-\ndrivers/base/regmap/regmap-spmi.c:205:struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev,\ndrivers/base/regmap/regmap-spmi.c-206-\t\t\t\t      const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spmi.c-209-{\ndrivers/base/regmap/regmap-spmi.c:210:\treturn __regmap_init(\u0026sdev-\u003edev, \u0026regmap_spmi_ext, sdev, config,\ndrivers/base/regmap/regmap-spmi.c-211-\t\t\t     lock_key, lock_name);\ndrivers/base/regmap/regmap-spmi.c-212-}\ndrivers/base/regmap/regmap-spmi.c:213:EXPORT_SYMBOL_GPL(__regmap_init_spmi_ext);\ndrivers/base/regmap/regmap-spmi.c-214-\ndrivers/base/regmap/regmap-spmi.c:215:struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *sdev,\ndrivers/base/regmap/regmap-spmi.c-216-\t\t\t\t\t   const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-spmi.c-219-{\ndrivers/base/regmap/regmap-spmi.c:220:\treturn __devm_regmap_init(\u0026sdev-\u003edev, \u0026regmap_spmi_ext, sdev, config,\ndrivers/base/regmap/regmap-spmi.c-221-\t\t\t\t  lock_key, lock_name);\ndrivers/base/regmap/regmap-spmi.c-222-}\ndrivers/base/regmap/regmap-spmi.c:223:EXPORT_SYMBOL_GPL(__devm_regmap_init_spmi_ext);\ndrivers/base/regmap/regmap-spmi.c-224-\n--\ndrivers/base/regmap/regmap-w1.c=190=static const struct regmap_bus *regmap_get_w1_bus(struct device *w1_dev,\n--\ndrivers/base/regmap/regmap-w1.c-204-\ndrivers/base/regmap/regmap-w1.c:205:struct regmap *__regmap_init_w1(struct device *w1_dev,\ndrivers/base/regmap/regmap-w1.c-206-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-w1.c-215-\ndrivers/base/regmap/regmap-w1.c:216:\treturn __regmap_init(w1_dev, bus, w1_dev, config,\ndrivers/base/regmap/regmap-w1.c-217-\t\t\t lock_key, lock_name);\ndrivers/base/regmap/regmap-w1.c-218-}\ndrivers/base/regmap/regmap-w1.c:219:EXPORT_SYMBOL_GPL(__regmap_init_w1);\ndrivers/base/regmap/regmap-w1.c-220-\ndrivers/base/regmap/regmap-w1.c:221:struct regmap *__devm_regmap_init_w1(struct device *w1_dev,\ndrivers/base/regmap/regmap-w1.c-222-\t\t\t\t const struct regmap_config *config,\n--\ndrivers/base/regmap/regmap-w1.c-231-\ndrivers/base/regmap/regmap-w1.c:232:\treturn __devm_regmap_init(w1_dev, bus, w1_dev, config,\ndrivers/base/regmap/regmap-w1.c-233-\t\t\t\t lock_key, lock_name);\ndrivers/base/regmap/regmap-w1.c-234-}\ndrivers/base/regmap/regmap-w1.c:235:EXPORT_SYMBOL_GPL(__devm_regmap_init_w1);\ndrivers/base/regmap/regmap-w1.c-236-\n--\ndrivers/base/regmap/regmap.c=675=EXPORT_SYMBOL_GPL(regmap_get_val_endian);\ndrivers/base/regmap/regmap.c-676-\ndrivers/base/regmap/regmap.c:677:struct regmap *__regmap_init(struct device *dev,\ndrivers/base/regmap/regmap.c-678-\t\t\t     const struct regmap_bus *bus,\n--\ndrivers/base/regmap/regmap.c-1182-}\ndrivers/base/regmap/regmap.c:1183:EXPORT_SYMBOL_GPL(__regmap_init);\ndrivers/base/regmap/regmap.c-1184-\ndrivers/base/regmap/regmap.c=1185=static void devm_regmap_release(void *regmap)\n--\ndrivers/base/regmap/regmap.c-1189-\ndrivers/base/regmap/regmap.c:1190:struct regmap *__devm_regmap_init(struct device *dev,\ndrivers/base/regmap/regmap.c-1191-\t\t\t\t  const struct regmap_bus *bus,\n--\ndrivers/base/regmap/regmap.c-1199-\ndrivers/base/regmap/regmap.c:1200:\tregmap = __regmap_init(dev, bus, bus_context, config,\ndrivers/base/regmap/regmap.c-1201-\t\t\t       lock_key, lock_name);\n--\ndrivers/base/regmap/regmap.c-1210-}\ndrivers/base/regmap/regmap.c:1211:EXPORT_SYMBOL_GPL(__devm_regmap_init);\ndrivers/base/regmap/regmap.c-1212-\n--\ndrivers/base/regmap/regmap.c=3543=EXPORT_SYMBOL_GPL(regmap_parse_val);\ndrivers/base/regmap/regmap.c-3544-\ndrivers/base/regmap/regmap.c:3545:static int __init regmap_initcall(void)\ndrivers/base/regmap/regmap.c-3546-{\n--\ndrivers/base/regmap/regmap.c-3550-}\ndrivers/base/regmap/regmap.c:3551:postcore_initcall(regmap_initcall);\n--\ndrivers/bluetooth/btintel.c=881=static const struct regmap_config regmap_ibt_cfg = {\n--\ndrivers/bluetooth/btintel.c-886-\ndrivers/bluetooth/btintel.c:887:struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read,\ndrivers/bluetooth/btintel.c-888-\t\t\t\t   u16 opcode_write)\n--\ndrivers/bluetooth/btintel.c-902-\ndrivers/bluetooth/btintel.c:903:\treturn regmap_init(\u0026hdev-\u003edev, \u0026regmap_ibt, ctx, \u0026regmap_ibt_cfg);\ndrivers/bluetooth/btintel.c-904-}\ndrivers/bluetooth/btintel.c:905:EXPORT_SYMBOL_GPL(btintel_regmap_init);\ndrivers/bluetooth/btintel.c-906-\n--\ndrivers/bluetooth/btintel.h=271=int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver);\ndrivers/bluetooth/btintel.h:272:struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read,\ndrivers/bluetooth/btintel.h-273-\t\t\t\t   u16 opcode_write);\n--\ndrivers/bluetooth/btintel.h=341=static inline int btintel_read_version(struct hci_dev *hdev,\n--\ndrivers/bluetooth/btintel.h-346-\ndrivers/bluetooth/btintel.h:347:static inline struct regmap *btintel_regmap_init(struct hci_dev *hdev,\ndrivers/bluetooth/btintel.h-348-\t\t\t\t\t\t u16 opcode_read,\n--\ndrivers/bus/sunxi-rsb.c=469=static struct sunxi_rsb_ctx *regmap_sunxi_rsb_init_ctx(struct sunxi_rsb_device *rdev,\n--\ndrivers/bus/sunxi-rsb.c-492-\ndrivers/bus/sunxi-rsb.c:493:struct regmap *__devm_regmap_init_sunxi_rsb(struct sunxi_rsb_device *rdev,\ndrivers/bus/sunxi-rsb.c-494-\t\t\t\t\t    const struct regmap_config *config,\n--\ndrivers/bus/sunxi-rsb.c-502-\ndrivers/bus/sunxi-rsb.c:503:\treturn __devm_regmap_init(\u0026rdev-\u003edev, \u0026regmap_sunxi_rsb, ctx, config,\ndrivers/bus/sunxi-rsb.c-504-\t\t\t\t  lock_key, lock_name);\ndrivers/bus/sunxi-rsb.c-505-}\ndrivers/bus/sunxi-rsb.c:506:EXPORT_SYMBOL_GPL(__devm_regmap_init_sunxi_rsb);\ndrivers/bus/sunxi-rsb.c-507-\n--\ndrivers/bus/vexpress-config.c=60=struct vexpress_config_bridge_ops {\ndrivers/bus/vexpress-config.c:61:\tstruct regmap * (*regmap_init)(struct device *dev, void *context);\ndrivers/bus/vexpress-config.c-62-\tvoid (*regmap_exit)(struct regmap *regmap, void *context);\n--\ndrivers/bus/vexpress-config.c=122=static void vexpress_config_devres_release(struct device *dev, void *res)\n--\ndrivers/bus/vexpress-config.c-129-\ndrivers/bus/vexpress-config.c:130:struct regmap *devm_regmap_init_vexpress_config(struct device *dev)\ndrivers/bus/vexpress-config.c-131-{\n--\ndrivers/bus/vexpress-config.c-144-\ndrivers/bus/vexpress-config.c:145:\tregmap = (bridge-\u003eops-\u003eregmap_init)(dev, bridge-\u003econtext);\ndrivers/bus/vexpress-config.c-146-\tif (IS_ERR(regmap)) {\n--\ndrivers/bus/vexpress-config.c-155-}\ndrivers/bus/vexpress-config.c:156:EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);\ndrivers/bus/vexpress-config.c-157-\n--\ndrivers/bus/vexpress-config.c=235=static struct regmap_config vexpress_syscfg_regmap_config = {\n--\ndrivers/bus/vexpress-config.c-246-\ndrivers/bus/vexpress-config.c:247:static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,\ndrivers/bus/vexpress-config.c-248-\t\tvoid *context)\n--\ndrivers/bus/vexpress-config.c-312-\ndrivers/bus/vexpress-config.c:313:\tfunc-\u003eregmap = regmap_init(dev, NULL, func,\ndrivers/bus/vexpress-config.c-314-\t\t\t\u0026vexpress_syscfg_regmap_config);\n--\ndrivers/bus/vexpress-config.c=344=static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {\ndrivers/bus/vexpress-config.c:345:\t.regmap_init = vexpress_syscfg_regmap_init,\ndrivers/bus/vexpress-config.c-346-\t.regmap_exit = vexpress_syscfg_regmap_exit,\n--\ndrivers/clk/actions/owl-common.c=23=static void owl_clk_set_regmap(const struct owl_clk_desc *desc,\n--\ndrivers/clk/actions/owl-common.c-37-\ndrivers/clk/actions/owl-common.c:38:int owl_clk_regmap_init(struct platform_device *pdev,\ndrivers/clk/actions/owl-common.c-39-\t\t\tstruct owl_clk_desc *desc)\n--\ndrivers/clk/actions/owl-common.c-47-\ndrivers/clk/actions/owl-common.c:48:\tregmap = devm_regmap_init_mmio(\u0026pdev-\u003edev, base, \u0026owl_regmap_config);\ndrivers/clk/actions/owl-common.c-49-\tif (IS_ERR(regmap)) {\n\n"
}

33/2 2026/07/25 10:05 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 65276
							output: 44
							thoughts: 63
						

Thoughts:
**Investigating the RTL9300 MDIO Driver's Register Map Initialization**

Okay, so I'm digging into the Realtek RTL9300 MDIO driver – it's crucial for understanding how the network interface is managed at a low level. My initial thought is that it probably utilizes `devm_regmap_init_mmio`, or something similar, for its register map initialization. That's usually the standard approach, especially when dealing with memory-mapped I/O. To confirm, I'll need to jump into the source code, specifically `drivers/net/mdio/mdio-realtek-rtl9300.c`. Let's see how the driver actually handles the register map and if it's following the standard methodology. I'm keen to examine the `regmap` implementation to ensure efficient and controlled access to the RTL9300's internal registers. It is also important to verify how this is connected to the core MDIO functionality.



34/2 2026/07/25 10:05 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "regmap_init",
  "PathPrefix": "drivers/net/mdio/mdio-realtek-rtl9300.c"
}

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

35/2 2026/07/25 10:05 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 65609
							output: 42
							thoughts: 26
						

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

**Investigating the Register Map Initialization**

Hmm, hold on a second. This code doesn't seem to be using `regmap_init` like I'd expect for register map setup. That's a little unusual, given the general architecture. I'm going to need to dig deeper into *how* it's actually getting the `regmap` handle. Maybe there's a different initialization path or a custom driver setup that bypasses the standard procedure. I need to trace back from where `regmap` is used and see where its value is being derived. Is it being passed in from somewhere? Is there a helper function being called? Time to navigate the code and piece together the register map initialization sequence.



36/2 2026/07/25 10:05 tool grepper
0m Args:
{
  "Expression": "regmap",
  "PathPrefix": "drivers/net/mdio/mdio-realtek-rtl9300.c"
}

Results:
{
  "Output": "drivers/net/mdio/mdio-realtek-rtl9300.c-125-#include \u003clinux/property.h\u003e\ndrivers/net/mdio/mdio-realtek-rtl9300.c:126:#include \u003clinux/regmap.h\u003e\ndrivers/net/mdio/mdio-realtek-rtl9300.c-127-\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=246=struct otto_emdio_priv {\ndrivers/net/mdio/mdio-realtek-rtl9300.c-247-\tconst struct otto_emdio_info *info;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:248:\tstruct regmap *regmap;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-249-\tstruct mutex lock; /* protect HW access */\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=305=static int otto_emdio_set_port_polling(struct otto_emdio_priv *priv, int port, bool active)\ndrivers/net/mdio/mdio-realtek-rtl9300.c-306-{\ndrivers/net/mdio/mdio-realtek-rtl9300.c:307:\treturn regmap_assign_bits(priv-\u003eregmap, priv-\u003einfo-\u003epoll_ctrl + (port / 32) * 4,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-308-\t\t\t\t  BIT(port % 32), active);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=311=static int otto_emdio_run_cmd(struct mii_bus *bus, u32 cmd,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-319-\t/* Defensive pre check just in case something goes horribly wrong */\ndrivers/net/mdio/mdio-realtek-rtl9300.c:320:\tret = regmap_read_poll_timeout(priv-\u003eregmap, info-\u003ecmd_regs.c22_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-321-\t\t\t\t       cmdstate, !(cmdstate \u0026 PHY_CTRL_CMD), 10, 10000);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-327-\t\t/* Fill extra registers for high port count models */\ndrivers/net/mdio/mdio-realtek-rtl9300.c:328:\t\tret = regmap_write(priv-\u003eregmap, info-\u003ecmd_regs.broadcast, cmd_data-\u003ebroadcast);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-329-\t\tif (ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-331-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:332:\t\tret = regmap_write(priv-\u003eregmap, info-\u003ecmd_regs.ext_page, cmd_data-\u003eext_page);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-333-\t\tif (ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-335-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:336:\t\tret = regmap_write(priv-\u003eregmap,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-337-\t\t\t\t   info-\u003ecmd_regs.port_mask_high, cmd_data-\u003eport_mask_high);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-341-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:342:\tret = regmap_write(priv-\u003eregmap, info-\u003ecmd_regs.port_mask_low, cmd_data-\u003eport_mask_low);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-343-\tif (ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-345-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:346:\tret = regmap_write(priv-\u003eregmap, info-\u003ecmd_regs.io_data, cmd_data-\u003eio_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-347-\tif (ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-349-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:350:\tret = regmap_write(priv-\u003eregmap, info-\u003ecmd_regs.c45_data, cmd_data-\u003ec45_data);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-351-\tif (ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-354-\t/* C22 data and command bits share the same register. */\ndrivers/net/mdio/mdio-realtek-rtl9300.c:355:\tret = regmap_write(priv-\u003eregmap, info-\u003ecmd_regs.c22_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-356-\t\t\t   cmd_data-\u003ec22_data | cmd | PHY_CTRL_CMD);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-359-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:360:\tret = regmap_read_poll_timeout(priv-\u003eregmap, info-\u003ecmd_regs.c22_data,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-361-\t\t\t\t       cmdstate, !(cmdstate \u0026 PHY_CTRL_CMD), 10, 10000);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=368=static int otto_emdio_read_cmd(struct mii_bus *bus, u32 cmd,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-378-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:379:\tret = regmap_read(priv-\u003eregmap, priv-\u003einfo-\u003ecmd_regs.io_data, value);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-380-\tif (ret)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=692=static int otto_emdio_write_mapping(struct otto_emdio_priv *priv, u32 base, u32 port,\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-698-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:699:\treturn regmap_update_bits(priv-\u003eregmap, reg, mask \u003c\u003c shift, value \u003c\u003c shift);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-700-}\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=728=static int otto_emdio_8380_setup_controller(struct otto_emdio_priv *priv)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-733-\t */\ndrivers/net/mdio/mdio-realtek-rtl9300.c:734:\treturn regmap_set_bits(priv-\u003eregmap, RTL8380_SMI_GLB_CTRL, RTL8380_SMI_PHY_PATCH_DONE);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-735-}\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=737=static int otto_emdio_9300_setup_controller(struct otto_emdio_priv *priv)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-739-\tu32 glb_ctrl_mask = 0, glb_ctrl_val = 0;\ndrivers/net/mdio/mdio-realtek-rtl9300.c:740:\tstruct regmap *regmap = priv-\u003eregmap;\ndrivers/net/mdio/mdio-realtek-rtl9300.c-741-\tint i, err;\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-748-\ndrivers/net/mdio/mdio-realtek-rtl9300.c:749:\terr = regmap_update_bits(regmap, RTL9300_SMI_GLB_CTRL,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-750-\t\t\t\t glb_ctrl_mask, glb_ctrl_val);\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=757=static int otto_emdio_9310_setup_controller(struct otto_emdio_priv *priv)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-762-\tfor (i = 0; i \u003c priv-\u003einfo-\u003enum_buses; i++) {\ndrivers/net/mdio/mdio-realtek-rtl9300.c:763:\t\terr = regmap_assign_bits(priv-\u003eregmap, RTL9310_SMI_GLB_CTRL1,\ndrivers/net/mdio/mdio-realtek-rtl9300.c-764-\t\t\t\t\t RTL9310_SMI_GLB_FMT_SEL_C45(i),\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c=979=static int otto_emdio_probe(struct platform_device *pdev)\n--\ndrivers/net/mdio/mdio-realtek-rtl9300.c-993-\tpriv-\u003einfo = device_get_match_data(dev);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:994:\tpriv-\u003eregmap = syscon_node_to_regmap(dev-\u003eparent-\u003eof_node);\ndrivers/net/mdio/mdio-realtek-rtl9300.c:995:\tif (IS_ERR(priv-\u003eregmap))\ndrivers/net/mdio/mdio-realtek-rtl9300.c:996:\t\treturn PTR_ERR(priv-\u003eregmap);\ndrivers/net/mdio/mdio-realtek-rtl9300.c-997-\n"
}

37/2 2026/07/25 10:05 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 68724
							output: 20
							thoughts: 181
						

Thoughts:
**Analyzing the Register Map Initialization**

Okay, so I see this line: `priv->regmap = syscon_node_to_regmap(dev->parent->of_node);` Right, it's grabbing the register map from the `syscon` node. That's pretty standard for these types of drivers. Now, `syscon_node_to_regmap` is a function provided by `MFD_SYSCON`. Time to verify that `MFD_SYSCON` is actually enabled in this build. It usually is, but I always prefer to be thorough. I'll take a quick look at the configuration to confirm.

Ah, looks like `MFD_SYSCON` isn't explicitly set in the *current* config, so I'll add it to my `EnableConfigs` list to be safe. It looks like it should have been on by default, so it's probably just not set.

Let me just double-check that this is a boolean config, which seems likely. Yes, I'll quickly check `drivers/mfd/Kconfig` to confirm. It's always good to be certain about the dependencies before moving on.



38/2 2026/07/25 10:05 tool grepper
0m Args:
{
  "Expression": "config MFD_SYSCON"
}

Results:
{
  "Output": "drivers/mfd/Kconfig=1635=config MFD_SUN6I_PRCM\n--\ndrivers/mfd/Kconfig-1643-\ndrivers/mfd/Kconfig:1644:config MFD_SYSCON\ndrivers/mfd/Kconfig-1645-\tbool \"System Controller Register R/W Based on Regmap\"\n"
}

39/2 2026/07/25 10:05 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 69276
							output: 216
							thoughts: 857
						

Thoughts:
**Analyzing the MDIO Driver Patch**

Okay, first things first, confirming that `MFD_SYSCON` is indeed a boolean. Good, moving on. Now, let's zero in on the key functions we need to focus on for this patch. I've identified:

*   `phy_attach_direct`
*   `phy_detach`
*   `otto_emdio_probe`
*   `otto_emdio_notify_phy_attach`
*   `otto_emdio_notify_phy_detach`

Specifically, I see that the `otto_emdio_notify_*` functions are passed to the `bus->notify_*` callbacks. That's a strong indication of their importance in the overall control flow.

Let me take another quick sweep through `mdio-realtek-rtl9300.c` to ensure I'm not missing anything crucial. Alright, there are also the `otto_emdio_run_cmd`, `otto_emdio_read_cmd`, `otto_emdio_write_cmd` and the new `otto_emdio_8380_*` and `otto_emdio_8390_*` functions. These latter functions are specifically added by this patch, and I initially thought they might warrant inclusion because of their read/write nature. However, they are assigned to function pointers within the `otto_emdio_info` struct, meaning they likely *won't* be inlined. While they are new, focusing on the core driver setup and attachment logic provided by `otto_emdio_probe` and the notification functions seems sufficient. Including everything would just add noise to the analysis.

So, let's refine my `FocusSymbols` to:

*   `phy_attach_direct`
*   `phy_detach`
*   `otto_emdio_probe`
*   `otto_emdio_notify_phy_attach`
*   `otto_emdio_notify_phy_detach`

That feels right. Now, a quick check on `phy_attach_direct` and `phy_detach`. While these are core PHY functions, I don't believe they are heavily fuzzed, as they're not in the "hot path" like `phy_read` or `phy_write`. They are invoked during device initialization and teardown, making them fair game for inclusion.

Okay, let's summarize the reasoning behind this selection, to make it explicit: This patch introduces support for Realtek Otto Switches, the RTL8380 and RTL8390 specifically. It also incorporates hardware polling. The patch modifies the fundamental PHY code to include `notify_phy_attach` and `notify_phy_detach` callbacks within `struct mii_bus`, which are then triggered by `phy_attach_direct` and `phy_detach`. These core changes, specifically the notification callbacks, are highly reachable and crucial to the control flow, ensuring that PHY devices are correctly integrated with the driver. The MDIO driver changes are reachable, if the driver itself is enabled.

Finally, the relevant configurations here are:

*   `MDIO_REALTEK_RTL9300`
*   `COMPILE_TEST`
*   `PHYLIB`
*   `MFD_SYSCON`

Time to `set-results`.



40/2 2026/07/25 10:05 tool set-results
0m Args:
{
  "EnableConfigs": [
    "MDIO_REALTEK_RTL9300",
    "COMPILE_TEST",
    "PHYLIB",
    "MFD_SYSCON"
  ],
  "FocusSymbols": [
    "phy_attach_direct",
    "phy_detach",
    "otto_emdio_probe",
    "otto_emdio_notify_phy_attach",
    "otto_emdio_notify_phy_detach"
  ],
  "Reasoning": "The patch adds support for Realtek Otto Switches Ethernet MDIO Controller (RTL8380, RTL8390) and introduces hardware polling support. It modifies core PHY code (phy_device.c) to add notify_phy_attach and notify_phy_detach callbacks to struct mii_bus, which are invoked from phy_attach_direct and phy_detach. These core changes are highly reachable and functional. The MDIO driver changes are also reachable if the driver is enabled.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "MDIO_REALTEK_RTL9300",
    "COMPILE_TEST",
    "PHYLIB",
    "MFD_SYSCON"
  ],
  "FocusSymbols": [
    "phy_attach_direct",
    "phy_detach",
    "otto_emdio_probe",
    "otto_emdio_notify_phy_attach",
    "otto_emdio_notify_phy_detach"
  ],
  "Reasoning": "The patch adds support for Realtek Otto Switches Ethernet MDIO Controller (RTL8380, RTL8390) and introduces hardware polling support. It modifies core PHY code (phy_device.c) to add notify_phy_attach and notify_phy_detach callbacks to struct mii_bus, which are invoked from phy_attach_direct and phy_detach. These core changes are highly reachable and functional. The MDIO driver changes are also reachable if the driver is enabled.",
  "WorthFuzzing": true
}

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)