llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2 4/4] clk: eyeq: add driver
       [not found] <20240703-mbly-clk-v2-4-fe8c6199a579@bootlin.com>
@ 2024-07-05  1:50 ` kernel test robot
  2024-07-05 10:03   ` Théo Lebrun
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-07-05  1:50 UTC (permalink / raw)
  To: Théo Lebrun, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: llvm, oe-kbuild-all, linux-clk, devicetree, linux-kernel,
	Vladimir Kondratiev, Grégory Clement, Thomas Petazzoni,
	Tawfik Bayouk, Théo Lebrun

Hi Théo,

kernel test robot noticed the following build errors:

[auto build test ERROR on f2661062f16b2de5d7b6a5c42a9a5c96326b8454]

url:    https://github.com/intel-lab-lkp/linux/commits/Th-o-Lebrun/Revert-dt-bindings-clock-mobileye-eyeq5-clk-add-bindings/20240704-211515
base:   f2661062f16b2de5d7b6a5c42a9a5c96326b8454
patch link:    https://lore.kernel.org/r/20240703-mbly-clk-v2-4-fe8c6199a579%40bootlin.com
patch subject: [PATCH v2 4/4] clk: eyeq: add driver
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20240705/202407050921.S41aCBdD-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project a0c6b8aef853eedaa0980f07c0a502a5a8a9740e)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240705/202407050921.S41aCBdD-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/202407050921.S41aCBdD-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/clk/clk-eyeq.c:30:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/clk/clk-eyeq.c:30:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/clk/clk-eyeq.c:30:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
>> drivers/clk/clk-eyeq.c:264:9: error: call to undeclared function 'readq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     264 |                 val = readq(priv->base + pll->reg64);
         |                       ^
   drivers/clk/clk-eyeq.c:724:9: error: call to undeclared function 'readq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     724 |                 val = readq(base + pll->reg64);
         |                       ^
   6 warnings and 2 errors generated.


vim +/readq +264 drivers/clk/clk-eyeq.c

   249	
   250	static void eqc_probe_init_plls(struct device *dev, struct eqc_priv *priv)
   251	{
   252		const struct eqc_match_data *data = priv->data;
   253		unsigned long mult, div, acc;
   254		const struct eqc_pll *pll;
   255		struct clk_hw *hw;
   256		unsigned int i;
   257		u32 r0, r1;
   258		u64 val;
   259		int ret;
   260	
   261		for (i = 0; i < data->pll_count; i++) {
   262			pll = &data->plls[i];
   263	
 > 264			val = readq(priv->base + pll->reg64);
   265			r0 = val;
   266			r1 = val >> 32;
   267	
   268			ret = eqc_pll_parse_registers(r0, r1, &mult, &div, &acc);
   269			if (ret) {
   270				dev_warn(dev, "failed parsing state of %s\n", pll->name);
   271				priv->cells->hws[pll->index] = ERR_PTR(ret);
   272				continue;
   273			}
   274	
   275			hw = clk_hw_register_fixed_factor_with_accuracy_fwname(dev,
   276					dev->of_node, pll->name, "ref", 0, mult, div, acc);
   277			priv->cells->hws[pll->index] = hw;
   278			if (IS_ERR(hw))
   279				dev_warn(dev, "failed registering %s: %pe\n", pll->name, hw);
   280		}
   281	}
   282	

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

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

* Re: [PATCH v2 4/4] clk: eyeq: add driver
  2024-07-05  1:50 ` [PATCH v2 4/4] clk: eyeq: add driver kernel test robot
@ 2024-07-05 10:03   ` Théo Lebrun
  0 siblings, 0 replies; 2+ messages in thread
From: Théo Lebrun @ 2024-07-05 10:03 UTC (permalink / raw)
  To: kernel test robot, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: llvm, oe-kbuild-all, linux-clk, devicetree, linux-kernel,
	Vladimir Kondratiev, Grégory Clement, Thomas Petazzoni,
	Tawfik Bayouk

Hello,

*Grasp*, I forgot addressing this topic.

On Fri Jul 5, 2024 at 3:50 AM CEST, kernel test robot wrote:
> kernel test robot noticed the following build errors:

[...]

> All errors (new ones prefixed by >>):
>
>    In file included from drivers/clk/clk-eyeq.c:30:
>    In file included from include/linux/io.h:14:
>    In file included from arch/hexagon/include/asm/io.h:328:
>    include/asm-generic/io.h:548:31: warning: performing pointer
>        arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>      548 |         val = __raw_readb(PCI_IOBASE + addr);
>          |                           ~~~~~~~~~~ ^
[...]

Ignoring all the warnings relative to <linux/io.h> as they appear on all
objects using this config, nothing specific to clk-eyeq.

> >> drivers/clk/clk-eyeq.c:264:9: error: call to undeclared function
> >>     'readq'; ISO C99 and later do not support implicit function
> >>     declarations [-Wimplicit-function-declaration]
>      264 |                 val = readq(priv->base + pll->reg64);
>          |                       ^

Options are:

 - #include <linux/io-64-nonatomic-lo-hi.h> or
            <linux/io-64-nonatomic-hi-lo.h> or

 - in Kconfig, add "depends on 64BIT # for readq()"

I'm leaning towards the Kconfig option. Build testing this driver on
32bit platforms makes no sense, this is a SoC clk platform driver used
on 64bit SoCs. Including a compat layer is a more complex solution.

I'll wait a bit before sending next revision.
You can ping if you want it straight away of course.

Thanks,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

end of thread, other threads:[~2024-07-05 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240703-mbly-clk-v2-4-fe8c6199a579@bootlin.com>
2024-07-05  1:50 ` [PATCH v2 4/4] clk: eyeq: add driver kernel test robot
2024-07-05 10:03   ` Théo Lebrun

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).