get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1291757,
    "url": "http://patchwork.ozlabs.org/api/patches/1291757/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200516004226.4795-2-anthony.l.nguyen@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": "<20200516004226.4795-2-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-05-16T00:42:14",
    "name": "[S44,02/14] ice: Handle critical FW error during admin queue initialization",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "26279117ade923151784948b2c10d9e3a68ce4b9",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@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/20200516004226.4795-2-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 177328,
            "url": "http://patchwork.ozlabs.org/api/series/177328/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=177328",
            "date": "2020-05-16T00:42:13",
            "name": "[S44,01/14] ice: Don't allow VLAN stripping change when pvid set",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/177328/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1291757/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1291757/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 spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49P64d2Hkqz9sTL\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 16 May 2020 10:45:05 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D41FD89A34;\n\tSat, 16 May 2020 00:45:03 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id b6pl8xNz8zgK; Sat, 16 May 2020 00:45:02 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D712289A27;\n\tSat, 16 May 2020 00:45:02 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id AD2861BF2B9\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:45:01 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id AA37B8811E\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:45:01 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id hzq-l8wJVf64 for <intel-wired-lan@lists.osuosl.org>;\n Sat, 16 May 2020 00:45:00 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id 9174187F74\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:45:00 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 May 2020 17:44:59 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by fmsmga004.fm.intel.com with ESMTP; 15 May 2020 17:44:59 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n rm2/5tguOkscckG2Jy1EfDwzxr9HJTkznpKsCVDCepcuVQPQgjnT9/ZYltCeE84Xd8fecD8VYG\n dcnBqYTcJM9w==",
            "\n ww9xvbPVoyg5BQVO+0HyVc99/8gNbrOz1UHOdFLZZdlkmzdM92FT/HFn96F8V51keHEUDi3J7l\n QvvvV0Fm8BUA=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,397,1583222400\"; d=\"scan'208\";a=\"287960344\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 15 May 2020 17:42:14 -0700",
        "Message-Id": "<20200516004226.4795-2-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200516004226.4795-1-anthony.l.nguyen@intel.com>",
        "References": "<20200516004226.4795-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S44 02/14] ice: Handle critical FW error\n during admin queue initialization",
        "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 <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>",
        "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: Evan Swanson <evan.swanson@intel.com>\n\nA race condition between FW and SW can occur between admin queue setup and\nthe first command sent. A link event may occur and FW attempts to notify a\nnon-existent queue. FW will set the critical error bit and disable the\nqueue. When this happens retry queue setup.\n\nSigned-off-by: Evan Swanson <evan.swanson@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_controlq.c | 126 ++++++++++--------\n drivers/net/ethernet/intel/ice/ice_controlq.h |   3 +\n .../net/ethernet/intel/ice/ice_hw_autogen.h   |   2 +\n drivers/net/ethernet/intel/ice/ice_main.c     |   2 +\n drivers/net/ethernet/intel/ice/ice_status.h   |   1 +\n 5 files changed, 80 insertions(+), 54 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c\nindex 62c2c1e621d2..479a74efc536 100644\n--- a/drivers/net/ethernet/intel/ice/ice_controlq.c\n+++ b/drivers/net/ethernet/intel/ice/ice_controlq.c\n@@ -12,6 +12,7 @@ do {\t\t\t\t\t\t\t\t\\\n \t(qinfo)->sq.bal = prefix##_ATQBAL;\t\t\t\\\n \t(qinfo)->sq.len_mask = prefix##_ATQLEN_ATQLEN_M;\t\\\n \t(qinfo)->sq.len_ena_mask = prefix##_ATQLEN_ATQENABLE_M;\t\\\n+\t(qinfo)->sq.len_crit_mask = prefix##_ATQLEN_ATQCRIT_M;\t\\\n \t(qinfo)->sq.head_mask = prefix##_ATQH_ATQH_M;\t\t\\\n \t(qinfo)->rq.head = prefix##_ARQH;\t\t\t\\\n \t(qinfo)->rq.tail = prefix##_ARQT;\t\t\t\\\n@@ -20,6 +21,7 @@ do {\t\t\t\t\t\t\t\t\\\n \t(qinfo)->rq.bal = prefix##_ARQBAL;\t\t\t\\\n \t(qinfo)->rq.len_mask = prefix##_ARQLEN_ARQLEN_M;\t\\\n \t(qinfo)->rq.len_ena_mask = prefix##_ARQLEN_ARQENABLE_M;\t\\\n+\t(qinfo)->rq.len_crit_mask = prefix##_ARQLEN_ARQCRIT_M;\t\\\n \t(qinfo)->rq.head_mask = prefix##_ARQH_ARQH_M;\t\t\\\n } while (0)\n \n@@ -641,6 +643,50 @@ static enum ice_status ice_init_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type)\n \treturn ret_code;\n }\n \n+/**\n+ * ice_shutdown_ctrlq - shutdown routine for any control queue\n+ * @hw: pointer to the hardware structure\n+ * @q_type: specific Control queue type\n+ *\n+ * NOTE: this function does not destroy the control queue locks.\n+ */\n+static void ice_shutdown_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type)\n+{\n+\tstruct ice_ctl_q_info *cq;\n+\n+\tswitch (q_type) {\n+\tcase ICE_CTL_Q_ADMIN:\n+\t\tcq = &hw->adminq;\n+\t\tif (ice_check_sq_alive(hw, cq))\n+\t\t\tice_aq_q_shutdown(hw, true);\n+\t\tbreak;\n+\tcase ICE_CTL_Q_MAILBOX:\n+\t\tcq = &hw->mailboxq;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn;\n+\t}\n+\n+\tice_shutdown_sq(hw, cq);\n+\tice_shutdown_rq(hw, cq);\n+}\n+\n+/**\n+ * ice_shutdown_all_ctrlq - shutdown routine for all control queues\n+ * @hw: pointer to the hardware structure\n+ *\n+ * NOTE: this function does not destroy the control queue locks. The driver\n+ * may call this at runtime to shutdown and later restart control queues, such\n+ * as in response to a reset event.\n+ */\n+void ice_shutdown_all_ctrlq(struct ice_hw *hw)\n+{\n+\t/* Shutdown FW admin queue */\n+\tice_shutdown_ctrlq(hw, ICE_CTL_Q_ADMIN);\n+\t/* Shutdown PF-VF Mailbox */\n+\tice_shutdown_ctrlq(hw, ICE_CTL_Q_MAILBOX);\n+}\n+\n /**\n  * ice_init_all_ctrlq - main initialization routine for all control queues\n  * @hw: pointer to the hardware structure\n@@ -656,17 +702,27 @@ static enum ice_status ice_init_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type)\n  */\n enum ice_status ice_init_all_ctrlq(struct ice_hw *hw)\n {\n-\tenum ice_status ret_code;\n+\tenum ice_status status;\n+\tu32 retry = 0;\n \n \t/* Init FW admin queue */\n-\tret_code = ice_init_ctrlq(hw, ICE_CTL_Q_ADMIN);\n-\tif (ret_code)\n-\t\treturn ret_code;\n+\tdo {\n+\t\tstatus = ice_init_ctrlq(hw, ICE_CTL_Q_ADMIN);\n+\t\tif (status)\n+\t\t\treturn status;\n \n-\tret_code = ice_init_check_adminq(hw);\n-\tif (ret_code)\n-\t\treturn ret_code;\n+\t\tstatus = ice_init_check_adminq(hw);\n+\t\tif (status != ICE_ERR_AQ_FW_CRITICAL)\n+\t\t\tbreak;\n \n+\t\tice_debug(hw, ICE_DBG_AQ_MSG,\n+\t\t\t  \"Retry Admin Queue init due to FW critical error\\n\");\n+\t\tice_shutdown_ctrlq(hw, ICE_CTL_Q_ADMIN);\n+\t\tmsleep(ICE_CTL_Q_ADMIN_INIT_MSEC);\n+\t} while (retry++ < ICE_CTL_Q_ADMIN_INIT_TIMEOUT);\n+\n+\tif (status)\n+\t\treturn status;\n \t/* Init Mailbox queue */\n \treturn ice_init_ctrlq(hw, ICE_CTL_Q_MAILBOX);\n }\n@@ -707,50 +763,6 @@ enum ice_status ice_create_all_ctrlq(struct ice_hw *hw)\n \treturn ice_init_all_ctrlq(hw);\n }\n \n-/**\n- * ice_shutdown_ctrlq - shutdown routine for any control queue\n- * @hw: pointer to the hardware structure\n- * @q_type: specific Control queue type\n- *\n- * NOTE: this function does not destroy the control queue locks.\n- */\n-static void ice_shutdown_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type)\n-{\n-\tstruct ice_ctl_q_info *cq;\n-\n-\tswitch (q_type) {\n-\tcase ICE_CTL_Q_ADMIN:\n-\t\tcq = &hw->adminq;\n-\t\tif (ice_check_sq_alive(hw, cq))\n-\t\t\tice_aq_q_shutdown(hw, true);\n-\t\tbreak;\n-\tcase ICE_CTL_Q_MAILBOX:\n-\t\tcq = &hw->mailboxq;\n-\t\tbreak;\n-\tdefault:\n-\t\treturn;\n-\t}\n-\n-\tice_shutdown_sq(hw, cq);\n-\tice_shutdown_rq(hw, cq);\n-}\n-\n-/**\n- * ice_shutdown_all_ctrlq - shutdown routine for all control queues\n- * @hw: pointer to the hardware structure\n- *\n- * NOTE: this function does not destroy the control queue locks. The driver\n- * may call this at runtime to shutdown and later restart control queues, such\n- * as in response to a reset event.\n- */\n-void ice_shutdown_all_ctrlq(struct ice_hw *hw)\n-{\n-\t/* Shutdown FW admin queue */\n-\tice_shutdown_ctrlq(hw, ICE_CTL_Q_ADMIN);\n-\t/* Shutdown PF-VF Mailbox */\n-\tice_shutdown_ctrlq(hw, ICE_CTL_Q_MAILBOX);\n-}\n-\n /**\n  * ice_destroy_ctrlq_locks - Destroy locks for a control queue\n  * @cq: pointer to the control queue\n@@ -1049,9 +1061,15 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,\n \n \t/* update the error if time out occurred */\n \tif (!cmd_completed) {\n-\t\tice_debug(hw, ICE_DBG_AQ_MSG,\n-\t\t\t  \"Control Send Queue Writeback timeout.\\n\");\n-\t\tstatus = ICE_ERR_AQ_TIMEOUT;\n+\t\tif (rd32(hw, cq->rq.len) & cq->rq.len_crit_mask ||\n+\t\t    rd32(hw, cq->sq.len) & cq->sq.len_crit_mask) {\n+\t\t\tice_debug(hw, ICE_DBG_AQ_MSG, \"Critical FW error.\\n\");\n+\t\t\tstatus = ICE_ERR_AQ_FW_CRITICAL;\n+\t\t} else {\n+\t\t\tice_debug(hw, ICE_DBG_AQ_MSG,\n+\t\t\t\t  \"Control Send Queue Writeback timeout.\\n\");\n+\t\t\tstatus = ICE_ERR_AQ_TIMEOUT;\n+\t\t}\n \t}\n \n sq_send_command_error:\ndiff --git a/drivers/net/ethernet/intel/ice/ice_controlq.h b/drivers/net/ethernet/intel/ice/ice_controlq.h\nindex bf0ebe6149e8..faaa08e8171b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_controlq.h\n+++ b/drivers/net/ethernet/intel/ice/ice_controlq.h\n@@ -34,6 +34,8 @@ enum ice_ctl_q {\n /* Control Queue timeout settings - max delay 250ms */\n #define ICE_CTL_Q_SQ_CMD_TIMEOUT\t2500  /* Count 2500 times */\n #define ICE_CTL_Q_SQ_CMD_USEC\t\t100   /* Check every 100usec */\n+#define ICE_CTL_Q_ADMIN_INIT_TIMEOUT\t10    /* Count 10 times */\n+#define ICE_CTL_Q_ADMIN_INIT_MSEC\t100   /* Check every 100msec */\n \n struct ice_ctl_q_ring {\n \tvoid *dma_head;\t\t\t/* Virtual address to DMA head */\n@@ -59,6 +61,7 @@ struct ice_ctl_q_ring {\n \tu32 bal;\n \tu32 len_mask;\n \tu32 len_ena_mask;\n+\tu32 len_crit_mask;\n \tu32 head_mask;\n };\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_hw_autogen.h b/drivers/net/ethernet/intel/ice/ice_hw_autogen.h\nindex 5803bacef129..91b658e224ad 100644\n--- a/drivers/net/ethernet/intel/ice/ice_hw_autogen.h\n+++ b/drivers/net/ethernet/intel/ice/ice_hw_autogen.h\n@@ -39,6 +39,7 @@\n #define PF_MBX_ARQH_ARQH_M\t\t\tICE_M(0x3FF, 0)\n #define PF_MBX_ARQLEN\t\t\t\t0x0022E480\n #define PF_MBX_ARQLEN_ARQLEN_M\t\t\tICE_M(0x3FF, 0)\n+#define PF_MBX_ARQLEN_ARQCRIT_M\t\t\tBIT(30)\n #define PF_MBX_ARQLEN_ARQENABLE_M\t\tBIT(31)\n #define PF_MBX_ARQT\t\t\t\t0x0022E580\n #define PF_MBX_ATQBAH\t\t\t\t0x0022E180\n@@ -47,6 +48,7 @@\n #define PF_MBX_ATQH_ATQH_M\t\t\tICE_M(0x3FF, 0)\n #define PF_MBX_ATQLEN\t\t\t\t0x0022E200\n #define PF_MBX_ATQLEN_ATQLEN_M\t\t\tICE_M(0x3FF, 0)\n+#define PF_MBX_ATQLEN_ATQCRIT_M\t\t\tBIT(30)\n #define PF_MBX_ATQLEN_ATQENABLE_M\t\tBIT(31)\n #define PF_MBX_ATQT\t\t\t\t0x0022E300\n #define PRTDCB_GENC\t\t\t\t0x00083000\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 589bafb601ae..644784e86177 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -5292,6 +5292,8 @@ const char *ice_stat_str(enum ice_status stat_err)\n \t\treturn \"ICE_ERR_AQ_NO_WORK\";\n \tcase ICE_ERR_AQ_EMPTY:\n \t\treturn \"ICE_ERR_AQ_EMPTY\";\n+\tcase ICE_ERR_AQ_FW_CRITICAL:\n+\t\treturn \"ICE_ERR_AQ_FW_CRITICAL\";\n \t}\n \n \treturn \"ICE_ERR_UNKNOWN\";\ndiff --git a/drivers/net/ethernet/intel/ice/ice_status.h b/drivers/net/ethernet/intel/ice/ice_status.h\nindex 546a02856d09..4028c6365172 100644\n--- a/drivers/net/ethernet/intel/ice/ice_status.h\n+++ b/drivers/net/ethernet/intel/ice/ice_status.h\n@@ -37,6 +37,7 @@ enum ice_status {\n \tICE_ERR_AQ_FULL\t\t\t\t= -102,\n \tICE_ERR_AQ_NO_WORK\t\t\t= -103,\n \tICE_ERR_AQ_EMPTY\t\t\t= -104,\n+\tICE_ERR_AQ_FW_CRITICAL\t\t\t= -105,\n };\n \n #endif /* _ICE_STATUS_H_ */\n",
    "prefixes": [
        "S44",
        "02/14"
    ]
}