get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 831542,
    "url": "http://patchwork.ozlabs.org/api/patches/831542/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20171027150656.68250-8-alice.michael@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": "<20171027150656.68250-8-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2017-10-27T15:06:55",
    "name": "[next,S81-V3,8/9] i40e: Fix for NUP NVM image downgrade failure",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "32351f3ba05665d8a821964840b3ec6b1c2f8a7a",
    "submitter": {
        "id": 71123,
        "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api",
        "name": "Michael, Alice",
        "email": "alice.michael@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/20171027150656.68250-8-alice.michael@intel.com/mbox/",
    "series": [
        {
            "id": 10681,
            "url": "http://patchwork.ozlabs.org/api/series/10681/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=10681",
            "date": "2017-10-27T15:06:48",
            "name": "[next,S81-V3,1/9] i40e: display priority_xon and priority_xoff stats",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/10681/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/831542/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/831542/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>)",
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 3yP0604r6zz9t4X\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 28 Oct 2017 10:12:55 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id B1FC530C7B;\n\tFri, 27 Oct 2017 23:12:53 +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 cgcCF0ad5Lbk; Fri, 27 Oct 2017 23:12:52 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 150EB30C72;\n\tFri, 27 Oct 2017 23:12:52 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2D7B11C1F24\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:47 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 21C218A0B1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:47 +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 KQZvIP-TtDeU for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:45 +0000 (UTC)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 808378A0E2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 27 Oct 2017 23:12:43 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Oct 2017 16:12:42 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby fmsmga002.fm.intel.com with ESMTP; 27 Oct 2017 16:12:42 -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-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.44,306,1505804400\"; d=\"scan'208\";\n\ta=\"1236400575\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 27 Oct 2017 11:06:55 -0400",
        "Message-Id": "<20171027150656.68250-8-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20171027150656.68250-1-alice.michael@intel.com>",
        "References": "<20171027150656.68250-1-alice.michael@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S81-V3 8/9] i40e: Fix for NUP NVM\n\timage downgrade failure",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "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": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nSince commit 96a39aed25e6 (\"i40e: Acquire NVM lock before\nreads on all devices\") we've used the NVM lock\nto synchronize NVM reads even on devices which don't strictly\nneed the lock.\n\nDoing so can cause a regression on older firmware prior to 1.5,\nespecially when downgrading the firmware.\n\nFix this by only grabbing the lock if we're running on an X722\ndevice (which requires the lock as it uses the AdminQ to read\nthe NVM), or if we're currently running 1.5 or newer firmware.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_adminq.c | 6 ++++++\n drivers/net/ethernet/intel/i40e/i40e_common.c | 3 ++-\n drivers/net/ethernet/intel/i40e/i40e_nvm.c    | 8 +++++---\n drivers/net/ethernet/intel/i40e/i40e_type.h   | 1 +\n 4 files changed, 14 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c\nindex 9dcb2a9..9af7425 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c\n@@ -613,6 +613,12 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)\n \t\thw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;\n \t}\n \n+\t/* Newer versions of firmware require lock when reading the NVM */\n+\tif (hw->aq.api_maj_ver > 1 ||\n+\t    (hw->aq.api_maj_ver == 1 &&\n+\t     hw->aq.api_min_ver >= 5))\n+\t\thw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK;\n+\n \t/* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */\n \tif (hw->aq.api_maj_ver > 1 ||\n \t    (hw->aq.api_maj_ver == 1 &&\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 0203665..13c7946 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -948,7 +948,8 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw)\n \t\thw->pf_id = (u8)(func_rid & 0x7);\n \n \tif (hw->mac.type == I40E_MAC_X722)\n-\t\thw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE;\n+\t\thw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE |\n+\t\t\t     I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK;\n \n \tstatus = i40e_init_nvm(hw);\n \treturn status;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\nindex 0ccab0a..7689c2e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n@@ -328,15 +328,17 @@ static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw,\n i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,\n \t\t\t       u16 *data)\n {\n-\ti40e_status ret_code;\n+\ti40e_status ret_code = 0;\n \n-\tret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);\n+\tif (hw->flags & I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK)\n+\t\tret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);\n \tif (ret_code)\n \t\treturn ret_code;\n \n \tret_code = __i40e_read_nvm_word(hw, offset, data);\n \n-\ti40e_release_nvm(hw);\n+\tif (hw->flags & I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK)\n+\t\ti40e_release_nvm(hw);\n \n \treturn ret_code;\n }\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h\nindex 00d4833..0e85687 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h\n@@ -629,6 +629,7 @@ struct i40e_hw {\n #define I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE BIT_ULL(0)\n #define I40E_HW_FLAG_802_1AD_CAPABLE        BIT_ULL(1)\n #define I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE  BIT_ULL(2)\n+#define I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK BIT_ULL(3)\n \tu64 flags;\n \n \t/* Used in set switch config AQ command */\n",
    "prefixes": [
        "next",
        "S81-V3",
        "8/9"
    ]
}