get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 955600,
    "url": "http://patchwork.ozlabs.org/api/patches/955600/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180809132958.23036-5-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": "<20180809132958.23036-5-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2018-08-09T13:29:47",
    "name": "[v3,04/15] ice: Prevent control queue operations during reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1717f1ca777991b2761a4b44cd5c41131d3c20bf",
    "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/20180809132958.23036-5-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 60078,
            "url": "http://patchwork.ozlabs.org/api/series/60078/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=60078",
            "date": "2018-08-09T13:29:43",
            "name": "Feature updates for ice",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/60078/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/955600/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/955600/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.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41mTdl0QBFz9s4c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  9 Aug 2018 23:30:18 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5BDCD8834C;\n\tThu,  9 Aug 2018 13:30:17 +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 tqIgFfmpJe86; Thu,  9 Aug 2018 13:30:16 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8BCA588350;\n\tThu,  9 Aug 2018 13:30:16 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 53BA61C3F93\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  9 Aug 2018 13:30:14 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 5163787A0C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  9 Aug 2018 13:30:14 +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 dKVykc+B2vhd for <intel-wired-lan@lists.osuosl.org>;\n\tThu,  9 Aug 2018 13:30:13 +0000 (UTC)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id BE192879F6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  9 Aug 2018 13:30:13 +0000 (UTC)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Aug 2018 06:30:13 -0700",
            "from kyungmin-mobl.amr.corp.intel.com (HELO\n\tavenkata-mobl4.localdomain) ([10.254.101.153])\n\tby fmsmga006.fm.intel.com with ESMTP; 09 Aug 2018 06:30:10 -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.53,215,1531810800\"; d=\"scan'208\";a=\"253368097\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu,  9 Aug 2018 06:29:47 -0700",
        "Message-Id": "<20180809132958.23036-5-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20180809132958.23036-1-anirudh.venkataramanan@intel.com>",
        "References": "<20180809132958.23036-1-anirudh.venkataramanan@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH v3 04/15] ice: Prevent control queue\n\toperations during reset",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "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>",
        "MIME-Version": "1.0",
        "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": "Once reset is issued, the driver loses all control queue interfaces.\nExercising control queue operations during reset is incorrect and\nmay result in long timeouts.\n\nThis patch introduces a new field 'reset_ongoing' in the hw structure.\nThis is set to 1 by the core driver when it receives a reset interrupt.\nice_sq_send_cmd checks reset_ongoing before actually issuing the control\nqueue operation. If a reset is in progress, it returns a soft error code\n(ICE_ERR_RESET_PENDING) to the caller. The caller may or may not have to\ntake any action based on this return. Once the driver knows that the\nreset is done, it has to set reset_ongoing back to 0. This will allow\ncontrol queue operations to be posted to the hardware again.\n\nThis \"bail out\" logic was specifically added to ice_sq_send_cmd (which\nis pretty low level function) so that we have one solution in one place\nthat applies to all types of control queues.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_controlq.c |  3 ++\n drivers/net/ethernet/intel/ice/ice_main.c     | 34 ++++++++++++++++---\n drivers/net/ethernet/intel/ice/ice_status.h   |  1 +\n drivers/net/ethernet/intel/ice/ice_type.h     |  1 +\n 4 files changed, 34 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c\nindex 62be72fdc8f3..1fe026a65d75 100644\n--- a/drivers/net/ethernet/intel/ice/ice_controlq.c\n+++ b/drivers/net/ethernet/intel/ice/ice_controlq.c\n@@ -806,6 +806,9 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,\n \tu16 retval = 0;\n \tu32 val = 0;\n \n+\t/* if reset is in progress return a soft error */\n+\tif (hw->reset_ongoing)\n+\t\treturn ICE_ERR_RESET_ONGOING;\n \tmutex_lock(&cq->sq_lock);\n \n \tcq->sq_last_status = ICE_AQ_RC_OK;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex f1e80eed2fd6..014a2f3ea76c 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -535,10 +535,13 @@ static void ice_reset_subtask(struct ice_pf *pf)\n \t\tice_prepare_for_reset(pf);\n \n \t\t/* make sure we are ready to rebuild */\n-\t\tif (ice_check_reset(&pf->hw))\n+\t\tif (ice_check_reset(&pf->hw)) {\n \t\t\tset_bit(__ICE_RESET_FAILED, pf->state);\n-\t\telse\n+\t\t} else {\n+\t\t\t/* done with reset. start rebuild */\n+\t\t\tpf->hw.reset_ongoing = false;\n \t\t\tice_rebuild(pf);\n+\t\t}\n \t\tclear_bit(__ICE_RESET_RECOVERY_PENDING, pf->state);\n \t\tgoto unlock;\n \t}\n@@ -1754,7 +1757,8 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n \t\t * We also make note of which reset happened so that peer\n \t\t * devices/drivers can be informed.\n \t\t */\n-\t\tif (!test_bit(__ICE_RESET_RECOVERY_PENDING, pf->state)) {\n+\t\tif (!test_and_set_bit(__ICE_RESET_RECOVERY_PENDING,\n+\t\t\t\t      pf->state)) {\n \t\t\tif (reset == ICE_RESET_CORER)\n \t\t\t\tset_bit(__ICE_CORER_RECV, pf->state);\n \t\t\telse if (reset == ICE_RESET_GLOBR)\n@@ -1762,7 +1766,20 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n \t\t\telse\n \t\t\t\tset_bit(__ICE_EMPR_RECV, pf->state);\n \n-\t\t\tset_bit(__ICE_RESET_RECOVERY_PENDING, pf->state);\n+\t\t\t/* There are couple of different bits at play here.\n+\t\t\t * hw->reset_ongoing indicates whether the hardware is\n+\t\t\t * in reset. This is set to true when a reset interrupt\n+\t\t\t * is received and set back to false after the driver\n+\t\t\t * has determined that the hardware is out of reset.\n+\t\t\t *\n+\t\t\t * __ICE_RESET_RECOVERY_PENDING in pf->state indicates\n+\t\t\t * that a post reset rebuild is required before the\n+\t\t\t * driver is operational again. This is set above.\n+\t\t\t *\n+\t\t\t * As this is the start of the reset/rebuild cycle, set\n+\t\t\t * both to indicate that.\n+\t\t\t */\n+\t\t\thw->reset_ongoing = true;\n \t\t}\n \t}\n \n@@ -4185,7 +4202,14 @@ static int ice_vsi_stop_tx_rings(struct ice_vsi *vsi)\n \t}\n \tstatus = ice_dis_vsi_txq(vsi->port_info, vsi->num_txq, q_ids, q_teids,\n \t\t\t\t NULL);\n-\tif (status) {\n+\t/* if the disable queue command was exercised during an active reset\n+\t * flow, ICE_ERR_RESET_ONGOING is returned. This is not an error as\n+\t * the reset operation disables queues at the hardware level anyway.\n+\t */\n+\tif (status == ICE_ERR_RESET_ONGOING) {\n+\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\"Reset in progress. LAN Tx queues already disabled\\n\");\n+\t} else if (status) {\n \t\tdev_err(&pf->pdev->dev,\n \t\t\t\"Failed to disable LAN Tx queues, error: %d\\n\",\n \t\t\tstatus);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_status.h b/drivers/net/ethernet/intel/ice/ice_status.h\nindex 9a95c4ffd7d7..d2dae913d81e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_status.h\n+++ b/drivers/net/ethernet/intel/ice/ice_status.h\n@@ -20,6 +20,7 @@ enum ice_status {\n \tICE_ERR_ALREADY_EXISTS\t\t\t= -14,\n \tICE_ERR_DOES_NOT_EXIST\t\t\t= -15,\n \tICE_ERR_MAX_LIMIT\t\t\t= -17,\n+\tICE_ERR_RESET_ONGOING\t\t\t= -18,\n \tICE_ERR_BUF_TOO_SHORT\t\t\t= -52,\n \tICE_ERR_NVM_BLANK_MODE\t\t\t= -53,\n \tICE_ERR_AQ_ERROR\t\t\t= -100,\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex e1a0d0e5d074..adfe131bd3f3 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -295,6 +295,7 @@ struct ice_hw {\n \tu16 max_children[ICE_AQC_TOPO_MAX_LEVEL_NUM];\n \n \tu8 evb_veb;\t\t/* true for VEB, false for VEPA */\n+\tu8 reset_ongoing;\t/* true if hw is in reset, false otherwise */\n \tstruct ice_bus_info bus;\n \tstruct ice_nvm_info nvm;\n \tstruct ice_hw_dev_caps dev_caps;\t/* device capabilities */\n",
    "prefixes": [
        "v3",
        "04/15"
    ]
}