linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] clk: microchip: core: fix issue with round_rate conversion and allow compile test
@ 2025-12-01 22:06 Brian Masney
  2025-12-01 22:06 ` [PATCH v2 1/3] clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops Brian Masney
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Brian Masney @ 2025-12-01 22:06 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Maxime Ripard, Claudiu Beznea,
	Conor Dooley
  Cc: linux-clk, linux-kernel, Brian Masney, kernel test robot

Here's a series that fixes an issue that fixes an issue with my
round_rate conversion on this PIC32 driver, drops an unused include
file, and a change that allows building this driver on other
architectures with COMPILE_TEST enabled.

Changes in v2:
- Add new patch to drop unused asm/traps.h
- Link to v1: https://lore.kernel.org/r/20251125-clk-microchip-fixes-v1-0-6c1f5573d1b9@redhat.com

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
Brian Masney (3):
      clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops
      clk: microchip: core: remove unused include asm/traps.h
      clk: microchip: core: allow driver to be compiled with COMPILE_TEST

 drivers/clk/microchip/Kconfig    |  2 +-
 drivers/clk/microchip/clk-core.c | 19 ++++++++-----------
 2 files changed, 9 insertions(+), 12 deletions(-)
---
base-commit: 92fd6e84175befa1775e5c0ab682938eca27c0b2
change-id: 20251125-clk-microchip-fixes-d0864e21ef0d

Best regards,
-- 
Brian Masney <bmasney@redhat.com>


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

* [PATCH v2 1/3] clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops
  2025-12-01 22:06 [PATCH v2 0/3] clk: microchip: core: fix issue with round_rate conversion and allow compile test Brian Masney
@ 2025-12-01 22:06 ` Brian Masney
  2025-12-01 22:06 ` [PATCH v2 2/3] clk: microchip: core: remove unused include asm/traps.h Brian Masney
  2025-12-01 22:06 ` [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
  2 siblings, 0 replies; 8+ messages in thread
From: Brian Masney @ 2025-12-01 22:06 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Maxime Ripard, Claudiu Beznea,
	Conor Dooley
  Cc: linux-clk, linux-kernel, Brian Masney, kernel test robot

pic32_sclk_ops previously had a sclk_round_rate() member, and this was
recently converted over to sclk_determine_rate() with the help of a
Coccinelle semantic patch. pic32_sclk_ops now has two conflicting
determine_rate ops members.

Prior to the conversion, pic32_sclk_ops already had a determine_rate
member that points to __clk_mux_determine_rate(). When both the
round_rate() and determine_rate() ops are defined, the clk core only
uses the determine_rate() op. Let's go ahead and drop the recently
converted sclk_determine_rate() to match the previous functionality
prior to the conversion.

Fixes: e9f039c08cdc ("clk: microchip: core: convert from round_rate() to determine_rate()")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202511222115.uvHrP95A-lkp@intel.com/
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/microchip/clk-core.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index b34348d491f3e1b576b2b9a8a66bfddd8c2296ea..a0163441dfe5c1dfc27dae48e64cf3cb3d6b764f 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -780,15 +780,6 @@ static unsigned long sclk_get_rate(struct clk_hw *hw, unsigned long parent_rate)
 	return parent_rate / div;
 }
 
