Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp49440rdd; Wed, 22 Nov 2023 09:06:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNFe/RqjM9C9N5yvCV+igS12hGOrDUFPIA4ImDclIgqYjjl+X6OAv+zcn3YofcVg1PfmAM X-Received: by 2002:a05:6a00:2d95:b0:68e:3f0b:5e6f with SMTP id fb21-20020a056a002d9500b0068e3f0b5e6fmr3340127pfb.24.1700672809469; Wed, 22 Nov 2023 09:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700672809; cv=none; d=google.com; s=arc-20160816; b=J28QPLHCoruqfRTyL8tXo9d3NFNV2w+3i62S6jCQpKEkwIM4pZAYwA0Mi0ayKAeu9I P/nO9c63gD0eLGkzbMaxiR6Cz2nx/qInwB1EAgCfxDsMlx3WCtQRqoDZoypFMhOZxzuL GYZz+O6f3G4mEr2dAYE4RtzPXw2hn/AlSTsbpfYT4GDSDH0yiRlOWEEIwJRRrqYBtziu PdcFSjUzSw/Smi08Nh5Q0NFS/nDM8DCFateZ8FNWB0Z2ETiONMk5kli1llSZy5QLkSTJ hCiJ34IxXh5dFqsooGooeWXJkebgFw0D5bfEYE7Z3lC4UPWfsFPxTzNnEHHdBR9zXvnY gt2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=YH+s+mGXzXn9Z3vbD3GChpf5e7kkb+7vD/AnIKRBx+U=; fh=lluIK1XVIJhUoa46ZVmEAYdchIqUe1qMfq8xwNZtDB0=; b=Lf08HZ3+z5L5n/YU6bS6QT56KzIHU+YNg3+vymn4sIS2btXD3WhRv/BtOQGQqOnTax Z3bSHh1uvTIs7mH/4kF/qsYe3pHUnF3fsrGY1u6iCr3kB0a5MHa242s19WoQ8opGDcVi xRz3UBwb5Ec/ULK/kGaS01k3wbkqPzOP9LcGrcgiWazwJD71eVXqgh4iZ0rhbQ/uw7Sv 5hadh1cfqd5o9UMXrj+5NPfMw4+u3RMiMCDj/30GAtaLp51/85CZayv0CrOmDtF0DPuh l7770o2oYvkj4C0oJprsysA11jWlVjS5c8oMymVjS0JiLkFDIv6olghQJwRvrkKLVRWl NXMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@o2.pl header.s=1024a header.b=bHhfUM3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=o2.pl Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id a19-20020a656413000000b005c200cf68absi12879176pgv.229.2023.11.22.09.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 09:06:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@o2.pl header.s=1024a header.b=bHhfUM3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=o2.pl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3CCCC80740D4; Wed, 22 Nov 2023 09:06:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbjKVRGV (ORCPT + 99 others); Wed, 22 Nov 2023 12:06:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231708AbjKVRGU (ORCPT ); Wed, 22 Nov 2023 12:06:20 -0500 Received: from mx-out.tlen.pl (mx-out.tlen.pl [193.222.135.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B10819D for ; Wed, 22 Nov 2023 09:06:15 -0800 (PST) Received: (wp-smtpd smtp.tlen.pl 40590 invoked from network); 22 Nov 2023 18:06:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1700672769; bh=YH+s+mGXzXn9Z3vbD3GChpf5e7kkb+7vD/AnIKRBx+U=; h=Subject:To:Cc:From; b=bHhfUM3Qiu+H0Oze6p6stIQYJnDGv8AIvl30jBB7mF40h6vUnf+gdccjZuake+8X4 3JWivrXqkmvKk+nWghrHY76t/4Rbx306AbAakTxpcAeyE6habY8KvFSTPtqORdj8FS ePPwuBLhK8c6ND1zUOtzjNLe20PcNfdfR3UJW1zc= Received: from aafl106.neoplus.adsl.tpnet.pl (HELO [192.168.1.22]) (mat.jonczyk@o2.pl@[83.4.141.106]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 22 Nov 2023 18:06:08 +0100 Message-ID: <5357e62e-2b42-41bc-8c63-1bafdb461e99@o2.pl> Date: Wed, 22 Nov 2023 18:06:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] rtc: Add support for configuring the UIP timeout for RTC reads Content-Language: en-GB To: Mario Limonciello , Alessandro Zummo , Alexandre Belloni Cc: "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 References: <20231120141555.458-1-mario.limonciello@amd.com> <20231120141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MjDBYa0A3ksqD84qUBNuEKkZKgibBbs4qT35oXf kgWJtW+JziZf6LYx4WvRa80VDIIYCcQM6TrpsXIJI+su5qpzON1XJQG2iswY8PJ40pkRI9Sm kfTFrHOgiTpwZnI9saWqJh2ABavtnKZ1CtAY2VA8gmEqQeqs2hjdiNHAmRxR2wARAQABwsFl BBgBAgAPBQJajA8kAhsMBQkSzAMAAAoJEPvWWrhhCv7GhpYP/1tH/Kc35OgWu2lsgJxR9Z49 4q+yYAuu11p0aQidL5utMFiemYHvxh/sJ4vMq65uPQXoQ3vo8lu9YR/p8kEt8jbljJusw6xQ iKA1Cc68xtseiKcUrjmN/rk3csbT+Qj2rZwkgod8v9GlKo6BJXMcKGbHb1GJtLF5HyI1q4j/ zfeu7G1gVjGTx8e2OLyuBJp0HlFXWs2vWSMesmZQIBVNyyL9mmDLEwO4ULK2quF6RYtbvg+2 PMyomNAaQB4s1UbXAO87s75hM79iszIzak2am4dEjTx+uYCWpvcw3rRDz7aMs401CphrlMKr WndS5qYcdiS9fvAfu/Jp5KIawpM0tVrojnKWCKHG4UnJIn+RF26+E7bjzE/Q5/NpkMblKD/Y 6LHzJWsnLnL1o7MUARU++ztOl2Upofyuj7BSath0N632+XCTXk9m5yeDCl/UzPbP9brIChuw gF7DbkdscM7fkYzkUVRJM45rKOupy5Z03EtAzuT5Z/If3qJPU0txAJsquDohppFsGHrzn/X2 0nI2LedLnIMUWwLRT4EvdYzsbP6im/7FXps15jaBOreobCaWTWtKtwD2LNI0l9LU9/RF+4Ac gwYu1CerMmdFbSo8ZdnaXlbEHinySUPqKmLHmPgDfxKNhfRDm1jJcGATkHCP80Fww8Ihl8aS TANkZ3QqXNX2 In-Reply-To: <20231120141555.458-4-mario.limonciello@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-WP-MailID: ea291e9367221e28bf5b618e6f0cdea1 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [ITNh] X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 22 Nov 2023 09:06:34 -0800 (PST) W dniu 20.11.2023 o 15:15, Mario Limonciello pisze: > The UIP timeout is hardcoded to 10ms for all RTC reads, but in some > contexts this might not be enough time. Add a timeout parameter to > mc146818_get_time() and mc146818_get_time_callback(). > > If UIP timeout is configured by caller to be >=100 ms and a call > takes this long, log a warning. > > Make all callers use 10ms to ensure no functional changes. > > Cc: stable@vger.kernel.org # 6.1.y: commit d2a632a8a117 ("rtc: mc146818-lib: reduce RTC_UIP polling period") I was wrong and commit d2a632a8a117 ("rtc: mc146818-lib: reduce RTC_UIP polling period") is included in 6.1.y anyway (was merged before 6.1-rc1), does not have to be mentioned in the line above. > Fixes: ec5895c0f2d8 ("rtc: mc146818-lib: extract mc146818_avoid_UIP") > Signed-off-by: Mario Limonciello > --- > v1->v2: > * Add a warning if 100ms or more > * Add stable and fixes tags > --- [snip] > @@ -72,6 +76,9 @@ bool mc146818_avoid_UIP(void (*callback)(unsigned char seconds, void *param), > } > spin_unlock_irqrestore(&rtc_lock, flags); > > + if (i >= UIP_RECHECK_TIMEOUT_MS(100)) > + pr_warn("RTC took %d iterations to clear UIP\n", i); > + This warning message is difficult to understand for someone that is not familiar with the code / MC146818 documentation. "Reading current time from RTC took around %d ms" would be better. > return true; > } > return false; Greetings, Mateusz