Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1135956ybv; Thu, 13 Feb 2020 16:37:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyjMFVsyKKUkhVdLagBL0Wav6gVOhdhpiW3uNL/XltA0tykvs0EKmwLGZeIpbG2QHofcpEf X-Received: by 2002:a9d:6418:: with SMTP id h24mr190260otl.172.1581640651957; Thu, 13 Feb 2020 16:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581640651; cv=none; d=google.com; s=arc-20160816; b=zNDEXFTuPbBhnqTYJgqeb6UbyjQPZU124iYxP9x3Wrm84cJol3BC48wb5bDnoEcVem VugRlHFZ2sPHexCfFljjHlG4ybXyjHJqxx+JQWqc9e+slPlO/xz5//rqU1l66pQQKd8a 1YsN2/fJUoSlPARgYOrSa2D1oF/9VNW1m9mYzLzdIdOACfvIQKZosMmoW7QYxH18OwcG GDyzA8BroMxqs+dSVX0kFgNjKqdTexbScqxXvTXuqIzHctt5UHY+Po6QD71BQYCPXw9U A2QY0JqtwdR9zEBpXFVA7rPdBtTvwwoajtrevqyt9V6KbQJAryCFFLJDe5Qlmp2zqAQ4 rNUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=7l7oqozMjaUQwtb4t2bK1a6PNq8VKM6kWEpkQdB5Vic=; b=qs8fuFmh5ha+nFCSFBNgFAZPqu6kNp1Xi9G8/c4xi4agsuQk0Rc74/Gu6/HnJlV8le EeVeulBNrAYFLGkgyJ2GNKbJbWI2y7AJw1AONWX4JCkc0EtCRmFxSGgBzzGCBeo4v/9d Ev0KgashBV3eGsygI7vtiu5RbZOlOJeq5/oiJdJLA8wSdEfhwoCizPLKorjcrEv8q9+f iOWagJNas6JqPtFPdbbajWThhzbxR3YTc8TWIqAttQTq0Lv17oMLqqblXdRqh/ulwq22 f2healxVLloI0orCQPJpiafytd9euXT88u6coZof8gNPtFDXowvstRZYWA6gGD6OQMim 5fXg== 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 i15si2006947otk.120.2020.02.13.16.37.19; Thu, 13 Feb 2020 16:37:31 -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 S1728033AbgBNAgJ (ORCPT + 99 others); Thu, 13 Feb 2020 19:36:09 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:53556 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727594AbgBNAgJ (ORCPT ); Thu, 13 Feb 2020 19:36:09 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j2Oxa-0005sT-OQ; Fri, 14 Feb 2020 01:35:58 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 39163101115; Fri, 14 Feb 2020 01:35:58 +0100 (CET) From: Thomas Gleixner 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, valentin.schneider@arm.com, rjw@rjwysocki.net, ionela.voinescu@arm.com 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 Subject: Re: [PATCH v3 7/7] clocksource/drivers/arm_arch_timer: validate arch_timer_rate In-Reply-To: <20200211184542.29585-8-ionela.voinescu@arm.com> References: <20200211184542.29585-1-ionela.voinescu@arm.com> <20200211184542.29585-8-ionela.voinescu@arm.com> Date: Fri, 14 Feb 2020 01:35:58 +0100 Message-ID: <87mu9mgg41.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ionela Voinescu writes: > 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. > > 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 So this patch is from Valentin. Where is his Signed-off-by? > > +static int validate_timer_rate(void) > +{ > + if (!arch_timer_rate) > + return -EINVAL; > + > + /* Arch timer frequency < 1MHz can cause trouble */ > + WARN_ON(arch_timer_rate < 1000000); This does not make sense to me. If the rate is out of bounds then why warn an just continue instead of making it fail? Thanks, tglx