Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/554880/?format=api
{ "id": 554880, "url": "http://patchwork.ozlabs.org/api/patches/554880/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1449705033-4968-10-git-send-email-joshua.a.hay@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": "<1449705033-4968-10-git-send-email-joshua.a.hay@intel.com>", "list_archive_url": null, "date": "2015-12-09T23:50:29", "name": "[next,S23,09/13] i40e: Make some changes in the nvm read code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "b31565d9976c9e5bc7b26ec0f30929961dc05aba", "submitter": { "id": 19461, "url": "http://patchwork.ozlabs.org/api/people/19461/?format=api", "name": "Joshua Hay", "email": "joshua.a.hay@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/1449705033-4968-10-git-send-email-joshua.a.hay@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/554880/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/554880/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 7AF3A140E1E\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 10 Dec 2015 10:50:52 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B45A38C9F2;\n\tWed, 9 Dec 2015 23:50:51 +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 IHrderGFbSjX; Wed, 9 Dec 2015 23:50:48 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8A2D792627;\n\tWed, 9 Dec 2015 23:50:45 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 18F271C0FE5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 23:50:44 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 148AE8C9F2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 23:50:44 +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 w3Na4ibl4Zhi for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 23:50:43 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4C049917A9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 23:50:42 +0000 (UTC)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga101.fm.intel.com with ESMTP; 09 Dec 2015 15:50:34 -0800", "from jahay1-mobl2.amr.corp.intel.com (HELO\n\tlocalhost.localdomain.localdomain) ([134.134.176.79])\n\tby orsmga002.jf.intel.com with ESMTP; 09 Dec 2015 15:50:33 -0800" ], "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.20,405,1444719600\"; d=\"scan'208\";a=\"868414320\"", "From": "Joshua Hay <joshua.a.hay@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 9 Dec 2015 15:50:29 -0800", "Message-Id": "<1449705033-4968-10-git-send-email-joshua.a.hay@intel.com>", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1449705033-4968-1-git-send-email-joshua.a.hay@intel.com>", "References": "<1449705033-4968-1-git-send-email-joshua.a.hay@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S23 09/13] i40e: Make some changes in\n\tthe nvm read code", "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": "From: Anjali Singhai Jain <anjali.singhai@intel.com>\n\nIn X722, NVM reads can't be done through SRCTL registers.\nAnd require AQ calls, which require grabbing the NVM lock.\nUnfortunately some paths need the lock to be acquired once\nand do a whole bunch of stuff and then release it.\nThis patch creates an unsafe version of the read calls, so\nthat it can be called from the paths that need the bulk access.\n\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\nAcked-by: Shannon Nelson <shannon.nelson@intel.com>\nSigned-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\nChange-ID: Ia9076e9100c5cf61206a856bd279059d3a052024\n---\nTesting Hints: Also make sure LAN driver\nsees the correct NVM version and does not fail verify checksum\nduring init and during reset.\n\n drivers/net/ethernet/intel/i40e/i40e_nvm.c | 70 +++++++++++++++++++++++++-----\n 1 file changed, 59 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\nindex 6100cdd..79c0053 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n@@ -212,6 +212,24 @@ read_nvm_exit:\n }\n \n /**\n+ * __i40e_read_nvm_word - Reads nvm word, assumes caller does the locking\n+ * @hw: pointer to the HW structure\n+ * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF)\n+ * @data: word read from the Shadow RAM\n+ *\n+ * Reads one 16 bit word from the Shadow RAM using the GLNVM_SRCTL register.\n+ **/\n+static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw,\n+\t\t\t\t\tu16 offset,\n+\t\t\t\t\tu16 *data)\n+{\n+\ti40e_status ret_code = 0;\n+\n+\tret_code = i40e_read_nvm_word_srctl(hw, offset, data);\n+\treturn ret_code;\n+}\n+\n+/**\n * i40e_read_nvm_aq - Read Shadow RAM.\n * @hw: pointer to the HW structure.\n * @module_pointer: module pointer location in words from the NVM beginning\n@@ -280,7 +298,7 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,\n }\n \n /**\n- * i40e_read_nvm_word - Reads Shadow RAM\n+ * i40e_read_nvm_word - Reads nvm word and acquire lock if necessary\n * @hw: pointer to the HW structure\n * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF)\n * @data: word read from the Shadow RAM\n@@ -393,7 +411,28 @@ read_nvm_buffer_aq_exit:\n }\n \n /**\n- * i40e_read_nvm_buffer - Reads Shadow RAM buffer\n+ * __i40e_read_nvm_buffer - Reads nvm buffer, caller must acquire lock\n+ * @hw: pointer to the HW structure\n+ * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF).\n+ * @words: (in) number of words to read; (out) number of words actually read\n+ * @data: words read from the Shadow RAM\n+ *\n+ * Reads 16 bit words (data buffer) from the SR using the i40e_read_nvm_srrd()\n+ * method. The buffer read is preceded by the NVM ownership take\n+ * and followed by the release.\n+ **/\n+static i40e_status __i40e_read_nvm_buffer(struct i40e_hw *hw,\n+\t\t\t\t\t u16 offset,\n+\t\t\t\t\t u16 *words, u16 *data)\n+{\n+\ti40e_status ret_code = 0;\n+\n+\tret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data);\n+\treturn ret_code;\n+}\n+\n+/**\n+ * i40e_read_nvm_buffer - Reads Shadow RAM buffer and acuire lock if necessary\n * @hw: pointer to the HW structure\n * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF).\n * @words: (in) number of words to read; (out) number of words actually read\n@@ -499,15 +538,17 @@ static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw,\n \tdata = (u16 *)vmem.va;\n \n \t/* read pointer to VPD area */\n-\tret_code = i40e_read_nvm_word(hw, I40E_SR_VPD_PTR, &vpd_module);\n+\tret_code = __i40e_read_nvm_word(hw, I40E_SR_VPD_PTR,\n+\t\t\t\t\t&vpd_module);\n \tif (ret_code) {\n \t\tret_code = I40E_ERR_NVM_CHECKSUM;\n \t\tgoto i40e_calc_nvm_checksum_exit;\n \t}\n \n \t/* read pointer to PCIe Alt Auto-load module */\n-\tret_code = i40e_read_nvm_word(hw, I40E_SR_PCIE_ALT_AUTO_LOAD_PTR,\n-\t\t\t\t &pcie_alt_module);\n+\tret_code = __i40e_read_nvm_word(hw,\n+\t\t\t\t\tI40E_SR_PCIE_ALT_AUTO_LOAD_PTR,\n+\t\t\t\t\t&pcie_alt_module);\n \tif (ret_code) {\n \t\tret_code = I40E_ERR_NVM_CHECKSUM;\n \t\tgoto i40e_calc_nvm_checksum_exit;\n@@ -521,7 +562,7 @@ static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw,\n \t\tif ((i % I40E_SR_SECTOR_SIZE_IN_WORDS) == 0) {\n \t\t\tu16 words = I40E_SR_SECTOR_SIZE_IN_WORDS;\n \n-\t\t\tret_code = i40e_read_nvm_buffer(hw, i, &words, data);\n+\t\t\tret_code = __i40e_read_nvm_buffer(hw, i, &words, data);\n \t\t\tif (ret_code) {\n \t\t\t\tret_code = I40E_ERR_NVM_CHECKSUM;\n \t\t\t\tgoto i40e_calc_nvm_checksum_exit;\n@@ -593,13 +634,18 @@ i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw,\n \tu16 checksum_sr = 0;\n \tu16 checksum_local = 0;\n \n-\tret_code = i40e_calc_nvm_checksum(hw, &checksum_local);\n-\tif (ret_code)\n+\tif (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE)\n+\t\tret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);\n+\tif (!ret_code) {\n+\t\tret_code = i40e_calc_nvm_checksum(hw, &checksum_local);\n+\t\tif (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE)\n+\t\t\ti40e_release_nvm(hw);\n+\t\tif (ret_code)\n+\t\t\tgoto i40e_validate_nvm_checksum_exit;\n+\t} else {\n \t\tgoto i40e_validate_nvm_checksum_exit;\n+\t}\n \n-\t/* Do not use i40e_read_nvm_word() because we do not want to take\n-\t * the synchronization semaphores twice here.\n-\t */\n \ti40e_read_nvm_word(hw, I40E_SR_SW_CHECKSUM_WORD, &checksum_sr);\n \n \t/* Verify read checksum from EEPROM is the same as\n@@ -958,6 +1004,7 @@ retry:\n \t\tbreak;\n \n \tcase I40E_NVMUPD_CSUM_CON:\n+\t\t/* Assumes the caller has acquired the nvm */\n \t\tstatus = i40e_update_nvm_checksum(hw);\n \t\tif (status) {\n \t\t\t*perrno = hw->aq.asq_last_status ?\n@@ -971,6 +1018,7 @@ retry:\n \t\tbreak;\n \n \tcase I40E_NVMUPD_CSUM_LCB:\n+\t\t/* Assumes the caller has acquired the nvm */\n \t\tstatus = i40e_update_nvm_checksum(hw);\n \t\tif (status) {\n \t\t\t*perrno = hw->aq.asq_last_status ?\n", "prefixes": [ "next", "S23", "09/13" ] }