Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3573238rdh; Mon, 27 Nov 2023 19:02:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/VXn9JWY5I3XRShX1Ug8lxVH9NlJHOuYvbnTe7npF2+3n7l4GZXKRoIl8Ho92tEEtJxqv X-Received: by 2002:a17:902:c653:b0:1ce:5ca7:1070 with SMTP id s19-20020a170902c65300b001ce5ca71070mr13737372pls.16.1701140559820; Mon, 27 Nov 2023 19:02:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701140559; cv=none; d=google.com; s=arc-20160816; b=z97CSKE2CvzG+aHq2nKDPr9XsZx5EWByZo6OeDmXyU/xkZXT2L4skVN/q84g+MUXmV oJ16tEVl4T0ZybIiZwuY4GuR/8VCzWKiN5YfhPkqyjV5jvyTMl4okZwG8YOSZ8HpFAQ+ VvUbaaJd28wv4qVnNJ5rkHc0xjuyYM8BjRScpJKVfIrhyp6yAiw9YhbdpXGd1BUo4kl9 ajkEF+SWmmSWn51IIVNiWnU9O5kKNuLP4+UCmVrn5p8jU/8/SmA2VBWEvQNrat31CUbi BE9mZNt4uGr67eOn8AZRIoiTaFfFjIdDTs4D2hi/FhVM/J0MhOEVAWU73bNJ5vWnHowX GGSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1qfqf2+RZ7/nECKRmQQUpg370xXB5mfljF1ZyOfI82Q=; fh=5BltEAHXpG025PGKTvVeKAiOpt+M9+YrzTr7yOW7p1o=; b=QwHDaaMEAlxxt7GEEoOBPzqfLJIaTW7S4JDC3oVSx9mb96bz2hdQ7VCg2Ng722UUKg x7HM3Si0N8JS5JmTniOAkct//nePB9Dc+5+FETWTaJhE5m1loswiCk5GcCvcleNUxMM/ Du8tnPLi6r2Xw2kNYJHrkJG81gy4qCaCWW0d5t2QHohu7R5BeUcMldGbBpnSjzf8wJWr GshwGwK81Zejj9YWgzOM92XK3zx/F6kpoP1tB/Tn9uhGtLDjpcgCz3WsNngAoGseiEEN XsAf0A224LZ6vO6+oaWg6ePlaqapkyN+EAw1PeES5FRNVPI/6YSDMVwBpgtyEj2OM2Go BMHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L89B5vte; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y7-20020a1709029b8700b001c7342b46e4si10696545plp.23.2023.11.27.19.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 19:02:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L89B5vte; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 33A3582D74C2; Mon, 27 Nov 2023 19:02:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234512AbjK1DCI (ORCPT + 99 others); Mon, 27 Nov 2023 22:02:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjK1DCH (ORCPT ); Mon, 27 Nov 2023 22:02:07 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92601E6; Mon, 27 Nov 2023 19:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701140533; x=1732676533; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=GHfgwWLsu9jzuKtJnQ3BCNFmuSuFaxa27DukiFUuftg=; b=L89B5vte26YSR3O+wlziguUYlBrUE0Cru0rGnc5X/J09a3fR1RfXFRw5 DlAdgz7lUbRivW7XPFVKARXsSDA/d3uzBHfX/rb8KZJLolrC80+gRU8Hp cdVK9fy/50J1PfawD1PxRa0wDrva088lDQkhwIZUHe+28Eu8UN54+DScr HQyQ6oLdHfWaKqKB16AsdQYvTlNfceyFNQizYjP4p+Tgy/EK3FJ8ZrN9m hJ5NASj/PwbRkIn28V7mz9/rGxImxYxNNEwwUARKzQsjPYhfaTSvTwTbm /S4jnggwiGkRg2ZU7yws+ytU9mMLSylnbpT/cz21rdDkEfUck8soZSCdd A==; X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="457170208" X-IronPort-AV: E=Sophos;i="6.04,232,1695711600"; d="scan'208";a="457170208" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 19:02:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,232,1695711600"; d="scan'208";a="16482931" Received: from lkp-server01.sh.intel.com (HELO d584ee6ebdcc) ([10.239.97.150]) by orviesa001.jf.intel.com with ESMTP; 27 Nov 2023 19:02:07 -0800 Received: from kbuild by d584ee6ebdcc with local (Exim 4.96) (envelope-from ) id 1r7oMP-0006v8-1E; Tue, 28 Nov 2023 03:02:05 +0000 Date: Tue, 28 Nov 2023 11:01:50 +0800 From: kernel test robot To: Mario Limonciello , Mateusz =?utf-8?Q?Jo=C5=84czyk?= , Alessandro Zummo , Alexandre Belloni Cc: oe-kbuild-all@lists.linux.dev, "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" , open list , 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 , Borislav Petkov , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Mario Limonciello Subject: Re: [PATCH v3 3/4] rtc: Add support for configuring the UIP timeout for RTC reads Message-ID: <202311280845.YrtuJ0eq-lkp@intel.com> References: <20231127192553.9734-4-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231127192553.9734-4-mario.limonciello@amd.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 27 Nov 2023 19:02:27 -0800 (PST) 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 | 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