Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4564104ybp; Mon, 14 Oct 2019 06:41:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxM99FjRTdRxPxgLo7ueRMWFfiFYBA/WEOkhWtt0gDLs3QO7UqfXO1nrv5la7nbcmzEAYHK X-Received: by 2002:aa7:ce08:: with SMTP id d8mr29015737edv.260.1571060479190; Mon, 14 Oct 2019 06:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571060479; cv=none; d=google.com; s=arc-20160816; b=tsaG9zwtF2ZKqYd9diBlcFTou84QrkmVJgPhYqTWcEopc5wjdAnK+NQziiJRSj7s0n pTeb/l6NY79VuTR+lB6FRJG/Qeb/TkgVd02aH64cAgZxKeOKd6SlSn22038F2Uk/RLit /YRGRl4XgScZuDHVI5cHxXbSTUPqaehHR1bOImlvlDru++wmmAk/athLb8DEFUjcWqZ3 6VJKD0gWGMQMfvi6LmOU9U1Jzn4LamMJQGJATRMBoE1QflxeSLjl5D3V/pmAeSAVYtst H5vJAVA0YW6LUXY0v6OuYqubxRzIuoaloS9lvqCtK8+cMtR9kcul36UAmYNV7k7pJ5KH kK+A== 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=5rbDEkMdgIq0t6jr2rKyVrcHm4JVcqBvjSFe0GY1Jxo=; b=inaiJtjzg1zBAohsuPJmVWCCACUcYwofBgUVeMA0PhhSjtuwEXeTBXGdEEwtsvm0fW hOjByrnLpUYgTKXzBgLmWQy9pvYotosDHPBzfPkppNte9BLerO8q6Dj+QCrIOA7AAqCv MbNxsjym2OOJ8MEuKRkZ0nCjiOHFiyWRULzIi1gMpfUQyUwAzzYHpA7VzwIuI1cjUjkU VtITtF2BLKdfktQT3/170fmoJfYN9PJD6zVVVBHIuA4VkwPan/ZWZcBVxAvADdbACNOa BnR9r/xWJdUNRyBCkjtsaiuZ5tg0VR93yYH8mNIhGvEtaSPjzeMAH9+slXA9JapEglAz 5eqg== 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 r24si11257228ejs.166.2019.10.14.06.40.55; Mon, 14 Oct 2019 06:41:19 -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 S1731995AbfJNNk3 (ORCPT + 99 others); Mon, 14 Oct 2019 09:40:29 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:38698 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbfJNNk3 (ORCPT ); Mon, 14 Oct 2019 09:40:29 -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 1iK0aE-0000dA-EF; Mon, 14 Oct 2019 15:40:22 +0200 Date: Mon, 14 Oct 2019 15:40:21 +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: Message-ID: References: <20191009160246.17898-1-benjamin.gaignard@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 2:56 PM, Thomas Gleixner wrote: > > On Wed, 9 Oct 2019, Benjamin Gaignard wrote: > >> @@ -78,7 +78,7 @@ static bool tick_check_broadcast_device(struct clock_event_device *curdev, > >> { > >> if ((newdev->features & CLOCK_EVT_FEAT_DUMMY) || > >> (newdev->features & CLOCK_EVT_FEAT_PERCPU) || > >> - (newdev->features & CLOCK_EVT_FEAT_C3STOP)) > >> + tick_broadcast_could_stop(newdev)) > > No. This might be called _before_ a cpuidle driver is available and then > > when that driver is loaded and goes deep, everything goes south. > > What could be the solution to let know to tick broadcast framework that > this device > > will not be stopped (because CPU won't go in idle) ? > > I have tried to put "always-on" property on DT but it was a NACK too: > > https://lkml.org/lkml/2019/9/27/164 > > Do I have miss a flag somewhere ? 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. Thanks, tglx