From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935573AbdCJKMx (ORCPT ); Fri, 10 Mar 2017 05:12:53 -0500 Received: from mail-ve1eur01on0061.outbound.protection.outlook.com ([104.47.1.61]:44992 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755367AbdCJKMr (ORCPT ); Fri, 10 Mar 2017 05:12:47 -0500 From: Andy Tang To: Viresh Kumar CC: "rjw@rjwysocki.net" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: RE: [PATCH] cpufreq: qoriq: enhance bus frequency calculation Thread-Topic: [PATCH] cpufreq: qoriq: enhance bus frequency calculation Thread-Index: AQHSmK8/0PSdJCJWT0ytGvi4JxRcQKGMQKuAgAEKaPCAAI8qgIAAAQIA Date: Fri, 10 Mar 2017 10:12:44 +0000 Message-ID: References: <1489047306-31818-1-git-send-email-andy.tang@nxp.com> <20170309093917.GB3341@vireshk-i7> <20170310100511.GD3341@vireshk-i7> In-Reply-To: <20170310100511.GD3341@vireshk-i7> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; x-originating-ip: [199.59.231.64] x-ms-office365-filtering-correlation-id: 7dfea12c-0f44-4856-7246-08d4679dfe6e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:DB6PR0402MB2839; x-microsoft-exchange-diagnostics: 1;DB6PR0402MB2839;7:KRwFpAxvkKVG/kuKnu7h9CVWSeGang7g5LzrLreHvjPh/kUf5ckb2VaMFAWxdM4NW9CV+i90Kp1K2iKFs6byCveb49jBZ8rLp6DXiRMTgzSx9+AV76A/UgVxtVKE3bzeWSz5UrrRfewIDSrFZbV61FWH02slqOycgcGEa9gi48cKPBvGf4EU3GIjb+6GDIVFch0u/ih+hX1QszG1acpiVOM66mOI7AW6Yp/tSJ//mU6I0M561xUJXRbIudGZ6TpDzx537PfPMwKB6BsW0z88VFEJU0Cq2Yuw0ui6qquwkxzGQK1CXpSCVg7h7u2xYmV+GfBqUiel1LAAmxtt9wfA6w== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123558025)(20161123560025)(20161123564025)(20161123562025)(6072148);SRVR:DB6PR0402MB2839;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0402MB2839; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(39850400002)(39450400003)(39840400002)(39410400002)(377424004)(377454003)(24454002)(13464003)(9686003)(8676002)(2906002)(25786008)(110136004)(3280700002)(6506006)(6116002)(38730400002)(7736002)(3660700001)(6246003)(4326008)(99286003)(77096006)(54906002)(55016002)(53546006)(6436002)(81166006)(53936002)(106116001)(305945005)(8936002)(74316002)(93886004)(2950100002)(86362001)(6916009)(122556002)(33656002)(5660300001)(7696004)(2900100001)(102836003)(189998001)(54356999)(66066001)(3846002)(76176999)(50986999);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0402MB2839;H:DB6PR0402MB2837.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2017 10:12:44.1589 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2839 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 v2AAD37W028820 Hi Viresh, > -----Original Message----- > From: Viresh Kumar [mailto:viresh.kumar@linaro.org] > Sent: Friday, March 10, 2017 6:05 PM > To: Andy Tang > Cc: rjw@rjwysocki.net; linux-pm@vger.kernel.org; linux- > kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org > Subject: Re: [PATCH] cpufreq: qoriq: enhance bus frequency calculation > > On 10-03-17, 01:44, Andy Tang wrote: > > > Will this always work? If yes, then what about dropping the code > > > parsing DT completely ? That is, just rely on clk_get_rate() in all cases. > > > > > We put all the clock tree configuration in driver, not in dts. > > cg-pll0-div1 is hardcoded in driver since we don't depend on dts. > > We kind of don't have other choices but use the hardcode clock name > > here too. > > Looks like you misread my comment. Let me try again. Will it be fine to write > get_bus_freq() this way? > > static u32 get_bus_freq(void) > { > struct clk *pltclk; > > /* get platform freq by its clock name */ > pltclk = clk_get(NULL, "cg-pll0-div1"); > if (IS_ERR(pltclk)) { > pr_err("%s: can't get bus frequency %ld\n", > __func__, PTR_ERR(pltclk)); > return PTR_ERR(pltclk); > } > > return clk_get_rate(pltclk); > } > Yes, we can. But for some legacy powerpc-based socs, this may not work. powerpc-base socs are still using legacy clock driver. For compatibility sake, we better be compatible with old ones. It would break any compatibility this way. Regards, Yuantian > -- > viresh