get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 522597,
    "url": "http://patchwork.ozlabs.org/api/patches/522597/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1443133592-159225-1-git-send-email-anjali.singhai@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": "<1443133592-159225-1-git-send-email-anjali.singhai@intel.com>",
    "list_archive_url": null,
    "date": "2015-09-24T22:26:32",
    "name": "i40e: Fix basic support for X722 devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "7f799c0b0c4fb070a80ee4f7e67a7040ed92160d",
    "submitter": {
        "id": 65487,
        "url": "http://patchwork.ozlabs.org/api/people/65487/?format=api",
        "name": "Singhai, Anjali",
        "email": "anjali.singhai@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/1443133592-159225-1-git-send-email-anjali.singhai@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/522597/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/522597/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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id 5CFCE140775\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 25 Sep 2015 08:10:37 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6F38D95763;\n\tThu, 24 Sep 2015 22:10:36 +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 Cc62f4tgcLCg; Thu, 24 Sep 2015 22:10:35 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id DC04A9566E;\n\tThu, 24 Sep 2015 22:10:35 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 879261C16AC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 24 Sep 2015 22:10:34 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 826788D80A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 24 Sep 2015 22:10:34 +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 990n0yHbmlFB for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 24 Sep 2015 22:10:33 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id CA6688D808\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 24 Sep 2015 22:10:33 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga101.jf.intel.com with ESMTP; 24 Sep 2015 15:10:33 -0700",
            "from asinghai-cp.jf.intel.com ([134.134.3.57])\n\tby fmsmga001.fm.intel.com with ESMTP; 24 Sep 2015 15:10:33 -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.17,583,1437462000\"; d=\"scan'208\";a=\"796765127\"",
        "From": "Anjali Singhai Jain <anjali.singhai@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 24 Sep 2015 15:26:32 -0700",
        "Message-Id": "<1443133592-159225-1-git-send-email-anjali.singhai@intel.com>",
        "X-Mailer": "git-send-email 1.8.1.4",
        "Subject": "[Intel-wired-lan] [PATCH] i40e: Fix basic support for X722 devices",
        "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>",
        "MIME-Version": "1.0",
        "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": "Acquire NVM, before issuing an AQ read nvm command for X722.\nWe need to acquire the NVM before issuing an AQ read to the NVM\notherwise we will get EBUSY from the FW. Also release when done.\n\nThis fixes the two X722 issues with respect to eeprom checksum verify\nand reading NVM version info.\n\nWith this patch in place, i40e driver will provide basic support\nfor X722 devices.\n\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_common.c |  3 +++\n drivers/net/ethernet/intel/i40e/i40e_nvm.c    | 31 +++++++++++++++++++++------\n drivers/net/ethernet/intel/i40e/i40e_type.h   |  3 +++\n 3 files changed, 31 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 26bb922..a6ea6be 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -958,6 +958,9 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw)\n \telse\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+\n \tstatus = i40e_init_nvm(hw);\n \treturn status;\n }\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\nindex 2142e10..21572be 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n@@ -290,9 +290,18 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,\n i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,\n \t\t\t       u16 *data)\n {\n-\tif (hw->mac.type == I40E_MAC_X722)\n-\t\treturn i40e_read_nvm_word_aq(hw, offset, data);\n-\treturn i40e_read_nvm_word_srctl(hw, offset, data);\n+\tenum i40e_status_code ret_code = 0;\n+\n+\tif (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {\n+\t\tret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);\n+\t\tif (!ret_code) {\n+\t\t\tret_code = i40e_read_nvm_word_aq(hw, offset, data);\n+\t\t\ti40e_release_nvm(hw);\n+\t\t}\n+\t} else {\n+\t\tret_code = i40e_read_nvm_word_srctl(hw, offset, data);\n+\t}\n+\treturn ret_code;\n }\n \n /**\n@@ -397,9 +406,19 @@ read_nvm_buffer_aq_exit:\n i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,\n \t\t\t\t u16 *words, u16 *data)\n {\n-\tif (hw->mac.type == I40E_MAC_X722)\n-\t\treturn i40e_read_nvm_buffer_aq(hw, offset, words, data);\n-\treturn i40e_read_nvm_buffer_srctl(hw, offset, words, data);\n+\tenum i40e_status_code ret_code = 0;\n+\n+\tif (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {\n+\t\tret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);\n+\t\tif (!ret_code) {\n+\t\t\tret_code = i40e_read_nvm_buffer_aq(hw, offset, words,\n+\t\t\t\t\t\t\t   data);\n+\t\t\ti40e_release_nvm(hw);\n+\t\t}\n+\t} else {\n+\t\tret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data);\n+\t}\n+\treturn ret_code;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h\nindex 6f69576..7487013 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h\n@@ -542,6 +542,9 @@ struct i40e_hw {\n \tstruct i40e_dcbx_config remote_dcbx_config; /* Peer Cfg */\n \tstruct i40e_dcbx_config desired_dcbx_config; /* CEE Desired Cfg */\n \n+#define I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE BIT_ULL(0)\n+\tu64 flags;\n+\n \t/* debug mask */\n \tu32 debug_mask;\n \tchar err_str[16];\n",
    "prefixes": []
}