Linux-Clk Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/2] Add support for IPA clock for SC7180
@ 2020-01-06 10:18 Taniya Das
  2020-01-06 10:18 ` [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering Taniya Das
  2020-01-06 10:18 ` [PATCH v2 2/2] clk: qcom: rpmh: Add IPA clock for SC7180 Taniya Das
  0 siblings, 2 replies; 6+ messages in thread
From: Taniya Das @ 2020-01-06 10:18 UTC (permalink / raw)
  To: Stephen Boyd, Michael Turquette  
  Cc: David Brown, Rajendra Nayak, linux-arm-msm, linux-soc, linux-clk,
	linux-kernel, Taniya Das

[v2]
 * After register clk_hw::init is NULL, save off the name before registering.

[v1]
 * Support IPA clock for SC7180 and also handle undefined clock registration
   in clk-rpmh driver.

Taniya Das (2):
  clk: qcom: rpmh: skip undefined clocks when registering
  clk: qcom: rpmh: Add IPA clock for SC7180

 drivers/clk/qcom/clk-rpmh.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the  Linux Foundation.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering
  2020-01-06 10:18 [PATCH v2 0/2] Add support for IPA clock for SC7180 Taniya Das
@ 2020-01-06 10:18 ` Taniya Das
  2020-01-06 15:05   ` kbuild test robot
  2020-01-06 16:54   ` Stephen Boyd
  2020-01-06 10:18 ` [PATCH v2 2/2] clk: qcom: rpmh: Add IPA clock for SC7180 Taniya Das
  1 sibling, 2 replies; 6+ messages in thread
From: Taniya Das @ 2020-01-06 10:18 UTC (permalink / raw)
  To: Stephen Boyd, Michael Turquette  
  Cc: David Brown, Rajendra Nayak, linux-arm-msm, linux-soc, linux-clk,
	linux-kernel, Taniya Das

