)]}'
{
  "commit": "e42329945d1613c2b41da9642b855f4612d8ea46",
  "tree": "d07a52d7375f6f76e859a322c2d2e86c96314430",
  "parents": [
    "de4aa72d6bb84d1ddb50669ffb7f62164fe49887"
  ],
  "author": {
    "name": "Coia Prant",
    "email": "coiaprant@gmail.com",
    "time": "Sat Oct 17 13:43:59 2026 +0800"
  },
  "committer": {
    "name": "Jakub Kicinski",
    "email": "kuba@kernel.org",
    "time": "Wed Oct 21 16:41:36 2026 -0700"
  },
  "message": "net: pcs: xpcs: add ANRESTART support for SGMII link recovery\n\nOn some hardware using the DesignWare XPCS IP (e.g., RK3568 MAC side\nSGMII), the PCS does not automatically restart auto-negotiation when the\nlink goes down and comes back up. Without an explicit ANRESTART, the link\nstays down forever.\n\nAdd BMCR_ANRESTART in two places:\n1. In xpcs_config_aneg_c37_sgmii(), when starting AN, set ANRESTART\n   alongside ANENABLE to initiate a fresh negotiation.\n2. In xpcs_get_state_c37_sgmii(), when link is down and AN completion is\n   detected, clear the interrupt and trigger ANRESTART to restart the\n   negotiation process. Propagate the return value of the restart so\n   errors are not silently ignored.\n\nThe restart cannot go through the .pcs_an_restart op: phylink only\ncalls it for 802.3z interfaces, and SGMII is not one. Changing hardware\nstate from pcs_get_state() is already done elsewhere in this driver\n(xpcs_get_state_c73() calls xpcs_soft_reset() and xpcs_do_config()),\nso the same pattern is used here.\n\nThe latch is cleared before issuing the restart, not after: clearing it\nafterwards would discard a freshly latched ANCMPLT from the new\nnegotiation. If an MDIO access fails at this point, it indicates an\nunrecoverable hardware condition until reset.\n\nAlso clear DW_VR_MII_AN_INTR_STS in xpcs_config_aneg_c37_sgmii() before\nstarting AN, matching what xpcs_config_aneg_c37_1000basex() already does.\nOn the non-inband path the function now returns the result of that write\ninstead of the DIG_CTRL1 modify.\n\nUpdate the comment in xpcs_config_aneg_c37_sgmii() to note that although\nthe DesignWare databook says AN restart is not needed for MAC side SGMII,\nsome implementations (e.g. Rockchip RK3568) require it to recover the\nlink after a disconnect.\n\nThis is not a fix for an existing mainline platform: the affected\nplatform (RK3568 XPCS) is introduced later in the same series.\n\nTested-by: Jiawen Wu \u003cjiawenwu@trustnetic.com\u003e\nTested-by: Maxime Chevallier \u003cmaxime.chevallier@bootlin.com\u003e\nSigned-off-by: Coia Prant \u003ccoiaprant@gmail.com\u003e\nLink: https://patch.msgid.link/20261017054406.1828061-2-coiaprant@gmail.com\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b415b93d77c154e9b90f2e78d19db80ba19b2914",
      "old_mode": 33188,
      "old_path": "drivers/net/pcs/pcs-xpcs.c",
      "new_id": "6466e0ff2a98bd89230356e2805eafcc4ac6980f",
      "new_mode": 33188,
      "new_path": "drivers/net/pcs/pcs-xpcs.c"
    }
  ]
}
