From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06EB7C4828F for ; Fri, 9 Feb 2024 17:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TgURWYkGlD5/lwX72mlIcPNLYvwviotQkGjg8MtoI7o=; b=A+9GcyvTESFyGv o2AeZBHDxqbU6auP4hhzwpvJzT7919uSajVEGvbrjTb9aE9zVpRUPS/J76b837xMxrbWULAC7hgLF AMr9YpHEPEBZnRc/6vXG7Z+fFiI3Z0PKxpyItq7D26liq5AhSVvHmXffmj9qCcJePcun52ZNX91hP FadaWGW/pEooE+iVaOxgvATpz5Yq9MpihlFyeK69YkuUt26KXJvSyrfkTmv2aifv8R46t6cn37BGB fWDaB/AgUwTK6OqVRWMRdsCFAYqeQyNMLX2mAnDeZE0DgJLACrMbzFyxma3l5bvoz3QxJGiiLVXCk ZjFIYNCaxFF0uYyabIyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYUdi-0000000076T-0fsG; Fri, 09 Feb 2024 17:26:14 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYUdb-0000000074J-47b5 for linux-arm-kernel@lists.infradead.org; Fri, 09 Feb 2024 17:26:09 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 419HPtq9027981; Fri, 9 Feb 2024 11:25:55 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707499555; bh=o/yHIEvgh2LRKD3q5Z1jqyyrArHXgL1I3+o2CJJSOiI=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=qbxvAUFK3+CMJemxeZkMJm7kaneX+IrQQ6sdbs/KBn32b83WOYrcPq/Gtlhs66rJ5 baPk94KBCfjzmlyZZcayIUSP1B64qYjooypHx10NKEKbjkHfdRSCn8XQ5TQhZWx8NH HWY6gsa23a5FTrbWjvtMGoGZfycPy5l5EafmNxhY= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 419HPtNo002091 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 9 Feb 2024 11:25:55 -0600 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 9 Feb 2024 11:25:55 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 9 Feb 2024 11:25:55 -0600 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 419HPt5I126337; Fri, 9 Feb 2024 11:25:55 -0600 Date: Fri, 9 Feb 2024 11:25:55 -0600 From: Nishanth Menon To: "Kumar, Udit" CC: , , , , , , , , , , Subject: Re: [PATCH v3] clk: keystone: sci-clk: Adding support for non contiguous clocks Message-ID: <20240209172555.fxlxijhhbgrkyibo@agreeing> References: <20240207091100.4001428-1-u-kumar1@ti.com> <20240207125410.r2q3jcplvif7dvt2@tumbling> <3a7c4a18-5463-414f-82df-39aaed861148@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3a7c4a18-5463-414f-82df-39aaed861148@ti.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240209_092608_230244_2CDFC75C X-CRM114-Status: GOOD ( 28.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 19:53-20240207, Kumar, Udit wrote: > Hi=A0Nishanth, > = > On 2/7/2024 6:24 PM, Nishanth Menon wrote: > > On 14:41-20240207, Udit Kumar wrote: > > > Most of clocks and their parents are defined in contiguous range, > > > But in few cases, there is gap in clock numbers[0]. > > > Driver assumes clocks to be in contiguous range, and add their clock > > > ids incrementally. > > > = > > > New firmware started returning error while calling get_freq and is_on > > > API for non-available clock ids. > > > = > > > In this fix, driver checks and adds only valid clock ids. > > > = > > > Fixes: 3c13933c6033 ("clk: keystone: sci-clk: add support for dynamic= ally probing clocks") > > > = > > > [0] https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j7200/clock= s.html > > > Section Clocks for NAVSS0_CPTS_0 Device, > > > clock id 12-15 not present. > > > = > > > Signed-off-by: Udit Kumar > > > --- > > > Changelog > > > Changes in v3 > > > - instead of get_freq, is_auto API is used to check validilty of clock > > > - Address comments of v2, to have preindex increment > > > Link to v2 https://lore.kernel.org/all/20240206104357.3803517-1-u-kum= ar1@ti.com/ > > > = > > > Changes in v2 > > > - Updated commit message > > > - Simplified logic for valid clock id > > > link to v1 https://lore.kernel.org/all/20240205044557.3340848-1-u-kum= ar1@ti.com/ > > > = > > > = > > > P.S > > > Firmawre returns total num_parents count including non available ids. > > > For above device id NAVSS0_CPTS_0, number of parents clocks are 16 > > > i.e from id 2 to 17. But out of these ids few are not valid. > > > So driver adds only valid clock ids out ot total. > > > = > > > Original logs > > > https://gist.github.com/uditkumarti/de4b36b21247fb36725ad909ce4812f6#= file-original-logs > > > Line 2630 for error > > > = > > > Logs with fix v3 > > > https://gist.github.com/uditkumarti/94e3e28d62282fd708dbfe37435ce1d9#= file-v3 > > > Line 2586 > > > = > > > = > > > drivers/clk/keystone/sci-clk.c | 12 ++++++++++-- > > > 1 file changed, 10 insertions(+), 2 deletions(-) > > > = > > > diff --git a/drivers/clk/keystone/sci-clk.c b/drivers/clk/keystone/sc= i-clk.c > > > index 35fe197dd303..31b7df05d7bb 100644 > > > --- a/drivers/clk/keystone/sci-clk.c > > > +++ b/drivers/clk/keystone/sci-clk.c > > > @@ -516,6 +516,7 @@ static int ti_sci_scan_clocks_from_dt(struct sci_= clk_provider *provider) > > > struct sci_clk *sci_clk, *prev; > > > int num_clks =3D 0; > > > int num_parents; > > > [..] /* Check if this clock id is valid */ > > > + ret =3D provider->ops->is_auto(provider->sci, > > > + sci_clk->dev_id, ++clk_id, &state); > > A bit too nice coding ;) =3D> I had been confused momentarily by clk_id= =3D args.args[1] > > change just above till I saw that you are pre-incrementing > > clk_id - Is there a harm in leaving the original clk_id increment logic > > alone (it was much simpler to read up)? > = > No warm in using original code but want to avoid, two statement for > increment in case of failure and success. > = > Let me know, if i need to add few comments around this > = > or if you think, code is confusing I can move to original one Yes, please drop the un-necessary changes. In this case, original increment code should work just fine. -- = Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5= 849D 1736 249D _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel