Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/609817/?format=api
{ "id": 609817, "url": "http://patchwork.ozlabs.org/api/patches/609817/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1460475052-6348-5-git-send-email-harshitha.ramamurthy@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": "<1460475052-6348-5-git-send-email-harshitha.ramamurthy@intel.com>", "list_archive_url": null, "date": "2016-04-12T15:30:43", "name": "[next,S33,04/13] i40e: Specify AQ event opcode to wait for", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b94dcbd1e3f2318a2a9ea881144d6656aa79d74c", "submitter": { "id": 68642, "url": "http://patchwork.ozlabs.org/api/people/68642/?format=api", "name": "Harshitha Ramamurthy", "email": "harshitha.ramamurthy@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/1460475052-6348-5-git-send-email-harshitha.ramamurthy@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/609817/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/609817/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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 3ql3Jr2fBJz9sRZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Apr 2016 09:38:04 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 8E75E33336;\n\tTue, 12 Apr 2016 23:38:03 +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 Sncqy6ZylEic; Tue, 12 Apr 2016 23:37:58 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id BF608332E9;\n\tTue, 12 Apr 2016 23:37:58 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 580651C0E44\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:37:54 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 53D369D422\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:37:54 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id tVwdDHA8fwwB for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:37:52 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9E94F89F97\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:37:52 +0000 (UTC)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga101.fm.intel.com with ESMTP; 12 Apr 2016 16:36:30 -0700", "from harshitha-linux1.jf.intel.com ([10.166.45.81])\n\tby orsmga002.jf.intel.com with ESMTP; 12 Apr 2016 16:36:30 -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,476,1455004800\"; d=\"scan'208\";a=\"953677394\"", "From": "Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 12 Apr 2016 08:30:43 -0700", "Message-Id": "<1460475052-6348-5-git-send-email-harshitha.ramamurthy@intel.com>", "X-Mailer": "git-send-email 2.4.3", "In-Reply-To": "<1460475052-6348-1-git-send-email-harshitha.ramamurthy@intel.com>", "References": "<1460475052-6348-1-git-send-email-harshitha.ramamurthy@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S33 04/13] i40e: Specify AQ event\n\topcode to wait for", "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: Shannon Nelson <shannon.nelson@intel.com>\n\nTo add a little flexibility to the nvmupdate facility, this code adds the\nability to specify an AQ event opcode to wait on after the Exec_AQ request.\n\nSigned-off-by: Shannon Nelson <shannon.nelson@intel.com>\nChange-ID: Iddbfd63c3de8df3edb9d3e90678b08989bc4946e\n---\nTesting Hints (required if no HSD):\n make use of the devel test program i40e_aq_cmd.c\n\t# ethtool -s p4p1 msglvl 0xf000008f\n\t turn on nvmupdate debugging\n\t# i40e_aq_cmd p4p1 aq\n\t should run with no errors\n\t# i40e_aq_cmd p4p1 aq 0x0222\n\t should complain that it can't finish\n\tCannot get AQ result: Device or resource busy\n\t# i40e_aq_cmd p4p1 stat\n\t should log stat info with state 3 and opc 0x0222\n\t should return non-zero\n\t# i40e_aq_cmd p4p1 clear\n\t should run with no error\n\t# i40e_aq_cmd p4p1 stat\n\t should log stat info with state 0 and opc 0x0000\n\t# i40e_aq_cmd p4p1 aq\n\t should run with no error\n\n drivers/net/ethernet/intel/i40e/i40e_nvm.c | 49 +++++++++++++++++++++++----\n drivers/net/ethernet/intel/i40e/i40e_type.h | 1 +\n drivers/net/ethernet/intel/i40evf/i40e_type.h | 1 +\n 3 files changed, 44 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\nindex f2cea3d..954efe3 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n@@ -693,10 +693,10 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,\n \t/* early check for status command and debug msgs */\n \tupd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno);\n \n-\ti40e_debug(hw, I40E_DEBUG_NVM, \"%s state %d nvm_release_on_hold %d cmd 0x%08x config 0x%08x offset 0x%08x data_size 0x%08x\\n\",\n+\ti40e_debug(hw, I40E_DEBUG_NVM, \"%s state %d nvm_release_on_hold %d opc 0x%04x cmd 0x%08x config 0x%08x offset 0x%08x data_size 0x%08x\\n\",\n \t\t i40e_nvm_update_state_str[upd_cmd],\n \t\t hw->nvmupd_state,\n-\t\t hw->nvm_release_on_done,\n+\t\t hw->nvm_release_on_done, hw->nvm_wait_opcode,\n \t\t cmd->command, cmd->config, cmd->offset, cmd->data_size);\n \n \tif (upd_cmd == I40E_NVMUPD_INVALID) {\n@@ -710,7 +710,18 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,\n \t * going into the state machine\n \t */\n \tif (upd_cmd == I40E_NVMUPD_STATUS) {\n+\t\tif (!cmd->data_size) {\n+\t\t\t*perrno = -EFAULT;\n+\t\t\treturn I40E_ERR_BUF_TOO_SHORT;\n+\t\t}\n+\n \t\tbytes[0] = hw->nvmupd_state;\n+\n+\t\tif (cmd->data_size >= 4) {\n+\t\t\tbytes[1] = 0;\n+\t\t\t*((u16 *)&bytes[2]) = hw->nvm_wait_opcode;\n+\t\t}\n+\n \t\treturn 0;\n \t}\n \n@@ -729,6 +740,14 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,\n \n \tcase I40E_NVMUPD_STATE_INIT_WAIT:\n \tcase I40E_NVMUPD_STATE_WRITE_WAIT:\n+\t\t/* if we need to stop waiting for an event, clear\n+\t\t * the wait info and return before doing anything else\n+\t\t */\n+\t\tif (cmd->offset == 0xffff) {\n+\t\t\ti40e_nvmupd_check_wait_event(hw, hw->nvm_wait_opcode);\n+\t\t\treturn 0;\n+\t\t}\n+\n \t\tstatus = I40E_ERR_NOT_READY;\n \t\t*perrno = -EBUSY;\n \t\tbreak;\n@@ -800,6 +819,7 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw,\n \t\t\t\ti40e_release_nvm(hw);\n \t\t\t} else {\n \t\t\t\thw->nvm_release_on_done = true;\n+\t\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_erase;\n \t\t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT;\n \t\t\t}\n \t\t}\n@@ -816,6 +836,7 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw,\n \t\t\t\ti40e_release_nvm(hw);\n \t\t\t} else {\n \t\t\t\thw->nvm_release_on_done = true;\n+\t\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_update;\n \t\t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT;\n \t\t\t}\n \t\t}\n@@ -828,10 +849,12 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw,\n \t\t\t\t\t\t hw->aq.asq_last_status);\n \t\t} else {\n \t\t\tstatus = i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno);\n-\t\t\tif (status)\n+\t\t\tif (status) {\n \t\t\t\ti40e_release_nvm(hw);\n-\t\t\telse\n+\t\t\t} else {\n+\t\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_update;\n \t\t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_WRITE_WAIT;\n+\t\t\t}\n \t\t}\n \t\tbreak;\n \n@@ -850,6 +873,7 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw,\n \t\t\t\ti40e_release_nvm(hw);\n \t\t\t} else {\n \t\t\t\thw->nvm_release_on_done = true;\n+\t\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_update;\n \t\t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT;\n \t\t\t}\n \t\t}\n@@ -940,8 +964,10 @@ retry:\n \tswitch (upd_cmd) {\n \tcase I40E_NVMUPD_WRITE_CON:\n \t\tstatus = i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno);\n-\t\tif (!status)\n+\t\tif (!status) {\n+\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_update;\n \t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_WRITE_WAIT;\n+\t\t}\n \t\tbreak;\n \n \tcase I40E_NVMUPD_WRITE_LCB:\n@@ -954,6 +980,7 @@ retry:\n \t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT;\n \t\t} else {\n \t\t\thw->nvm_release_on_done = true;\n+\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_update;\n \t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT;\n \t\t}\n \t\tbreak;\n@@ -967,6 +994,7 @@ retry:\n \t\t\t\t -EIO;\n \t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT;\n \t\t} else {\n+\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_update;\n \t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_WRITE_WAIT;\n \t\t}\n \t\tbreak;\n@@ -981,6 +1009,7 @@ retry:\n \t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT;\n \t\t} else {\n \t\t\thw->nvm_release_on_done = true;\n+\t\t\thw->nvm_wait_opcode = i40e_aqc_opc_nvm_update;\n \t\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT;\n \t\t}\n \t\tbreak;\n@@ -1036,14 +1065,14 @@ retry:\n **/\n void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode)\n {\n-\tif (opcode == i40e_aqc_opc_nvm_erase ||\n-\t opcode == i40e_aqc_opc_nvm_update) {\n+\tif (opcode == hw->nvm_wait_opcode) {\n \t\ti40e_debug(hw, I40E_DEBUG_NVM,\n \t\t\t \"NVMUPD: clearing wait on opcode 0x%04x\\n\", opcode);\n \t\tif (hw->nvm_release_on_done) {\n \t\t\ti40e_release_nvm(hw);\n \t\t\thw->nvm_release_on_done = false;\n \t\t}\n+\t\thw->nvm_wait_opcode = 0;\n \n \t\tswitch (hw->nvmupd_state) {\n \t\tcase I40E_NVMUPD_STATE_INIT_WAIT:\n@@ -1220,6 +1249,12 @@ static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw,\n \t\t*perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status);\n \t}\n \n+\t/* should we wait for a followup event? */\n+\tif (cmd->offset) {\n+\t\thw->nvm_wait_opcode = cmd->offset;\n+\t\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT;\n+\t}\n+\n \treturn status;\n }\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h\nindex 793036b..bb57cd9 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h\n@@ -550,6 +550,7 @@ struct i40e_hw {\n \tstruct i40e_aq_desc nvm_wb_desc;\n \tstruct i40e_virt_mem nvm_buff;\n \tbool nvm_release_on_done;\n+\tu16 nvm_wait_opcode;\n \n \t/* HMC info */\n \tstruct i40e_hmc_info hmc; /* HMC info struct */\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h\nindex 4a78c18..b720713 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h\n@@ -523,6 +523,7 @@ struct i40e_hw {\n \tstruct i40e_aq_desc nvm_wb_desc;\n \tstruct i40e_virt_mem nvm_buff;\n \tbool nvm_release_on_done;\n+\tu16 nvm_wait_opcode;\n \n \t/* HMC info */\n \tstruct i40e_hmc_info hmc; /* HMC info struct */\n", "prefixes": [ "next", "S33", "04/13" ] }