-static int sclk_determine_rate(struct clk_hw *hw,
-			       struct clk_rate_request *req)
-{
-	req->rate = calc_best_divided_rate(req->rate, req->best_parent_rate,
-					   SLEW_SYSDIV, 1);
-
-	return 0;
-}
-
 static int sclk_set_rate(struct clk_hw *hw,
 			 unsigned long rate, unsigned long parent_rate)
 {
@@ -912,7 +903,6 @@ static int sclk_init(struct clk_hw *hw)
 const struct clk_ops pic32_sclk_ops = {
 	.get_parent	= sclk_get_parent,
 	.set_parent	= sclk_set_parent,
-	.determine_rate = sclk_determine_rate,
 	.set_rate	= sclk_set_rate,
 	.recalc_rate	= sclk_get_rate,
 	.init		= sclk_init,

-- 
2.51.1


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

* [PATCH v2 2/3] clk: microchip: core: remove unused include asm/traps.h
  2025-12-01 22:06 [PATCH v2 0/3] clk: microchip: core: fix issue with round_rate conversion and allow compile test Brian Masney
  2025-12-01 22:06 ` [PATCH v2 1/3] clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops Brian Masney
@ 2025-12-01 22:06 ` Brian Masney
  2025-12-01 22:06 ` [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
  2 siblings, 0 replies; 8+ messages in thread
From: Brian Masney @ 2025-12-01 22:06 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Maxime Ripard, Claudiu Beznea,
	Conor Dooley
  Cc: linux-clk, linux-kernel, Brian Masney

The asm/traps.h include file is not actually used, so let's go ahead and
remove it.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/microchip/clk-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index a0163441dfe5c1dfc27dae48e64cf3cb3d6b764f..664663d9d7765ee0c61203ea11211da54b709377 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -10,7 +10,6 @@
 #include <linux/io.h>
 #include <linux/iopoll.h>
 #include <asm/mach-pic32/pic32.h>
-#include <asm/traps.h>
 
 #include "clk-core.h"
 

-- 
2.51.1


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

* [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2025-12-01 22:06 [PATCH v2 0/3] clk: microchip: core: fix issue with round_rate conversion and allow compile test Brian Masney
  2025-12-01 22:06 ` [PATCH v2 1/3] clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops Brian Masney
  2025-12-01 22:06 ` [PATCH v2 2/3] clk: microchip: core: remove unused include asm/traps.h Brian Masney
@ 2025-12-01 22:06 ` Brian Masney
  2025-12-05  3:51   ` kernel test robot
  2025-12-05  7:21   ` Dan Carpenter
  2 siblings, 2 replies; 8+ messages in thread
From: Brian Masney @ 2025-12-01 22:06 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Maxime Ripard, Claudiu Beznea,
	Conor Dooley
  Cc: linux-clk, linux-kernel, Brian Masney

This driver currently only supports builds against a PIC32 target. To
avoid future breakage in the future, let's update the Kconfig and the
driver so that it can be built with CONFIG_COMPILE_TEST enabled.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/microchip/Kconfig    | 2 +-
 drivers/clk/microchip/clk-core.c | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/microchip/Kconfig b/drivers/clk/microchip/Kconfig
index 1b9e43eb54976b219a0277cc971f353fd6af226a..1e56a057319d97e20440fe4e107d26fa85c95ab1 100644
--- a/drivers/clk/microchip/Kconfig
+++ b/drivers/clk/microchip/Kconfig
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 config COMMON_CLK_PIC32
-	def_bool COMMON_CLK && MACH_PIC32
+	def_bool (COMMON_CLK && MACH_PIC32) || COMPILE_TEST
 
 config MCHP_CLK_MPFS
 	bool "Clk driver for PolarFire SoC"
diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index 664663d9d7765ee0c61203ea11211da54b709377..49c7b8b487ed6bc0e43d7177cb7c4cee9008f544 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -9,7 +9,15 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
+
+#if !defined(CONFIG_MACH_PIC32) && defined(CONFIG_COMPILE_TEST)
+#define PIC32_CLR(_reg)		((_reg) + 0x04)
+#define PIC32_SET(_reg)		((_reg) + 0x08)
+#define PIC32_INV(_reg)		((_reg) + 0x0C)
+#define pic32_syskey_unlock()
+#else
 #include <asm/mach-pic32/pic32.h>
+#endif
 
 #include "clk-core.h"
 

-- 
2.51.1


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

* Re: [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2025-12-01 22:06 ` [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
@ 2025-12-05  3:51   ` kernel test robot
  2025-12-05 11:33     ` Brian Masney
  2025-12-05  7:21   ` Dan Carpenter
  1 sibling, 1 reply; 8+ messages in thread
From: kernel test robot @ 2025-12-05  3:51 UTC (permalink / raw)
  To: Brian Masney, Michael Turquette, Stephen Boyd, Maxime Ripard,
	Claudiu Beznea, Conor Dooley
  Cc: oe-kbuild-all, linux-clk, linux-kernel, Brian Masney

Hi Brian,

kernel test robot noticed the following build errors:

[auto build test ERROR on 92fd6e84175befa1775e5c0ab682938eca27c0b2]

url:    https://github.com/intel-lab-lkp/linux/commits/Brian-Masney/clk-microchip-core-remove-duplicate-determine_rate-on-pic32_sclk_ops/20251202-060924
base:   92fd6e84175befa1775e5c0ab682938eca27c0b2
patch link:    https://lore.kernel.org/r/20251201-clk-microchip-fixes-v2-3-9d5a0daadd98%40redhat.com
patch subject: [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
config: openrisc-allmodconfig (https://download.01.org/0day-ci/archive/20251205/202512051151.N3iZUKEG-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251205/202512051151.N3iZUKEG-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512051151.N3iZUKEG-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/clk/microchip/clk-core.c: Assembler messages:
>> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
>> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
>> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
>> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
>> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
   drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'


vim +721 drivers/clk/microchip/clk-core.c

ce6e11884659988 Purna Chandra Mandal 2016-05-13  682  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  683  static int spll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
ce6e11884659988 Purna Chandra Mandal 2016-05-13  684  			     unsigned long parent_rate)
ce6e11884659988 Purna Chandra Mandal 2016-05-13  685  {
ce6e11884659988 Purna Chandra Mandal 2016-05-13  686  	struct pic32_sys_pll *pll = clkhw_to_spll(hw);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  687  	unsigned long ret, flags;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  688  	u32 mult, odiv, v;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  689  	int err;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  690  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  691  	ret = spll_calc_mult_div(pll, rate, parent_rate, &mult, &odiv);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  692  	if (!ret)
ce6e11884659988 Purna Chandra Mandal 2016-05-13  693  		return -EINVAL;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  694  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  695  	/*
ce6e11884659988 Purna Chandra Mandal 2016-05-13  696  	 * We can't change SPLL counters when it is in-active use
ce6e11884659988 Purna Chandra Mandal 2016-05-13  697  	 * by SYSCLK. So check before applying new counters/rate.
ce6e11884659988 Purna Chandra Mandal 2016-05-13  698  	 */
ce6e11884659988 Purna Chandra Mandal 2016-05-13  699  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  700  	/* Is spll_clk active parent of sys_clk ? */
ce6e11884659988 Purna Chandra Mandal 2016-05-13  701  	if (unlikely(clk_hw_get_parent(pic32_sclk_hw) == hw)) {
ce6e11884659988 Purna Chandra Mandal 2016-05-13  702  		pr_err("%s: failed, clk in-use\n", __func__);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  703  		return -EBUSY;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  704  	}
ce6e11884659988 Purna Chandra Mandal 2016-05-13  705  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  706  	spin_lock_irqsave(&pll->core->reg_lock, flags);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  707  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  708  	/* apply new multiplier & divisor */
ce6e11884659988 Purna Chandra Mandal 2016-05-13  709  	v = readl(pll->ctrl_reg);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  710  	v &= ~(PLL_MULT_MASK << PLL_MULT_SHIFT);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  711  	v &= ~(PLL_ODIV_MASK << PLL_ODIV_SHIFT);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  712  	v |= (mult << PLL_MULT_SHIFT) | (odiv << PLL_ODIV_SHIFT);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  713  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  714  	/* sys unlock before write */
ce6e11884659988 Purna Chandra Mandal 2016-05-13  715  	pic32_syskey_unlock();
ce6e11884659988 Purna Chandra Mandal 2016-05-13  716  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  717  	writel(v, pll->ctrl_reg);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  718  	cpu_relax();
ce6e11884659988 Purna Chandra Mandal 2016-05-13  719  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  720  	/* insert few nops (5-stage) to ensure CPU does not hang */
ce6e11884659988 Purna Chandra Mandal 2016-05-13 @721  	cpu_nop5();
ce6e11884659988 Purna Chandra Mandal 2016-05-13  722  	cpu_nop5();
ce6e11884659988 Purna Chandra Mandal 2016-05-13  723  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  724  	/* Wait until PLL is locked (maximum 100 usecs). */
ce6e11884659988 Purna Chandra Mandal 2016-05-13  725  	err = readl_poll_timeout_atomic(pll->status_reg, v,
ce6e11884659988 Purna Chandra Mandal 2016-05-13  726  					v & pll->lock_mask, 1, 100);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  727  	spin_unlock_irqrestore(&pll->core->reg_lock, flags);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  728  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  729  	return err;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  730  }
ce6e11884659988 Purna Chandra Mandal 2016-05-13  731  

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

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

* Re: [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2025-12-01 22:06 ` [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
  2025-12-05  3:51   ` kernel test robot
@ 2025-12-05  7:21   ` Dan Carpenter
  2025-12-05 11:35     ` Brian Masney
  1 sibling, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-12-05  7:21 UTC (permalink / raw)
  To: oe-kbuild, Brian Masney, Michael Turquette, Stephen Boyd,
	Maxime Ripard, Claudiu Beznea, Conor Dooley
  Cc: lkp, oe-kbuild-all, linux-clk, linux-kernel, Brian Masney

Hi Brian,

kernel test robot noticed the following build warnings:

url:    https://github.com/intel-lab-lkp/linux/commits/Brian-Masney/clk-microchip-core-remove-duplicate-determine_rate-on-pic32_sclk_ops/20251202-060924
base:   92fd6e84175befa1775e5c0ab682938eca27c0b2
patch link:    https://lore.kernel.org/r/20251201-clk-microchip-fixes-v2-3-9d5a0daadd98%40redhat.com
patch subject: [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
config: arm-randconfig-r071-20251204 (https://download.01.org/0day-ci/archive/20251205/202512050233.R9hAWsJN-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.5.0

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 <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202512050233.R9hAWsJN-lkp@intel.com/

smatch warnings:
drivers/clk/microchip/clk-core.c:300 roclk_get_parent() warn: signedness bug returning '(-22)'
drivers/clk/microchip/clk-core.c:833 sclk_get_parent() warn: signedness bug returning '(-22)'

vim +300 drivers/clk/microchip/clk-core.c

ce6e11884659988 Purna Chandra Mandal 2016-05-13  286  static u8 roclk_get_parent(struct clk_hw *hw)
                                                             ^^
returns a u8.

ce6e11884659988 Purna Chandra Mandal 2016-05-13  287  {
ce6e11884659988 Purna Chandra Mandal 2016-05-13  288  	struct pic32_ref_osc *refo = clkhw_to_refosc(hw);
ce6e11884659988 Purna Chandra Mandal 2016-05-13  289  	u32 v, i;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  290  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  291  	v = (readl(refo->ctrl_reg) >> REFO_SEL_SHIFT) & REFO_SEL_MASK;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  292  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  293  	if (!refo->parent_map)
ce6e11884659988 Purna Chandra Mandal 2016-05-13  294  		return v;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  295  
ce6e11884659988 Purna Chandra Mandal 2016-05-13  296  	for (i = 0; i < clk_hw_get_num_parents(hw); i++)
ce6e11884659988 Purna Chandra Mandal 2016-05-13  297  		if (refo->parent_map[i] == v)
ce6e11884659988 Purna Chandra Mandal 2016-05-13  298  			return i;
ce6e11884659988 Purna Chandra Mandal 2016-05-13  299  
ce6e11884659988 Purna Chandra Mandal 2016-05-13 @300  	return -EINVAL;
                                                        ^^^^^^^^^^^^^^^
So it can't return negative error codes.

ce6e11884659988 Purna Chandra Mandal 2016-05-13  301  }

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


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

* Re: [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2025-12-05  3:51   ` kernel test robot
@ 2025-12-05 11:33     ` Brian Masney
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Masney @ 2025-12-05 11:33 UTC (permalink / raw)
  To: kernel test robot
  Cc: Michael Turquette, Stephen Boyd, Maxime Ripard, Claudiu Beznea,
	Conor Dooley, oe-kbuild-all, linux-clk, linux-kernel

On Fri, Dec 05, 2025 at 11:51:12AM +0800, kernel test robot wrote:
>    drivers/clk/microchip/clk-core.c: Assembler messages:
> >> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
> >> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
> >> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
> >> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
> >> drivers/clk/microchip/clk-core.c:721: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:722: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'
>    drivers/clk/microchip/clk-core.c:862: Error: unrecognized instruction `nop'

That's related to these calls: __asm__ __volatile__("nop");
In the case of compile test, I'll just make this a noop. I'll post a new
version.

Brian


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

* Re: [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2025-12-05  7:21   ` Dan Carpenter
@ 2025-12-05 11:35     ` Brian Masney
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Masney @ 2025-12-05 11:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: oe-kbuild, Michael Turquette, Stephen Boyd, Maxime Ripard,
	Claudiu Beznea, Conor Dooley, lkp, oe-kbuild-all, linux-clk,
	linux-kernel

On Fri, Dec 05, 2025 at 10:21:55AM +0300, Dan Carpenter wrote:
> smatch warnings:
> drivers/clk/microchip/clk-core.c:300 roclk_get_parent() warn: signedness bug returning '(-22)'
> drivers/clk/microchip/clk-core.c:833 sclk_get_parent() warn: signedness bug returning '(-22)'
> 
> vim +300 drivers/clk/microchip/clk-core.c
> 
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  286  static u8 roclk_get_parent(struct clk_hw *hw)
>                                                              ^^
> returns a u8.
> 
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  287  {
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  288  	struct pic32_ref_osc *refo = clkhw_to_refosc(hw);
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  289  	u32 v, i;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  290  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  291  	v = (readl(refo->ctrl_reg) >> REFO_SEL_SHIFT) & REFO_SEL_MASK;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  292  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  293  	if (!refo->parent_map)
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  294  		return v;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  295  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  296  	for (i = 0; i < clk_hw_get_num_parents(hw); i++)
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  297  		if (refo->parent_map[i] == v)
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  298  			return i;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  299  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13 @300  	return -EINVAL;
>                                                         ^^^^^^^^^^^^^^^
> So it can't return negative error codes.
> 
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  301  }

This was an existing bug in the driver. Since I'm making changes
to this driver, I'll go ahead and fix this as well.

Brian


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

end of thread, other threads:[~2025-12-05 11:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 22:06 [PATCH v2 0/3] clk: microchip: core: fix issue with round_rate conversion and allow compile test Brian Masney
2025-12-01 22:06 ` [PATCH v2 1/3] clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops Brian Masney
2025-12-01 22:06 ` [PATCH v2 2/3] clk: microchip: core: remove unused include asm/traps.h Brian Masney
2025-12-01 22:06 ` [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
2025-12-05  3:51   ` kernel test robot
2025-12-05 11:33     ` Brian Masney
2025-12-05  7:21   ` Dan Carpenter
2025-12-05 11:35     ` Brian Masney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).