When iterating over a platform's available clocks in clk_rpmh_probe(),
check for undefined (null) entries in the clocks array.  Not all
clock indexes necessarily have clocks defined.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
---
 drivers/clk/qcom/clk-rpmh.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index 7ed313a..075cc43 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -431,11 +431,15 @@ static int clk_rpmh_probe(struct platform_device *pdev)
 	hw_clks = desc->clks;

 	for (i = 0; i < desc->num_clks; i++) {
-		const char *name = hw_clks[i]->init->name;
 		u32 res_addr;
 		size_t aux_data_len;
 		const struct bcm_db *data;

+		if (!hw_clks[i])
+			continue;
+
+		const char *name = hw_clks[i]->init->name;
+
 		rpmh_clk = to_clk_rpmh(hw_clks[i]);
 		res_addr = cmd_db_read_addr(rpmh_clk->res_name);
 		if (!res_addr) {
--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the  Linux Foundation.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] clk: qcom: rpmh: Add IPA clock for SC7180
  2020-01-06 10:18 [PATCH v2 0/2] Add support for IPA clock for SC7180 Taniya Das
  2020-01-06 10:18 ` [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering Taniya Das
@ 2020-01-06 10:18 ` Taniya Das
  2020-01-06 16:54   ` Stephen Boyd
  1 sibling, 1 reply; 6+ messages in thread
From: Taniya Das @ 2020-01-06 10:18 UTC (permalink / raw)
  To: Stephen Boyd, Michael Turquette  
  Cc: David Brown, Rajendra Nayak, linux-arm-msm, linux-soc, linux-clk,
	linux-kernel, Taniya Das

The Qualcomm IP Accelerator (IPA) clock resource that is managed by the BCM is
required by the IPA driver in order to scale its core clock.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
---
 drivers/clk/qcom/clk-rpmh.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index 075cc43..8b0844b 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -396,6 +396,7 @@ static struct clk_hw *sc7180_rpmh_clocks[] = {
 	[RPMH_RF_CLK1_A]	= &sdm845_rf_clk1_ao.hw,
 	[RPMH_RF_CLK2]		= &sdm845_rf_clk2.hw,
 	[RPMH_RF_CLK2_A]	= &sdm845_rf_clk2_ao.hw,
+	[RPMH_IPA_CLK]		= &sdm845_ipa.hw,
 };

 static const struct clk_rpmh_desc clk_rpmh_sc7180 = {
--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the  Linux Foundation.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering
  2020-01-06 10:18 ` [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering Taniya Das
@ 2020-01-06 15:05   ` kbuild test robot
  2020-01-06 16:54   ` Stephen Boyd
  1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2020-01-06 15:05 UTC (permalink / raw)
  To: Taniya Das
  Cc: kbuild-all, Stephen Boyd, Michael Turquette  ,
	David Brown, Rajendra Nayak, linux-arm-msm, linux-soc, linux-clk,
	linux-kernel, Taniya Das

[-- Attachment #1: Type: text/plain, Size: 3530 bytes --]

Hi Taniya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on clk/clk-next]
[also build test WARNING on v5.5-rc5 next-20191220]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Taniya-Das/Add-support-for-IPA-clock-for-SC7180/20200106-201629
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/clk//qcom/clk-rpmh.c: In function 'clk_rpmh_probe':
>> drivers/clk//qcom/clk-rpmh.c:441:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      const char *name = hw_clks[i]->init->name;
      ^~~~~

vim +441 drivers/clk//qcom/clk-rpmh.c

   419	
   420	static int clk_rpmh_probe(struct platform_device *pdev)
   421	{
   422		struct clk_hw **hw_clks;
   423		struct clk_rpmh *rpmh_clk;
   424		const struct clk_rpmh_desc *desc;
   425		int ret, i;
   426	
   427		desc = of_device_get_match_data(&pdev->dev);
   428		if (!desc)
   429			return -ENODEV;
   430	
   431		hw_clks = desc->clks;
   432	
   433		for (i = 0; i < desc->num_clks; i++) {
   434			u32 res_addr;
   435			size_t aux_data_len;
   436			const struct bcm_db *data;
   437	
   438			if (!hw_clks[i])
   439				continue;
   440	
 > 441			const char *name = hw_clks[i]->init->name;
   442	
   443			rpmh_clk = to_clk_rpmh(hw_clks[i]);
   444			res_addr = cmd_db_read_addr(rpmh_clk->res_name);
   445			if (!res_addr) {
   446				dev_err(&pdev->dev, "missing RPMh resource address for %s\n",
   447					rpmh_clk->res_name);
   448				return -ENODEV;
   449			}
   450	
   451			data = cmd_db_read_aux_data(rpmh_clk->res_name, &aux_data_len);
   452			if (IS_ERR(data)) {
   453				ret = PTR_ERR(data);
   454				dev_err(&pdev->dev,
   455					"error reading RPMh aux data for %s (%d)\n",
   456					rpmh_clk->res_name, ret);
   457				return ret;
   458			}
   459	
   460			/* Convert unit from Khz to Hz */
   461			if (aux_data_len == sizeof(*data))
   462				rpmh_clk->unit = le32_to_cpu(data->unit) * 1000ULL;
   463	
   464			rpmh_clk->res_addr += res_addr;
   465			rpmh_clk->dev = &pdev->dev;
   466	
   467			ret = devm_clk_hw_register(&pdev->dev, hw_clks[i]);
   468			if (ret) {
   469				dev_err(&pdev->dev, "failed to register %s\n", name);
   470				return ret;
   471			}
   472		}
   473	
   474		/* typecast to silence compiler warning */
   475		ret = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_rpmh_hw_get,
   476						  (void *)desc);
   477		if (ret) {
   478			dev_err(&pdev->dev, "Failed to add clock provider\n");
   479			return ret;
   480		}
   481	
   482		dev_dbg(&pdev->dev, "Registered RPMh clocks\n");
   483	
   484		return 0;
   485	}
   486	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 63076 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering
  2020-01-06 10:18 ` [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering Taniya Das
  2020-01-06 15:05   ` kbuild test robot
@ 2020-01-06 16:54   ` Stephen Boyd
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2020-01-06 16:54 UTC (permalink / raw)
  To: Michael Turquette, Taniya Das
  Cc: David Brown, Rajendra Nayak, linux-arm-msm, linux-soc, linux-clk,
	linux-kernel, Taniya Das

Quoting Taniya Das (2020-01-06 02:18:42)
> When iterating over a platform's available clocks in clk_rpmh_probe(),
> check for undefined (null) entries in the clocks array.  Not all
> clock indexes necessarily have clocks defined.
> 
> Signed-off-by: Taniya Das <tdas@codeaurora.org>
> ---

Applied to clk-next + added the fix for type declaration.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] clk: qcom: rpmh: Add IPA clock for SC7180
  2020-01-06 10:18 ` [PATCH v2 2/2] clk: qcom: rpmh: Add IPA clock for SC7180 Taniya Das
@ 2020-01-06 16:54   ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2020-01-06 16:54 UTC (permalink / raw)
  To: Michael Turquette, Taniya Das
  Cc: David Brown, Rajendra Nayak, linux-arm-msm, linux-soc, linux-clk,
	linux-kernel, Taniya Das

Quoting Taniya Das (2020-01-06 02:18:43)
> The Qualcomm IP Accelerator (IPA) clock resource that is managed by the BCM is
> required by the IPA driver in order to scale its core clock.
> 
> Signed-off-by: Taniya Das <tdas@codeaurora.org>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 10:18 [PATCH v2 0/2] Add support for IPA clock for SC7180 Taniya Das
2020-01-06 10:18 ` [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering Taniya Das
2020-01-06 15:05   ` kbuild test robot
2020-01-06 16:54   ` Stephen Boyd
2020-01-06 10:18 ` [PATCH v2 2/2] clk: qcom: rpmh: Add IPA clock for SC7180 Taniya Das
2020-01-06 16:54   ` Stephen Boyd

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org
	public-inbox-index linux-clk

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git