get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1086466,
    "url": "http://patchwork.ozlabs.org/api/patches/1086466/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416172439.27908-6-anirudh.venkataramanan@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": "<20190416172439.27908-6-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2019-04-16T17:24:29",
    "name": "[S19,05/15] ice: Fix hang when ethtool disables FW LLDP",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ae62ecaf2ed23d4b08482449abf5dd5839793bdb",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416172439.27908-6-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 103107,
            "url": "http://patchwork.ozlabs.org/api/series/103107/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=103107",
            "date": "2019-04-16T17:24:38",
            "name": "Fixes and feature updates for ice",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/103107/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1086466/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1086466/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@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 44kC1f3y5cz9s55\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Apr 2019 03:25:26 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 09B3F25C74;\n\tTue, 16 Apr 2019 17:25:25 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 6bwQC69L9Btm; Tue, 16 Apr 2019 17:25:18 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id C5F3A23358;\n\tTue, 16 Apr 2019 17:25:17 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2A4641BF9A0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:15 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 26FAC870B2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:15 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id QZEOgKJVDtvc for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:13 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 3518986E4E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:13 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2019 10:25:11 -0700",
            "from shasta.jf.intel.com ([10.166.244.191])\n\tby orsmga001.jf.intel.com with ESMTP; 16 Apr 2019 10:25:11 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.60,358,1549958400\"; d=\"scan'208\";a=\"224064168\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 16 Apr 2019 10:24:29 -0700",
        "Message-Id": "<20190416172439.27908-6-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190416172439.27908-1-anirudh.venkataramanan@intel.com>",
        "References": "<20190416172439.27908-1-anirudh.venkataramanan@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S19 05/15] ice: Fix hang when ethtool\n\tdisables FW LLDP",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<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\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Dave Ertman <david.m.ertman@intel.com>\n\nWhen disabling and enabling VSIs, there are a couple of flows\nthat recursively acquire the RTNL lock which causes a deadlock.\nFix that.\n\nSigned-off-by: Dave Ertman <david.m.ertman@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> cleaned up commit message]\n---\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 31 ++++++++++++--------\n drivers/net/ethernet/intel/ice/ice_dcb_lib.h |  5 ++--\n drivers/net/ethernet/intel/ice/ice_ethtool.c |  4 +--\n drivers/net/ethernet/intel/ice/ice_main.c    |  2 +-\n 4 files changed, 25 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex 53c3a6056572..7da22f044d4a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -133,8 +133,10 @@ static void ice_pf_dcb_recfg(struct ice_pf *pf)\n  * ice_pf_dcb_cfg - Apply new DCB configuration\n  * @pf: pointer to the PF struct\n  * @new_cfg: DCBX config to apply\n+ * @locked: is the RTNL held\n  */\n-static int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg)\n+static\n+int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n {\n \tstruct ice_dcbx_cfg *old_cfg, *curr_cfg;\n \tstruct ice_aqc_port_ets_elem buf = { 0 };\n@@ -163,7 +165,8 @@ static int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg)\n \t/* avoid race conditions by holding the lock while disabling and\n \t * re-enabling the VSI\n \t */\n-\trtnl_lock();\n+\tif (!locked)\n+\t\trtnl_lock();\n \tice_pf_dis_all_vsi(pf, true);\n \n \tmemcpy(curr_cfg, new_cfg, sizeof(*curr_cfg));\n@@ -192,7 +195,8 @@ static int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg)\n \n out:\n \tice_pf_ena_all_vsi(pf, true);\n-\trtnl_unlock();\n+\tif (!locked)\n+\t\trtnl_unlock();\n \tdevm_kfree(&pf->pdev->dev, old_cfg);\n \treturn ret;\n }\n@@ -271,15 +275,16 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \tprev_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW;\n \tprev_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;\n \tmemcpy(&prev_cfg->etsrec, &prev_cfg->etscfg, sizeof(prev_cfg->etsrec));\n-\tice_pf_dcb_cfg(pf, prev_cfg);\n+\tice_pf_dcb_cfg(pf, prev_cfg, false);\n \tdevm_kfree(&pf->pdev->dev, prev_cfg);\n }\n \n /**\n  * ice_dcb_init_cfg - set the initial DCB config in SW\n  * @pf: pf to apply config to\n+ * @locked: Is the RTNL held\n  */\n-static int ice_dcb_init_cfg(struct ice_pf *pf)\n+static int ice_dcb_init_cfg(struct ice_pf *pf, bool locked)\n {\n \tstruct ice_dcbx_cfg *newcfg;\n \tstruct ice_port_info *pi;\n@@ -294,7 +299,7 @@ static int ice_dcb_init_cfg(struct ice_pf *pf)\n \tmemset(&pi->local_dcbx_cfg, 0, sizeof(*newcfg));\n \n \tdev_info(&pf->pdev->dev, \"Configuring initial DCB values\\n\");\n-\tif (ice_pf_dcb_cfg(pf, newcfg))\n+\tif (ice_pf_dcb_cfg(pf, newcfg, locked))\n \t\tret = -EINVAL;\n \n \tdevm_kfree(&pf->pdev->dev, newcfg);\n@@ -305,8 +310,9 @@ static int ice_dcb_init_cfg(struct ice_pf *pf)\n /**\n  * ice_dcb_sw_default_config - Apply a default DCB config\n  * @pf: pf to apply config to\n+ * @locked: was this function called with RTNL held\n  */\n-static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf)\n+static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool locked)\n {\n \tstruct ice_aqc_port_ets_elem buf = { 0 };\n \tstruct ice_dcbx_cfg *dcbcfg;\n@@ -338,7 +344,7 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf)\n \tdcbcfg->app[0].priority = 3;\n \tdcbcfg->app[0].prot_id = ICE_APP_PROT_ID_FCOE;\n \n-\tret = ice_pf_dcb_cfg(pf, dcbcfg);\n+\tret = ice_pf_dcb_cfg(pf, dcbcfg, locked);\n \tdevm_kfree(&pf->pdev->dev, dcbcfg);\n \tif (ret)\n \t\treturn ret;\n@@ -349,8 +355,9 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf)\n /**\n  * ice_init_pf_dcb - initialize DCB for a PF\n  * @pf: pf to initiialize DCB for\n+ * @locked: Was function called with RTNL held\n  */\n-int ice_init_pf_dcb(struct ice_pf *pf)\n+int ice_init_pf_dcb(struct ice_pf *pf, bool locked)\n {\n \tstruct device *dev = &pf->pdev->dev;\n \tstruct ice_port_info *port_info;\n@@ -386,7 +393,7 @@ int ice_init_pf_dcb(struct ice_pf *pf)\n \t}\n \n \tif (sw_default) {\n-\t\terr = ice_dcb_sw_dflt_cfg(pf);\n+\t\terr = ice_dcb_sw_dflt_cfg(pf, locked);\n \t\tif (err) {\n \t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\"Failed to set local DCB config %d\\n\", err);\n@@ -405,7 +412,7 @@ int ice_init_pf_dcb(struct ice_pf *pf)\n \n \tset_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);\n \n-\terr = ice_dcb_init_cfg(pf);\n+\terr = ice_dcb_init_cfg(pf, locked);\n \tif (err)\n \t\tgoto dcb_init_err;\n \n@@ -515,7 +522,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \n \t\terr = ice_lldp_to_dcb_cfg(event->msg_buf, dcbcfg);\n \t\tif (!err)\n-\t\t\tice_pf_dcb_cfg(pf, dcbcfg);\n+\t\t\tice_pf_dcb_cfg(pf, dcbcfg, false);\n \n \t\tdevm_kfree(&pf->pdev->dev, dcbcfg);\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\nindex 7786ec94b06a..fbeef2a82073 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n@@ -14,7 +14,7 @@ void ice_dcb_rebuild(struct ice_pf *pf);\n u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg);\n u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg *dcbcfg);\n void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi);\n-int ice_init_pf_dcb(struct ice_pf *pf);\n+int ice_init_pf_dcb(struct ice_pf *pf, bool locked);\n void ice_update_dcb_stats(struct ice_pf *pf);\n int\n ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,\n@@ -40,7 +40,8 @@ static inline u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg __always_unused *dcbcfg)\n \treturn 1;\n }\n \n-static inline int ice_init_pf_dcb(struct ice_pf *pf)\n+static inline int\n+ice_init_pf_dcb(struct ice_pf *pf, bool __always_unused locked)\n {\n \tdev_dbg(&pf->pdev->dev, \"DCB not supported\\n\");\n \treturn -EOPNOTSUPP;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex 76122a28da7e..c1511393846f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -458,7 +458,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t * will likely not need DCB, so failure to init is\n \t\t\t * not a concern of ethtool\n \t\t\t */\n-\t\t\tstatus = ice_init_pf_dcb(pf);\n+\t\t\tstatus = ice_init_pf_dcb(pf, true);\n \t\t\tif (status)\n \t\t\t\tdev_warn(&pf->pdev->dev, \"Fail to init DCB\\n\");\n \t\t} else {\n@@ -497,7 +497,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t\tdev_dbg(&pf->pdev->dev,\n \t\t\t\t\t\"Fail to reg for MIB change\\n\");\n \n-\t\t\tstatus = ice_init_pf_dcb(pf);\n+\t\t\tstatus = ice_init_pf_dcb(pf, true);\n \t\t\tif (status)\n \t\t\t\tdev_dbg(&pf->pdev->dev, \"Fail to init DCB\\n\");\n \t\t}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex cbe8c5f2d953..65def2773313 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -2302,7 +2302,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)\n \n \tice_init_pf(pf);\n \n-\terr = ice_init_pf_dcb(pf);\n+\terr = ice_init_pf_dcb(pf, false);\n \tif (err) {\n \t\tclear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);\n \t\tclear_bit(ICE_FLAG_DCB_ENA, pf->flags);\n",
    "prefixes": [
        "S19",
        "05/15"
    ]
}