Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5911924ybv; Wed, 12 Feb 2020 02:34:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzInad1aJ1FmCduowPB7UiPAtu7b4oqX2lN926T39x7y5fHFhCWYariertRP2g5gpYLGuhS X-Received: by 2002:aca:f20b:: with SMTP id q11mr5526223oih.78.1581503676451; Wed, 12 Feb 2020 02:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581503676; cv=none; d=google.com; s=arc-20160816; b=tkLcBsAYaBBPmqBYlCWD6X5pN2ddVaQdvmKgkU8/EoP9KoOwePEBqLwa/eh8leNEwz DBUGlYPunkrSgcfvcL+Cc61FixY4nbspkEevR+pDE1cyVK564oXfRyjQkgs5ndUt8oBy tkPaAof2Jmvc1t4DmalIi5z4Yb4sGLifUz9yIvW1sts9Kw22rtkEqIeco0k95FUpdCcR Q31IfB2DG4WQkoq92RD/XFhBtJ5jJLO0CrB41MO1CcCTel23sFs9TX+2T1xI+ukW0aMQ gzm2IgfS9MM9kS2iL3lhNhmUziigJoLRZMexsyMRRnQHuIGplCb8IHup7FN2AZpHNNh9 N1/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0hV96/7i31S+cYUPYRcawHLyJPzMRbEqPjT15tSdG/s=; b=JgsGrwzn8xvdVXGAN21Vrr8NEf9Mm41zAiU3FUlC4fEJFdMOIVhpWSsMNqmXR2Rhew 7NLrAo7MWUbrEwEP02OPY89a/lE8s4JnduSshzV8j1yjK5CcYi4XTU41w6Tx2d4xv9va 86gbZwoj+gHYCNR17DW85zSvn9CERlfwmDyabWcDBykzWZis7oPTFsss4WeVcKFw7y/A DhsifiQqIxiawp9VjIzC+ConqkqH48NU/tbJDqHgT7gGblbq8+Zba9Be//9EaICJeDlh amyHj5BR0gnat+xvG/CkEE0p3/NmOXW9Mccni1jzWhz7bqaIwiKMPc4QkcxtKhWiPX/S w6tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si690otm.111.2020.02.12.02.34.23; Wed, 12 Feb 2020 02:34:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727849AbgBLKcy (ORCPT + 99 others); Wed, 12 Feb 2020 05:32:54 -0500 Received: from foss.arm.com ([217.140.110.172]:58812 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgBLKcw (ORCPT ); Wed, 12 Feb 2020 05:32:52 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C589330E; Wed, 12 Feb 2020 02:32:51 -0800 (PST) Received: from localhost (unknown [10.1.198.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 61A953F68F; Wed, 12 Feb 2020 02:32:51 -0800 (PST) Date: Wed, 12 Feb 2020 10:32:49 +0000 From: Ionela Voinescu To: Valentin Schneider Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, maz@kernel.org, suzuki.poulose@arm.com, sudeep.holla@arm.com, lukasz.luba@arm.com, rjw@rjwysocki.net, peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, viresh.kumar@linaro.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v3 7/7] clocksource/drivers/arm_arch_timer: validate arch_timer_rate Message-ID: <20200212103249.GA19041@arm.com> References: <20200211184542.29585-1-ionela.voinescu@arm.com> <20200211184542.29585-8-ionela.voinescu@arm.com> <05e257b6-0a39-135d-8117-7883739538c3@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05e257b6-0a39-135d-8117-7883739538c3@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Valentin, On Wednesday 12 Feb 2020 at 09:30:34 (+0000), Valentin Schneider wrote: > On 11/02/2020 18:45, Ionela Voinescu wrote: > > From: Valentin Schneider > > > > Using an arch timer with a frequency of less than 1MHz can result in an > > incorrect functionality of the system which assumes a reasonable rate. > > > > One example is the use of activity monitors for frequency invariance > > which uses the rate of the arch timer as the known rate of the constant > > cycle counter in computing its ratio compared to the maximum frequency > > of a CPU. For arch timer frequencies less than 1MHz this ratio could > > end up being 0 which is an invalid value for its use. > > > > I'm being pedantic here (as usual), but I'd contrast this a bit more. The > activity monitor code checks by itself that the ratio doesn't end up being > 0, which is why we don't slam the brakes if the arch timer freq is < 1MHz. > > It's just a CNTFRQ sanity check that goes a bit beyond the 0 value check, > IMO. > I agree, but this part was just given as an example of functionality that relies on a reasonable arch timer rate. The AMU code checks for the ratio not to be 0 so it does not end up breaking frequency invariance. But if the ratio does end up being 0 due to the value of arch_time_rate, we bypass the use of activity monitors which I'd argue it's incorrect functionality by disabling a potential better source of information for frequency invariance. But I can rewrite this part for more clarity. > > Therefore, warn if the arch timer rate is below 1MHz which contravenes > > the recommended architecture interval of 1 to 50MHz. > > > > Signed-off-by: Ionela Voinescu > > Cc: Mark Rutland > > Cc: Marc Zyngier > > ISTR something somewhere that says the first signoff should be that of the > author of the patch, and seeing as I just provided an untested diff that > ought to be you :) Will do! Thanks, Ionela.