From: kernel test robot <lkp@intel.com>
To: Qin Jian <qinjian@cqplus1.com>, robh+dt@kernel.org
Cc: kbuild-all@lists.01.org, mturquette@baylibre.com,
sboyd@kernel.org, tglx@linutronix.de, maz@kernel.org,
p.zabel@pengutronix.de, linux@armlinux.org.uk,
broonie@kernel.org, arnd@arndb.de,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 06/10] clk: Add Sunplus SP7021 clock driver
Date: Sat, 4 Dec 2021 00:09:23 +0800 [thread overview]
Message-ID: <202112032353.vXXsrZu2-lkp@intel.com> (raw)
In-Reply-To: <8d23a5e00d870173993032c6a68fb5f48182691d.1638515726.git.qinjian@cqplus1.com>
Hi Qin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on clk/clk-next]
[also build test WARNING on tip/irq/core linus/master v5.16-rc3 next-20211203]
[cannot apply to pza/reset/next robh/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Qin-Jian/Add-Sunplus-SP7021-SoC-Support/20211203-154345
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211203/202112032353.vXXsrZu2-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/ebecbb4f178661a7de3c03b73ccd59722c3ee26c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Qin-Jian/Add-Sunplus-SP7021-SoC-Support/20211203-154345
git checkout ebecbb4f178661a7de3c03b73ccd59722c3ee26c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/clk/ drivers/irqchip/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/clk/clk-sp7021.c: In function 'plltv_fractional_div':
>> drivers/clk/clk-sp7021.c:304:13: warning: variable 'diff_min_sign' set but not used [-Wunused-but-set-variable]
304 | u32 diff_min_sign = 0;
| ^~~~~~~~~~~~~
drivers/clk/clk-sp7021.c: At top level:
>> drivers/clk/clk-sp7021.c:638:13: warning: no previous prototype for 'clk_register_sp_pll' [-Wmissing-prototypes]
638 | struct clk *clk_register_sp_pll(const char *name, const char *parent,
| ^~~~~~~~~~~~~~~~~~~
vim +/diff_min_sign +304 drivers/clk/clk-sp7021.c
298
299 static long plltv_fractional_div(struct sp_pll *clk, unsigned long freq)
300 {
301 u32 m, r;
302 u32 nint, nfra;
303 u32 diff_min_quotient = 210000000, diff_min_remainder = 0;
> 304 u32 diff_min_sign = 0;
305 unsigned long fvco, nf, f, fout = 0;
306 int sdm, ph;
307
308 /* check freq */
309 if (freq < F_MIN) {
310 pr_warn("%s: %s freq:%lu < F_MIN:%lu, round up\n",
311 __func__, clk_hw_get_name(&clk->hw), freq, F_MIN);
312 freq = F_MIN;
313 } else if (freq > F_MAX) {
314 pr_warn("%s: %s freq:%lu > F_MAX:%lu, round down\n",
315 __func__, clk_hw_get_name(&clk->hw), freq, F_MAX);
316 freq = F_MAX;
317 }
318
319 /* DIVR 0~3 */
320 for (r = 0; r <= 3; r++) {
321 fvco = freq << r;
322 if (fvco <= FVCO_MAX)
323 break;
324 }
325 f = F_27M >> r;
326
327 /* PH_SEL 1/0 */
328 for (ph = 1; ph >= 0; ph--) {
329 const u32 *pp = pt[ph];
330 u32 ms = 1;
331
332 /* SDM_MOD 0/1 */
333 for (sdm = 0; sdm <= 1; sdm++) {
334 u32 mod = mods[sdm];
335
336 /* DIVM 1~32 */
337 for (m = ms; m <= 32; m++) {
338 u32 diff_freq;
339 u32 diff_freq_quotient = 0, diff_freq_remainder = 0;
340 u32 diff_freq_sign = 0; /* 0:Positive number, 1:Negative number */
341
342 nf = fvco * m;
343 nint = nf / pp[3];
344
345 if (nint < pp[1])
346 continue;
347 if (nint > pp[1])
348 break;
349
350 nfra = (((nf % pp[3]) * mod * pp[4]) + (F_27M / 2)) / F_27M;
351 if (nfra)
352 diff_freq = (f * (nint + pp[2]) / pp[0]) -
353 (f * (mod - nfra) / mod / pp[4]);
354 else
355 diff_freq = (f * (nint) / pp[0]);
356
357 diff_freq_quotient = diff_freq / m;
358 diff_freq_remainder = ((diff_freq % m) * 1000) / m;
359
360 if (freq > diff_freq_quotient) {
361 diff_freq_quotient = freq - diff_freq_quotient - 1;
362 diff_freq_remainder = 1000 - diff_freq_remainder;
363 diff_freq_sign = 1;
364 } else {
365 diff_freq_quotient = diff_freq_quotient - freq;
366 diff_freq_sign = 0;
367 }
368
369 if (diff_min_quotient > diff_freq_quotient ||
370 (diff_min_quotient == diff_freq_quotient &&
371 diff_min_remainder > diff_freq_remainder)) {
372 /* found a closer freq, save parameters */
373 clk->p[SEL_FRA] = 1;
374 clk->p[SDM_MOD] = sdm;
375 clk->p[PH_SEL] = ph;
376 clk->p[NFRA] = nfra;
377 clk->p[DIVR] = r;
378 clk->p[DIVM] = m;
379
380 fout = diff_freq / m;
381 diff_min_quotient = diff_freq_quotient;
382 diff_min_remainder = diff_freq_remainder;
383 diff_min_sign = diff_freq_sign;
384 }
385 }
386 }
387 }
388
389 if (!fout) {
390 pr_err("%s: %s freq:%lu not found a valid setting\n",
391 __func__, clk_hw_get_name(&clk->hw), freq);
392 return -EINVAL;
393 }
394
395 return fout;
396 }
397
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v5 06/10] clk: Add Sunplus SP7021 clock driver
Date: Sat, 04 Dec 2021 00:09:23 +0800 [thread overview]
Message-ID: <202112032353.vXXsrZu2-lkp@intel.com> (raw)
In-Reply-To: <8d23a5e00d870173993032c6a68fb5f48182691d.1638515726.git.qinjian@cqplus1.com>
[-- Attachment #1: Type: text/plain, Size: 5625 bytes --]
Hi Qin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on clk/clk-next]
[also build test WARNING on tip/irq/core linus/master v5.16-rc3 next-20211203]
[cannot apply to pza/reset/next robh/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Qin-Jian/Add-Sunplus-SP7021-SoC-Support/20211203-154345
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211203/202112032353.vXXsrZu2-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/ebecbb4f178661a7de3c03b73ccd59722c3ee26c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Qin-Jian/Add-Sunplus-SP7021-SoC-Support/20211203-154345
git checkout ebecbb4f178661a7de3c03b73ccd59722c3ee26c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/clk/ drivers/irqchip/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/clk/clk-sp7021.c: In function 'plltv_fractional_div':
>> drivers/clk/clk-sp7021.c:304:13: warning: variable 'diff_min_sign' set but not used [-Wunused-but-set-variable]
304 | u32 diff_min_sign = 0;
| ^~~~~~~~~~~~~
drivers/clk/clk-sp7021.c: At top level:
>> drivers/clk/clk-sp7021.c:638:13: warning: no previous prototype for 'clk_register_sp_pll' [-Wmissing-prototypes]
638 | struct clk *clk_register_sp_pll(const char *name, const char *parent,
| ^~~~~~~~~~~~~~~~~~~
vim +/diff_min_sign +304 drivers/clk/clk-sp7021.c
298
299 static long plltv_fractional_div(struct sp_pll *clk, unsigned long freq)
300 {
301 u32 m, r;
302 u32 nint, nfra;
303 u32 diff_min_quotient = 210000000, diff_min_remainder = 0;
> 304 u32 diff_min_sign = 0;
305 unsigned long fvco, nf, f, fout = 0;
306 int sdm, ph;
307
308 /* check freq */
309 if (freq < F_MIN) {
310 pr_warn("%s: %s freq:%lu < F_MIN:%lu, round up\n",
311 __func__, clk_hw_get_name(&clk->hw), freq, F_MIN);
312 freq = F_MIN;
313 } else if (freq > F_MAX) {
314 pr_warn("%s: %s freq:%lu > F_MAX:%lu, round down\n",
315 __func__, clk_hw_get_name(&clk->hw), freq, F_MAX);
316 freq = F_MAX;
317 }
318
319 /* DIVR 0~3 */
320 for (r = 0; r <= 3; r++) {
321 fvco = freq << r;
322 if (fvco <= FVCO_MAX)
323 break;
324 }
325 f = F_27M >> r;
326
327 /* PH_SEL 1/0 */
328 for (ph = 1; ph >= 0; ph--) {
329 const u32 *pp = pt[ph];
330 u32 ms = 1;
331
332 /* SDM_MOD 0/1 */
333 for (sdm = 0; sdm <= 1; sdm++) {
334 u32 mod = mods[sdm];
335
336 /* DIVM 1~32 */
337 for (m = ms; m <= 32; m++) {
338 u32 diff_freq;
339 u32 diff_freq_quotient = 0, diff_freq_remainder = 0;
340 u32 diff_freq_sign = 0; /* 0:Positive number, 1:Negative number */
341
342 nf = fvco * m;
343 nint = nf / pp[3];
344
345 if (nint < pp[1])
346 continue;
347 if (nint > pp[1])
348 break;
349
350 nfra = (((nf % pp[3]) * mod * pp[4]) + (F_27M / 2)) / F_27M;
351 if (nfra)
352 diff_freq = (f * (nint + pp[2]) / pp[0]) -
353 (f * (mod - nfra) / mod / pp[4]);
354 else
355 diff_freq = (f * (nint) / pp[0]);
356
357 diff_freq_quotient = diff_freq / m;
358 diff_freq_remainder = ((diff_freq % m) * 1000) / m;
359
360 if (freq > diff_freq_quotient) {
361 diff_freq_quotient = freq - diff_freq_quotient - 1;
362 diff_freq_remainder = 1000 - diff_freq_remainder;
363 diff_freq_sign = 1;
364 } else {
365 diff_freq_quotient = diff_freq_quotient - freq;
366 diff_freq_sign = 0;
367 }
368
369 if (diff_min_quotient > diff_freq_quotient ||
370 (diff_min_quotient == diff_freq_quotient &&
371 diff_min_remainder > diff_freq_remainder)) {
372 /* found a closer freq, save parameters */
373 clk->p[SEL_FRA] = 1;
374 clk->p[SDM_MOD] = sdm;
375 clk->p[PH_SEL] = ph;
376 clk->p[NFRA] = nfra;
377 clk->p[DIVR] = r;
378 clk->p[DIVM] = m;
379
380 fout = diff_freq / m;
381 diff_min_quotient = diff_freq_quotient;
382 diff_min_remainder = diff_freq_remainder;
383 diff_min_sign = diff_freq_sign;
384 }
385 }
386 }
387 }
388
389 if (!fout) {
390 pr_err("%s: %s freq:%lu not found a valid setting\n",
391 __func__, clk_hw_get_name(&clk->hw), freq);
392 return -EINVAL;
393 }
394
395 return fout;
396 }
397
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next prev parent reply other threads:[~2021-12-03 16:15 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 7:34 [PATCH v5 00/10] Add Sunplus SP7021 SoC Support Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 7:34 ` [PATCH v5 01/10] dt-bindings: vendor-prefixes: Add Sunplus Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 7:34 ` [PATCH v5 02/10] dt-bindings: arm: sunplus: Add bindings for Sunplus SP7021 SoC boards Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 7:34 ` [PATCH v5 03/10] dt-bindings: reset: Add bindings for SP7021 reset driver Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 7:34 ` [PATCH v5 04/10] reset: Add Sunplus " Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-07 8:35 ` Philipp Zabel
2021-12-07 8:35 ` Philipp Zabel
2021-12-03 7:34 ` [PATCH v5 05/10] dt-bindings: clock: Add bindings for SP7021 clock driver Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-16 6:43 ` Stephen Boyd
2021-12-16 6:43 ` Stephen Boyd
2021-12-03 7:34 ` [PATCH v5 06/10] clk: Add Sunplus " Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 16:09 ` kernel test robot [this message]
2021-12-03 16:09 ` kernel test robot
2021-12-16 6:42 ` Stephen Boyd
2021-12-16 6:42 ` Stephen Boyd
2021-12-03 7:34 ` [PATCH v5 07/10] dt-bindings: interrupt-controller: Add bindings for SP7021 interrupt controller Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 7:34 ` [PATCH v5 08/10] irqchip: Add Sunplus SP7021 interrupt controller driver Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 17:41 ` kernel test robot
2021-12-03 17:41 ` kernel test robot
2021-12-03 17:41 ` kernel test robot
2021-12-03 17:41 ` kernel test robot
2021-12-03 17:41 ` kernel test robot
2021-12-03 18:01 ` kernel test robot
2021-12-03 18:01 ` kernel test robot
2021-12-07 9:02 ` Marc Zyngier
2021-12-07 9:02 ` Marc Zyngier
2021-12-08 7:15 ` qinjian[覃健]
2021-12-08 7:15 ` qinjian[覃健]
2021-12-08 7:45 ` Marc Zyngier
2021-12-08 7:45 ` Marc Zyngier
2021-12-08 9:28 ` qinjian[覃健]
2021-12-08 16:02 ` Marc Zyngier
2021-12-08 16:02 ` Marc Zyngier
2021-12-03 7:34 ` [PATCH v5 09/10] ARM: sunplus: Add initial support for Sunplus SP7021 SoC Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 12:59 ` Arnd Bergmann
2021-12-03 12:59 ` Arnd Bergmann
2021-12-07 7:21 ` qinjian[覃健]
2021-12-07 7:21 ` qinjian[覃健]
2021-12-07 9:11 ` Arnd Bergmann
2021-12-07 9:11 ` Arnd Bergmann
2021-12-09 8:49 ` qinjian[覃健]
2021-12-09 9:58 ` Arnd Bergmann
2021-12-09 9:58 ` Arnd Bergmann
2021-12-09 10:12 ` Ard Biesheuvel
2021-12-09 10:12 ` Ard Biesheuvel
2021-12-03 7:34 ` [PATCH v5 10/10] ARM: sp7021_defconfig: Add Sunplus SP7021 defconfig Qin Jian
2021-12-03 7:34 ` Qin Jian
2021-12-03 12:49 ` Arnd Bergmann
2021-12-03 12:49 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2021-12-16 9:48 [PATCH v5 06/10] clk: Add Sunplus SP7021 clock driver qinjian[覃健]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202112032353.vXXsrZu2-lkp@intel.com \
--to=lkp@intel.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=maz@kernel.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=qinjian@cqplus1.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.