Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/849014/?format=api
{ "id": 849014, "url": "http://patchwork.ozlabs.org/api/patches/849014/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1513323522-15021-11-git-send-email-sagar.a.kamble@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": "<1513323522-15021-11-git-send-email-sagar.a.kamble@intel.com>", "list_archive_url": null, "date": "2017-12-15T07:38:25", "name": "[10/27] ixgbe: Use timecounter_initialize interface", "commit_ref": null, "pull_url": null, "state": "awaiting-upstream", "archived": false, "hash": "6fcf9cb2255eeefa0c76fa4e13b8a57ad14fd23a", "submitter": { "id": 72926, "url": "http://patchwork.ozlabs.org/api/people/72926/?format=api", "name": "Sagar Arun Kamble", "email": "sagar.a.kamble@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/1513323522-15021-11-git-send-email-sagar.a.kamble@intel.com/mbox/", "series": [ { "id": 18670, "url": "http://patchwork.ozlabs.org/api/series/18670/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=18670", "date": "2017-12-15T07:38:16", "name": "[01/27] timecounter: Make cyclecounter struct part of timecounter struct", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/18670/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/849014/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/849014/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>)", "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 3yyhzy2Zxqz9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Dec 2017 18:35:42 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id D2785265B2;\n\tFri, 15 Dec 2017 07:35:40 +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 DwxE1CG02wYB; Fri, 15 Dec 2017 07:35:39 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id CF9872F66A;\n\tFri, 15 Dec 2017 07:35:39 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8FF481C21D9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Dec 2017 07:35:38 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 5664D2F304\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Dec 2017 07:35:38 +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 hsJrNQ2Qc+wX for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Dec 2017 07:35:36 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 06C522F87F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Dec 2017 07:35:35 +0000 (UTC)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 Dec 2017 23:35:35 -0800", "from sakamble-desktop.iind.intel.com ([10.223.26.118])\n\tby orsmga004.jf.intel.com with ESMTP; 14 Dec 2017 23:35:33 -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-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.45,403,1508828400\"; d=\"scan'208\";a=\"158949294\"", "From": "Sagar Arun Kamble <sagar.a.kamble@intel.com>", "To": "linux-kernel@vger.kernel.org", "Date": "Fri, 15 Dec 2017 13:08:25 +0530", "Message-Id": "<1513323522-15021-11-git-send-email-sagar.a.kamble@intel.com>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>", "References": "<1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>", "Subject": "[Intel-wired-lan] [PATCH 10/27] ixgbe: Use timecounter_initialize\n\tinterface", "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>", "Cc": "intel-wired-lan@lists.osuosl.org,\n\tRichard Cochran <richardcochran@gmail.com>,\n\tSagar Arun Kamble <sagar.a.kamble@intel.com>, netdev@vger.kernel.org", "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": "With new interface timecounter_initialize we can initialize timecounter\nfields and underlying cyclecounter together. Update ixgbe ptp timecounter\ninit with this new function.\n\nSigned-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>\nCc: Richard Cochran <richardcochran@gmail.com>\nCc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\nCc: intel-wired-lan@lists.osuosl.org\nCc: netdev@vger.kernel.org\nCc: linux-kernel@vger.kernel.org\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h | 6 +++-\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 +--\n drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 45 +++++++++++++++------------\n 3 files changed, 32 insertions(+), 23 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 5c391a0..67e8b5c 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -739,6 +739,10 @@ struct ixgbe_adapter {\n \tunsigned long last_rx_timestamp;\n \tspinlock_t tmreg_lock;\n \tstruct timecounter hw_tc;\n+\tu64 (*cc_read)(const struct cyclecounter *cc);\n+\tu64 cc_mask;\n+\tu32 cc_mult;\n+\tu32 cc_shift;\n \tu32 base_incval;\n \tu32 tx_hwtstamp_timeouts;\n \tu32 tx_hwtstamp_skipped;\n@@ -994,7 +998,7 @@ static inline void ixgbe_ptp_rx_hwtstamp(struct ixgbe_ring *rx_ring,\n \n int ixgbe_ptp_set_ts_config(struct ixgbe_adapter *adapter, struct ifreq *ifr);\n int ixgbe_ptp_get_ts_config(struct ixgbe_adapter *adapter, struct ifreq *ifr);\n-void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter);\n+void ixgbe_ptp_start_timecounter(struct ixgbe_adapter *adapter);\n void ixgbe_ptp_reset(struct ixgbe_adapter *adapter);\n void ixgbe_ptp_check_pps_event(struct ixgbe_adapter *adapter);\n #ifdef CONFIG_PCI_IOV\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 62a1891..86a337b 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -7332,7 +7332,7 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)\n \tadapter->last_rx_ptp_check = jiffies;\n \n \tif (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))\n-\t\tixgbe_ptp_start_cyclecounter(adapter);\n+\t\tixgbe_ptp_start_timecounter(adapter);\n \n \tswitch (link_speed) {\n \tcase IXGBE_LINK_SPEED_10GB_FULL:\n@@ -7400,7 +7400,7 @@ static void ixgbe_watchdog_link_is_down(struct ixgbe_adapter *adapter)\n \t\tadapter->flags2 |= IXGBE_FLAG2_SEARCH_FOR_SFP;\n \n \tif (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))\n-\t\tixgbe_ptp_start_cyclecounter(adapter);\n+\t\tixgbe_ptp_start_timecounter(adapter);\n \n \te_info(drv, \"NIC Link is Down\\n\");\n \tnetif_carrier_off(netdev);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c\nindex 6e9f2c0..073c1ef 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c\n@@ -1075,7 +1075,8 @@ static void ixgbe_ptp_link_speed_adjust(struct ixgbe_adapter *adapter,\n }\n \n /**\n- * ixgbe_ptp_start_cyclecounter - create the cycle counter from hw\n+ * ixgbe_ptp_start_timecounter - create the cycle counter from hw and\n+ *\t\t\t\t initialize corresponding timecounter.\n * @adapter: pointer to the adapter structure\n *\n * This function should be called to set the proper values for the TIMINCA\n@@ -1084,10 +1085,9 @@ static void ixgbe_ptp_link_speed_adjust(struct ixgbe_adapter *adapter,\n * structure. It should be called whenever a new TIMINCA value is necessary,\n * such as during initialization or when the link speed changes.\n */\n-void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)\n+void ixgbe_ptp_start_timecounter(struct ixgbe_adapter *adapter)\n {\n \tstruct ixgbe_hw *hw = &adapter->hw;\n-\tstruct cyclecounter cc;\n \tunsigned long flags;\n \tu32 incval = 0;\n \tu32 tsauxc = 0;\n@@ -1104,9 +1104,9 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)\n \t * proper fix to this problem would require modification of the\n \t * timecounter delta calculations.\n \t */\n-\tcc.mask = CLOCKSOURCE_MASK(64);\n-\tcc.mult = 1;\n-\tcc.shift = 0;\n+\tadapter->cc_mask = CLOCKSOURCE_MASK(64);\n+\tadapter->cc_mult = 1;\n+\tadapter->cc_shift = 0;\n \n \tswitch (hw->mac.type) {\n \tcase ixgbe_mac_X550EM_x:\n@@ -1118,13 +1118,13 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)\n \t\t */\n \t\tfuse0 = IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0));\n \t\tif (!(fuse0 & IXGBE_FUSES0_300MHZ)) {\n-\t\t\tcc.mult = 3;\n-\t\t\tcc.shift = 2;\n+\t\t\tadapter->cc_mult = 3;\n+\t\t\tadapter->cc_shift = 2;\n \t\t}\n \t\t/* fallthrough */\n \tcase ixgbe_mac_x550em_a:\n \tcase ixgbe_mac_X550:\n-\t\tcc.read = ixgbe_ptp_read_X550;\n+\t\tadapter->cc_read = ixgbe_ptp_read_X550;\n \n \t\t/* enable SYSTIME counter */\n \t\tIXGBE_WRITE_REG(hw, IXGBE_SYSTIMR, 0);\n@@ -1139,17 +1139,21 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)\n \t\tIXGBE_WRITE_FLUSH(hw);\n \t\tbreak;\n \tcase ixgbe_mac_X540:\n-\t\tcc.read = ixgbe_ptp_read_82599;\n+\t\tadapter->cc_read = ixgbe_ptp_read_82599;\n \n-\t\tixgbe_ptp_link_speed_adjust(adapter, &cc.shift, &incval);\n+\t\tixgbe_ptp_link_speed_adjust(adapter,\n+\t\t\t\t\t &adapter->cc_shift,\n+\t\t\t\t\t &incval);\n \t\tIXGBE_WRITE_REG(hw, IXGBE_TIMINCA, incval);\n \t\tbreak;\n \tcase ixgbe_mac_82599EB:\n-\t\tcc.read = ixgbe_ptp_read_82599;\n+\t\tadapter->cc_read = ixgbe_ptp_read_82599;\n \n-\t\tixgbe_ptp_link_speed_adjust(adapter, &cc.shift, &incval);\n+\t\tixgbe_ptp_link_speed_adjust(adapter,\n+\t\t\t\t\t &adapter->cc_shift,\n+\t\t\t\t\t &incval);\n \t\tincval >>= IXGBE_INCVAL_SHIFT_82599;\n-\t\tcc.shift -= IXGBE_INCVAL_SHIFT_82599;\n+\t\tadapter->cc_shift -= IXGBE_INCVAL_SHIFT_82599;\n \t\tIXGBE_WRITE_REG(hw, IXGBE_TIMINCA,\n \t\t\t\tBIT(IXGBE_INCPER_SHIFT_82599) | incval);\n \t\tbreak;\n@@ -1164,7 +1168,12 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)\n \n \t/* need lock to prevent incorrect read while modifying cyclecounter */\n \tspin_lock_irqsave(&adapter->tmreg_lock, flags);\n-\tmemcpy(&adapter->hw_tc.cc, &cc, sizeof(adapter->hw_tc.cc));\n+\ttimecounter_initialize(&adapter->tc,\n+\t\t\t adapter->cc_read,\n+\t\t\t adapter->cc_mask,\n+\t\t\t adapter->cc_mult,\n+\t\t\t adapter->cc_shift,\n+\t\t\t ktime_to_ns(ktime_get_real()));\n \tspin_unlock_irqrestore(&adapter->tmreg_lock, flags);\n }\n \n@@ -1192,11 +1201,7 @@ void ixgbe_ptp_reset(struct ixgbe_adapter *adapter)\n \tif (hw->mac.type == ixgbe_mac_82598EB)\n \t\treturn;\n \n-\tixgbe_ptp_start_cyclecounter(adapter);\n-\n-\tspin_lock_irqsave(&adapter->tmreg_lock, flags);\n-\ttimecounter_init(&adapter->hw_tc, ktime_to_ns(ktime_get_real()));\n-\tspin_unlock_irqrestore(&adapter->tmreg_lock, flags);\n+\tixgbe_ptp_start_timecounter(adapter);\n \n \tadapter->last_overflow_check = jiffies;\n \n", "prefixes": [ "10/27" ] }