Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/595229/?format=api
{ "id": 595229, "url": "http://patchwork.ozlabs.org/api/patches/595229/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1457559900-7031-1-git-send-email-donald.c.skidmore@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": "<1457559900-7031-1-git-send-email-donald.c.skidmore@intel.com>", "list_archive_url": null, "date": "2016-03-09T21:45:00", "name": "ixgbe: Place SWFW semaphore in known valid state at probe", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "7124953500db0b81351f198c43b4eb85d992bfb3", "submitter": { "id": 4487, "url": "http://patchwork.ozlabs.org/api/people/4487/?format=api", "name": "Skidmore, Donald C", "email": "donald.c.skidmore@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/1457559900-7031-1-git-send-email-donald.c.skidmore@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/595229/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/595229/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 5FF1514032B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 10 Mar 2016 07:47:55 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 71A1633AEC;\n\tWed, 9 Mar 2016 20:47:54 +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 t7u1IXtI0O+3; Wed, 9 Mar 2016 20:47:53 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3D397332FF;\n\tWed, 9 Mar 2016 20:47:53 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8F3001C0D9C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Mar 2016 20:47:52 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 88EDD339A4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Mar 2016 20:47:52 +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 XtRTXaO4w7EQ for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Mar 2016 20:47:50 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTP id A697F33A14\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Mar 2016 20:47:50 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 09 Mar 2016 12:47:50 -0800", "from localhost.jf.intel.com (HELO dcskidmo-M40.jf.intel.com)\n\t([134.134.3.22])\n\tby FMSMGA003.fm.intel.com with ESMTP; 09 Mar 2016 12:47:52 -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.24,312,1455004800\"; d=\"scan'208\";a=\"666625836\"", "From": "Donald C Skidmore <donald.c.skidmore@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 9 Mar 2016 16:45:00 -0500", "Message-Id": "<1457559900-7031-1-git-send-email-donald.c.skidmore@intel.com>", "X-Mailer": "git-send-email 2.4.3", "Subject": "[Intel-wired-lan] [PATCH] ixgbe: Place SWFW semaphore in known\n\tvalid state at probe", "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: Don Skidmore <donald.c.skidmore@intel.com>\n\nIt is possible on some HW that a system reset could occur when we are\nholding the SWFW semaphore lock. So next time the driver was loaded we\nwould see it incorrectly as locked. This patch will recover from that state\nby: Attempting to aquire the semaphore and then regardless of whether or\nnot it was aquire we immediately release it. This will force us into\na known good state.\n\nSigned-off-by: Donald C Skidmore <donald.c.skidmore@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c | 1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 20 ++++++++++++++++++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_x540.h | 1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 2 ++\n 7 files changed, 30 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c\nindex f47eb12..6ecd598 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c\n@@ -1196,6 +1196,7 @@ static const struct ixgbe_mac_operations mac_ops_82598 = {\n \t.set_fw_drv_ver = NULL,\n \t.acquire_swfw_sync = &ixgbe_acquire_swfw_sync,\n \t.release_swfw_sync = &ixgbe_release_swfw_sync,\n+\t.init_swfw_sync\t\t= NULL,\n \t.get_thermal_sensor_data = NULL,\n \t.init_thermal_sensor_thresh = NULL,\n \t.prot_autoc_read\t= &prot_autoc_read_generic,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c\nindex c3ae5a7..4bb6b68 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c\n@@ -2228,6 +2228,7 @@ static const struct ixgbe_mac_operations mac_ops_82599 = {\n \t.set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing,\n \t.acquire_swfw_sync = &ixgbe_acquire_swfw_sync,\n \t.release_swfw_sync = &ixgbe_release_swfw_sync,\n+\t.init_swfw_sync\t\t= NULL,\n \t.get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic,\n \t.init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic,\n \t.prot_autoc_read\t= &prot_autoc_read_82599,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 9f8d762..813b29f 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -9126,6 +9126,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tif (err)\n \t\tgoto err_sw_init;\n \n+\t/* Make sure the SWFW semaphore is in a valid state */\n+\tif (hw->mac.ops.init_swfw_sync)\n+\t\thw->mac.ops.init_swfw_sync(hw);\n+\n \t/* Make it possible the adapter to be woken up via WOL */\n \tswitch (adapter->hw.mac.type) {\n \tcase ixgbe_mac_82599EB:\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\nindex 787d2b2..bc012ab 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n@@ -3266,6 +3266,7 @@ struct ixgbe_mac_operations {\n \ts32 (*enable_rx_dma)(struct ixgbe_hw *, u32);\n \ts32 (*acquire_swfw_sync)(struct ixgbe_hw *, u32);\n \tvoid (*release_swfw_sync)(struct ixgbe_hw *, u32);\n+\tvoid (*init_swfw_sync)(struct ixgbe_hw *);\n \ts32 (*prot_autoc_read)(struct ixgbe_hw *, bool *, u32 *);\n \ts32 (*prot_autoc_write)(struct ixgbe_hw *, u32, bool);\n \ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c\nindex c00b67b..40824d8 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c\n@@ -747,6 +747,25 @@ static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw)\n }\n \n /**\n+ * ixgbe_init_swfw_sync_X540 - Release hardware semaphore\n+ * @hw: pointer to hardware structure\n+ *\n+ * This function reset hardware semaphore bits for a semaphore that may\n+ * have be left locked due to a catastrophic failure.\n+ **/\n+void ixgbe_init_swfw_sync_X540(struct ixgbe_hw *hw)\n+{\n+\t/* First try to grab the semaphore but we don't need to bother\n+\t * looking to see whether we got the lock or not since we do\n+\t * the same thing regardless of whether we got the lock or not.\n+\t * We got the lock - we release it.\n+\t * We timeout trying to get the lock - we force its release.\n+\t */\n+\tixgbe_get_swfw_sync_semaphore(hw);\n+\tixgbe_release_swfw_sync_semaphore(hw);\n+}\n+\n+/**\n * ixgbe_blink_led_start_X540 - Blink LED based on index.\n * @hw: pointer to hardware structure\n * @index: led number to blink\n@@ -854,6 +873,7 @@ static const struct ixgbe_mac_operations mac_ops_X540 = {\n \t.set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing,\n \t.acquire_swfw_sync = &ixgbe_acquire_swfw_sync_X540,\n \t.release_swfw_sync = &ixgbe_release_swfw_sync_X540,\n+\t.init_swfw_sync\t\t= &ixgbe_init_swfw_sync_X540,\n \t.disable_rx_buff\t= &ixgbe_disable_rx_buff_generic,\n \t.enable_rx_buff\t\t= &ixgbe_enable_rx_buff_generic,\n \t.get_thermal_sensor_data = NULL,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.h\nindex a1468b1..e21cd48 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.h\n@@ -36,4 +36,5 @@ s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index);\n s32 ixgbe_blink_led_stop_X540(struct ixgbe_hw *hw, u32 index);\n s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask);\n void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask);\n+void ixgbe_init_swfw_sync_X540(struct ixgbe_hw *hw);\n s32 ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\nindex 972c9aa..9d3f765 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n@@ -2432,6 +2432,7 @@ static const struct ixgbe_mac_operations mac_ops_X550 = {\n \t.setup_sfp\t\t= NULL,\n \t.acquire_swfw_sync\t= &ixgbe_acquire_swfw_sync_X540,\n \t.release_swfw_sync\t= &ixgbe_release_swfw_sync_X540,\n+\t.init_swfw_sync\t\t= &ixgbe_init_swfw_sync_X540,\n \t.prot_autoc_read\t= prot_autoc_read_generic,\n \t.prot_autoc_write\t= prot_autoc_write_generic,\n \t.setup_fc\t\t= ixgbe_setup_fc_generic,\n@@ -2449,6 +2450,7 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = {\n \t.setup_sfp\t\t= ixgbe_setup_sfp_modules_X550em,\n \t.acquire_swfw_sync\t= &ixgbe_acquire_swfw_sync_X550em,\n \t.release_swfw_sync\t= &ixgbe_release_swfw_sync_X550em,\n+\t.init_swfw_sync\t\t= &ixgbe_init_swfw_sync_X540,\n \t.setup_fc\t\t= NULL, /* defined later */\n };\n \n", "prefixes": [] }