Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/884925/?format=api
{ "id": 884925, "url": "http://patchwork.ozlabs.org/api/patches/884925/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1520860975-110746-1-git-send-email-paul.greenwalt@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": "<1520860975-110746-1-git-send-email-paul.greenwalt@intel.com>", "list_archive_url": null, "date": "2018-03-12T13:22:55", "name": "ixgbe: add status reg reads to ixgbe_check_remove", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b4f45e6d9d93bfc6a5d1c4a65fac51126ef85c23", "submitter": { "id": 71166, "url": "http://patchwork.ozlabs.org/api/people/71166/?format=api", "name": "Paul Greenwalt", "email": "paul.greenwalt@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/1520860975-110746-1-git-send-email-paul.greenwalt@intel.com/mbox/", "series": [ { "id": 33355, "url": "http://patchwork.ozlabs.org/api/series/33355/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=33355", "date": "2018-03-12T13:22:55", "name": "ixgbe: add status reg reads to ixgbe_check_remove", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/33355/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/884925/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/884925/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.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=intel.com" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 400Xq26jWBz9sSM\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 13 Mar 2018 09:34:38 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 143E688E34;\n\tMon, 12 Mar 2018 22:34:37 +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 OBsjYJu0oSLT; Mon, 12 Mar 2018 22:34:35 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 78A4588E49;\n\tMon, 12 Mar 2018 22:34:35 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id CCCF21C072C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Mar 2018 22:34:34 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id C97B021F71\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Mar 2018 22:34:34 +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 SculmPtVLBbj for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Mar 2018 22:34:34 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby silver.osuosl.org (Postfix) with ESMTPS id DFBF9207A8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Mar 2018 22:34:33 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Mar 2018 15:34:33 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.241.74])\n\tby fmsmga004.fm.intel.com with ESMTP; 12 Mar 2018 15:34: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-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.47,463,1515484800\"; d=\"scan'208\";a=\"36734616\"", "From": "Paul Greenwalt <paul.greenwalt@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 12 Mar 2018 09:22:55 -0400", "Message-Id": "<1520860975-110746-1-git-send-email-paul.greenwalt@intel.com>", "X-Mailer": "git-send-email 2.7.5", "Subject": "[Intel-wired-lan] [PATCH] ixgbe: add status reg reads to\n\tixgbe_check_remove", "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 status register reads and delay between reads to ixgbe_check_remove.\nRegisters can read 0xFFFFFFFF during pci reset, which causes the driver\nto remove the adapter. The additional status register reads can reduce the\nchance of this race condition.\n\nIf the status register is not 0xFFFFFFFF, then ixgbe_check_remove returns\nthe value of the register being read.\n\nSigned-off-by: Paul Greenwalt <paul.greenwalt@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.h | 1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 31 ++++++++++++++++---------\n 2 files changed, 21 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\nindex 7359d0b..c0827ef 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n@@ -154,6 +154,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,\n void ixgbe_set_soft_rate_select_speed(struct ixgbe_hw *hw,\n \t\t\t\t ixgbe_link_speed speed);\n \n+#define IXGBE_FAILED_READ_RETRIES 5\n #define IXGBE_FAILED_READ_REG 0xffffffffU\n #define IXGBE_FAILED_READ_CFG_DWORD 0xffffffffU\n #define IXGBE_FAILED_READ_CFG_WORD 0xffffU\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 8536942..faf368b 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -353,23 +353,32 @@ static void ixgbe_remove_adapter(struct ixgbe_hw *hw)\n \t\tixgbe_service_event_schedule(adapter);\n }\n \n-static void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg)\n+static u32 ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg)\n {\n+\tu8 __iomem *reg_addr;\n \tu32 value;\n+\tint i;\n \n-\t/* The following check not only optimizes a bit by not\n-\t * performing a read on the status register when the\n-\t * register just read was a status register read that\n-\t * returned IXGBE_FAILED_READ_REG. It also blocks any\n-\t * potential recursion.\n+\treg_addr = READ_ONCE(hw->hw_addr);\n+\tif (ixgbe_removed(reg_addr))\n+\t\treturn IXGBE_FAILED_READ_REG;\n+\n+\t/* Register read of 0xFFFFFFF can indicate the adapter has been removed,\n+\t * so perform several status register reads to determine if the adapter\n+\t * has been removed.\n \t */\n-\tif (reg == IXGBE_STATUS) {\n-\t\tixgbe_remove_adapter(hw);\n-\t\treturn;\n+\tfor (i = 0; i < IXGBE_FAILED_READ_RETRIES; i++) {\n+\t\tvalue = readl(reg_addr + IXGBE_STATUS);\n+\t\tif (value != IXGBE_FAILED_READ_REG)\n+\t\t\tbreak;\n+\t\tmdelay(3);\n \t}\n-\tvalue = ixgbe_read_reg(hw, IXGBE_STATUS);\n+\n \tif (value == IXGBE_FAILED_READ_REG)\n \t\tixgbe_remove_adapter(hw);\n+\telse\n+\t\tvalue = readl(reg_addr + reg);\n+\treturn value;\n }\n \n /**\n@@ -415,7 +424,7 @@ u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg)\n writes_completed:\n \tvalue = readl(reg_addr + reg);\n \tif (unlikely(value == IXGBE_FAILED_READ_REG))\n-\t\tixgbe_check_remove(hw, reg);\n+\t\tvalue = ixgbe_check_remove(hw, reg);\n \treturn value;\n }\n \n", "prefixes": [] }