get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 597215,
    "url": "http://patchwork.ozlabs.org/api/patches/597215/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160314180602.8397.1350.stgit@mdrustad-wks.jf.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": "<20160314180602.8397.1350.stgit@mdrustad-wks.jf.intel.com>",
    "list_archive_url": null,
    "date": "2016-03-14T18:06:02",
    "name": "[V2,5/5] ixgbe: Take manageability semaphore for firmware commands",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e03cc000809b9797e6fc1e0fbd45915d322738f6",
    "submitter": {
        "id": 13252,
        "url": "http://patchwork.ozlabs.org/api/people/13252/?format=api",
        "name": "Rustad, Mark D",
        "email": "mark.d.rustad@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/20160314180602.8397.1350.stgit@mdrustad-wks.jf.intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/597215/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/597215/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.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"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id 3qP5KM6mXFz9ssM\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 15 Mar 2016 05:06:15 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 41DF490F8A;\n\tMon, 14 Mar 2016 18:06: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 Wn1KgPzzAJA1; Mon, 14 Mar 2016 18:06:11 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8ED2790F88;\n\tMon, 14 Mar 2016 18:06:11 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8FAEB1C0BA9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:06:04 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 4C57495993\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:06:04 +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 ByvohhNOWafM for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:06:03 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2AA5C95841\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:06:03 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 14 Mar 2016 11:06:02 -0700",
            "from mdrustad-wks.jf.intel.com ([134.134.3.229])\n\tby fmsmga001.fm.intel.com with ESMTP; 14 Mar 2016 11:06:02 -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.24,336,1455004800\"; d=\"scan'208\";a=\"923827224\"",
        "From": "Mark D Rustad <mark.d.rustad@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 14 Mar 2016 11:06:02 -0700",
        "Message-ID": "<20160314180602.8397.1350.stgit@mdrustad-wks.jf.intel.com>",
        "In-Reply-To": "<20160314180316.8397.65394.stgit@mdrustad-wks.jf.intel.com>",
        "References": "<20160314180316.8397.65394.stgit@mdrustad-wks.jf.intel.com>",
        "User-Agent": "StGit/unknown-version",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH V2 5/5] ixgbe: Take manageability\n\tsemaphore for firmware commands",
        "X-BeenThere": "intel-wired-lan@lists.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.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "We need to take the manageability semaphore when issuing firmware\ncommands to avoid problems. With this in place, the semaphore is\nno longer taken in the ixgbe_set_fw_drv_ver_generic function, since\nit will now always be taken by the ixgbe_host_interface_command\nfunction.\n\nSigned-off-by: Mark Rustad <mark.d.rustad@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.c |   30 +++++++++++++++--------\n 1 file changed, 19 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\nindex b8cdff7fe673..ee43a383aa0a 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n@@ -3494,11 +3494,16 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n \t\tstruct ixgbe_hic_hdr hdr;\n \t\tu32 u32arr[1];\n \t} *bp = buffer;\n+\ts32 status;\n \n \tif (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) {\n \t\thw_dbg(hw, \"Buffer length failure buffersize-%d.\\n\", length);\n \t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n \t}\n+\t/* Take management host interface semaphore */\n+\tstatus = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);\n+\tif (status)\n+\t\treturn status;\n \n \t/* Set bit 9 of FWSTS clearing FW reset indication */\n \tfwsts = IXGBE_READ_REG(hw, IXGBE_FWSTS);\n@@ -3508,13 +3513,15 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n \thicr = IXGBE_READ_REG(hw, IXGBE_HICR);\n \tif (!(hicr & IXGBE_HICR_EN)) {\n \t\thw_dbg(hw, \"IXGBE_HOST_EN bit disabled.\\n\");\n-\t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tstatus = IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tgoto rel_out;\n \t}\n \n \t/* Calculate length in DWORDs. We must be DWORD aligned */\n \tif (length % sizeof(u32)) {\n \t\thw_dbg(hw, \"Buffer length failure, not aligned to dword\");\n-\t\treturn IXGBE_ERR_INVALID_ARGUMENT;\n+\t\tstatus = IXGBE_ERR_INVALID_ARGUMENT;\n+\t\tgoto rel_out;\n \t}\n \n \tdword_len = length >> 2;\n@@ -3540,11 +3547,12 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n \tif ((timeout && i == timeout) ||\n \t    !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) {\n \t\thw_dbg(hw, \"Command has failed with no status valid.\\n\");\n-\t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tstatus = IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tgoto rel_out;\n \t}\n \n \tif (!return_data)\n-\t\treturn 0;\n+\t\tgoto rel_out;\n \n \t/* Calculate length in DWORDs */\n \tdword_len = hdr_size >> 2;\n@@ -3558,11 +3566,12 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n \t/* If there is any thing in data position pull it in */\n \tbuf_len = bp->hdr.buf_len;\n \tif (!buf_len)\n-\t\treturn 0;\n+\t\tgoto rel_out;\n \n \tif (length < round_up(buf_len, 4) + hdr_size) {\n \t\thw_dbg(hw, \"Buffer not large enough for reply message.\\n\");\n-\t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tstatus = IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tgoto rel_out;\n \t}\n \n \t/* Calculate length in DWORDs, add 3 for odd lengths */\n@@ -3574,7 +3583,10 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n \t\tle32_to_cpus(&bp->u32arr[bi]);\n \t}\n \n-\treturn 0;\n+rel_out:\n+\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);\n+\n+\treturn status;\n }\n \n /**\n@@ -3597,9 +3609,6 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n \tint i;\n \ts32 ret_val;\n \n-\tif (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM))\n-\t\treturn IXGBE_ERR_SWFW_SYNC;\n-\n \tfw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;\n \tfw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN;\n \tfw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CEM_CMD_RESERVED;\n@@ -3631,7 +3640,6 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n \t\tbreak;\n \t}\n \n-\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);\n \treturn ret_val;\n }\n \n",
    "prefixes": [
        "V2",
        "5/5"
    ]
}