Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp714511pxm; Fri, 25 Feb 2022 18:05:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5tUpTS3AragmrlVv0VVfi9n41hL3yeWicaK5MO+X75mRqmV+ngJqK5z4A4a3/URgIF9zF X-Received: by 2002:a17:903:244d:b0:150:18f3:8e98 with SMTP id l13-20020a170903244d00b0015018f38e98mr9405807pls.28.1645841148910; Fri, 25 Feb 2022 18:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645841148; cv=none; d=google.com; s=arc-20160816; b=xRZZZGDn7/iYYEhGoharPXzOvw1kT/8LvHYmYlMpySyGzOXOt6sTOt8V3FQ69KCDjA W3lj/H1s/vfOYfmAWNlLOQ9GLsgClrHZXLKmZJzcvaqqYCUw9bnJkGoOpHB5YuSCBfHj M2mO4reEdwIc+Kq1LQmlqqYDO11L0Jzi3BOMDVaPgdw4ozDyE1I6zaX9y0Jt8S6XmffK iYub6JCSBN+AG8x+naG9KmJ/XRc1J88fkG5QLXbzpapkRReSaP+lM0QkO4qMFVcwq9LF 22uY3lF7ek1AEi/qiiQOMiGAb/4Ve75SQxmRZMMOJlnNyj4V0ea8DSSns4QvnSDQDaM/ ip4A== 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=4TpFdWGGu68hiozG5aqHPRXt94qhCk+o6JG516+kdbE=; b=ED8QbXqoEs0MrhGO+3KeLfph9ywKEvBye2DjjXBX7hQOee0l30ahtJZlxG51ltXI8a zM0ELvuT5Ld+bHgJwaWDtJSJ4M8S5/lQHvenx9GJ9I0aWXlPxBIfh3g0DljWrJUPru7M 2TsFLEun9g/DqfFdYn/AHVkXM8gIHtStrnW8RI0G8vXcXnFYh3IAZuYRaPW4hn3reaRN D+WQJmyZyvpphB0mUkbpJ2FewHJGgtRsZQw7+SqTHTh+e8glSTWrUDQsZGzgJ0iIIMJB eNFK/+gH3nj7w2ucs9/5rqZch0ylCxd+nN0GeZ7ATbHBlGhBTNstOE0C7Z7YBOuDh+zr FEmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=DzGxjc6L; 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 q91-20020a17090a1b6400b001bc8b90ee8csi9866428pjq.190.2022.02.25.18.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:05:48 -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=DzGxjc6L; 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 C80EF23EC74; Fri, 25 Feb 2022 17:44:21 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239914AbiBZADT (ORCPT + 99 others); Fri, 25 Feb 2022 19:03:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239844AbiBZADR (ORCPT ); Fri, 25 Feb 2022 19:03:17 -0500 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CF1A157200 for ; Fri, 25 Feb 2022 16:02:44 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id j5so5595463ila.2 for ; Fri, 25 Feb 2022 16:02:44 -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=4TpFdWGGu68hiozG5aqHPRXt94qhCk+o6JG516+kdbE=; b=DzGxjc6L9fhiwmV2m0lZXtTqNZOD0d6unMPEKi/4vECMwSDnZGJKgitxTQY+EiEGfy XquzQiMm6zyfeB2uD/xjaAvx/63eP9LCMpLBaaYVhBv327i4srbO4RFScHr69DptsG+L emmu5kQvsQAaBRhnQy43NaHkWsS8brDZvR1RU= 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=4TpFdWGGu68hiozG5aqHPRXt94qhCk+o6JG516+kdbE=; b=QAvgZRunuVfWc4YRYDQREOx+6aVBhus0pZlBBRpLTT/SKVl7cm0TOp51XSo55GKtmZ Nodkc4Xj9/70iExyuID3l6YledcepcsKjRxfuZBnQL8NCPGEMFJCdwn0em9ECseoH+0A 7xn/PC/WmOLacnmYZcOiHAkF2YeoSuu2i7yY+t6xmoHhBZ9uW0fcI5FseTXxZpacZC9P gwbAgezED2T9B6TRy+20JGBg+cQrS3F3EamPe9LINUOSbvMXXNKo9ML2JDbwRpL2DPsH U0eu/S5HwxWiKr7wyITDx4b0KfsOBMuFtQSPYbjMRPA5bPPH/pXh6Uj+unSs/ulk53hg JDUQ== X-Gm-Message-State: AOAM532ktZYjpw8mFJDWltBMmOSTclp2i/2EcgUiSfwB/Y+6Pf08Clgq IsPZIYeepypnXXhQBRRcUZQzqg== X-Received: by 2002:a92:cf43:0:b0:2c2:841e:b03b with SMTP id c3-20020a92cf43000000b002c2841eb03bmr8009336ilr.68.1645833763950; Fri, 25 Feb 2022 16:02:43 -0800 (PST) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id h6-20020a056e021b8600b002bf45d43938sm2400916ili.86.2022.02.25.16.02.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Feb 2022 16:02:43 -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> <6d8f500d-0ee0-3e27-dfdf-e8c0a34880e5@linuxfoundation.org> From: Shuah Khan Message-ID: Date: Fri, 25 Feb 2022 17:02:43 -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: <6d8f500d-0ee0-3e27-dfdf-e8c0a34880e5@linuxfoundation.org> 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/25/22 1:56 PM, Shuah Khan wrote: > 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 > Applied to linux-kselftest next for Linux 5.18-rc1 thanks, -- Shuah