Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753083AbbGXPHx (ORCPT ); Fri, 24 Jul 2015 11:07:53 -0400 Received: from mail-by2on0146.outbound.protection.outlook.com ([207.46.100.146]:53062 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752503AbbGXPHu (ORCPT ); Fri, 24 Jul 2015 11:07:50 -0400 Authentication-Results: freescale.com; dkim=none (message not signed) header.d=none; Message-ID: <1437750459.2993.224.camel@freescale.com> Subject: Re: [PATCH v2] powerpc/dts: Add and fix 1588 timer node for eTSEC From: Scott Wood To: Lu Yangbo-B47093 CC: "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Date: Fri, 24 Jul 2015 10:07:39 -0500 In-Reply-To: References: <1430969347-13869-1-git-send-email-yangbo.lu@freescale.com> <1437079112.2993.127.camel@freescale.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.0-fta1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Originating-IP: [2601:448:8100:f9f:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: CY1PR19CA0032.namprd19.prod.outlook.com (25.162.38.170) To BN3PR03MB1477.namprd03.prod.outlook.com (25.163.35.140) X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1477;2:dL2tAeiB8D8rHrY5EkGadFtlHBIs6eX10+7iXf1LOCLeg85Zge9B6VnoFI/PWWBLNlqSvFPoCvUGkVVEUPW9P56K/Cwz2eC2ypcQ2Y4zDYQMRjFoKVVkzTNrEN0dPo/2Z2d05rLNXwXE0PONYAodFWGQUPE8JaIE43a7RCEnxw8=;3:gC3EbB60EVPrLURRMrFhAUM1wGXDKRJOw+DljVeCviAjTHFLMAKemdkeGjJWY5fTRpLLO71sMFjHjBL0KNUxOnLJiMCsu4KUNEOd6ZKzC/pmkScbQUsBInY8ygSnI6o8bql0Gf8nxvOHj59yKuXFJA==;25:b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U2awLeRLJMNpV+THcvuFDm1PnGn2MbjZhHLcNCqh8Xvs9JPaWzTVXi/OD7UsusCTGbqBG5LgBCNCBAobznC8t7F9x0Rl/Wf3nQ3TycLPB49k= BN3PR03MB1477: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN3PR03MB1477;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1477; X-Forefront-PRVS: 0647963F84 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(377424004)(122386002)(23676002)(46102003)(77096005)(50466002)(77156002)(62966003)(2950100001)(92566002)(5001960100002)(42186005)(40100003)(36756003)(4001450100002)(19580395003)(5001920100001)(103116003)(50986999)(5820100001)(93886004)(87976001)(575784001)(47776003)(86362001)(110136002)(76176999)(189998001)(19580405001)(33646002)(50226001)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1477;H:[IPv6:2601:448:8100:f9f:12bf:48ff:fe84:c9a0];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1477;23:TxBgucxZfmkCPo8HJqkY8eyLCJLhBC/zNK/fqkhYz/GSfK7dpky06gUUXMo6nW6ZZHCTa7MctMJXaXsIWdv5vbtFo9XYrriqtOr13iHRPL0D5TEbjVffkFHJCi+b6rgROA4Y2U5fzFs/BJGClP3M91/YWFIRaTiX3ghda6m9gY2k95VjzcjdeVXLQeODm4xpux3qj43TO0XBMaWRbD7qHIT3COTo5XsZLiCTDMj/s8BGq2CWxpsdHiugIE4dfES0rcv1H/xOsWsY2v44KgpCZufcVebqt3vN71DHUJ+7rN+hlXKE88MgAzhYA78wq05K1s13G8nKD9ioGj4B9QMLtiHEApSrqLLzjLOXNsUjWeKK6ixZm7mguV4IM+4753wRSmQ/ixvCJSQCEcw5j7XT+81VBETAdUz9MQuNPCIfsX/78UlSCLdV9iyxQsQ/ZimdrlwhOCfM1do374a3Kw0GrM0BZ0Mdi8hJdEnn6w2VCOJB2csdlyyk0qfvwSCxV3dvAyOq1JC5xFO1kaKiWLQJnmsMn7l8s1WceU2JMx1y/E89VCJqf/jXp7l8VchrvxVr2IZM4IIM9EA+FyVxXyew0aD9+zwRv9P0kitLyMwuKiJH0kq4HqieFWXDD8BbA5ADzWvesEYatfrGL4BUnXWeMPUFFP5tQZNIKsPhM1EMcR87iqN0pKiZJK9k23+806Cg7OfdMX+eHlN4ObtK8Gu1gXf38A/6d94cZ7eJLDoCn085guHrHVYnUmeYEfRY+f2AdfJadHWNTotGKG0YVzZNExQtWy+bZ4fl+VwO4wEPPEpdegA0YZpPvAnx8Dk2ecAcAb9iNpVSQ9on/2XVPJIm99nea7TyR7fmvZscd98lOiaCLlK9ENCJr5fQRct4qsdFrVrAFTvFyWDzmw4wA3Eq7jFsuHLZTkPFxRp5WRnSZf66S1jiu+OH73CfIHR1Ch6y X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1477;5:00n56RwISoQR2vxmUFqagX+afbzaHsrmwoLIltlgVQkl1H5nGNYEw+MI8y5SzDsAj+oqZdl40fPMz1+d3Cy0y5kKT2JZimE4S3d77QlOgE0VqqxvtUKnDketwB7r1OJPXdYnmb7SXU8NFCh7NyGUrA==;24:0diJ+MaN+9oe3FljHdMUHjhtaPyZq6qxNnLPFwVQpeayk2S9OgSSXKKZYov/EPOTPVdq91PvvMkF/JwoY/0XIKIMu4GjOnNgOAuzMBojbLw=;20:17rcy907NPIr/+y9iTAeKcwtNUqrM/f7zKJIm0g8iluvmnLIUDkRuts1pKwUyaNa5lbmGUE+Jq84ichcwkHtiw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2015 15:07:46.9813 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1477 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3458 Lines: 87 On Mon, 2015-07-20 at 01:33 -0500, Lu Yangbo-B47093 wrote: > > On Wed, 2015-07-15 at 21:37 -0500, Lu Yangbo-B47093 wrote: > > > Any comments? > > > Thanks. > > > > Sorry, I must have missed this on my last time through the patch queue. > > I see you've decimalized the fiper and max-adj properties, which is > > good... but does it really make sense for tmr-add? I'm not familiar with > > what this value represents, but the numbers look more natural as hex (e.g. > > 0xaaaaaaab versus 2863311531). > > Yes, the fiper value would be writed into fiper registers. And max-adj > value would be used in ptp driver in driver/ptp/. > But you insisted that values should be in decimalism in the v1 patch... :) > > See the history :) I didn't insist on decimals for *everything*, just where it makes sense, and that "it goes in a register" doesn't *automatically* mean that it doesn't make sense. ################# history ################## > > > + ptp_clock@b0e00{ > > > + compatible = "fsl,etsec-ptp"; > > > + reg = <0xb0e00 0xb0>; > > > + interrupts = <68 2 0 0 69 2 0 0>; > > > + fsl,tclk-period = <5>; > > > + fsl,tmr-prsc = <2>; > > > + fsl,tmr-add = <0xcccccccd>; > > > + fsl,tmr-fiper1 = <0x3b9ac9fb>; > > > + fsl,tmr-fiper2 = <0x00018696>; > > > + fsl,max-adj = <249999999>; > > > > Please don't use hex for numbers that make more sense as decimal. > > [Lu Yangbo-B47093] The hex value is register value, I think it's better > > to use hex. > > Whether it goes into a register doesn't matter. Hex values are useful for > values which are subdivided into various bitfields, or whose hex > representation is simpler than decimal. I'm not familiar with the details > of this hardware, but I doubt the former is the case for 0x3b9ac9fb == > 9999999995 or 0x18696 == 99990. > > -Scott > ###################################### > > > > > > > > diff --git a/arch/powerpc/boot/dts/p2020rdb-pc.dtsi > > > > b/arch/powerpc/boot/dts/p2020rdb-pc.dtsi > > > > index c21d1c7..363172d 100644 > > > > --- a/arch/powerpc/boot/dts/p2020rdb-pc.dtsi > > > > +++ b/arch/powerpc/boot/dts/p2020rdb-pc.dtsi > > > > @@ -215,12 +215,12 @@ > > > > }; > > > > > > > > ptp_clock@24e00{ > > > > - fsl,tclk-period = <5>; > > > > - fsl,tmr-prsc = <200>; > > > > - fsl,tmr-add = <0xCCCCCCCD>; > > > > - fsl,tmr-fiper1 = <0x3B9AC9FB>; > > > > - fsl,tmr-fiper2 = <0x0001869B>; > > > > - fsl,max-adj = <249999999>; > > > > + fsl,tclk-period = <5>; > > > > + fsl,tmr-prsc = <2>; > > > > + fsl,tmr-add = <2863311531>; > > > > + fsl,tmr-fiper1 = <999999995>; > > > > + fsl,tmr-fiper2 = <99990>; > > > > + fsl,max-adj = <299999999>; > > > > }; > > > > And here, you're changing the value of fsl,tmr-add and fsl,max-adj. Why? > > The old values maybe not calculated base on the default eTSEC system clock > value. > 1588 timer couldn’t be adjusted correctly by old values. Explain in the changelog what was wrong with the old values (don't just say "Fix 1588 timer node in file"). -Scott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/