All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] clk: Support spread spectrum and use it in clk-scmi
@ 2025-01-24 14:25 Peng Fan (OSS)
  2025-01-24 14:25 ` [PATCH 1/3] clk: Introduce clk_set_spread_spectrum Peng Fan (OSS)
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-24 14:25 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Russell King, Sudeep Holla,
	Cristian Marussi
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, Rob Herring,
	Krzysztof Kozlowski, Dario Binacchi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, imx, Peng Fan

- Introduce clk_set_spread_spectrum to set the parameters for enabling
  spread spectrum of a clock.
- Parse 'assigned-clock-sscs' and configure it by default before using the
  clock. The pull request for this property is at [1]
  This property is parsed before parsing clock rate.

- Enable this feature for clk-scmi on i.MX95.
  This may not the best, since checking machine compatibles.
  I am thinking to provide an API scmi_get_vendor_info, then driver
  could use it for OEM stuff, such as
  if (scmi_get_vendor_info returns NXP_IMX)
      ops->set_spread_spectrum = scmi_clk_set_spread_spectrum_imx;

[1] https://github.com/devicetree-org/dt-schema/pull/154

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Peng Fan (3):
      clk: Introduce clk_set_spread_spectrum
      clk: conf: Support assigned-clock-sscs
      clk: scmi: Support spread spectrum

 drivers/clk/clk-conf.c        | 68 +++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/clk-scmi.c        | 37 +++++++++++++++++++++++
 drivers/clk/clk.c             | 39 +++++++++++++++++++++++++
 include/linux/clk-provider.h  | 22 ++++++++++++++
 include/linux/clk.h           | 22 ++++++++++++++
 include/linux/scmi_protocol.h |  5 ++++
 6 files changed, 193 insertions(+)
---
base-commit: 5ffa57f6eecefababb8cbe327222ef171943b183
change-id: 20250124-clk-ssc-fccd4f60d7e5

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [PATCH 1/3] clk: Introduce clk_set_spread_spectrum
@ 2025-01-28 20:46 kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2025-01-28 20:46 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250124-clk-ssc-v1-1-2d39f6baf2af@nxp.com>
References: <20250124-clk-ssc-v1-1-2d39f6baf2af@nxp.com>
TO: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
TO: Michael Turquette <mturquette@baylibre.com>
TO: Stephen Boyd <sboyd@kernel.org>
TO: Russell King <linux@armlinux.org.uk>
TO: Sudeep Holla <sudeep.holla@arm.com>
TO: Cristian Marussi <cristian.marussi@arm.com>
CC: linux-clk@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: arm-scmi@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: Rob Herring <robh@kernel.org>
CC: Krzysztof Kozlowski <krzk@kernel.org>
CC: Dario Binacchi <dario.binacchi@amarulasolutions.com>
CC: Shawn Guo <shawnguo@kernel.org>
CC: Sascha Hauer <s.hauer@pengutronix.de>
CC: Pengutronix Kernel Team <kernel@pengutronix.de>
CC: Fabio Estevam <festevam@gmail.com>
CC: imx@lists.linux.dev
CC: Peng Fan <peng.fan@nxp.com>

Hi Peng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 5ffa57f6eecefababb8cbe327222ef171943b183]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Fan-OSS/clk-Introduce-clk_set_spread_spectrum/20250124-212050
base:   5ffa57f6eecefababb8cbe327222ef171943b183
patch link:    https://lore.kernel.org/r/20250124-clk-ssc-v1-1-2d39f6baf2af%40nxp.com
patch subject: [PATCH 1/3] clk: Introduce clk_set_spread_spectrum
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: i386-randconfig-r072-20250128 (https://download.01.org/0day-ci/archive/20250129/202501290426.C0eOwFDB-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202501290426.C0eOwFDB-lkp@intel.com/

New smatch warnings:
drivers/clk/clk.c:2828 clk_set_spread_spectrum() warn: inconsistent returns 'clk'.

Old smatch warnings:
drivers/clk/clk.c:4211 clk_hw_create_clk() warn: passing zero to 'ERR_CAST'

vim +/clk +2828 drivers/clk/clk.c

4935b22c46ea5e James Hogan 2013-07-29  2792  
26268b725cb020 Peng Fan    2025-01-24  2793  int clk_set_spread_spectrum(struct clk *clk, unsigned int modfreq,
26268b725cb020 Peng Fan    2025-01-24  2794  			    unsigned int spreadpercent, unsigned int method,
26268b725cb020 Peng Fan    2025-01-24  2795  			    bool enable)
26268b725cb020 Peng Fan    2025-01-24  2796  {
26268b725cb020 Peng Fan    2025-01-24  2797  	struct clk_spread_spectrum clk_ss;
26268b725cb020 Peng Fan    2025-01-24  2798  	struct clk_core *core;
26268b725cb020 Peng Fan    2025-01-24  2799  	int ret = 0;
26268b725cb020 Peng Fan    2025-01-24  2800  
26268b725cb020 Peng Fan    2025-01-24  2801  	if (!clk || !clk->core)
26268b725cb020 Peng Fan    2025-01-24  2802  		return 0;
26268b725cb020 Peng Fan    2025-01-24  2803  
26268b725cb020 Peng Fan    2025-01-24  2804  	clk_ss.modfreq = modfreq;
26268b725cb020 Peng Fan    2025-01-24  2805  	clk_ss.spreadpercent = spreadpercent;
26268b725cb020 Peng Fan    2025-01-24  2806  	clk_ss.method = method;
26268b725cb020 Peng Fan    2025-01-24  2807  	clk_ss.enable = enable;
26268b725cb020 Peng Fan    2025-01-24  2808  
26268b725cb020 Peng Fan    2025-01-24  2809  	clk_prepare_lock();
26268b725cb020 Peng Fan    2025-01-24  2810  
26268b725cb020 Peng Fan    2025-01-24  2811  	core = clk->core;
26268b725cb020 Peng Fan    2025-01-24  2812  
26268b725cb020 Peng Fan    2025-01-24  2813  	if (core->prepare_count) {
26268b725cb020 Peng Fan    2025-01-24  2814  		ret = -EBUSY;
26268b725cb020 Peng Fan    2025-01-24  2815  		goto fail;
26268b725cb020 Peng Fan    2025-01-24  2816  	}
26268b725cb020 Peng Fan    2025-01-24  2817  
26268b725cb020 Peng Fan    2025-01-24  2818  	ret = clk_pm_runtime_get(core);
26268b725cb020 Peng Fan    2025-01-24  2819  	if (ret)
26268b725cb020 Peng Fan    2025-01-24  2820  		goto fail;
26268b725cb020 Peng Fan    2025-01-24  2821  
26268b725cb020 Peng Fan    2025-01-24  2822  	if (core->ops->set_spread_spectrum)
26268b725cb020 Peng Fan    2025-01-24  2823  		ret = core->ops->set_spread_spectrum(core->hw, &clk_ss);
26268b725cb020 Peng Fan    2025-01-24  2824  
26268b725cb020 Peng Fan    2025-01-24  2825  	clk_pm_runtime_put(core);
26268b725cb020 Peng Fan    2025-01-24  2826  	clk_prepare_unlock();
26268b725cb020 Peng Fan    2025-01-24  2827  fail:
26268b725cb020 Peng Fan    2025-01-24 @2828  	return ret;
26268b725cb020 Peng Fan    2025-01-24  2829  }
26268b725cb020 Peng Fan    2025-01-24  2830  EXPORT_SYMBOL_GPL(clk_set_spread_spectrum);
26268b725cb020 Peng Fan    2025-01-24  2831  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2025-02-04  0:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-24 14:25 [PATCH 0/3] clk: Support spread spectrum and use it in clk-scmi Peng Fan (OSS)
2025-01-24 14:25 ` [PATCH 1/3] clk: Introduce clk_set_spread_spectrum Peng Fan (OSS)
2025-01-24 13:51   ` Dan Carpenter
2025-01-28 20:25   ` Stephen Boyd
2025-02-02 10:42     ` Peng Fan
2025-02-03  9:43       ` Cristian Marussi
2025-02-03 11:47         ` Peng Fan
2025-02-03 11:22           ` Cristian Marussi
2025-02-04  0:31             ` Peng Fan
2025-01-24 14:25 ` [PATCH 2/3] clk: conf: Support assigned-clock-sscs Peng Fan (OSS)
2025-01-24 14:25 ` [PATCH 3/3] clk: scmi: Support spread spectrum Peng Fan (OSS)
2025-01-24 21:33   ` kernel test robot
2025-01-28 12:07   ` Cristian Marussi
2025-01-25 12:58 ` [PATCH 0/3] clk: Support spread spectrum and use it in clk-scmi Dario Binacchi
2025-01-27  7:42   ` Krzysztof Kozlowski
2025-01-27  7:59     ` Dario Binacchi
2025-01-27  8:31       ` Krzysztof Kozlowski
2025-01-27  8:35         ` Dario Binacchi
  -- strict thread matches above, loose matches on Subject: below --
2025-01-28 20:46 [PATCH 1/3] clk: Introduce clk_set_spread_spectrum kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.