All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Mario Limonciello" <mario.limonciello@amd.com>,
	"Mateusz Jończyk" <mat.jonczyk@o2.pl>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Cc: oe-kbuild-all@lists.linux.dev,
	"open list:REAL TIME CLOCK (RTC) SUBSYSTEM"
	<linux-rtc@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	linux-pm@vger.kernel.org, tobrohl@gmail.com, aalsing@gmail.com,
	Dhaval.Giani@amd.com, xmb8dsv4@gmail.com, x86@kernel.org,
	dhaval.giani@gmail.com, Dave Hansen <dave.hansen@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: [PATCH v3 3/4] rtc: Add support for configuring the UIP timeout for RTC reads
Date: Tue, 28 Nov 2023 11:01:50 +0800	[thread overview]
Message-ID: <202311280845.YrtuJ0eq-lkp@intel.com> (raw)
In-Reply-To: <20231127192553.9734-4-mario.limonciello@amd.com>

Hi Mario,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 2cc14f52aeb78ce3f29677c2de1f06c0e91471ab]

url:    https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello/rtc-mc146818-lib-Adjust-failure-return-code-for-mc146818_get_time/20231128-032825
base:   2cc14f52aeb78ce3f29677c2de1f06c0e91471ab
patch link:    https://lore.kernel.org/r/20231127192553.9734-4-mario.limonciello%40amd.com
patch subject: [PATCH v3 3/4] rtc: Add support for configuring the UIP timeout for RTC reads
config: i386-randconfig-141-20231128 (https://download.01.org/0day-ci/archive/20231128/202311280845.YrtuJ0eq-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231128/202311280845.YrtuJ0eq-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/202311280845.YrtuJ0eq-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/rtc/rtc-mc146818-lib.c:82:5: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
                                   UIP_RECHECK_TIMEOUT_MS(i));
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:508:37: note: expanded from macro 'pr_warn'
           printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                                      ~~~     ^~~~~~~~~~~
   include/linux/printk.h:455:60: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                                                       ~~~    ^~~~~~~~~~~
   include/linux/printk.h:427:19: note: expanded from macro 'printk_index_wrap'
                   _p_func(_fmt, ##__VA_ARGS__);                           \
                           ~~~~    ^~~~~~~~~~~
   drivers/rtc/rtc-mc146818-lib.c:13:35: note: expanded from macro 'UIP_RECHECK_TIMEOUT_MS'
   #define UIP_RECHECK_TIMEOUT_MS(x)       (x / UIP_RECHECK_DELAY_MS)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +82 drivers/rtc/rtc-mc146818-lib.c

    14	
    15	/*
    16	 * Execute a function while the UIP (Update-in-progress) bit of the RTC is
    17	 * unset. The timeout is configurable by the caller in ms.
    18	 *
    19	 * Warning: callback may be executed more then once.
    20	 */
    21	bool mc146818_avoid_UIP(void (*callback)(unsigned char seconds, void *param),
    22				int timeout,
    23				void *param)
    24	{
    25		int i;
    26		unsigned long flags;
    27		unsigned char seconds;
    28	
    29		for (i = 0; i < UIP_RECHECK_TIMEOUT_MS(timeout); i++) {
    30			spin_lock_irqsave(&rtc_lock, flags);
    31	
    32			/*
    33			 * Check whether there is an update in progress during which the
    34			 * readout is unspecified. The maximum update time is ~2ms. Poll
    35			 * for completion.
    36			 *
    37			 * Store the second value before checking UIP so a long lasting
    38			 * NMI which happens to hit after the UIP check cannot make
    39			 * an update cycle invisible.
    40			 */
    41			seconds = CMOS_READ(RTC_SECONDS);
    42	
    43			if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) {
    44				spin_unlock_irqrestore(&rtc_lock, flags);
    45				udelay(UIP_RECHECK_DELAY);
    46				continue;
    47			}
    48	
    49			/* Revalidate the above readout */
    50			if (seconds != CMOS_READ(RTC_SECONDS)) {
    51				spin_unlock_irqrestore(&rtc_lock, flags);
    52				continue;
    53			}
    54	
    55			if (callback)
    56				callback(seconds, param);
    57	
    58			/*
    59			 * Check for the UIP bit again. If it is set now then
    60			 * the above values may contain garbage.
    61			 */
    62			if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) {
    63				spin_unlock_irqrestore(&rtc_lock, flags);
    64				udelay(UIP_RECHECK_DELAY);
    65				continue;
    66			}
    67	
    68			/*
    69			 * A NMI might have interrupted the above sequence so check
    70			 * whether the seconds value has changed which indicates that
    71			 * the NMI took longer than the UIP bit was set. Unlikely, but
    72			 * possible and there is also virt...
    73			 */
    74			if (seconds != CMOS_READ(RTC_SECONDS)) {
    75				spin_unlock_irqrestore(&rtc_lock, flags);
    76				continue;
    77			}
    78			spin_unlock_irqrestore(&rtc_lock, flags);
    79	
    80			if (i >= UIP_RECHECK_TIMEOUT_MS(100))
    81				pr_warn("Reading current time from RTC took around %d ms\n",
  > 82					UIP_RECHECK_TIMEOUT_MS(i));
    83	
    84			return true;
    85		}
    86		return false;
    87	}
    88	EXPORT_SYMBOL_GPL(mc146818_avoid_UIP);
    89	

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

  parent reply	other threads:[~2023-11-28  3:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 19:25 [PATCH v3 0/4] Extend time to wait for UIP for some callers Mario Limonciello
2023-11-27 19:25 ` [PATCH v3 1/4] rtc: mc146818-lib: Adjust failure return code for mc146818_get_time() Mario Limonciello
2023-11-27 19:25 ` [PATCH v3 2/4] rtc: Adjust failure return code for cmos_set_alarm() Mario Limonciello
2023-11-27 19:25 ` [PATCH v3 3/4] rtc: Add support for configuring the UIP timeout for RTC reads Mario Limonciello
2023-11-27 20:31   ` Mateusz Jończyk
2023-11-27 20:37     ` Mario Limonciello
2023-11-28  0:19   ` kernel test robot
2023-11-28  3:01   ` kernel test robot [this message]
2023-11-27 19:25 ` [PATCH v3 4/4] rtc: Extend timeout for waiting for UIP to clear to 1s Mario Limonciello

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=202311280845.YrtuJ0eq-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Dhaval.Giani@amd.com \
    --cc=a.zummo@towertech.it \
    --cc=aalsing@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dhaval.giani@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mat.jonczyk@o2.pl \
    --cc=mingo@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --cc=tobrohl@gmail.com \
    --cc=x86@kernel.org \
    --cc=xmb8dsv4@gmail.com \
    /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.