| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/26 12:15 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies devicetree bindings documentation and the dwmac-mediatek platform driver for ARM-based MediaTek SoCs (MT2712/MT8188/MT8189/MT8195). This requires specific physical MediaTek SoC hardware that is not emulated in standard virtualized QEMU/GCE environments and is structurally unreachable on the amd64 target architecture.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/26 12:15 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit faa8175e9c96d07ab719d2f32cb487a70806073c\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sat Sep 26 12:15:41 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml\nindex 3aab21b8e8de5..6624dff015f09 100644\n--- a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml\n+++ b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml\n@@ -20,13 +20,11 @@ select:\n enum:\n - mediatek,mt2712-gmac\n - mediatek,mt8188-gmac\n+ - mediatek,mt8189-gmac\n - mediatek,mt8195-gmac\n required:\n - compatible\n \n-allOf:\n- - $ref: snps,dwmac.yaml#\n-\n properties:\n compatible:\n oneOf:\n@@ -36,6 +34,7 @@ properties:\n - const: snps,dwmac-4.20a\n - items:\n - enum:\n+ - mediatek,mt8189-gmac\n - mediatek,mt8195-gmac\n - const: snps,dwmac-5.10a\n - items:\n@@ -44,26 +43,6 @@ properties:\n - const: mediatek,mt8195-gmac\n - const: snps,dwmac-5.10a\n \n- clocks:\n- minItems: 5\n- items:\n- - description: AXI clock\n- - description: APB clock\n- - description: MAC Main clock\n- - description: PTP clock\n- - description: RMII reference clock provided by MAC\n- - description: MAC clock gate\n-\n- clock-names:\n- minItems: 5\n- items:\n- - const: axi\n- - const: apb\n- - const: mac_main\n- - const: ptp_ref\n- - const: rmii_internal\n- - const: mac_cg\n-\n interrupts:\n maxItems: 1\n \n@@ -86,8 +65,10 @@ properties:\n or will round down. Range 0~31*170.\n For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,\n or will round down. Range 0~31*550.\n- For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple of 290,\n- or will round down. Range 0~31*290.\n+ For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a\n+ multiple of 290, or will round down. Range 0~31*290.\n+ For MT8189 RGMII/RMII/MII interface, Allowed value need to\n+ be a multiple of 180, or will round down. Range 0~31*180.\n \n mediatek,rx-delay-ps:\n description:\n@@ -96,8 +77,10 @@ properties:\n or will round down. Range 0~31*170.\n For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,\n or will round down. Range 0~31*550.\n- For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple\n- of 290, or will round down. Range 0~31*290.\n+ For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a\n+ multiple of 290, or will round down. Range 0~31*290.\n+ For MT8189 RGMII/RMII/MII interface, Allowed value need to\n+ be a multiple of 180, or will round down. Range 0~31*180.\n \n mediatek,rmii-rxc:\n type: boolean\n@@ -147,6 +130,56 @@ required:\n - phy-mode\n - mediatek,pericfg\n \n+allOf:\n+ - $ref: snps,dwmac.yaml#\n+ - if:\n+ properties:\n+ compatible:\n+ contains:\n+ enum:\n+ - mediatek,mt2712-gmac\n+ - mediatek,mt8188-gmac\n+ - mediatek,mt8195-gmac\n+ then:\n+ properties:\n+ clocks:\n+ minItems: 5\n+ items:\n+ - description: AXI clock\n+ - description: APB clock\n+ - description: MAC Main clock\n+ - description: PTP clock\n+ - description: RMII reference clock provided by MAC\n+ - description: MAC clock gate\n+\n+ clock-names:\n+ minItems: 5\n+ items:\n+ - const: axi\n+ - const: apb\n+ - const: mac_main\n+ - const: ptp_ref\n+ - const: rmii_internal\n+ - const: mac_cg\n+\n+ - if:\n+ properties:\n+ compatible:\n+ contains:\n+ enum:\n+ - mediatek,mt8189-gmac\n+ then:\n+ properties:\n+ clocks:\n+ items:\n+ - description: MAC Main clock\n+ - description: PTP clock\n+\n+ clock-names:\n+ items:\n+ - const: mac_main\n+ - const: ptp_ref\n+\n unevaluatedProperties: false\n \n examples:\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c\nindex 30ae0dba7fffd..f07c331b029f0 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c\n@@ -36,8 +36,20 @@\n #define ETH_FINE_DLY_GTXC\tBIT(1)\n #define ETH_FINE_DLY_RXC\tBIT(0)\n \n+/* Peri Configuration register for mt8189 */\n+#define MT8189_PERI_ETH_CTRL_OFFSET\t0x270\n+\n+#define MT8189_CTRL0_TXC_OUT_OP_EN\tBIT(20)\n+\n+#define MT8189_DLY_RXC_STAGE_DIV\t180 /* 180ps per stage */\n+#define MT8189_DLY_RXC_MAX\t\t5760 /* 32 * 180ps */\n+#define MT8189_DLY_TXC_STAGE_DIV\t180 /* 180ps per stage */\n+#define MT8189_DLY_TXC_MAX\t\t5760 /* 32 * 180ps */\n+\n /* Peri Configuration register for mt8195 */\n-#define MT8195_PERI_ETH_CTRL0\t\t0xFD0\n+#define MT8195_PERI_ETH_CTRL_OFFSET\t0xFD0\n+\n+#define MT8195_PERI_ETH_CTRL0\t\t0x0\n #define MT8195_RMII_CLK_SRC_INTERNAL\tBIT(28)\n #define MT8195_RMII_CLK_SRC_RXC\t\tBIT(27)\n #define MT8195_ETH_INTF_SEL\t\tGENMASK(26, 24)\n@@ -47,7 +59,7 @@\n #define MT8195_DLY_GTXC_ENABLE\t\tBIT(5)\n #define MT8195_DLY_GTXC_STAGES\t\tGENMASK(4, 0)\n \n-#define MT8195_PERI_ETH_CTRL1\t\t0xFD4\n+#define MT8195_PERI_ETH_CTRL1\t\t0x4\n #define MT8195_DLY_RXC_INV\t\tBIT(25)\n #define MT8195_DLY_RXC_ENABLE\t\tBIT(18)\n #define MT8195_DLY_RXC_STAGES\t\tGENMASK(17, 13)\n@@ -55,7 +67,7 @@\n #define MT8195_DLY_TXC_ENABLE\t\tBIT(5)\n #define MT8195_DLY_TXC_STAGES\t\tGENMASK(4, 0)\n \n-#define MT8195_PERI_ETH_CTRL2\t\t0xFD8\n+#define MT8195_PERI_ETH_CTRL2\t\t0x8\n #define MT8195_DLY_RMII_RXC_INV\t\tBIT(25)\n #define MT8195_DLY_RMII_RXC_ENABLE\tBIT(18)\n #define MT8195_DLY_RMII_RXC_STAGES\tGENMASK(17, 13)\n@@ -63,6 +75,11 @@\n #define MT8195_DLY_RMII_TXC_ENABLE\tBIT(5)\n #define MT8195_DLY_RMII_TXC_STAGES\tGENMASK(4, 0)\n \n+#define MT8195_DLY_RXC_STAGE_DIV\t290 /* 290ps per stage */\n+#define MT8195_DLY_RXC_MAX\t\t9280 /* 32 x 290ps */\n+#define MT8195_DLY_TXC_STAGE_DIV\t290 /* 290ps per stage */\n+#define MT8195_DLY_TXC_MAX\t\t9280 /* 32 x 290ps */\n+\n struct mac_delay_struct {\n \tu32 tx_delay;\n \tu32 rx_delay;\n@@ -89,13 +106,20 @@ struct mediatek_dwmac_variant {\n \t\t\t\t u8 phy_intf_sel);\n \tint (*dwmac_set_delay)(struct mediatek_dwmac_plat_data *plat);\n \n+\tvoid (*dwmac_fix_mac_speed)(void *priv, phy_interface_t interface,\n+\t\t\t\t int speed, unsigned int mode);\n+\n \t/* clock ids to be requested */\n \tconst char * const *clk_list;\n \tint num_clks;\n \n+\tu32 peri_eth_ctrl_offset;\n \tu32 rx_delay_max;\n \tu32 tx_delay_max;\n+\tu16 rx_delay_stage_div;\n+\tu16 tx_delay_stage_div;\n \tu8 dma_bit_mask;\n+\tbool mac_txclk_out_en;\n };\n \n /* list of clocks required for mac */\n@@ -107,6 +131,10 @@ static const char * const mt8195_dwmac_clk_l[] = {\n \t\"axi\", \"apb\", \"mac_cg\", \"mac_main\", \"ptp_ref\"\n };\n \n+static const char * const mt8189_dwmac_clk_l[] = {\n+\t\"mac_main\", \"ptp_ref\"\n+};\n+\n static int mt2712_set_interface(struct mediatek_dwmac_plat_data *plat,\n \t\t\t\tu8 phy_intf_sel)\n {\n@@ -277,6 +305,7 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,\n \t\t\t\tu8 phy_intf_sel)\n {\n \tu32 intf_val = FIELD_PREP(MT8195_ETH_INTF_SEL, phy_intf_sel);\n+\tu32 reg_offset = plat-\u003evariant-\u003eperi_eth_ctrl_offset;\n \n \tif (phy_intf_sel == PHY_INTF_SEL_RMII) {\n \t\tif (plat-\u003ermii_clk_from_mac)\n@@ -288,44 +317,50 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,\n \t/* MT8195 only support external PHY */\n \tintf_val |= MT8195_EXT_PHY_MODE;\n \n-\tregmap_write(plat-\u003eperi_regmap, MT8195_PERI_ETH_CTRL0, intf_val);\n+\tif (plat-\u003evariant-\u003emac_txclk_out_en)\n+\t\tintf_val |= MT8189_CTRL0_TXC_OUT_OP_EN;\n \n-\treturn 0;\n-}\n+\tregmap_write(plat-\u003eperi_regmap,\n+\t\t reg_offset + MT8195_PERI_ETH_CTRL0,\n+\t\t intf_val);\n \n-static void mt8195_delay_ps2stage(struct mediatek_dwmac_plat_data *plat)\n-{\n-\tstruct mac_delay_struct *mac_delay = \u0026plat-\u003emac_delay;\n-\n-\t/* 290ps per stage */\n-\tmac_delay-\u003etx_delay /= 290;\n-\tmac_delay-\u003erx_delay /= 290;\n-}\n-\n-static void mt8195_delay_stage2ps(struct mediatek_dwmac_plat_data *plat)\n-{\n-\tstruct mac_delay_struct *mac_delay = \u0026plat-\u003emac_delay;\n-\n-\t/* 290ps per stage */\n-\tmac_delay-\u003etx_delay *= 290;\n-\tmac_delay-\u003erx_delay *= 290;\n+\treturn 0;\n }\n \n static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)\n {\n+\tu16 rx_delay_stage_div = plat-\u003evariant-\u003erx_delay_stage_div;\n+\tu16 tx_delay_stage_div = plat-\u003evariant-\u003etx_delay_stage_div;\n \tstruct mac_delay_struct *mac_delay = \u0026plat-\u003emac_delay;\n-\tu32 gtxc_delay_val = 0, delay_val = 0, rmii_delay_val = 0;\n+\tu32 reg_offset = plat-\u003evariant-\u003eperi_eth_ctrl_offset;\n+\tu32 rx_delay_stage_val;\n+\tu32 tx_delay_stage_val;\n+\tu32 gtxc_delay_val = 0;\n+\tu32 rmii_delay_val = 0;\n+\tu32 delay_val = 0;\n+\n+\tif (rx_delay_stage_div)\n+\t\trx_delay_stage_val = mac_delay-\u003erx_delay / rx_delay_stage_div;\n+\telse\n+\t\trx_delay_stage_val = 0;\n \n-\tmt8195_delay_ps2stage(plat);\n+\tif (tx_delay_stage_div)\n+\t\ttx_delay_stage_val = mac_delay-\u003etx_delay / tx_delay_stage_div;\n+\telse\n+\t\ttx_delay_stage_val = 0;\n \n \tswitch (plat-\u003ephy_mode) {\n \tcase PHY_INTERFACE_MODE_MII:\n-\t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE, !!mac_delay-\u003etx_delay);\n-\t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES, mac_delay-\u003etx_delay);\n+\t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE,\n+\t\t\t\t\t!!tx_delay_stage_val);\n+\t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES,\n+\t\t\t\t\ttx_delay_stage_val);\n \t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_INV, mac_delay-\u003etx_inv);\n \n-\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE, !!mac_delay-\u003erx_delay);\n-\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES, mac_delay-\u003erx_delay);\n+\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,\n+\t\t\t\t\t!!rx_delay_stage_val);\n+\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,\n+\t\t\t\t\trx_delay_stage_val);\n \t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_INV, mac_delay-\u003erx_inv);\n \t\tbreak;\n \tcase PHY_INTERFACE_MODE_RMII:\n@@ -336,16 +371,16 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)\n \t\t\t * The ingress timing can be adjusted by RMII_RXC delay macro circuit.\n \t\t\t */\n \t\t\trmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_ENABLE,\n-\t\t\t\t\t\t !!mac_delay-\u003etx_delay);\n+\t\t\t\t\t\t !!tx_delay_stage_val);\n \t\t\trmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_STAGES,\n-\t\t\t\t\t\t mac_delay-\u003etx_delay);\n+\t\t\t\t\t\t tx_delay_stage_val);\n \t\t\trmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_INV,\n \t\t\t\t\t\t mac_delay-\u003etx_inv);\n \n \t\t\trmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_ENABLE,\n-\t\t\t\t\t\t !!mac_delay-\u003erx_delay);\n+\t\t\t\t\t\t !!rx_delay_stage_val);\n \t\t\trmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_STAGES,\n-\t\t\t\t\t\t mac_delay-\u003erx_delay);\n+\t\t\t\t\t\t rx_delay_stage_val);\n \t\t\trmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_INV,\n \t\t\t\t\t\t mac_delay-\u003erx_inv);\n \t\t} else {\n@@ -361,9 +396,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)\n \t\t\t\t * by RXC delay macro circuit.\n \t\t\t\t */\n \t\t\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,\n-\t\t\t\t\t\t\t!!mac_delay-\u003erx_delay);\n+\t\t\t\t\t\t\t!!rx_delay_stage_val);\n \t\t\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,\n-\t\t\t\t\t\t\tmac_delay-\u003erx_delay);\n+\t\t\t\t\t\t\trx_delay_stage_val);\n \t\t\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_INV,\n \t\t\t\t\t\t\tmac_delay-\u003erx_inv);\n \t\t\t} else {\n@@ -372,9 +407,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)\n \t\t\t\t * by TXC delay macro circuit.\n \t\t\t\t */\n \t\t\t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE,\n-\t\t\t\t\t\t\t!!mac_delay-\u003erx_delay);\n+\t\t\t\t\t\t\t!!rx_delay_stage_val);\n \t\t\t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES,\n-\t\t\t\t\t\t\tmac_delay-\u003erx_delay);\n+\t\t\t\t\t\t\trx_delay_stage_val);\n \t\t\t\tdelay_val |= FIELD_PREP(MT8195_DLY_TXC_INV,\n \t\t\t\t\t\t\tmac_delay-\u003erx_inv);\n \t\t\t}\n@@ -384,12 +419,16 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)\n \tcase PHY_INTERFACE_MODE_RGMII_TXID:\n \tcase PHY_INTERFACE_MODE_RGMII_RXID:\n \tcase PHY_INTERFACE_MODE_RGMII_ID:\n-\t\tgtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE, !!mac_delay-\u003etx_delay);\n-\t\tgtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES, mac_delay-\u003etx_delay);\n+\t\tgtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,\n+\t\t\t\t\t !!tx_delay_stage_val);\n+\t\tgtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES,\n+\t\t\t\t\t tx_delay_stage_val);\n \t\tgtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_INV, mac_delay-\u003etx_inv);\n \n-\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE, !!mac_delay-\u003erx_delay);\n-\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES, mac_delay-\u003erx_delay);\n+\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,\n+\t\t\t\t\t!!rx_delay_stage_val);\n+\t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,\n+\t\t\t\t\trx_delay_stage_val);\n \t\tdelay_val |= FIELD_PREP(MT8195_DLY_RXC_INV, mac_delay-\u003erx_inv);\n \n \t\tbreak;\n@@ -399,28 +438,101 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)\n \t}\n \n \tregmap_update_bits(plat-\u003eperi_regmap,\n-\t\t\t MT8195_PERI_ETH_CTRL0,\n+\t\t\t reg_offset + MT8195_PERI_ETH_CTRL0,\n \t\t\t MT8195_RGMII_TXC_PHASE_CTRL |\n \t\t\t MT8195_DLY_GTXC_INV |\n \t\t\t MT8195_DLY_GTXC_ENABLE |\n \t\t\t MT8195_DLY_GTXC_STAGES,\n \t\t\t gtxc_delay_val);\n-\tregmap_write(plat-\u003eperi_regmap, MT8195_PERI_ETH_CTRL1, delay_val);\n-\tregmap_write(plat-\u003eperi_regmap, MT8195_PERI_ETH_CTRL2, rmii_delay_val);\n-\n-\tmt8195_delay_stage2ps(plat);\n+\tregmap_write(plat-\u003eperi_regmap,\n+\t\t reg_offset + MT8195_PERI_ETH_CTRL1,\n+\t\t delay_val);\n+\tregmap_write(plat-\u003eperi_regmap,\n+\t\t reg_offset + MT8195_PERI_ETH_CTRL2,\n+\t\t rmii_delay_val);\n \n \treturn 0;\n }\n \n+static void mt8195_fix_mac_speed(void *priv, phy_interface_t interface,\n+\t\t\t\t int speed, unsigned int mode)\n+{\n+\tstruct mediatek_dwmac_plat_data *priv_plat = priv;\n+\tconst struct mediatek_dwmac_variant *variant;\n+\tstruct mac_delay_struct *mac_delay;\n+\tu32 tx_delay_stage_val, reg_offset;\n+\tu32 reg_val = 0;\n+\n+\tif (!priv_plat)\n+\t\treturn;\n+\n+\tmac_delay = \u0026priv_plat-\u003emac_delay;\n+\tvariant = priv_plat-\u003evariant;\n+\n+\tif (!mac_delay-\u003etx_delay ||\n+\t (interface != PHY_INTERFACE_MODE_RGMII \u0026\u0026\n+\t interface != PHY_INTERFACE_MODE_RGMII_RXID))\n+\t\treturn;\n+\n+\t/*\n+\t * When link speed is 1Gbps with RGMII interface, and a TX internal\n+\t * delay needs to be applied on MAC, prefer to override the delay\n+\t * settings with a 2ns fixed delay which is controlled by\n+\t * RGMII_TXC_PHASE_CTRL. Otherwise, fallback to HW delay macro circuit\n+\t * for 10/100Mbps link speeds.\n+\t */\n+\tif (speed == SPEED_1000) {\n+\t\treg_val = MT8195_RGMII_TXC_PHASE_CTRL;\n+\t} else {\n+\t\tif (variant-\u003etx_delay_stage_div)\n+\t\t\ttx_delay_stage_val = mac_delay-\u003etx_delay /\n+\t\t\t\t\t variant-\u003etx_delay_stage_div;\n+\n+\t\treg_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,\n+\t\t\t\t !!mac_delay-\u003etx_delay);\n+\t\treg_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES,\n+\t\t\t\t tx_delay_stage_val);\n+\t\treg_val |= FIELD_PREP(MT8195_DLY_GTXC_INV,\n+\t\t\t\t mac_delay-\u003etx_inv);\n+\t}\n+\n+\treg_offset = variant-\u003eperi_eth_ctrl_offset + MT8195_PERI_ETH_CTRL0;\n+\tregmap_update_bits(priv_plat-\u003eperi_regmap,\n+\t\t\t reg_offset,\n+\t\t\t MT8195_RGMII_TXC_PHASE_CTRL |\n+\t\t\t MT8195_DLY_GTXC_ENABLE |\n+\t\t\t MT8195_DLY_GTXC_INV |\n+\t\t\t MT8195_DLY_GTXC_STAGES,\n+\t\t\t reg_val);\n+}\n+\n+static const struct mediatek_dwmac_variant mt8189_gmac_variant = {\n+\t.dwmac_set_phy_interface = mt8195_set_interface,\n+\t.dwmac_set_delay = mt8195_set_delay,\n+\t.dwmac_fix_mac_speed = mt8195_fix_mac_speed,\n+\t.clk_list = mt8189_dwmac_clk_l,\n+\t.num_clks = ARRAY_SIZE(mt8189_dwmac_clk_l),\n+\t.dma_bit_mask = 35,\n+\t.rx_delay_max = MT8189_DLY_RXC_MAX,\n+\t.tx_delay_max = MT8189_DLY_TXC_MAX,\n+\t.rx_delay_stage_div = MT8189_DLY_RXC_STAGE_DIV,\n+\t.tx_delay_stage_div = MT8189_DLY_TXC_STAGE_DIV,\n+\t.peri_eth_ctrl_offset = MT8189_PERI_ETH_CTRL_OFFSET,\n+\t.mac_txclk_out_en = true,\n+};\n+\n static const struct mediatek_dwmac_variant mt8195_gmac_variant = {\n \t.dwmac_set_phy_interface = mt8195_set_interface,\n \t.dwmac_set_delay = mt8195_set_delay,\n+\t.dwmac_fix_mac_speed = mt8195_fix_mac_speed,\n \t.clk_list = mt8195_dwmac_clk_l,\n \t.num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l),\n-\t.rx_delay_max = 9280,\n-\t.tx_delay_max = 9280,\n+\t.rx_delay_max = MT8195_DLY_RXC_MAX,\n+\t.tx_delay_max = MT8195_DLY_TXC_MAX,\n+\t.rx_delay_stage_div = MT8195_DLY_RXC_STAGE_DIV,\n+\t.tx_delay_stage_div = MT8195_DLY_TXC_STAGE_DIV,\n \t.dma_bit_mask = 35,\n+\t.peri_eth_ctrl_offset = MT8195_PERI_ETH_CTRL_OFFSET,\n };\n \n static int mediatek_dwmac_config_dt(struct mediatek_dwmac_plat_data *plat)\n@@ -571,6 +683,9 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,\n \tplat-\u003eresume = mediatek_dwmac_init;\n \tplat-\u003eclks_config = mediatek_dwmac_clks_config;\n \n+\tif (priv_plat-\u003evariant-\u003edwmac_fix_mac_speed)\n+\t\tplat-\u003efix_mac_speed = priv_plat-\u003evariant-\u003edwmac_fix_mac_speed;\n+\n \tplat-\u003esafety_feat_cfg = devm_kzalloc(\u0026pdev-\u003edev,\n \t\t\t\t\t sizeof(*plat-\u003esafety_feat_cfg),\n \t\t\t\t\t GFP_KERNEL);\n@@ -662,6 +777,8 @@ static void mediatek_dwmac_remove(struct platform_device *pdev)\n static const struct of_device_id mediatek_dwmac_match[] = {\n \t{ .compatible = \"mediatek,mt2712-gmac\",\n \t .data = \u0026mt2712_gmac_variant },\n+\t{ .compatible = \"mediatek,mt8189-gmac\",\n+\t .data = \u0026mt8189_gmac_variant },\n \t{ .compatible = \"mediatek,mt8195-gmac\",\n \t .data = \u0026mt8195_gmac_variant },\n \t{ }\n"
} |
| 2/1 | 2026/09/26 12:15 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies devicetree bindings documentation and the dwmac-mediatek platform driver for ARM-based MediaTek SoCs (MT2712/MT8188/MT8189/MT8195). This requires specific physical MediaTek SoC hardware that is not emulated in standard virtualized QEMU/GCE environments and is structurally unreachable on the amd64 target architecture.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit faa8175e9c96d07ab719d2f32cb487a70806073c
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Sep 26 12:15:41 2026 +0000
syz-cluster: applied patch under review
diff --git a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
index 3aab21b8e8de5..6624dff015f09 100644
--- a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
@@ -20,13 +20,11 @@ select:
enum:
- mediatek,mt2712-gmac
- mediatek,mt8188-gmac
+ - mediatek,mt8189-gmac
- mediatek,mt8195-gmac
required:
- compatible
-allOf:
- - $ref: snps,dwmac.yaml#
-
properties:
compatible:
oneOf:
@@ -36,6 +34,7 @@ properties:
- const: snps,dwmac-4.20a
- items:
- enum:
+ - mediatek,mt8189-gmac
- mediatek,mt8195-gmac
- const: snps,dwmac-5.10a
- items:
@@ -44,26 +43,6 @@ properties:
- const: mediatek,mt8195-gmac
- const: snps,dwmac-5.10a
- clocks:
- minItems: 5
- items:
- - description: AXI clock
- - description: APB clock
- - description: MAC Main clock
- - description: PTP clock
- - description: RMII reference clock provided by MAC
- - description: MAC clock gate
-
- clock-names:
- minItems: 5
- items:
- - const: axi
- - const: apb
- - const: mac_main
- - const: ptp_ref
- - const: rmii_internal
- - const: mac_cg
-
interrupts:
maxItems: 1
@@ -86,8 +65,10 @@ properties:
or will round down. Range 0~31*170.
For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
or will round down. Range 0~31*550.
- For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple of 290,
- or will round down. Range 0~31*290.
+ For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a
+ multiple of 290, or will round down. Range 0~31*290.
+ For MT8189 RGMII/RMII/MII interface, Allowed value need to
+ be a multiple of 180, or will round down. Range 0~31*180.
mediatek,rx-delay-ps:
description:
@@ -96,8 +77,10 @@ properties:
or will round down. Range 0~31*170.
For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
or will round down. Range 0~31*550.
- For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple
- of 290, or will round down. Range 0~31*290.
+ For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a
+ multiple of 290, or will round down. Range 0~31*290.
+ For MT8189 RGMII/RMII/MII interface, Allowed value need to
+ be a multiple of 180, or will round down. Range 0~31*180.
mediatek,rmii-rxc:
type: boolean
@@ -147,6 +130,56 @@ required:
- phy-mode
- mediatek,pericfg
+allOf:
+ - $ref: snps,dwmac.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mediatek,mt2712-gmac
+ - mediatek,mt8188-gmac
+ - mediatek,mt8195-gmac
+ then:
+ properties:
+ clocks:
+ minItems: 5
+ items:
+ - description: AXI clock
+ - description: APB clock
+ - description: MAC Main clock
+ - description: PTP clock
+ - description: RMII reference clock provided by MAC
+ - description: MAC clock gate
+
+ clock-names:
+ minItems: 5
+ items:
+ - const: axi
+ - const: apb
+ - const: mac_main
+ - const: ptp_ref
+ - const: rmii_internal
+ - const: mac_cg
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mediatek,mt8189-gmac
+ then:
+ properties:
+ clocks:
+ items:
+ - description: MAC Main clock
+ - description: PTP clock
+
+ clock-names:
+ items:
+ - const: mac_main
+ - const: ptp_ref
+
unevaluatedProperties: false
examples:
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index 30ae0dba7fffd..f07c331b029f0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -36,8 +36,20 @@
#define ETH_FINE_DLY_GTXC BIT(1)
#define ETH_FINE_DLY_RXC BIT(0)
+/* Peri Configuration register for mt8189 */
+#define MT8189_PERI_ETH_CTRL_OFFSET 0x270
+
+#define MT8189_CTRL0_TXC_OUT_OP_EN BIT(20)
+
+#define MT8189_DLY_RXC_STAGE_DIV 180 /* 180ps per stage */
+#define MT8189_DLY_RXC_MAX 5760 /* 32 * 180ps */
+#define MT8189_DLY_TXC_STAGE_DIV 180 /* 180ps per stage */
+#define MT8189_DLY_TXC_MAX 5760 /* 32 * 180ps */
+
/* Peri Configuration register for mt8195 */
-#define MT8195_PERI_ETH_CTRL0 0xFD0
+#define MT8195_PERI_ETH_CTRL_OFFSET 0xFD0
+
+#define MT8195_PERI_ETH_CTRL0 0x0
#define MT8195_RMII_CLK_SRC_INTERNAL BIT(28)
#define MT8195_RMII_CLK_SRC_RXC BIT(27)
#define MT8195_ETH_INTF_SEL GENMASK(26, 24)
@@ -47,7 +59,7 @@
#define MT8195_DLY_GTXC_ENABLE BIT(5)
#define MT8195_DLY_GTXC_STAGES GENMASK(4, 0)
-#define MT8195_PERI_ETH_CTRL1 0xFD4
+#define MT8195_PERI_ETH_CTRL1 0x4
#define MT8195_DLY_RXC_INV BIT(25)
#define MT8195_DLY_RXC_ENABLE BIT(18)
#define MT8195_DLY_RXC_STAGES GENMASK(17, 13)
@@ -55,7 +67,7 @@
#define MT8195_DLY_TXC_ENABLE BIT(5)
#define MT8195_DLY_TXC_STAGES GENMASK(4, 0)
-#define MT8195_PERI_ETH_CTRL2 0xFD8
+#define MT8195_PERI_ETH_CTRL2 0x8
#define MT8195_DLY_RMII_RXC_INV BIT(25)
#define MT8195_DLY_RMII_RXC_ENABLE BIT(18)
#define MT8195_DLY_RMII_RXC_STAGES GENMASK(17, 13)
@@ -63,6 +75,11 @@
#define MT8195_DLY_RMII_TXC_ENABLE BIT(5)
#define MT8195_DLY_RMII_TXC_STAGES GENMASK(4, 0)
+#define MT8195_DLY_RXC_STAGE_DIV 290 /* 290ps per stage */
+#define MT8195_DLY_RXC_MAX 9280 /* 32 x 290ps */
+#define MT8195_DLY_TXC_STAGE_DIV 290 /* 290ps per stage */
+#define MT8195_DLY_TXC_MAX 9280 /* 32 x 290ps */
+
struct mac_delay_struct {
u32 tx_delay;
u32 rx_delay;
@@ -89,13 +106,20 @@ struct mediatek_dwmac_variant {
u8 phy_intf_sel);
int (*dwmac_set_delay)(struct mediatek_dwmac_plat_data *plat);
+ void (*dwmac_fix_mac_speed)(void *priv, phy_interface_t interface,
+ int speed, unsigned int mode);
+
/* clock ids to be requested */
const char * const *clk_list;
int num_clks;
+ u32 peri_eth_ctrl_offset;
u32 rx_delay_max;
u32 tx_delay_max;
+ u16 rx_delay_stage_div;
+ u16 tx_delay_stage_div;
u8 dma_bit_mask;
+ bool mac_txclk_out_en;
};
/* list of clocks required for mac */
@@ -107,6 +131,10 @@ static const char * const mt8195_dwmac_clk_l[] = {
"axi", "apb", "mac_cg", "mac_main", "ptp_ref"
};
+static const char * const mt8189_dwmac_clk_l[] = {
+ "mac_main", "ptp_ref"
+};
+
static int mt2712_set_interface(struct mediatek_dwmac_plat_data *plat,
u8 phy_intf_sel)
{
@@ -277,6 +305,7 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,
u8 phy_intf_sel)
{
u32 intf_val = FIELD_PREP(MT8195_ETH_INTF_SEL, phy_intf_sel);
+ u32 reg_offset = plat->variant->peri_eth_ctrl_offset;
if (phy_intf_sel == PHY_INTF_SEL_RMII) {
if (plat->rmii_clk_from_mac)
@@ -288,44 +317,50 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,
/* MT8195 only support external PHY */
intf_val |= MT8195_EXT_PHY_MODE;
- regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL0, intf_val);
+ if (plat->variant->mac_txclk_out_en)
+ intf_val |= MT8189_CTRL0_TXC_OUT_OP_EN;
- return 0;
-}
+ regmap_write(plat->peri_regmap,
+ reg_offset + MT8195_PERI_ETH_CTRL0,
+ intf_val);
-static void mt8195_delay_ps2stage(struct mediatek_dwmac_plat_data *plat)
-{
- struct mac_delay_struct *mac_delay = &plat->mac_delay;
-
- /* 290ps per stage */
- mac_delay->tx_delay /= 290;
- mac_delay->rx_delay /= 290;
-}
-
-static void mt8195_delay_stage2ps(struct mediatek_dwmac_plat_data *plat)
-{
- struct mac_delay_struct *mac_delay = &plat->mac_delay;
-
- /* 290ps per stage */
- mac_delay->tx_delay *= 290;
- mac_delay->rx_delay *= 290;
+ return 0;
}
static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
{
+ u16 rx_delay_stage_div = plat->variant->rx_delay_stage_div;
+ u16 tx_delay_stage_div = plat->variant->tx_delay_stage_div;
struct mac_delay_struct *mac_delay = &plat->mac_delay;
- u32 gtxc_delay_val = 0, delay_val = 0, rmii_delay_val = 0;
+ u32 reg_offset = plat->variant->peri_eth_ctrl_offset;
+ u32 rx_delay_stage_val;
+ u32 tx_delay_stage_val;
+ u32 gtxc_delay_val = 0;
+ u32 rmii_delay_val = 0;
+ u32 delay_val = 0;
+
+ if (rx_delay_stage_div)
+ rx_delay_stage_val = mac_delay->rx_delay / rx_delay_stage_div;
+ else
+ rx_delay_stage_val = 0;
- mt8195_delay_ps2stage(plat);
+ if (tx_delay_stage_div)
+ tx_delay_stage_val = mac_delay->tx_delay / tx_delay_stage_div;
+ else
+ tx_delay_stage_val = 0;
switch (plat->phy_mode) {
case PHY_INTERFACE_MODE_MII:
- delay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE, !!mac_delay->tx_delay);
- delay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES, mac_delay->tx_delay);
+ delay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE,
+ !!tx_delay_stage_val);
+ delay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES,
+ tx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_TXC_INV, mac_delay->tx_inv);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE, !!mac_delay->rx_delay);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES, mac_delay->rx_delay);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,
+ !!rx_delay_stage_val);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_INV, mac_delay->rx_inv);
break;
case PHY_INTERFACE_MODE_RMII:
@@ -336,16 +371,16 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
* The ingress timing can be adjusted by RMII_RXC delay macro circuit.
*/
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_ENABLE,
- !!mac_delay->tx_delay);
+ !!tx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_STAGES,
- mac_delay->tx_delay);
+ tx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_INV,
mac_delay->tx_inv);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_ENABLE,
- !!mac_delay->rx_delay);
+ !!rx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_STAGES,
- mac_delay->rx_delay);
+ rx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_INV,
mac_delay->rx_inv);
} else {
@@ -361,9 +396,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
* by RXC delay macro circuit.
*/
delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,
- !!mac_delay->rx_delay);
+ !!rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,
- mac_delay->rx_delay);
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_INV,
mac_delay->rx_inv);
} else {
@@ -372,9 +407,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
* by TXC delay macro circuit.
*/
delay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE,
- !!mac_delay->rx_delay);
+ !!rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES,
- mac_delay->rx_delay);
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_TXC_INV,
mac_delay->rx_inv);
}
@@ -384,12 +419,16 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
case PHY_INTERFACE_MODE_RGMII_TXID:
case PHY_INTERFACE_MODE_RGMII_RXID:
case PHY_INTERFACE_MODE_RGMII_ID:
- gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE, !!mac_delay->tx_delay);
- gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES, mac_delay->tx_delay);
+ gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,
+ !!tx_delay_stage_val);
+ gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES,
+ tx_delay_stage_val);
gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_INV, mac_delay->tx_inv);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE, !!mac_delay->rx_delay);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES, mac_delay->rx_delay);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,
+ !!rx_delay_stage_val);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_INV, mac_delay->rx_inv);
break;
@@ -399,28 +438,101 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
}
regmap_update_bits(plat->peri_regmap,
- MT8195_PERI_ETH_CTRL0,
+ reg_offset + MT8195_PERI_ETH_CTRL0,
MT8195_RGMII_TXC_PHASE_CTRL |
MT8195_DLY_GTXC_INV |
MT8195_DLY_GTXC_ENABLE |
MT8195_DLY_GTXC_STAGES,
gtxc_delay_val);
- regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL1, delay_val);
- regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL2, rmii_delay_val);
-
- mt8195_delay_stage2ps(plat);
+ regmap_write(plat->peri_regmap,
+ reg_offset + MT8195_PERI_ETH_CTRL1,
+ delay_val);
+ regmap_write(plat->peri_regmap,
+ reg_offset + MT8195_PERI_ETH_CTRL2,
+ rmii_delay_val);
return 0;
}
+static void mt8195_fix_mac_speed(void *priv, phy_interface_t interface,
+ int speed, unsigned int mode)
+{
+ struct mediatek_dwmac_plat_data *priv_plat = priv;
+ const struct mediatek_dwmac_variant *variant;
+ struct mac_delay_struct *mac_delay;
+ u32 tx_delay_stage_val, reg_offset;
+ u32 reg_val = 0;
+
+ if (!priv_plat)
+ return;
+
+ mac_delay = &priv_plat->mac_delay;
+ variant = priv_plat->variant;
+
+ if (!mac_delay->tx_delay ||
+ (interface != PHY_INTERFACE_MODE_RGMII &&
+ interface != PHY_INTERFACE_MODE_RGMII_RXID))
+ return;
+
+ /*
+ * When link speed is 1Gbps with RGMII interface, and a TX internal
+ * delay needs to be applied on MAC, prefer to override the delay
+ * settings with a 2ns fixed delay which is controlled by
+ * RGMII_TXC_PHASE_CTRL. Otherwise, fallback to HW delay macro circuit
+ * for 10/100Mbps link speeds.
+ */
+ if (speed == SPEED_1000) {
+ reg_val = MT8195_RGMII_TXC_PHASE_CTRL;
+ } else {
+ if (variant->tx_delay_stage_div)
+ tx_delay_stage_val = mac_delay->tx_delay /
+ variant->tx_delay_stage_div;
+
+ reg_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,
+ !!mac_delay->tx_delay);
+ reg_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES,
+ tx_delay_stage_val);
+ reg_val |= FIELD_PREP(MT8195_DLY_GTXC_INV,
+ mac_delay->tx_inv);
+ }
+
+ reg_offset = variant->peri_eth_ctrl_offset + MT8195_PERI_ETH_CTRL0;
+ regmap_update_bits(priv_plat->peri_regmap,
+ reg_offset,
+ MT8195_RGMII_TXC_PHASE_CTRL |
+ MT8195_DLY_GTXC_ENABLE |
+ MT8195_DLY_GTXC_INV |
+ MT8195_DLY_GTXC_STAGES,
+ reg_val);
+}
+
+static const struct mediatek_dwmac_variant mt8189_gmac_variant = {
+ .dwmac_set_phy_interface = mt8195_set_interface,
+ .dwmac_set_delay = mt8195_set_delay,
+ .dwmac_fix_mac_speed = mt8195_fix_mac_speed,
+ .clk_list = mt8189_dwmac_clk_l,
+ .num_clks = ARRAY_SIZE(mt8189_dwmac_clk_l),
+ .dma_bit_mask = 35,
+ .rx_delay_max = MT8189_DLY_RXC_MAX,
+ .tx_delay_max = MT8189_DLY_TXC_MAX,
+ .rx_delay_stage_div = MT8189_DLY_RXC_STAGE_DIV,
+ .tx_delay_stage_div = MT8189_DLY_TXC_STAGE_DIV,
+ .peri_eth_ctrl_offset = MT8189_PERI_ETH_CTRL_OFFSET,
+ .mac_txclk_out_en = true,
+};
+
static const struct mediatek_dwmac_variant mt8195_gmac_variant = {
.dwmac_set_phy_interface = mt8195_set_interface,
.dwmac_set_delay = mt8195_set_delay,
+ .dwmac_fix_mac_speed = mt8195_fix_mac_speed,
.clk_list = mt8195_dwmac_clk_l,
.num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l),
- .rx_delay_max = 9280,
- .tx_delay_max = 9280,
+ .rx_delay_max = MT8195_DLY_RXC_MAX,
+ .tx_delay_max = MT8195_DLY_TXC_MAX,
+ .rx_delay_stage_div = MT8195_DLY_RXC_STAGE_DIV,
+ .tx_delay_stage_div = MT8195_DLY_TXC_STAGE_DIV,
.dma_bit_mask = 35,
+ .peri_eth_ctrl_offset = MT8195_PERI_ETH_CTRL_OFFSET,
};
static int mediatek_dwmac_config_dt(struct mediatek_dwmac_plat_data *plat)
@@ -571,6 +683,9 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,
plat->resume = mediatek_dwmac_init;
plat->clks_config = mediatek_dwmac_clks_config;
+ if (priv_plat->variant->dwmac_fix_mac_speed)
+ plat->fix_mac_speed = priv_plat->variant->dwmac_fix_mac_speed;
+
plat->safety_feat_cfg = devm_kzalloc(&pdev->dev,
sizeof(*plat->safety_feat_cfg),
GFP_KERNEL);
@@ -662,6 +777,8 @@ static void mediatek_dwmac_remove(struct platform_device *pdev)
static const struct of_device_id mediatek_dwmac_match[] = {
{ .compatible = "mediatek,mt2712-gmac",
.data = &mt2712_gmac_variant },
+ { .compatible = "mediatek,mt8189-gmac",
+ .data = &mt8189_gmac_variant },
{ .compatible = "mediatek,mt8195-gmac",
.data = &mt8195_gmac_variant },
{ }
|
| 3/2 | 2026/09/26 12:15 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10346 output: 40 thoughts: 178 Thoughts: **Evaluating the Syzkaller Patch Series for amd64** Okay, so I've got this patch series for syzkaller fuzzing, targeting amd64, and I need to assess it. Let's dig in and see what's being changed. The diff points to a couple of files: `Documentation/devicetree/bindings/net/mediatek-dwmac.yaml` and `drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c`. The first one is straightforward enough – just documentation. But that second one, `dwmac-mediatek.c`... what *is* that? I vaguely recall something about Mediatek and DWMAC, but I need to refresh my memory on this. Right, I need to figure out the context of `dwmac-mediatek.c`. Is it a driver? Platform-specific code? I'll probably find the answer in the `drivers/net/ethernet/stmicro/stmmac/Kconfig` or possibly the `Makefile`. Okay, let me either `grepper` that or just scan the `Kconfig` for something like `DWMAC_MEDIATEK`... that should give me a good handle on what this patch actually *does* and whether it's relevant to the syzkaller effort. |
| 4/2 | 2026/09/26 12:15 | tool | grepper |
0mArgs:{
"Expression": "DWMAC_MEDIATEK",
"PathPrefix": "drivers/net/ethernet/stmicro/stmmac"
}Results: {
"Output": "drivers/net/ethernet/stmicro/stmmac/Kconfig=106=config DWMAC_LPC18XX\n--\ndrivers/net/ethernet/stmicro/stmmac/Kconfig-113-\ndrivers/net/ethernet/stmicro/stmmac/Kconfig:114:config DWMAC_MEDIATEK\ndrivers/net/ethernet/stmicro/stmmac/Kconfig-115-\ttristate \"MediaTek MT27xx GMAC support\"\n--\ndrivers/net/ethernet/stmicro/stmmac/Makefile=20=obj-$(CONFIG_DWMAC_LPC18XX)\t+= dwmac-lpc18xx.o\ndrivers/net/ethernet/stmicro/stmmac/Makefile:21:obj-$(CONFIG_DWMAC_MEDIATEK)\t+= dwmac-mediatek.o\ndrivers/net/ethernet/stmicro/stmmac/Makefile-22-obj-$(CONFIG_DWMAC_MESON)\t+= dwmac-meson.o dwmac-meson8b.o\n"
} |
| 5/2 | 2026/09/26 12:15 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11124 output: 44 thoughts: 34 Thoughts: Here's a summary of my thought process, as requested: **Investigating the stmmac Driver Configuration** Okay, so I need to dive into the configuration options for the `stmmac` Ethernet driver. I'm going to head over to the `drivers/net/ethernet/stmicro/stmmac/Kconfig` file. Specifically, I'm thinking that line 114, and around it, is the most likely location to find the meat of the matter. That's where I can expect to find the dependencies, any conditional compilation logic, and the detailed settings associated with the `stmmac` driver that I need. This is where the configuration magic happens, so I'll start there and work outward as necessary. |
| 6/2 | 2026/09/26 12:15 | tool | read-file |
0mArgs:{
"File": "drivers/net/ethernet/stmicro/stmmac/Kconfig",
"FirstLine": 110,
"LineCount": 20
}Results: {
"Contents": " 110:\t\tselect MFD_SYSCON\n 111:\t\thelp\n 112:\t\t Support for NXP LPC18xx/43xx DWMAC Ethernet.\n 113:\t\n 114:\tconfig DWMAC_MEDIATEK\n 115:\t\ttristate \"MediaTek MT27xx GMAC support\"\n 116:\t\tdepends on OF \u0026\u0026 (ARCH_MEDIATEK || COMPILE_TEST)\n 117:\t\thelp\n 118:\t\t Support for MediaTek GMAC Ethernet controller.\n 119:\t\n 120:\t\t This selects the MT2712 SoC support for the stmmac driver.\n 121:\t\n 122:\tconfig DWMAC_MESON\n 123:\t\ttristate \"Amlogic Meson dwmac support\"\n 124:\t\tdefault ARCH_MESON\n 125:\t\tdepends on OF \u0026\u0026 COMMON_CLK \u0026\u0026 (ARCH_MESON || COMPILE_TEST)\n 126:\t\thelp\n 127:\t\t Support for Ethernet controller on Amlogic Meson SoCs.\n 128:\t\n 129:\t\t This selects the Amlogic Meson SoC glue layer support for\n"
} |
| 7/2 | 2026/09/26 12:15 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11683 output: 46 thoughts: 57 Thoughts: Okay, let's break this down. **Analyzing Driver Dependencies and Platform** First things first: I need to understand the constraints. The code I'm looking at has two critical dependencies: `OF` (presumably the Open Firmware framework) and then a conditional – either `ARCH_MEDIATEK` (meaning this is a Mediatek architecture) OR `COMPILE_TEST`. This tells me this code either targets a Mediatek platform or is for some sort of build testing. Given that it relies on both, it is important to understand which platform it applies to. Now, considering this, it is likely a platform driver. My next step is to examine the driver's core functionality within `dwmac-mediatek.c`. I need to zero in on how it probes for hardware and how it registers with the system. This likely holds the key to how it interacts with the specific Mediatek hardware it's designed for or how it's tested. I want to see how the system identifies and loads the driver. |
| 8/2 | 2026/09/26 12:15 | tool | grepper |
0mArgs:{
"Expression": "module_platform_driver",
"PathPrefix": "drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c"
}Results: {
"Output": "drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c=789=static struct platform_driver mediatek_dwmac_driver = {\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c-797-};\ndrivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c:798:module_platform_driver(mediatek_dwmac_driver);\ndrivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c-799-\n"
} |
| 9/2 | 2026/09/26 12:15 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12152 output: 118 thoughts: 964 Thoughts: **Analyzing the Fuzzing Potential of `mediatek_dwmac_driver`** Okay, let's break this down. We're looking at `mediatek_dwmac_driver`, which is a platform driver for MediaTek GMAC ethernet controllers. It's designed for MediaTek SoCs like MT2712, MT8188, MT8189, and MT8195. The immediate concern is the target architecture: it's `amd64`. But, hold on a second… isn't ARCH_MEDIATEK an ARM/ARM64 architecture? The key question is, can this driver even *run* or *probe* on an amd64 system in a Syzkaller environment using QEMU or GCE? Let's go back and carefully review the provided instructions, specifically sections 1 and 2, because they directly address this. According to those sections, reachability is paramount. Fuzzing is only effective if the code can actually *execute* within a standard virtualized environment. We're talking QEMU/GCE, software-emulated devices, and netdev, tun/tap support. If the code is structurally unreachable, it's a no-go, regardless of added assertions or complex logic. The instructions specifically call out unreachable hardware, such as vendor-specific PCIe switches, and also mention unreachable execution paths, like driver teardown callbacks that are triggered only during physical hot-unplug or manual driver unbinding. Also critical are *code paths exclusive to architectures other than the target architecture*. Now, circling back to the `mediatek_dwmac_driver`, it *is* an SoC platform driver for MediaTek hardware. The `mediatek_dwmac_match` function confirms this, with matches for DT nodes like "mediatek,mt2712-gmac" and "mediatek,mt8189-gmac". These are embedded ethernet MAC controllers within MediaTek ARM SoCs. This hardware is *physically* integrated into the MediaTek ARM SoCs. Crucially, this hardware is *not* emulated in standard QEMU on x86_64/amd64. It isn't a virtual device, a USB device, or a PCI device emulated in the standard QEMU. It’s also not accessible via tun/tap or netlink. Even if it *compiles* on amd64 using COMPILE_TEST and OF, it can't probe because the standard x86 QEMU simply doesn't have the MediaTek device tree nodes or the MediaTek GMAC hardware. Furthermore, OF platform devices without DT nodes *never* probe on amd64! Therefore, this code is *structurally unreachable* on amd64. It requires specific SoC hardware that's not emulated in standard QEMU and, moreover, it's an architecture/SoC-specific platform driver for ARM-based MediaTek SoCs, while the target architecture is amd64. Let's do a final, double-check of all aspects. The changes involve DT bindings documentation and the driver itself. Nothing else has been modified. So, let’s verify whether WorthFuzzing should be set to false. Given the structural limitations: - Unreachable hardware: MediaTek SoC ethernet controller (dwmac-mediatek). - Target architecture: amd64. This is an ARM/ARM64 MediaTek SoC driver that depends on OF and either ARCH_MEDIATEK or COMPILE_TEST. - Standard QEMU/GCE amd64 environments do not emulate MediaTek SoCs or dwmac-mediatek devices. Therefore, `WorthFuzzing=false`. EnableConfigs will be null or empty, FocusSymbols are null or empty, and the Reasoning should succinctly explain this, basically stating that the changes only affect DeviceTree bindings documentation and the MediaTek DWMAC platform glue driver for ARM-based MediaTek SoCs, which represents physical SoC hardware that is structurally unreachable on amd64 / standard virtualized QEMU environments. I'll call `set-results` with `WorthFuzzing=false`, `EnableConfigs=[]`, `FocusSymbols=[]`, and that Reasoning. |
| 10/2 | 2026/09/26 12:16 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies devicetree bindings documentation and the dwmac-mediatek platform driver for ARM-based MediaTek SoCs (MT2712/MT8188/MT8189/MT8195). This requires specific physical MediaTek SoC hardware that is not emulated in standard virtualized QEMU/GCE environments and is structurally unreachable on the amd64 target architecture.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies devicetree bindings documentation and the dwmac-mediatek platform driver for ARM-based MediaTek SoCs (MT2712/MT8188/MT8189/MT8195). This requires specific physical MediaTek SoC hardware that is not emulated in standard virtualized QEMU/GCE environments and is structurally unreachable on the amd64 target architecture.",
"WorthFuzzing": false
} |
| 11/1 | 2026/09/26 12:16 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|