Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4619177ybp; Mon, 14 Oct 2019 07:30:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDcWPRK6hyLWGa6PjnOMfO579vODPPZ9HycdcZGfhZZlC+igsXEdkqe6ZBp9qMHYNyocc2 X-Received: by 2002:a17:906:85c5:: with SMTP id i5mr28655790ejy.222.1571063405798; Mon, 14 Oct 2019 07:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571063405; cv=none; d=google.com; s=arc-20160816; b=hlhadvjodsNMytQk20eYX/mvphZ1pnz6HicnJOsDvgC2rlHJPzfmQMDRPTsN6HaQeY eyaf8Tjki9yo7AO5oikAoqs7nBlQ0fwjkVop5z+JRQRR6akVhwzxAJ1J3COObLRCPWNq MfjggUCK4cozD3zIKjzij+tVNCqyuu8t7Mz6IaRGI7z2Z8DdCGjDV1oIb2Vj+eH+YP8T Q3QNnoSwyVh7JDIHgDT06dOW1MZe4TUDazDbUuR6yxRzYPv6e17cwFu/tHMtMo/ZyNLu 7SGaFg/rGxuzWBx953mFX64E738fyvfQfJFV1NhCNhGJ53OnbdXtOxQOhw59Oh0sQbP4 VXZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=vO96uLl5xTysrzGvWogCOFDvztK0+AJeR6awRo/R9nU=; b=vFr6GpXkHsT9Go1S8YHJqi8vgyigVDJ/ZxWL/2HEhZi8TRpJZB5YqVcMIVAUQmtALc TWRvEIU3vKJzcRlyxoh01pCjZF7l4/jCS2HTJuIYVYYXE2pFvORvkcgLNmNW5LGIF55T x0odE/IbF0i72wlHKxc6H40GDEO78H6hjnJBZT3rTOx1v7AHwYYId2PrQgX5ks76mnXU iS7J6qZo8oo9Vz3mHXqgTYMJ5HhabdcNvkhDFEDnEaCJOhsZxlhw9bnjiFDUq0ohkS52 3HUVqJUOR4Wp8/rPuOrD9tiWGBlG1AuWGIECUyAxihif/3ou+2C2aqmqDhPEnKieZ8Er IG2Q== 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 u12si11739717ejt.21.2019.10.14.07.29.41; Mon, 14 Oct 2019 07:30:05 -0700 (PDT) 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 S1732821AbfJNO2k (ORCPT + 99 others); Mon, 14 Oct 2019 10:28:40 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:38857 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731121AbfJNO2k (ORCPT ); Mon, 14 Oct 2019 10:28:40 -0400 Received: from [5.158.153.52] (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 1iK1Kr-0001WJ-Uc; Mon, 14 Oct 2019 16:28:34 +0200 Date: Mon, 14 Oct 2019 16:28:33 +0200 (CEST) From: Thomas Gleixner To: Benjamin GAIGNARD cc: "fweisbec@gmail.com" , "mingo@kernel.org" , "marc.zyngier@arm.com" , "daniel.lezcano@linaro.org" , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" Subject: Re: [PATCH] tick: check if broadcast device could really be stopped In-Reply-To: <16f7e8e9-eefe-5973-a08a-3e1823d20034@st.com> Message-ID: References: <20191009160246.17898-1-benjamin.gaignard@st.com> <16f7e8e9-eefe-5973-a08a-3e1823d20034@st.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 Oct 2019, Benjamin GAIGNARD wrote: > On 10/14/19 3:40 PM, Thomas Gleixner wrote: > > I don't understand what you are trying to achieve here. If the tick device, > > i.e. the comparator stops working in deep idle states, then the device has > > rightfully the CLOCK_EVT_FEAT_C3STOP (mis)feature set. Which means that the > > system needs a fallback device for the deep idle case. If there is no > > physical fallback device then you should enable the hrtimer based broadcast > > pseudo tick device. > > > > If the CPUs never go deep idle because there is no idle driver loaded or > > the deep power state in which the comparator stops working is never > > reached, then the broadcast hrtimer will never be used. It just eats a bit > > of memory and a few extra instructions. > > Since CPUs won't go in deep idle I don't want to get a broadcast timer > but only an hrtimer to get accure latencies for the scheduler. What's wrong with the broadcast timer if it is never utilized? It's there, needs a few bytes of memory and that's it. > When arch arm timer doesn't set CLOCK_EVT_FEAT_C3STOP flag, my system got > a hrtimer and everything goes well. Sure, but that's applicable to your particular system only and not a generic solution. Neither your DT hack, nor the other one you posted. > If arch arm timer set CLOCK_EVT_FEAT_C3STOP hrtimer disappear (except if > I add an additional broadcast timer). Right. > What is the link between tick broadcast timer and hrtimer ? Does arch > arm timer could only implement them at the same time ? If the clock event device is affected by deep power states, then the core requires a fallback device, aka. broadcast timer, which makes sure that no event is lost in case that the CPU goes into a deep power state. If no CPU ever goes deep, the broadcast timer is there and unused. Obviously the system cannot enable high resolution timers if the clock event device is affected by power states. Unless you have a solution which works under all circumstances (and the current patch definitely does not) then you have to deal with the requirement of the broadcast timer (either physical or software based). "I don't want a broadcast timer falls" into the "I want a pony" realm. Thanks, tglx