From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932635AbdABJgP (ORCPT ); Mon, 2 Jan 2017 04:36:15 -0500 Received: from mail-by2nam01on0069.outbound.protection.outlook.com ([104.47.34.69]:21920 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932541AbdABJgM (ORCPT ); Mon, 2 Jan 2017 04:36:12 -0500 From: Rafal Ozieblo To: Andrei Pistirica , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "davem@davemloft.net" , "nicolas.ferre@atmel.com" , "harinikatakamlinux@gmail.com" , "harini.katakam@xilinx.com" CC: "punnaia@xilinx.com" , "michals@xilinx.com" , "anirudh@xilinx.com" , "boris.brezillon@free-electrons.com" , "alexandre.belloni@free-electrons.com" , "tbultel@pixelsurmer.com" , "richardcochran@gmail.com" Subject: RE: [RFC PATCH net-next v4 1/2] macb: Add 1588 support in Cadence GEM. Thread-Topic: [RFC PATCH net-next v4 1/2] macb: Add 1588 support in Cadence GEM. Thread-Index: AQHSVfGM/AIZMc0Aj0+XufhsBcqeqqEdbqAQgAeTw4A= Date: Mon, 2 Jan 2017 09:36:10 +0000 Message-ID: References: <1481720175-12703-1-git-send-email-andrei.pistirica@microchip.com> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rafalo@cadence.com; x-originating-ip: [213.131.238.28] x-ms-office365-filtering-correlation-id: 860ea4a2-9213-4520-326b-08d432f2c97b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN3PR07MB2513; x-microsoft-exchange-diagnostics: 1;BN3PR07MB2513;7:WkPP7a9CVYzezVRvSp3MsFZ9//QECEWU6uGoyMdsOEyVdOdjFvOIffR1Loomviz1xgQX54jEpb4k9TjWV/zAtvPLkYH6pxDDU/oDx1KR9YZr8ug48HYX1E/eEEhPVGfkPFfO/hitP+PPWlENs3yF21B9GrWMvMlZuyv1WPT+x+bDZ3mWEMui2hRJADhe3FWB/OhFxsudUQ/pN10wt9fjyccLQgv+9F9ZGtDq6bP1JibaRWFyAKE7Oiz5hyrGY29nV3cVy7oMDkwImbAcmzU/Q8BNO6KwIcDDOZ+T2qb93Q5QSbXQayrpkUk/W/q4ZXEHEw9LpXOmc3leQ8D1fz7BXNpE+c4v2w+W5gwLQ+Of72Lm1OSBKelOBbesmVMC4wr6gUFHD8Pt/exDgEgC49faKHpViKMOwiZ0BpvXxf9X9fnC0T/k+S6X8WvmRAShQihlf35U9HlkJg3NGCf9DI0HjQ==;20:Sd3fXsSHRtPqGhtn6cheDmI8ZQqyAWBpAVRCgWebgIUWhFe5UXgER8xWnSoNmXwhEoiIeu95sQzp8fMlmNzBdMSo+fahB+NZ1MlwywlBNmx3XmNsv3ShJt0tY5JAC8El+Xj9yIu00JUcD3nxwORr9kyc6JOUL3PUsI3q8Sh66gzzy1B1Jdfoh2S5cSHALruLnqC64cVN536iYDPSNhBtyloBlcmorw4+E5YJt50lZSK7n5VJLXHrk5BPzEUfRgIT x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:BN3PR07MB2513;BCL:0;PCL:0;RULEID:;SRVR:BN3PR07MB2513; x-forefront-prvs: 017589626D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39450400003)(199003)(13464003)(189002)(36092001)(97736004)(54906002)(77096006)(3660700001)(122556002)(81156014)(74316002)(6506006)(86362001)(106116001)(76176999)(8936002)(54356999)(39060400001)(101416001)(106356001)(105586002)(2900100001)(3280700002)(50986999)(38730400001)(4326007)(2201001)(8666007)(6436002)(8656002)(92566002)(8676002)(229853002)(25786008)(9686002)(33656002)(3846002)(5001770100001)(5660300001)(2906002)(81166006)(305945005)(7416002)(6116002)(66066001)(102836003)(55016002)(2501003)(7696004)(7736002)(99286003)(189998001)(68736007)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2513;H:BN3PR07MB2516.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2017 09:36:10.5837 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2513 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v029aKhN021609 > -----Original Message----- > From: Rafal Ozieblo > Sent: 28 grudnia 2016 14:23 > Subject: RE: [RFC PATCH net-next v4 1/2] macb: Add 1588 support in Cadence GEM. > > > +static void gem_ptp_tx_hwtstamp(struct macb *bp, struct sk_buff *skb, > > + int peer_ev) > > +{ > > + struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb); > > + struct timespec64 ts; > > + u64 ns; > > + > > + /* PTP Peer Event Frame packets */ > > + if (peer_ev) { > > + ts.tv_sec = gem_readl(bp, PEFTSL); > > + ts.tv_nsec = gem_readl(bp, PEFTN); > > + > > + /* PTP Event Frame packets */ > > + } else { > > + ts.tv_sec = gem_readl(bp, EFTSL); > > + ts.tv_nsec = gem_readl(bp, EFTN); > > + } > I'm wondering what is a difference between timestamp in transmit buffer descriptor (Word 2 and 3) and PTP Event Frame Transmitted Seconds/Nanoseconds Register (0x1E0, 0x1E4). > According Cadence Hardware team: "It is just that some customers prefer to have the time in the descriptors as that is provided per frame. The registers are simply overwritten when a new event frame is transmitted/received and so software could miss it." The question is are you sure that you read timestamp for current frame? (not for the next frame).