* [freescale-fslc:6.1-2.2.x-imx 3578/18115] drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c:243:3: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *')
@ 2024-04-20 22:13 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-20 22:13 UTC (permalink / raw
To: Otavio Salvador; +Cc: oe-kbuild-all
tree: https://github.com/Freescale/linux-fslc 6.1-2.2.x-imx
head: de69f223c019fed2a465c014575b3b3d22b4c3fd
commit: fbc9c63f5eaa123239b5e21fee0c41a4b52bd831 [3578/18115] LF-6250-2 phy: freescale: Add i.MX93 Synopsys DesignWare MIPI DPHY support
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20240421/202404210610.PQxeXLEM-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 7089c359a3845323f6f30c44a47dd901f2edfe63)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240421/202404210610.PQxeXLEM-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/202404210610.PQxeXLEM-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c:15:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
547 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
560 | 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/phy/freescale/phy-fsl-imx93-mipi-dphy.c:15:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
573 | 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/phy/freescale/phy-fsl-imx93-mipi-dphy.c:15:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
584 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
In file included from drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c:15:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:20:
In file included from include/linux/mm.h:1748:
include/linux/vmstat.h:516:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
516 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c:243:3: warning: comparison of distinct pointer types ('typeof ((tmp)) *' (aka 'unsigned long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Wcompare-distinct-pointer-types]
243 | do_div(tmp, n * fvco_div);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div'
222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
| ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
>> drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c:243:3: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
243 | do_div(tmp, n * fvco_div);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
238 | __rem = __div64_32(&(n), __base); \
| ^~~~
include/asm-generic/div64.h:213:38: note: passing argument to parameter 'dividend' here
213 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
| ^
drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c:243:3: warning: shift count >= width of type [-Wshift-count-overflow]
243 | do_div(tmp, n * fvco_div);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:234:25: note: expanded from macro 'do_div'
234 | } else if (likely(((n) >> 32) == 0)) { \
| ^ ~~
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
77 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
9 warnings and 1 error generated.
vim +243 drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c
193
194 static int
195 dw_dphy_config_from_opts(struct phy *phy,
196 struct phy_configure_opts_mipi_dphy *dphy_opts,
197 struct dw_dphy_cfg *cfg)
198 {
199 struct dw_dphy_priv *priv = phy_get_drvdata(phy);
200 unsigned long fin = priv->ref_clk_rate;
201 unsigned long fout;
202 unsigned long best_fout = 0;
203 unsigned int fvco_div;
204 unsigned int min_n, max_n, n, best_n;
205 unsigned long m, best_m;
206 unsigned long min_delta = ULONG_MAX;
207 unsigned long tmp, delta;
208
209 if (dphy_opts->hs_clk_rate < DATA_RATE_MIN_SPEED ||
210 dphy_opts->hs_clk_rate > DATA_RATE_MAX_SPEED) {
211 dev_dbg(&phy->dev, "invalid data rate per lane: %lu\n",
212 dphy_opts->hs_clk_rate);
213 return -EINVAL;
214 }
215
216 fout = data_rate_to_fout(dphy_opts->hs_clk_rate);
217
218 /* Fout = Fvco / Fvco_div = (Fin * M) / (Fvco_div * N) */
219 fvco_div = 8UL / min(DIV_ROUND_UP(fout, FVCO_DIV_FACTOR), 8UL);
220
221 /* limitation: 2MHz <= Fin / N <= 8MHz */
222 min_n = DIV_ROUND_UP(fin, MHZ(8));
223 max_n = DIV_ROUND_DOWN_ULL(fin, MHZ(2));
224
225 /* clamp possible N(s) */
226 min_n = clamp(min_n, N_MIN, N_MAX);
227 max_n = clamp(max_n, N_MIN, N_MAX);
228
229 dev_dbg(&phy->dev, "Fout = %lu, Fvco_div = %u, n_range = [%u, %u]\n",
230 fout, fvco_div, min_n, max_n);
231
232 for (n = min_n; n <= max_n; n++) {
233 /* M = (Fout * N * Fvco_div) / Fin */
234 tmp = fout * n * fvco_div;
235 m = DIV_ROUND_CLOSEST(tmp, fin);
236
237 /* check M range */
238 if (m < M_MIN || m > M_MAX)
239 continue;
240
241 /* calculate temporary Fout */
242 tmp = m * fin;
> 243 do_div(tmp, n * fvco_div);
244 if (tmp < FOUT_MIN || tmp > FOUT_MAX)
245 continue;
246
247 delta = abs(fout - tmp);
248 if (delta < min_delta) {
249 best_n = n;
250 best_m = m;
251 min_delta = delta;
252 best_fout = tmp;
253 }
254 }
255
256 if (best_fout) {
257 cfg->m = best_m;
258 cfg->n = best_n;
259 dphy_opts->hs_clk_rate = best_fout * 2;
260 dev_dbg(&phy->dev, "best Fout = %lu, m = %u, n = %u\n",
261 best_fout, cfg->m, cfg->n);
262 } else {
263 dev_dbg(&phy->dev, "failed to find best Fout\n");
264 return -EINVAL;
265 }
266
267 return 0;
268 }
269
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-20 22:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-20 22:13 [freescale-fslc:6.1-2.2.x-imx 3578/18115] drivers/phy/freescale/phy-fsl-imx93-mipi-dphy.c:243:3: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') kernel test robot
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 read-only IMAP folder(s) and NNTP newsgroup(s).