Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752448AbdI2PRu (ORCPT ); Fri, 29 Sep 2017 11:17:50 -0400 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:52201 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752092AbdI2PRs (ORCPT ); Fri, 29 Sep 2017 11:17:48 -0400 From: Brandon Streiff To: Andrew Lunn CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "David S. Miller" , Florian Fainelli , Vivien Didelot , Richard Cochran , Erik Hons Subject: RE: [PATCH net-next RFC 2/9] net: dsa: mv88e6xxx: expose switch time as a PTP hardware clock Thread-Topic: [PATCH net-next RFC 2/9] net: dsa: mv88e6xxx: expose switch time as a PTP hardware clock Thread-Index: AQHTOG5h9rmyXj5FVEeyfsvu0pB47aLKhoyAgAFJodA= Date: Fri, 29 Sep 2017 15:17:02 +0000 Message-ID: References: <1506612341-18061-1-git-send-email-brandon.streiff@ni.com> <1506612341-18061-3-git-send-email-brandon.streiff@ni.com> <20170928170329.GC14940@lunn.ch> In-Reply-To: <20170928170329.GC14940@lunn.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [130.164.62.183] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR04MB1251;6:o9Z/OcFw8RAlGLf85FOk/Et7lL6vVxKUr+II9CBdYCfJ32FdaLCdwEY5lkAyB9Fa+wh/d0TduFsACn1QTDuoEvC2MT8OWXMO+ys8UXhO6KWLuIC7v4fxk5BxZN3ES+2v2PVF8qUBwBktvNr5uxfBPbxpwvmzJX7/ec0FVy/mlUwKUH9tVXJnn8s++bYz0J8k5A1YtzpJ/TkTt/UvsRqSQXGcgG1bdS/V5ogBVUBCWssPDLT7hsd/8Iq4PSFey916/VkJgQ6iAam9Cjcf69xfM/zMQ5MVupI83Anu05xLOdr24EMbhk3sTsx3GoVl7TYIlSDEuO2tmt99uoKSRH3XMw==;5:NWi/dTzRV+7aa2pCb1jrQhCUsf9SY9v71shOONb0jz8AdorhGZd6Pe8TjPwdaDfo7EYQGGIDGhx0H6aq/WGqvKH5C2JkyQBF7KuL0nX6lvQ7zggaPL2wXaPZaOdGfGMBS1yQIaYZQqfQGLN+cYkHlg==;24:O1jHw0Q4QB6icyypI0VHi1Ap9Ath16acmDaPYe1CIXx0K+QRnVgTBVGKe1ohXaCfgwkvufyunRgXVcZLpF/50mhBPlU5lfXp8mt062zuqAc=;7:X1DoZ++E1pPAK+Byu1RFiL8wLQ0Dy4uTxCwWOtsdp8SpBiws5EC6lpG9elJ7PKV9CzzCoLkP4CwLP2WzjCB+mwrUY7uW46/8cHKQNa0DLmmpWem8WHrjB+jR3caqiuV9hbveSGObn0kWJffVyNH+/KNHMILF0/YJWTiFBU1ZP/argsLgLMqERqsxkHGHK6hrr7jCvVErgboeQWcmWJvu075iKeZUO+xZIv3Q9oxLm1o= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(189002)(377454003)(199003)(2950100002)(81166006)(6436002)(7696004)(53936002)(478600001)(9686003)(6246003)(66066001)(39060400002)(316002)(54356999)(8936002)(77096006)(3280700002)(74316002)(189998001)(101416001)(3660700001)(76176999)(25786009)(6116002)(102836003)(3846002)(50986999)(229853002)(97736004)(14454004)(6916009)(81156014)(86362001)(54906003)(106356001)(68736007)(7736002)(105586002)(305945005)(4326008)(2906002)(6506006)(5660300001)(99286003)(8676002)(33656002)(55016002)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR04MB1251;H:CO2PR04MB2184.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: 16c39635-561b-4cd5-4938-08d5074d2382 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:BN6PR04MB1251; x-ms-traffictypediagnostic: BN6PR04MB1251: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR04MB1251;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR04MB1251; x-forefront-prvs: 0445A82F82 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: ni.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2017 15:17:02.9910 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 87ba1f9a-44cd-43a6-b008-6fdb45a5204e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR04MB1251 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-29_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=30 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709290219 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 nfs id v8TFHtdw029081 Content-Length: 908 Lines: 21 > From: Andrew Lunn [mailto:andrew@lunn.ch] > Sent: Thursday, September 28, 2017 12:03 PM > > > + bool timeout = time_is_before_jiffies(chip->last_overflow_check + > > + MV88E6XXX_TAI_OVERFLOW_PERIOD); > > + > > + if (timeout) { > > Why do you need this timeout? Do you think the kernel will call this > more often than required? > > Also, if it did call this function early, you skip the read, and > reschedule. There is then a danger the next read is after the > wraparound..... That was, conceptually, a copy-paste from ixgbe_ptp.c as I was looking for how to implement the overflow accounting; that driver has a similar time_is_before_jiffies check in ixgbe_ptp_overflow_check. Although now that I'm looking it over again, I'm also not certain of the need. Even if we're called more frequently than we expect, that doesn't seem to be harmful with regard to timekeeping. Hmm. -- brandon