Re: [PATCH 7/7] clocksource/drivers/timer-microchip-pit64b: use mchp_pit64b_{suspend, resume}

kernel test robot
2022-02-28T17:39:00Z

Hi Claudiu,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/timers/core]
[also build test WARNING on soc/for-next linus/master v5.17-rc6 next-20220225]
[cannot apply to daniel-lezcano/clockevents/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/Claudiu-Beznea/clocksource-drivers-timer-microchip-pit64b-fixes-and-improvements/20220228-191933
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 35e13e9da9afbce13c1d36465504ece4e65f24fe
config: i386-randconfig-a002-20220228 (https://download.01.org/0day-ci/archive/20220301/202203010158.D812WMzG-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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/a354e98d1b37361a46d6272ffccc149e3b8bbbca
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Claudiu-Beznea/clocksource-drivers-timer-microchip-pit64b-fixes-and-improvements/20220228-191933
git checkout a354e98d1b37361a46d6272ffccc149e3b8bbbca
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/clocksource/

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/clocksource/timer-microchip-pit64b.c:97:27: warning: tentative definition of variable with internal linkage has incomplete non-array type 'struct delay_timer' [-Wtentative-definition-incomplete-type]
static struct delay_timer mchp_pit64b_dt;
^
drivers/clocksource/timer-microchip-pit64b.c:97:15: note: forward declaration of 'struct delay_timer'
static struct delay_timer mchp_pit64b_dt;
^
drivers/clocksource/timer-microchip-pit64b.c:385:16: error: incomplete definition of type 'struct delay_timer'
mchp_pit64b_dt.read_current_timer = mchp_pit64b_dt_read;
~~~~~~~~~~~~~~^
drivers/clocksource/timer-microchip-pit64b.c:97:15: note: forward declaration of 'struct delay_timer'
static struct delay_timer mchp_pit64b_dt;
^
drivers/clocksource/timer-microchip-pit64b.c:386:16: error: incomplete definition of type 'struct delay_timer'
mchp_pit64b_dt.freq = clk_rate;
~~~~~~~~~~~~~~^
drivers/clocksource/timer-microchip-pit64b.c:97:15: note: forward declaration of 'struct delay_timer'
static struct delay_timer mchp_pit64b_dt;
^
drivers/clocksource/timer-microchip-pit64b.c:387:2: error: implicit declaration of function 'register_current_timer_delay' [-Werror,-Wimplicit-function-declaration]
register_current_timer_delay(&mchp_pit64b_dt);
^
>> drivers/clocksource/timer-microchip-pit64b.c:484:1: warning: unused label 'pclk_unprepare' [-Wunused-label]
pclk_unprepare:
^~~~~~~~~~~~~~~
drivers/clocksource/timer-microchip-pit64b.c:97:27: error: tentative definition has type 'struct delay_timer' that is never completed
static struct delay_timer mchp_pit64b_dt;
^
drivers/clocksource/timer-microchip-pit64b.c:97:15: note: forward declaration of 'struct delay_timer'
static struct delay_timer mchp_pit64b_dt;
^
2 warnings and 4 errors generated.

vim +/pclk_unprepare +484 drivers/clocksource/timer-microchip-pit64b.c

625022a5f16061 Claudiu Beznea 2019-12-13 430
625022a5f16061 Claudiu Beznea 2019-12-13 431 static int __init mchp_pit64b_dt_init_timer(struct device_node *node,
625022a5f16061 Claudiu Beznea 2019-12-13 432 bool clkevt)
625022a5f16061 Claudiu Beznea 2019-12-13 433 {
b9c60a741f06ed Claudiu Beznea 2020-01-06 434 struct mchp_pit64b_timer timer;
625022a5f16061 Claudiu Beznea 2019-12-13 435 unsigned long clk_rate;
625022a5f16061 Claudiu Beznea 2019-12-13 436 u32 irq = 0;
625022a5f16061 Claudiu Beznea 2019-12-13 437 int ret;
625022a5f16061 Claudiu Beznea 2019-12-13 438
625022a5f16061 Claudiu Beznea 2019-12-13 439 /* Parse DT node. */
625022a5f16061 Claudiu Beznea 2019-12-13 440 timer.pclk = of_clk_get_by_name(node, "pclk");
625022a5f16061 Claudiu Beznea 2019-12-13 441 if (IS_ERR(timer.pclk))
625022a5f16061 Claudiu Beznea 2019-12-13 442 return PTR_ERR(timer.pclk);
625022a5f16061 Claudiu Beznea 2019-12-13 443
625022a5f16061 Claudiu Beznea 2019-12-13 444 timer.gclk = of_clk_get_by_name(node, "gclk");
625022a5f16061 Claudiu Beznea 2019-12-13 445 if (IS_ERR(timer.gclk))
625022a5f16061 Claudiu Beznea 2019-12-13 446 return PTR_ERR(timer.gclk);
625022a5f16061 Claudiu Beznea 2019-12-13 447
625022a5f16061 Claudiu Beznea 2019-12-13 448 timer.base = of_iomap(node, 0);
625022a5f16061 Claudiu Beznea 2019-12-13 449 if (!timer.base)
625022a5f16061 Claudiu Beznea 2019-12-13 450 return -ENXIO;
625022a5f16061 Claudiu Beznea 2019-12-13 451
625022a5f16061 Claudiu Beznea 2019-12-13 452 if (clkevt) {
625022a5f16061 Claudiu Beznea 2019-12-13 453 irq = irq_of_parse_and_map(node, 0);
625022a5f16061 Claudiu Beznea 2019-12-13 454 if (!irq) {
625022a5f16061 Claudiu Beznea 2019-12-13 455 ret = -ENODEV;
625022a5f16061 Claudiu Beznea 2019-12-13 456 goto io_unmap;
625022a5f16061 Claudiu Beznea 2019-12-13 457 }
625022a5f16061 Claudiu Beznea 2019-12-13 458 }
625022a5f16061 Claudiu Beznea 2019-12-13 459
625022a5f16061 Claudiu Beznea 2019-12-13 460 /* Initialize mode (prescaler + SGCK bit). To be used at runtime. */
0faff1ca60d69f Claudiu Beznea 2022-02-28 461 ret = mchp_pit64b_init_mode(&timer, MCHP_PIT64B_DEF_FREQ);
625022a5f16061 Claudiu Beznea 2019-12-13 462 if (ret)
625022a5f16061 Claudiu Beznea 2019-12-13 463 goto irq_unmap;
625022a5f16061 Claudiu Beznea 2019-12-13 464
a354e98d1b3736 Claudiu Beznea 2022-02-28 465 if (timer.mode & MCHP_PIT64B_MR_SGCLK)
625022a5f16061 Claudiu Beznea 2019-12-13 466 clk_rate = clk_get_rate(timer.gclk);
a354e98d1b3736 Claudiu Beznea 2022-02-28 467 else
625022a5f16061 Claudiu Beznea 2019-12-13 468 clk_rate = clk_get_rate(timer.pclk);
625022a5f16061 Claudiu Beznea 2019-12-13 469 clk_rate = clk_rate / (MCHP_PIT64B_MODE_TO_PRES(timer.mode) + 1);
625022a5f16061 Claudiu Beznea 2019-12-13 470
625022a5f16061 Claudiu Beznea 2019-12-13 471 if (clkevt)
625022a5f16061 Claudiu Beznea 2019-12-13 472 ret = mchp_pit64b_init_clkevt(&timer, clk_rate, irq);
625022a5f16061 Claudiu Beznea 2019-12-13 473 else
625022a5f16061 Claudiu Beznea 2019-12-13 474 ret = mchp_pit64b_init_clksrc(&timer, clk_rate);
625022a5f16061 Claudiu Beznea 2019-12-13 475
625022a5f16061 Claudiu Beznea 2019-12-13 476 if (ret)
625022a5f16061 Claudiu Beznea 2019-12-13 477 goto gclk_unprepare;
625022a5f16061 Claudiu Beznea 2019-12-13 478
625022a5f16061 Claudiu Beznea 2019-12-13 479 return 0;
625022a5f16061 Claudiu Beznea 2019-12-13 480
625022a5f16061 Claudiu Beznea 2019-12-13 481 gclk_unprepare:
625022a5f16061 Claudiu Beznea 2019-12-13 482 if (timer.mode & MCHP_PIT64B_MR_SGCLK)
625022a5f16061 Claudiu Beznea 2019-12-13 483 clk_disable_unprepare(timer.gclk);
625022a5f16061 Claudiu Beznea 2019-12-13 @484 pclk_unprepare:
625022a5f16061 Claudiu Beznea 2019-12-13 485 clk_disable_unprepare(timer.pclk);
625022a5f16061 Claudiu Beznea 2019-12-13 486 irq_unmap:
625022a5f16061 Claudiu Beznea 2019-12-13 487 irq_dispose_mapping(irq);
625022a5f16061 Claudiu Beznea 2019-12-13 488 io_unmap:
625022a5f16061 Claudiu Beznea 2019-12-13 489 iounmap(timer.base);
625022a5f16061 Claudiu Beznea 2019-12-13 490
625022a5f16061 Claudiu Beznea 2019-12-13 491 return ret;
625022a5f16061 Claudiu Beznea 2019-12-13 492 }
625022a5f16061 Claudiu Beznea 2019-12-13 493

---
0-DAY CI Kernel Test Service, Intel Corporation