Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/951441/?format=api
{ "id": 951441, "url": "http://patchwork.ozlabs.org/api/patches/951441/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180731160410.50028-1-sebastianx.basierski@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": "<20180731160410.50028-1-sebastianx.basierski@intel.com>", "list_archive_url": null, "date": "2018-07-31T16:04:10", "name": "ixgbe: firmware recovery mode", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "f0a6b191afc7337303a70db51c7d62316c943f8f", "submitter": { "id": 74580, "url": "http://patchwork.ozlabs.org/api/people/74580/?format=api", "name": "Sebastian Basierski", "email": "sebastianx.basierski@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/20180731160410.50028-1-sebastianx.basierski@intel.com/mbox/", "series": [ { "id": 58458, "url": "http://patchwork.ozlabs.org/api/series/58458/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=58458", "date": "2018-07-31T16:04:10", "name": "ixgbe: firmware recovery mode", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/58458/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/951441/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/951441/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>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "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 41fndM2HWgz9ryn\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 31 Jul 2018 17:10:13 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id F223F22780;\n\tTue, 31 Jul 2018 07:10:11 +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 RtKcu7noqDhs; Tue, 31 Jul 2018 07:10:10 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id E35712281A;\n\tTue, 31 Jul 2018 07:10:10 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3F32F1C0521\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Jul 2018 07:10:09 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3B93E2281A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Jul 2018 07:10:09 +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 z5TQyFYiDOCB for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Jul 2018 07:10:06 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 77B4322780\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Jul 2018 07:10:06 +0000 (UTC)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t31 Jul 2018 00:10:06 -0700", "from ubuntu.imu.intel.com ([10.217.246.11])\n\tby fmsmga006.fm.intel.com with ESMTP; 31 Jul 2018 00:10:04 -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-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,426,1526367600\"; d=\"scan'208\";a=\"250396300\"", "From": "Sebastian Basierski <sebastianx.basierski@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 31 Jul 2018 18:04:10 +0200", "Message-Id": "<20180731160410.50028-1-sebastianx.basierski@intel.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[Intel-wired-lan] [PATCH] ixgbe: firmware recovery mode", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "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": "Add check for FW NVM recovery mode during driver initialization and\nservice task. If in recovery mode, log message and unregister device\n\nSigned-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>\n---\n .../net/ethernet/intel/ixgbe/ixgbe_common.c | 12 ++++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 41 +++++++++++++++++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 4 ++\n drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 15 +++++++\n 4 files changed, 72 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\nindex 0bd1294ba517..78460fb365ba 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n@@ -3484,6 +3484,18 @@ void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf)\n \tIXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof);\n }\n \n+/**\n+ * ixgbe_fw_recovery_mode - Check if in FW NVM recovery mode\n+ * @hw: pointer to hardware structure\n+ *\n+ **/\n+bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw)\n+{\n+\tif (hw->mac.ops.fw_recovery_mode)\n+\t\treturn hw->mac.ops.fw_recovery_mode(hw);\n+\treturn false;\n+}\n+\n /**\n * ixgbe_get_device_caps_generic - Get additional device capabilities\n * @hw: pointer to hardware structure\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 447098005490..2c08bcef27ad 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -7764,6 +7764,33 @@ static void ixgbe_reset_subtask(struct ixgbe_adapter *adapter)\n \trtnl_unlock();\n }\n \n+/**\n+ * ixgbe_check_fw_error - Check firmware for errors\n+ * @adapter: the adapter private structure\n+ *\n+ * Check firmware errors in register FWSM\n+ **/\n+static bool ixgbe_check_fw_error(struct ixgbe_adapter *adapter)\n+{\n+\tstruct ixgbe_hw *hw = &adapter->hw;\n+\tu32 fwsm;\n+\n+\t/* read fwsm.ext_err_ind register and log errors */\n+\tfwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw));\n+\n+\tif (fwsm & IXGBE_FWSM_EXT_ERR_IND_MASK ||\n+\t !(fwsm & IXGBE_FWSM_FW_VAL_BIT))\n+\t\te_dev_warn(\"Warning firmware error detected FWSM: 0x%08X\\n\",\n+\t\t\t fwsm);\n+\n+\tif (hw->mac.ops.fw_recovery_mode && hw->mac.ops.fw_recovery_mode(hw)) {\n+\t\te_dev_err(\"Firmware recovery mode detected. Limiting functionality. Refer to the Intel(R) Ethernet Adapters and Devices User Guide for details on firmware recovery mode.\\n\");\n+\treturn true;\n+\t}\n+\n+\treturn false;\n+}\n+\n /**\n * ixgbe_service_task - manages and runs subtasks\n * @work: pointer to work_struct containing our data\n@@ -7782,6 +7809,15 @@ static void ixgbe_service_task(struct work_struct *work)\n \t\tixgbe_service_event_complete(adapter);\n \t\treturn;\n \t}\n+\tif (ixgbe_check_fw_error(adapter)) {\n+\t\tif (!test_bit(__IXGBE_DOWN, &adapter->state)) {\n+\t\t\trtnl_lock();\n+\t\t\tunregister_netdev(adapter->netdev);\n+\t\t\trtnl_unlock();\n+\t\t}\n+\t\tixgbe_service_event_complete(adapter);\n+\t\treturn;\n+\t}\n \tif (adapter->flags2 & IXGBE_FLAG2_UDP_TUN_REREG_NEEDED) {\n \t\trtnl_lock();\n \t\tadapter->flags2 &= ~IXGBE_FLAG2_UDP_TUN_REREG_NEEDED;\n@@ -10694,6 +10730,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tif (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)\n \t\tnetdev->features |= NETIF_F_LRO;\n \n+\tif (ixgbe_check_fw_error(adapter)) {\n+\t\terr = -EIO;\n+\t\tgoto err_sw_init;\n+\t}\n+\n \t/* make sure the EEPROM is good */\n \tif (hw->eeprom.ops.validate_checksum(hw, NULL) < 0) {\n \t\te_dev_err(\"The EEPROM Checksum Is Not Valid\\n\");\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\nindex 44cfb2021145..7b7df5688b3a 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n@@ -924,6 +924,9 @@ struct ixgbe_nvm_version {\n /* Firmware Semaphore Register */\n #define IXGBE_FWSM_MODE_MASK\t0xE\n #define IXGBE_FWSM_FW_MODE_PT\t0x4\n+#define IXGBE_FWSM_FW_NVM_RECOVERY_MODE\tBIT(5)\n+#define IXGBE_FWSM_EXT_ERR_IND_MASK\t0x01F80000\n+#define IXGBE_FWSM_FW_VAL_BIT\tBIT(15)\n \n /* ARC Subsystem registers */\n #define IXGBE_HICR 0x15F00\n@@ -3460,6 +3463,7 @@ struct ixgbe_mac_operations {\n \t\t\t const char *);\n \ts32 (*get_thermal_sensor_data)(struct ixgbe_hw *);\n \ts32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw);\n+\tbool (*fw_recovery_mode)(struct ixgbe_hw *hw);\n \tvoid (*disable_rx)(struct ixgbe_hw *hw);\n \tvoid (*enable_rx)(struct ixgbe_hw *hw);\n \tvoid (*set_source_address_pruning)(struct ixgbe_hw *, bool,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\nindex a8148c7126e5..dbe502a1ffcf 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n@@ -1247,6 +1247,20 @@ static s32 ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw)\n \treturn 0;\n }\n \n+/** ixgbe_fw_recovery_mode - Check FW NVM recovery mode\n+ * @hw: pointer t hardware structure\n+ *\n+ * Returns true if in FW NVM recovery mode.\n+ **/\n+\n+static bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw)\n+{\n+\tu32 fwsm;\n+\n+\tfwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw));\n+\treturn !!(fwsm & IXGBE_FWSM_FW_NVM_RECOVERY_MODE);\n+}\n+\n /** ixgbe_disable_rx_x550 - Disable RX unit\n *\n * Enables the Rx DMA unit for x550\n@@ -3816,6 +3830,7 @@ static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,\n \t.enable_rx_buff\t\t\t= &ixgbe_enable_rx_buff_generic, \\\n \t.get_thermal_sensor_data\t= NULL, \\\n \t.init_thermal_sensor_thresh\t= NULL, \\\n+\t.fw_recovery_mode\t\t= &ixgbe_fw_recovery_mode_X550, \\\n \t.enable_rx\t\t\t= &ixgbe_enable_rx_generic, \\\n \t.disable_rx\t\t\t= &ixgbe_disable_rx_x550, \\\n \n", "prefixes": [] }