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 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB946C432C0 for ; Mon, 2 Dec 2019 13:35:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D711214AF for ; Mon, 2 Dec 2019 13:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575293711; bh=wxSZfFo7SznwT1ayrLRxDPV9OD+qKtgr4xwwiWvEVkA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=nCSHGrrc8iB2oZFq7EPWKFFABeu3wPpqXVpLZ1hj0jtKidG9QYQqy/LSZpv8JMory 89UYXtyDLBG8TSlZP1MDy/o05ZKdI5lm39awwgCYhG6aiem35XbYhuEmyJ5nfPzUj3 cB7iI0v1X3vjVmMQSDD/cwIkJM88RwGdo+/K0HPA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727451AbfLBNfL (ORCPT ); Mon, 2 Dec 2019 08:35:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:45714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbfLBNfK (ORCPT ); Mon, 2 Dec 2019 08:35:10 -0500 Received: from dragon (98.142.130.235.16clouds.com [98.142.130.235]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CD5020833; Mon, 2 Dec 2019 13:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575293710; bh=wxSZfFo7SznwT1ayrLRxDPV9OD+qKtgr4xwwiWvEVkA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dQc5qo85Bdrd3bB/Si1OSU1+SyQi7l8HIZFBAv7bnUXLMsReDrt+nCn6TCsfVTmiX cK37EoODq3M8t22DmDv6IY6cmmxfz/toFy2QQBS+8tAu+P81ExkQvXeex9s+EDIlLT dG9fJJ+vEX5YMXQ+GKJ7+WJXVZDJL82or/uqURtc= Date: Mon, 2 Dec 2019 21:34:51 +0800 From: Shawn Guo To: Leonard Crestez Cc: Stephen Boyd , MyungJoo Ham , Kyungmin Park , Rob Herring , "Rafael J. Wysocki" , Chanwoo Choi , Mark Rutland , Michael Turquette , Artur =?utf-8?B?xZp3aWdvxYQ=?= , Saravana Kannan , Angus Ainslie , Martin Kepplinger , Matthias Kaehlcke , Krzysztof Kozlowski , Alexandre Bailon , Georgi Djakov , Aisheng Dong , Abel Vesa , Jacky Bai , Anson Huang , Fabio Estevam , Viresh Kumar , "devicetree@vger.kernel.org" , "linux-pm@vger.kernel.org" , "linux-clk@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v3 4/6] PM / devfreq: Add dynamic scaling for imx ddr controller Message-ID: <20191202133449.GA21897@dragon> References: <5fcf829265ecde1af32cb1369528c97361c76992.1572558427.git.leonard.crestez@nxp.com> <20191202053847.GC9767@dragon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, Dec 02, 2019 at 09:12:12AM +0000, Leonard Crestez wrote: > >> + > >> + /* change the ddr freqency */ > >> + arm_smccc_smc(IMX_SIP_DDR_DVFS, target_freq, online_cpus, > >> + 0, 0, 0, 0, 0, &res); > >> + > >> + local_irq_enable(); > >> +} > >> + > >> +struct clk *clk_get_parent_by_index(struct clk *clk, int index) > >> +{ > >> + struct clk_hw *hw; > >> + > >> + hw = clk_hw_get_parent_by_index(__clk_get_hw(clk), index); > > > > Okay, this is why you need clk-provider.h. But this > > clk_get_parent_by_index() function looks completely generic, and should > > be proposed to clock core? > > There are very few driver users of clk_hw_get_parent_by_index: > > $ git grep -wl clk_hw_get_parent_by_index |grep -v drivers/clk > arch/mips/alchemy/common/clock.c > drivers/cpufreq/qoriq-cpufreq.c > drivers/devfreq/imx8m-ddrc.c > drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c > drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c > drivers/media/platform/atmel/atmel-isc-base.c > drivers/rtc/rtc-ac100.c > include/linux/clk-provider.h > > Even clk_get_parent has few users and it contains this strange comment: > > /* TODO: Create a per-user clk and change callers to call clk_put */ > > That proposed change effectively creates a new API? I didn't want to add > a new clk core API with unclear semantics. Since the merged version has 'static' added for clk_get_parent_by_index(), I'm fine with it being a local function. It's Stephen's call whether we should have it at clock core level. Shawn 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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E72C432C0 for ; Mon, 2 Dec 2019 13:35:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 341D620833 for ; Mon, 2 Dec 2019 13:35:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SRfhEzwy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="dQc5qo85" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 341D620833 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=HF/v/EZKOaj//LyY5XzluOy13UJWeOCsQs6BcApfiLU=; b=SRfhEzwyMoxhwK 8OtbGc4mSnrOuPbXIZxs0EXvWTq8mIqdKB2gqY9aS4OoW+XmiCJ3AEjGWtBKgmvE3WjtTyueg7XXq k7VpgN7q4Lwh4DegFkc0IPAcuL0T6Z3L6d10ULie+PgnlBI1PeLQDhbRENEqftI8w80tdJIleiVEP Dj6RHWHb079KcQbX5VOTDLzsxowYpKpziEGiaIaiJLnq+Byr2wqYsU86EEQ38/OOErH/iazux/REC 2LxKbzun6ye8FX2g3MdULZ5QLsgesiLFl8fW3yWml45m4t50YcSMLC2eV2eWC2TNYzfHoz8BbWjIa HkmVRWj0X39cogRpli+A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iblr7-0002J8-OS; Mon, 02 Dec 2019 13:35:13 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iblr5-0002Ie-2P for linux-arm-kernel@lists.infradead.org; Mon, 02 Dec 2019 13:35:12 +0000 Received: from dragon (98.142.130.235.16clouds.com [98.142.130.235]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CD5020833; Mon, 2 Dec 2019 13:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575293710; bh=wxSZfFo7SznwT1ayrLRxDPV9OD+qKtgr4xwwiWvEVkA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dQc5qo85Bdrd3bB/Si1OSU1+SyQi7l8HIZFBAv7bnUXLMsReDrt+nCn6TCsfVTmiX cK37EoODq3M8t22DmDv6IY6cmmxfz/toFy2QQBS+8tAu+P81ExkQvXeex9s+EDIlLT dG9fJJ+vEX5YMXQ+GKJ7+WJXVZDJL82or/uqURtc= Date: Mon, 2 Dec 2019 21:34:51 +0800 From: Shawn Guo To: Leonard Crestez Subject: Re: [PATCH v3 4/6] PM / devfreq: Add dynamic scaling for imx ddr controller Message-ID: <20191202133449.GA21897@dragon> References: <5fcf829265ecde1af32cb1369528c97361c76992.1572558427.git.leonard.crestez@nxp.com> <20191202053847.GC9767@dragon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_053511_156532_755F413B X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Artur =?utf-8?B?xZp3aWdvxYQ=?= , Jacky Bai , Viresh Kumar , Michael Turquette , Angus Ainslie , Alexandre Bailon , Matthias Kaehlcke , Abel Vesa , Saravana Kannan , Krzysztof Kozlowski , "linux-clk@vger.kernel.org" , Chanwoo Choi , MyungJoo Ham , dl-linux-imx , "devicetree@vger.kernel.org" , "linux-pm@vger.kernel.org" , Rob Herring , Martin Kepplinger , "linux-arm-kernel@lists.infradead.org" , Aisheng Dong , Anson Huang , Stephen Boyd , "Rafael J. Wysocki" , Kyungmin Park , "kernel@pengutronix.de" , Fabio Estevam , Georgi Djakov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 02, 2019 at 09:12:12AM +0000, Leonard Crestez wrote: > >> + > >> + /* change the ddr freqency */ > >> + arm_smccc_smc(IMX_SIP_DDR_DVFS, target_freq, online_cpus, > >> + 0, 0, 0, 0, 0, &res); > >> + > >> + local_irq_enable(); > >> +} > >> + > >> +struct clk *clk_get_parent_by_index(struct clk *clk, int index) > >> +{ > >> + struct clk_hw *hw; > >> + > >> + hw = clk_hw_get_parent_by_index(__clk_get_hw(clk), index); > > > > Okay, this is why you need clk-provider.h. But this > > clk_get_parent_by_index() function looks completely generic, and should > > be proposed to clock core? > > There are very few driver users of clk_hw_get_parent_by_index: > > $ git grep -wl clk_hw_get_parent_by_index |grep -v drivers/clk > arch/mips/alchemy/common/clock.c > drivers/cpufreq/qoriq-cpufreq.c > drivers/devfreq/imx8m-ddrc.c > drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c > drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c > drivers/media/platform/atmel/atmel-isc-base.c > drivers/rtc/rtc-ac100.c > include/linux/clk-provider.h > > Even clk_get_parent has few users and it contains this strange comment: > > /* TODO: Create a per-user clk and change callers to call clk_put */ > > That proposed change effectively creates a new API? I didn't want to add > a new clk core API with unclear semantics. Since the merged version has 'static' added for clk_get_parent_by_index(), I'm fine with it being a local function. It's Stephen's call whether we should have it at clock core level. Shawn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel