get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2212951/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2212951,
    "url": "http://patchwork.ozlabs.org/api/patches/2212951/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260318132351.428749-1-paul.greenwalt@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260318132351.428749-1-paul.greenwalt@intel.com>",
    "list_archive_url": null,
    "date": "2026-03-18T13:23:51",
    "name": "[iwl-net,v1] ice: fix PHY config on media change with link-down-on-close",
    "commit_ref": null,
    "pull_url": null,
    "state": "under-review",
    "archived": false,
    "hash": "2ce40f47529d8aac1344b6ec4606c4c6bde8ecfb",
    "submitter": {
        "id": 71166,
        "url": "http://patchwork.ozlabs.org/api/people/71166/?format=api",
        "name": "Paul Greenwalt",
        "email": "paul.greenwalt@intel.com"
    },
    "delegate": {
        "id": 109701,
        "url": "http://patchwork.ozlabs.org/api/users/109701/?format=api",
        "username": "anguy11",
        "first_name": "Anthony",
        "last_name": "Nguyen",
        "email": "anthony.l.nguyen@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260318132351.428749-1-paul.greenwalt@intel.com/mbox/",
    "series": [
        {
            "id": 496541,
            "url": "http://patchwork.ozlabs.org/api/series/496541/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=496541",
            "date": "2026-03-18T13:23:51",
            "name": "[iwl-net,v1] ice: fix PHY config on media change with link-down-on-close",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/496541/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2212951/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2212951/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=Ut2ccjYZ;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fbhBr0ytPz1y0M\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Mar 2026 08:03:47 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 2A0BE60DE8;\n\tWed, 18 Mar 2026 21:03:46 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 9vfNmCv8qgkH; Wed, 18 Mar 2026 21:03:45 +0000 (UTC)",
            "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 56E8F60DD5;\n\tWed, 18 Mar 2026 21:03:45 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n by lists1.osuosl.org (Postfix) with ESMTP id 3B2301B6\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Mar 2026 21:03:44 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 2C91340575\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Mar 2026 21:03:44 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id NTXKPhoR4lZO for <intel-wired-lan@lists.osuosl.org>;\n Wed, 18 Mar 2026 21:03:43 +0000 (UTC)",
            "from mgamail.intel.com (mgamail.intel.com [192.198.163.11])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 3538740573\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Mar 2026 21:03:42 +0000 (UTC)",
            "from orviesa002.jf.intel.com ([10.64.159.142])\n by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Mar 2026 14:03:42 -0700",
            "from unknown (HELO fedora.jf.intel.com) ([10.166.5.147])\n by orviesa002.jf.intel.com with ESMTP; 18 Mar 2026 14:03:42 -0700"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 56E8F60DD5",
            "OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3538740573"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1773867825;\n\tbh=vz8nEVx12vxjqyucT09gFOK5LpmQKcJZtc0FIhR6HvM=;\n\th=From:To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive:\n\t List-Post:List-Help:List-Subscribe:From;\n\tb=Ut2ccjYZLD0x+iQ1D985IylVWiLp42ozTZJidUk8goTsLWxU3ELq9usqfYz7gOaVi\n\t ru/AOIiRFEltHJaZd5c/+JgF0eGOsOV8KzLTtps5DpU9WReZMM0T+EK1A4x1EghYvn\n\t r7i/qmTMMs9t+M8NCwuT/762Q6jFyiIojQghcM3R8QwnG9ySAmMKm750W7L0er63ZM\n\t CrSez5Zn3Vwilg6MBJQV1GgDP4vgrh+TfnGpUYGFn18cyeiK7qZFxn7l5E2mCN5eU9\n\t DoxZxwfxrItmE3oLn+0HKH4aZkBS2daHb+Zf6F9N1jeUwSsifkKVjLB+HElOJhZHnN\n\t SxCknyQzgoHVg==",
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.11;\n helo=mgamail.intel.com; envelope-from=paul.greenwalt@intel.com;\n receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp2.osuosl.org 3538740573",
        "X-CSE-ConnectionGUID": [
            "TKuDGSk0TnSAR3gbjICj1w==",
            "GKscBPu6SZmuDiJ0XX5lNg=="
        ],
        "X-CSE-MsgGUID": [
            "i/GlNy5LQtOE2o3ElZJuWQ==",
            "J3va7b9SQ/u5pXor2QZOow=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6800,10657,11733\"; a=\"85568016\"",
            "E=Sophos;i=\"6.23,128,1770624000\"; d=\"scan'208\";a=\"85568016\"",
            "E=Sophos;i=\"6.23,128,1770624000\"; d=\"scan'208\";a=\"253242975\""
        ],
        "X-ExtLoop1": "1",
        "From": "Paul Greenwalt <paul.greenwalt@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Cc": "Paul Greenwalt <paul.greenwalt@intel.com>,\n Przemek Kitszel <przemyslaw.kitszel@intel.com>",
        "Date": "Wed, 18 Mar 2026 09:23:51 -0400",
        "Message-ID": "<20260318132351.428749-1-paul.greenwalt@intel.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1773867823; x=1805403823;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=djPEqXEX45keQbn/CZLMon+YslmkUef0cNi3LSj4yjk=;\n b=eXeYR64/wLovSvhGfW6+/6I+b+Wn3r2n5U9XDuRWj6tLUR2RUTo0o90R\n hMgPO7wXj7ijFF8CzmsevXz/0M9SsxC52EXVqQaoVLq47Y7yBQZN/s/W5\n 3WE357NN/FGV8ZjvpxPs6Nlcadv0mn8kzkED5oSqyKm2rfhb6i6PAWjrc\n OztbbCzAEnpNpmKOO+KBhWFkgoZ1SWjBH5TufOJR4HDU1rBA6bWeO3CwB\n l933Tk59L+BllqARbL6MegrLxXfc+6qUz7wmF1gIM39xBI+kgsNCwUqLr\n fVLrSy2hF1NtpR+fzHRL0htg2OY/E1VzwIegKiDOPFE1vTWpnE/MysCJx\n Q==;",
        "X-Mailman-Original-Authentication-Results": [
            "smtp2.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com",
            "smtp2.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=eXeYR64/"
        ],
        "Subject": "[Intel-wired-lan] [PATCH iwl-net v1] ice: fix PHY config on media\n change with link-down-on-close",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "Commit 1a3571b5938c (\"ice: restore PHY settings on media insertion\")\nintroduced separate flows for setting PHY configuration on media\npresent: ice_configure_phy() when link-down-on-close is disabled, and\nice_force_phys_link_state() when enabled. The latter incorrectly uses\nthe previous configuration even after module change, causing link\nissues such as wrong speed or no link.\n\nUnify PHY configuration into a single ice_phy_cfg() function with a\nlink_en parameter, ensuring PHY capabilities are always fetched fresh\nfrom hardware.\n\nFixes: 1a3571b5938c (\"ice: restore PHY settings on media insertion\")\nReviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>\nSigned-off-by: Paul Greenwalt <paul.greenwalt@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_main.c | 121 +++++-----------------\n 1 file changed, 27 insertions(+), 94 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex ebf48feffb30..512e55e974e2 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -1922,82 +1922,6 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \tice_print_vfs_mdd_events(pf);\n }\n \n-/**\n- * ice_force_phys_link_state - Force the physical link state\n- * @vsi: VSI to force the physical link state to up/down\n- * @link_up: true/false indicates to set the physical link to up/down\n- *\n- * Force the physical link state by getting the current PHY capabilities from\n- * hardware and setting the PHY config based on the determined capabilities. If\n- * link changes a link event will be triggered because both the Enable Automatic\n- * Link Update and LESM Enable bits are set when setting the PHY capabilities.\n- *\n- * Returns 0 on success, negative on failure\n- */\n-static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up)\n-{\n-\tstruct ice_aqc_get_phy_caps_data *pcaps;\n-\tstruct ice_aqc_set_phy_cfg_data *cfg;\n-\tstruct ice_port_info *pi;\n-\tstruct device *dev;\n-\tint retcode;\n-\n-\tif (!vsi || !vsi->port_info || !vsi->back)\n-\t\treturn -EINVAL;\n-\tif (vsi->type != ICE_VSI_PF)\n-\t\treturn 0;\n-\n-\tdev = ice_pf_to_dev(vsi->back);\n-\n-\tpi = vsi->port_info;\n-\n-\tpcaps = kzalloc_obj(*pcaps);\n-\tif (!pcaps)\n-\t\treturn -ENOMEM;\n-\n-\tretcode = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,\n-\t\t\t\t      NULL);\n-\tif (retcode) {\n-\t\tdev_err(dev, \"Failed to get phy capabilities, VSI %d error %d\\n\",\n-\t\t\tvsi->vsi_num, retcode);\n-\t\tretcode = -EIO;\n-\t\tgoto out;\n-\t}\n-\n-\t/* No change in link */\n-\tif (link_up == !!(pcaps->caps & ICE_AQC_PHY_EN_LINK) &&\n-\t    link_up == !!(pi->phy.link_info.link_info & ICE_AQ_LINK_UP))\n-\t\tgoto out;\n-\n-\t/* Use the current user PHY configuration. The current user PHY\n-\t * configuration is initialized during probe from PHY capabilities\n-\t * software mode, and updated on set PHY configuration.\n-\t */\n-\tcfg = kmemdup(&pi->phy.curr_user_phy_cfg, sizeof(*cfg), GFP_KERNEL);\n-\tif (!cfg) {\n-\t\tretcode = -ENOMEM;\n-\t\tgoto out;\n-\t}\n-\n-\tcfg->caps |= ICE_AQ_PHY_ENA_AUTO_LINK_UPDT;\n-\tif (link_up)\n-\t\tcfg->caps |= ICE_AQ_PHY_ENA_LINK;\n-\telse\n-\t\tcfg->caps &= ~ICE_AQ_PHY_ENA_LINK;\n-\n-\tretcode = ice_aq_set_phy_cfg(&vsi->back->hw, pi, cfg, NULL);\n-\tif (retcode) {\n-\t\tdev_err(dev, \"Failed to set phy config, VSI %d error %d\\n\",\n-\t\t\tvsi->vsi_num, retcode);\n-\t\tretcode = -EIO;\n-\t}\n-\n-\tkfree(cfg);\n-out:\n-\tkfree(pcaps);\n-\treturn retcode;\n-}\n-\n /**\n  * ice_init_nvm_phy_type - Initialize the NVM PHY type\n  * @pi: port info structure\n@@ -2066,7 +1990,7 @@ static void ice_init_link_dflt_override(struct ice_port_info *pi)\n  * first time media is available. The ICE_LINK_DEFAULT_OVERRIDE_PENDING state\n  * is used to indicate that the user PHY cfg default override is initialized\n  * and the PHY has not been configured with the default override settings. The\n- * state is set here, and cleared in ice_configure_phy the first time the PHY is\n+ * state is set here, and cleared in ice_phy_cfg the first time the PHY is\n  * configured.\n  *\n  * This function should be called only if the FW doesn't support default\n@@ -2172,14 +2096,18 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi)\n }\n \n /**\n- * ice_configure_phy - configure PHY\n+ * ice_phy_cfg - configure PHY\n  * @vsi: VSI of PHY\n+ * @link_en: true/false indicates to set link to enable/disable\n  *\n  * Set the PHY configuration. If the current PHY configuration is the same as\n- * the curr_user_phy_cfg, then do nothing to avoid link flap. Otherwise\n- * configure the based get PHY capabilities for topology with media.\n+ * the curr_user_phy_cfg and link_en hasn't changed, then do nothing to avoid\n+ * link flap. Otherwise configure the PHY based get PHY capabilities for\n+ * topology with media and link_en.\n+ *\n+ * Return: 0 on success, negative on failure\n  */\n-static int ice_configure_phy(struct ice_vsi *vsi)\n+static int ice_phy_cfg(struct ice_vsi *vsi, bool link_en)\n {\n \tstruct device *dev = ice_pf_to_dev(vsi->back);\n \tstruct ice_port_info *pi = vsi->port_info;\n@@ -2199,9 +2127,6 @@ static int ice_configure_phy(struct ice_vsi *vsi)\n \t    phy->link_info.topo_media_conflict == ICE_AQ_LINK_TOPO_UNSUPP_MEDIA)\n \t\treturn -EPERM;\n \n-\tif (test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, pf->flags))\n-\t\treturn ice_force_phys_link_state(vsi, true);\n-\n \tpcaps = kzalloc_obj(*pcaps);\n \tif (!pcaps)\n \t\treturn -ENOMEM;\n@@ -2215,10 +2140,8 @@ static int ice_configure_phy(struct ice_vsi *vsi)\n \t\tgoto done;\n \t}\n \n-\t/* If PHY enable link is configured and configuration has not changed,\n-\t * there's nothing to do\n-\t */\n-\tif (pcaps->caps & ICE_AQC_PHY_EN_LINK &&\n+\t/* Configuration has not changed. There's nothing to do. */\n+\tif (link_en == !!(pcaps->caps & ICE_AQC_PHY_EN_LINK) &&\n \t    ice_phy_caps_equals_cfg(pcaps, &phy->curr_user_phy_cfg))\n \t\tgoto done;\n \n@@ -2282,8 +2205,12 @@ static int ice_configure_phy(struct ice_vsi *vsi)\n \t */\n \tice_cfg_phy_fc(pi, cfg, phy->curr_user_fc_req);\n \n-\t/* Enable link and link update */\n-\tcfg->caps |= ICE_AQ_PHY_ENA_AUTO_LINK_UPDT | ICE_AQ_PHY_ENA_LINK;\n+\t/* Enable/Disable link and link update */\n+\tcfg->caps |= ICE_AQ_PHY_ENA_AUTO_LINK_UPDT;\n+\tif (link_en)\n+\t\tcfg->caps |= ICE_AQ_PHY_ENA_LINK;\n+\telse\n+\t\tcfg->caps &= ~ICE_AQ_PHY_ENA_LINK;\n \n \terr = ice_aq_set_phy_cfg(&pf->hw, pi, cfg, NULL);\n \tif (err)\n@@ -2336,7 +2263,7 @@ static void ice_check_media_subtask(struct ice_pf *pf)\n \t\t    test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, vsi->back->flags))\n \t\t\treturn;\n \n-\t\terr = ice_configure_phy(vsi);\n+\t\terr = ice_phy_cfg(vsi, true);\n \t\tif (!err)\n \t\t\tclear_bit(ICE_FLAG_NO_MEDIA, pf->flags);\n \n@@ -4892,9 +4819,15 @@ static int ice_init_link(struct ice_pf *pf)\n \n \t\tif (!test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, pf->flags)) {\n \t\t\tstruct ice_vsi *vsi = ice_get_main_vsi(pf);\n+\t\t\tstruct ice_link_default_override_tlv *ldo;\n+\t\t\tbool link_en;\n+\n+\t\t\tldo = &pf->link_dflt_override;\n+\t\t\tlink_en = !(ldo->options &\n+\t\t\t\t    ICE_LINK_OVERRIDE_AUTO_LINK_DIS);\n \n \t\t\tif (vsi)\n-\t\t\t\tice_configure_phy(vsi);\n+\t\t\t\tice_phy_cfg(vsi, link_en);\n \t\t}\n \t} else {\n \t\tset_bit(ICE_FLAG_NO_MEDIA, pf->flags);\n@@ -9702,7 +9635,7 @@ int ice_open_internal(struct net_device *netdev)\n \t\t\t}\n \t\t}\n \n-\t\terr = ice_configure_phy(vsi);\n+\t\terr = ice_phy_cfg(vsi, true);\n \t\tif (err) {\n \t\t\tnetdev_err(netdev, \"Failed to set physical link up, error %d\\n\",\n \t\t\t\t   err);\n@@ -9743,7 +9676,7 @@ int ice_stop(struct net_device *netdev)\n \t}\n \n \tif (test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, vsi->back->flags)) {\n-\t\tint link_err = ice_force_phys_link_state(vsi, false);\n+\t\tint link_err = ice_phy_cfg(vsi, false);\n \n \t\tif (link_err) {\n \t\t\tif (link_err == -ENOMEDIUM)\n",
    "prefixes": [
        "iwl-net",
        "v1"
    ]
}