X-Received: by 2002:a17:90b:197:b0:1bc:5037:7c52 with SMTP id t23-20020a17090b019700b001bc50377c52mr2306987pjs.174.1645505428411; Mon, 21 Feb 2022 20:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645505428; cv=none; d=google.com; s=arc-20160816; b=iC8WCyiJ4TWh8826eWiJG9DBIuw5yT73f5TFx+x2Gsox1iM84kT+H6az6acfXd9bu0 JSg2XExPR1pCj7JZ8IQ2nmXcONUssHM1yzlyzONCGkSRobylConT8VBtr0BiULf2h6q8 k5cpHLdqcH+5yOoRJIIhWyeiILBYyLXNEvgnroTVxOMAo6KoIeeh5lcgz0vVBGAfTbCj Ryflzbwp5+RUspWN61LxIFBeIlKvZzJQ2IN9S5pr1CFBrpIG2ER+E5Mm4jKyvO6GqyQx gKcOwCBx04h0/tTEG/5qPADuVM5p94KELVWwnZug3UEPqsLnzIziXY/WUjlhiOEGuGNk Lyzg== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=06jOtXI4rzCzz8wUf9ZOcz62rwmanvbVaynL0eLkoGs=; b=UpFtwobqeSREu8+GShr4Zxg9JGrNGzltSy3Z57pqysQC3f+SxHHNbKGLgm8RbWWBLm 2DDLiMJUYSe5ryIoMp/urNqgtyFmuPd4ijLVP8WhT/tKhfaNEVi3UlvrYgctOmoBOTS2 x3IaxZzvsI2aw0YpXWsFzgi5rsKNusEGFGRv/dDIAjAPJrBetQMdELN2m4nQuNRBltzK KyfJvcgY4rQckb5mEHuhtbokWk8ViILT5cCxO7DtQsj37nqo5/USOOGrsdoENJCBGwtO 0PzLMDtO2LWXwCBSs+a/9ydFl9FClpVZvB1lQol84khkpWSiVbmqKEouUQQEEEzKzurA vhdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EHb1XOnc; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s14si12011867pfu.318.2022.02.21.20.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 20:50:28 -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=@ti.com header.s=ti-com-17Q1 header.b=EHb1XOnc; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 782B2B2388; Mon, 21 Feb 2022 20:31:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352444AbiBUQaF (ORCPT + 99 others); Mon, 21 Feb 2022 11:30:05 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349831AbiBUQaB (ORCPT ); Mon, 21 Feb 2022 11:30:01 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75BA61D0C5; Mon, 21 Feb 2022 08:29:36 -0800 (PST) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 21LGTLYg127812; Mon, 21 Feb 2022 10:29:21 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1645460961; bh=06jOtXI4rzCzz8wUf9ZOcz62rwmanvbVaynL0eLkoGs=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=EHb1XOncE8G6tEuQe9TkcoGNaB4bjwYqpKB7qWiQ8OI1FAiSnr80PTZFJF0/Z46ua Bn7cKoTSZuG+e8Yf2v38ZA+IZnkV7rPjdW7V9RWI7wxjZmLnuJVSdbCjJgiikZZLE/ ZZ0s6geRJVEUS+6J0Wceg9j/TdURUuDYfuYdUu5U= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 21LGTLEB020497 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Feb 2022 10:29:21 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 21 Feb 2022 10:29:21 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Mon, 21 Feb 2022 10:29:21 -0600 Received: from [10.249.40.134] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 21LGTKtH063338; Mon, 21 Feb 2022 10:29:21 -0600 Message-ID: Date: Mon, 21 Feb 2022 10:29:20 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCHv4 3/4] watchdog: rti-wdt: attach to running watchdog during probe Content-Language: en-US To: Jan Kiszka , Nishanth Menon CC: , , , References: <20200717132958.14304-1-t-kristo@ti.com> <20200717132958.14304-4-t-kristo@ti.com> <20220221124405.o7vda3zaswi6ycrh@favored> <8a3f83be-172b-a0c8-d4ba-befa531e52f6@siemens.com> From: Hari Nagalla In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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/21/22 10:03, Jan Kiszka wrote: >> K, so we do want a safety margin for min_hw_heartbeat_ms, make it >> larger. But I still don't think it is best achieved by bending the >> frequency. That will also affect other values, e.g. returning a wrong >> programmed timeout to userspace if that was programmed earlier, using >> the original frequency. >> > I think I'm starting to get the original logic, and the result now works > here: > > The clock driving the watchdog might be slower than thought, and then we > may time out later than intended - generally not an issue. But it may > also be faster, and then we will see an expiry earlier than what is > supposed to be configured via "heartbeat". For the latter case, we lower > the frequency virtually by 10%, crossing fingers that this is enough. > Humm.. To me it appears the intent is to adjust when the input 32KHz clock is slower? when it is slower we reduce the pulse count by 10% (assuming the crystals are with 10% off clock) so that the desired timeout is achieved with lesser pulse count? > The problems are now: > - U-Boot (as a known early watchdog starter) does not do that as well, > and we will cause at least confusion on Linux side (60s will become > 66s from Linux POV e.g., and we may expire at 54s already) > => U-Boot should add the same 10%, patch will be sent Yes, i see that we need similar adjustment in u-boot as well. > - even with U-Boot on the same page, the rounding issue will prevent > accurate calculations of derived values, namely min_hw_heartbeat_ms. > => patch to come > - and ... >