Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5863086ybv; Wed, 12 Feb 2020 01:32:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyuktibWnc+GCniurwGN/WZqOp66vUDE+G3zIyMhU8VSQhJoaT7jYtBiDGVe5vhBT8dvtCF X-Received: by 2002:aca:3805:: with SMTP id f5mr5617101oia.6.1581499925707; Wed, 12 Feb 2020 01:32:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581499925; cv=none; d=google.com; s=arc-20160816; b=UKfgOjx6XiAeGy8XvjEKuzQlbTVIacF2gYD/ubFIx9pRYJu8ro1LxhZo3E3y3Weuoz pQbelIPtuq2Sy0WuLcyjdsvc+KMEdlQ2UbtDDbGljOClSxK2/TVoWfMdeNlJn2YXmTDU XKecgTRhmIESSdIhkK4tSED+uSEYwMJFmhtJZDmdgHplypfU1iY8QI9h+qyydn3PJXba shpZxwXmFYDqv9dC1+byOhDoG6haiQDziSI+jGgMCwLEhh1kKeXWNjcazIZwtDZSdxF+ Ea7Hk3scivqTVVzn0xBFBsW2ebE+mVNjlLq9EOLDBhBGu/Bg6J0fZh1hpE+7IPW/RpJl h4Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=gvfz+VPidWl4FLutFlfa+8hwFXF9tCrMPG/5dwQ7ZfQ=; b=JoYe9AQYlAR4+6ev8IchEKoT08/TTU1Jrr517AWOkLJGHzB1/eRSSLzQR58K24qndC gi55I63W8aH4xH0boPmQ/mV7cChZL2YQCuSRFSGujtDLJfCG5Koo+8poWU44BNr0m7ru kUyzVx9bQjmWRu9khJWSZ/+zXnm0pXs45gYPS0ARCdIDrrDrjCmVHIXUcgIDtz7bZOu1 B1ZnlmrmARqb3Z28vneaAlXlvRzXDL2+4w1+6R80puISvISv0O0bAxGy6mAhFlc5YmO8 jonw25P9lGnMIuyl+Wd3Q//VPXD/4b2Hbw3KicMNIvloJ2P43K1Dw9wqInn0kwUCyT2j 1JXA== 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 e26si2843687oii.88.2020.02.12.01.31.53; Wed, 12 Feb 2020 01:32:05 -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 S1728803AbgBLJaj (ORCPT + 99 others); Wed, 12 Feb 2020 04:30:39 -0500 Received: from foss.arm.com ([217.140.110.172]:57938 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728530AbgBLJaj (ORCPT ); Wed, 12 Feb 2020 04:30:39 -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 D521130E; Wed, 12 Feb 2020 01:30:38 -0800 (PST) Received: from [10.1.194.46] (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D400A3F6CF; Wed, 12 Feb 2020 01:30:36 -0800 (PST) Subject: Re: [PATCH v3 7/7] clocksource/drivers/arm_arch_timer: validate arch_timer_rate To: Ionela Voinescu , 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 Cc: 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 References: <20200211184542.29585-1-ionela.voinescu@arm.com> <20200211184542.29585-8-ionela.voinescu@arm.com> From: Valentin Schneider Message-ID: <05e257b6-0a39-135d-8117-7883739538c3@arm.com> Date: Wed, 12 Feb 2020 09:30:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200211184542.29585-8-ionela.voinescu@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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 :)