Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/651989/?format=api
{ "id": 651989, "url": "http://patchwork.ozlabs.org/api/patches/651989/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1469292274-59237-2-git-send-email-jarod@redhat.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": "<1469292274-59237-2-git-send-email-jarod@redhat.com>", "list_archive_url": null, "date": "2016-07-23T16:44:33", "name": "[net-next,1/2] e1000e: factor out systim sanitization", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "df83731eaee9c5e414abf271a883466d2d7a463d", "submitter": { "id": 1153, "url": "http://patchwork.ozlabs.org/api/people/1153/?format=api", "name": "Jarod Wilson", "email": "jarod@redhat.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/1469292274-59237-2-git-send-email-jarod@redhat.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/651989/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/651989/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3rxYK24Mdzz9syB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 24 Jul 2016 02:44:53 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DA8BA88987;\n\tSat, 23 Jul 2016 16:44:51 +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 9ANT2c4DQubP; Sat, 23 Jul 2016 16:44:50 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2412D885B8;\n\tSat, 23 Jul 2016 16:44:50 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 9C2F91C1178\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 23 Jul 2016 16:44:48 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 8935B26878\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 23 Jul 2016 16:44:48 +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 HwX5DHVSw21k for <intel-wired-lan@lists.osuosl.org>;\n\tSat, 23 Jul 2016 16:44:47 +0000 (UTC)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 2A65B25441\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 23 Jul 2016 16:44:47 +0000 (UTC)", "from int-mx10.intmail.prod.int.phx2.redhat.com\n\t(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 53BA4C0035A8;\n\tSat, 23 Jul 2016 16:44:46 +0000 (UTC)", "from hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com\n\t(hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com [10.16.184.47])\n\tby int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id u6NGiiJL016376; Sat, 23 Jul 2016 12:44:45 -0400" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": [ "domain auto-whitelisted by SQLgrey-1.7.6", "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]); Sat, 23 Jul 2016 16:44:46 +0000 (UTC)" ], "From": "Jarod Wilson <jarod@redhat.com>", "To": "linux-kernel@vger.kernel.org", "Date": "Sat, 23 Jul 2016 12:44:33 -0400", "Message-Id": "<1469292274-59237-2-git-send-email-jarod@redhat.com>", "In-Reply-To": "<1469292274-59237-1-git-send-email-jarod@redhat.com>", "References": "<1468959902-25071-1-git-send-email-jarod@redhat.com>\n\t<1469292274-59237-1-git-send-email-jarod@redhat.com>", "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.23", "Cc": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org", "Subject": "[Intel-wired-lan] [PATCH net-next 1/2] e1000e: factor out systim\n\tsanitization", "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": "This is prepatory work for an expanding list of adapter families that have\noccasional ~10 hour clock jumps when being used for PTP. Factor out the\nsanitization function and convert to a switch statement, rather than using\nan if.\n\nCC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\nCC: intel-wired-lan@lists.osuosl.org\nCC: netdev@vger.kernel.org\nSigned-off-by: Jarod Wilson <jarod@redhat.com>\n---\n drivers/net/ethernet/intel/e1000e/netdev.c | 71 ++++++++++++++++++------------\n 1 file changed, 44 insertions(+), 27 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex 41f32c0..955b294 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -4303,6 +4303,42 @@ void e1000e_reinit_locked(struct e1000_adapter *adapter)\n }\n \n /**\n+ * e1000e_sanitize_systim - sanitize raw cycle counter reads\n+ * @hw: pointer to the HW structure\n+ * @systim: cycle_t value read, sanitized and returned\n+ *\n+ * Errata for 82574/82583 possible bad bits read from SYSTIMH/L:\n+ * check to see that the time is incrementing at a reasonable\n+ * rate and is a multiple of incvalue.\n+ **/\n+static cycle_t e1000e_sanitize_systim(struct e1000_hw *hw, cycle_t systim)\n+{\n+\tu64 time_delta, rem, temp;\n+\tcycle_t systim_next;\n+\tu32 incvalue;\n+\tint i;\n+\n+\tincvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;\n+\tfor (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {\n+\t\t/* latch SYSTIMH on read of SYSTIML */\n+\t\tsystim_next = (cycle_t)er32(SYSTIML);\n+\t\tsystim_next |= (cycle_t)er32(SYSTIMH) << 32;\n+\n+\t\ttime_delta = systim_next - systim;\n+\t\ttemp = time_delta;\n+\t\t/* VMWare users have seen incvalue of zero, don't div / 0 */\n+\t\trem = incvalue ? do_div(temp, incvalue) : (time_delta != 0);\n+\n+\t\tsystim = systim_next;\n+\n+\t\tif ((time_delta < E1000_82574_SYSTIM_EPSILON) && (rem == 0))\n+\t\t\tbreak;\n+\t}\n+\n+\treturn systim;\n+}\n+\n+/**\n * e1000e_cyclecounter_read - read raw cycle counter (used by time counter)\n * @cc: cyclecounter structure\n **/\n@@ -4312,7 +4348,7 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)\n \t\t\t\t\t\t cc);\n \tstruct e1000_hw *hw = &adapter->hw;\n \tu32 systimel, systimeh;\n-\tcycle_t systim, systim_next;\n+\tcycle_t systim;\n \t/* SYSTIMH latching upon SYSTIML read does not work well.\n \t * This means that if SYSTIML overflows after we read it but before\n \t * we read SYSTIMH, the value of SYSTIMH has been incremented and we\n@@ -4335,32 +4371,13 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)\n \tsystim = (cycle_t)systimel;\n \tsystim |= (cycle_t)systimeh << 32;\n \n-\tif ((hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82583)) {\n-\t\tu64 time_delta, rem, temp;\n-\t\tu32 incvalue;\n-\t\tint i;\n-\n-\t\t/* errata for 82574/82583 possible bad bits read from SYSTIMH/L\n-\t\t * check to see that the time is incrementing at a reasonable\n-\t\t * rate and is a multiple of incvalue\n-\t\t */\n-\t\tincvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;\n-\t\tfor (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {\n-\t\t\t/* latch SYSTIMH on read of SYSTIML */\n-\t\t\tsystim_next = (cycle_t)er32(SYSTIML);\n-\t\t\tsystim_next |= (cycle_t)er32(SYSTIMH) << 32;\n-\n-\t\t\ttime_delta = systim_next - systim;\n-\t\t\ttemp = time_delta;\n-\t\t\t/* VMWare users have seen incvalue of zero, don't div / 0 */\n-\t\t\trem = incvalue ? do_div(temp, incvalue) : (time_delta != 0);\n-\n-\t\t\tsystim = systim_next;\n-\n-\t\t\tif ((time_delta < E1000_82574_SYSTIM_EPSILON) &&\n-\t\t\t (rem == 0))\n-\t\t\t\tbreak;\n-\t\t}\n+\tswitch (hw->mac.type) {\n+\tcase e1000_82574:\n+\tcase e1000_82583:\n+\t\tsystim = e1000e_sanitize_systim(hw, systim);\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n \t}\n \treturn systim;\n }\n", "prefixes": [ "net-next", "1/2" ] }