Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp695174pxm; Fri, 25 Feb 2022 17:30:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2OK58ZPoItP5QPKrntYqBGpMwU05nca9zGD9ei7j+EFxpzmByrsw9UgBd7hFym1aJCD+V X-Received: by 2002:a17:902:f70b:b0:14d:643d:9c99 with SMTP id h11-20020a170902f70b00b0014d643d9c99mr10514062plo.18.1645839035537; Fri, 25 Feb 2022 17:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645839035; cv=none; d=google.com; s=arc-20160816; b=f74SqVyvELdTQlSFjtwvBPgqrpchfkP1RsZXYl4ZkXnziBX8vzQKn3oL8sXh9QnCBS UApq2OVLDr+W4XIIDWgePc503yiadqDkaYgiyTAZfvMuEPWfZCWOfu1AQl/egHcxRLzJ bXzkwuzDClJWXHs+6QbwNfcSyEtw3/mdXPBGeoCR/P/RNLe+b9+XY/MaOv/Hgipz4S8t dD1YZN3hAzfdYsjLj8JQM9ZHVKo/y1QPBVNjLm/4yaVgmvkXDGdVVWNltdMNfnc5u+Eo pob9Etd5+IfZGUnASUtjX8A/XrE8WH2DAvaQmjoC2ZHGQC6H4kNZhQlmJXT25T2hsT1e BPhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=huyLr7FvhwAScRTcVGfKhBUO1dK4/Q5kyJ0SythEREo=; b=rAEqsANaGyswe1DliSfLIT42gUPTt9ogZtaN/9dhisYJctYZDNYoZYYWlaA2Wq6onW sC5FMIV8XLCrZ4QXfynaI6Nj7ts73CDgpSlYFoRfW1gG2DiMBoDUM0ytWbhVJa/3Nk2X ff3qbnW+FWzxxvkdTNr0S4MuAc5Bsn9wDAy+X/Wdl7tVaYYnnE1BBqul/Tp0wTLeD3g1 voEm4C9d5ln4z0KN3XjB9YXktpTXhVXizzd286DVl3FOZYH+kViWBKulPhQjYrw1oIme Ohhmy8QX0xozUMhYpKmRZEkeBl9D5G4wJIBA7SETX1NmiLa2sAFJfjK+ZEV9uLfgUB5E RIGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Yn6P22ag; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f22-20020a17090aa79600b001bbf34ddfadsi3232905pjq.68.2022.02.25.17.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 17:30:35 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Yn6P22ag; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C8C8465D32; Fri, 25 Feb 2022 17:27:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237676AbiBYU5B (ORCPT + 99 others); Fri, 25 Feb 2022 15:57:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233762AbiBYU5A (ORCPT ); Fri, 25 Feb 2022 15:57:00 -0500 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A272221A3 for ; Fri, 25 Feb 2022 12:56:27 -0800 (PST) Received: by mail-il1-x134.google.com with SMTP id d3so5254436ilr.10 for ; Fri, 25 Feb 2022 12:56:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=huyLr7FvhwAScRTcVGfKhBUO1dK4/Q5kyJ0SythEREo=; b=Yn6P22agzPqkbTpVeCOjmOTHGBpr4GWVE7B6LdLQfZPalJ9NYVkBo77BnpBbh8qgLs pvBq2xSJR4QIEL0i44p3ajnQ4wXkbh1I2Tld1/Ekoomt2bl+8NrNFf3fnDuAsTVzzwvU wxTTwbSajWrGqWEaCzQ9hzb66qsOgpkJMftig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=huyLr7FvhwAScRTcVGfKhBUO1dK4/Q5kyJ0SythEREo=; b=AFtQKx66kAVOm89xcXXc7KRO2GbDTm66x1Ljm/7AbrrcLD/rwQ8HtgJ3SMKmTMDA65 8YICaK5b+ODDsj/vulLkIUp+P6cilxZ5hC3lgnLOgOvDoq1+0LgVdSF40KAudXj14iAI N/QLgZwZgf+NAU6xUrsNZo/FpPonTehdhlZQlJBVCk6cCx0YWTQOImctgulh/gQS2ZSz vH3t2rGtIH3SKidvSLVzzPtnIQqKH9dlmouTymLYmRSfubvULYPPEAcSfZLqDEVawEZ2 dCW8PNl1DDqWD/qetxzEmtvhY/mUeVFexsP1XxksWENokVSmqj9HNv8r6jUheAXI/AY6 1mew== X-Gm-Message-State: AOAM530L+wd8j0mGs2kGeEAI8QJ82JThYfkZTT8Pms72PC60L8pniAaO Is6A4q0Rbjw+TSKk1UdW8UWz1Q== X-Received: by 2002:a05:6e02:184c:b0:2bf:f389:1f99 with SMTP id b12-20020a056e02184c00b002bff3891f99mr8202909ilv.22.1645822586901; Fri, 25 Feb 2022 12:56:26 -0800 (PST) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id 14-20020a92180e000000b002c1bfa2a5e6sm2143693ily.65.2022.02.25.12.56.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Feb 2022 12:56:26 -0800 (PST) Subject: Re: [PATCH] selftests/rtc: continuously read RTC in a loop for 30s To: =?UTF-8?Q?Mateusz_Jo=c5=84czyk?= , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rtc@vger.kernel.org Cc: Alessandro Zummo , Alexandre Belloni , Shuah Khan , Shuah Khan References: <20220219072713.5280-1-mat.jonczyk@o2.pl> From: Shuah Khan Message-ID: <6d8f500d-0ee0-3e27-dfdf-e8c0a34880e5@linuxfoundation.org> Date: Fri, 25 Feb 2022 13:56:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220219072713.5280-1-mat.jonczyk@o2.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/19/22 12:27 AM, Mateusz Jończyk wrote: > Some problems with reading the RTC time may happen rarely, for example > while the RTC is updating. So read the RTC many times to catch these > problems. For example, a previous attempt for my > commit ea6fa4961aab ("rtc: mc146818-lib: fix RTC presence check") > was incorrect and would have triggered this selftest. > > To avoid the risk of damaging the hardware, wait 11ms before consecutive > reads. > > In rtc_time_to_timestamp I copied values manually instead of casting - > just to be on the safe side. The 11ms wait period was chosen so that it is > not a divisor of 1000ms. > > Signed-off-by: Mateusz Jończyk > Cc: Alessandro Zummo > Cc: Alexandre Belloni > Cc: Shuah Khan > --- > > Also, before > commit cdedc45c579f ("rtc: cmos: avoid UIP when reading alarm time") > reading the RTC alarm time during RTC update produced incorrect results > on many Intel platforms. Preparing a similar selftest for this case > would be more difficult, though, because the RTC alarm time is cached by > the kernel. Direct access would have to be exposed somehow, for example > in debugfs. I may prepare a patch for it in the future. > --- Looks good to me. We end up tweaking the timeout=210 in settings every now and then. Not sure how we can avoid adjusting it as we find problems. I will apply this in for Linux 5.18-rc1 thanks, -- Shuah