[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202509101047.oTfSjXyE-lkp@intel.com>
Date: Wed, 10 Sep 2025 11:12:37 +0800
From: kernel test robot <lkp@...el.com>
To: Haofeng Li <920484857@...com>, John Stultz <jstultz@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Stephen Boyd <sboyd@...nel.org>, Haofeng Li <13266079573@....com>
Subject: Re: [PATCH] timekeeping: Move debug sleep time accounting outside
spinlock
Hi Haofeng,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/timers/core]
[also build test WARNING on linus/master v6.17-rc5 next-20250909]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Haofeng-Li/timekeeping-Move-debug-sleep-time-accounting-outside-spinlock/20250909-183705
base: tip/timers/core
patch link: https://lore.kernel.org/r/tencent_6FBD7FB2B5EDA57B1481766C52482D033008%40qq.com
patch subject: [PATCH] timekeeping: Move debug sleep time accounting outside spinlock
config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20250910/202509101047.oTfSjXyE-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250910/202509101047.oTfSjXyE-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509101047.oTfSjXyE-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/time/timekeeping.c: In function 'timekeeping_resume':
>> kernel/time/timekeeping.c:1986:55: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
1986 | tk_debug_account_sleep_time(&ts_delta);
| ^
vim +/if +1986 kernel/time/timekeeping.c
1929
1930 /**
1931 * timekeeping_resume - Resumes the generic timekeeping subsystem.
1932 */
1933 void timekeeping_resume(void)
1934 {
1935 struct timekeeper *tks = &tk_core.shadow_timekeeper;
1936 struct clocksource *clock = tks->tkr_mono.clock;
1937 struct timespec64 ts_new, ts_delta;
1938 bool inject_sleeptime = false;
1939 u64 cycle_now, nsec;
1940 unsigned long flags;
1941
1942 read_persistent_clock64(&ts_new);
1943
1944 clockevents_resume();
1945 clocksource_resume();
1946
1947 raw_spin_lock_irqsave(&tk_core.lock, flags);
1948
1949 /*
1950 * After system resumes, we need to calculate the suspended time and
1951 * compensate it for the OS time. There are 3 sources that could be
1952 * used: Nonstop clocksource during suspend, persistent clock and rtc
1953 * device.
1954 *
1955 * One specific platform may have 1 or 2 or all of them, and the
1956 * preference will be:
1957 * suspend-nonstop clocksource -> persistent clock -> rtc
1958 * The less preferred source will only be tried if there is no better
1959 * usable source. The rtc part is handled separately in rtc core code.
1960 */
1961 cycle_now = tk_clock_read(&tks->tkr_mono);
1962 nsec = clocksource_stop_suspend_timing(clock, cycle_now);
1963 if (nsec > 0) {
1964 ts_delta = ns_to_timespec64(nsec);
1965 inject_sleeptime = true;
1966 } else if (timespec64_compare(&ts_new, &timekeeping_suspend_time) > 0) {
1967 ts_delta = timespec64_sub(ts_new, timekeeping_suspend_time);
1968 inject_sleeptime = true;
1969 }
1970
1971 if (inject_sleeptime) {
1972 suspend_timing_needed = false;
1973 __timekeeping_inject_sleeptime(tks, &ts_delta);
1974 }
1975
1976 /* Re-base the last cycle value */
1977 tks->tkr_mono.cycle_last = cycle_now;
1978 tks->tkr_raw.cycle_last = cycle_now;
1979
1980 tks->ntp_error = 0;
1981 timekeeping_suspended = 0;
1982 timekeeping_update_from_shadow(&tk_core, TK_CLOCK_WAS_SET);
1983 raw_spin_unlock_irqrestore(&tk_core.lock, flags);
1984
1985 if (inject_sleeptime && timespec64_valid_strict(&ts_delta))
> 1986 tk_debug_account_sleep_time(&ts_delta);
1987
1988 /* Resume the clockevent device(s) and hrtimers */
1989 tick_resume();
1990 /* Notify timerfd as resume is equivalent to clock_was_set() */
1991 timerfd_resume();
1992 }
1993
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists