Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4575586ybp; Mon, 14 Oct 2019 06:52:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtH06CF99LusAelAffngsXMEesqsDwAmnPHt/S7ZlzDfiHm1ejRlHtniP/xSaR2XzhlG6P X-Received: by 2002:a17:906:cc90:: with SMTP id oq16mr28358307ejb.322.1571061163462; Mon, 14 Oct 2019 06:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571061163; cv=none; d=google.com; s=arc-20160816; b=Zl/DLGXuwEr2C4uq/qY1cB7v2P0Zy70AoyfmX8cHVOUD3E1gxUOXS9d0Bp8vU8xmyk g3/c7P4qjZLWLbDNC0QnJm7/y6EYi/AmfN4t8lW7aILImE0pkbAvzge4oniG0RxFiyeF oYsQndT/Hbuu5ixtBChhghGQsMyFxS/Y8YTGu8sdPcv4FETDdJ332ceUUgdroVHuFkUK S0QWyJRnS+geglsA5mQ3HX6FKjgevcjmRblrPlQ4Srm1LFtjtlZbZOj3aDl5LXvSbJVK v7qhwITyPMU0DonTXZYTaHzylPtK7VzcQ17231c9vI/jS7PnSarb7DfndKD/8yzPzxqO GfcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:cc:from:date:content-transfer-encoding:mime-version :subject:to; bh=FK4H9nqZXj8FY289CupKurjRx/srR0JOqwMy6H8q9Vc=; b=dndI/hJdDWxvVqo92V5yNHAPdiniQvxUXgpYIPl4PzFH7EzQD9ixg+QYk58ED353Do 3EO1Ftfuw/EjvzRU89ha/6/LeAXFEOgLThqkwYT4dpX0PxI9DUdTwEvuj3Mh+D41aTaL yw3X1q8+4LZ7SdljkgSXKOmFz1bhHa0K6PmFnadsrvlYfYtSeailPFL7RbfkTkfBub8X u3fco3//1LUcJy1Z440Ox1BpWnKe3WDTzW2GyKwv7ekbZkpM+7CCd8FAkI3kbEJCMNNs 2YvYvOzI/XuuCQTiQRQSEHBD7JsinwXwmVl7e+frzosj+fCf9pOxOL/wpKKzeF88TGt6 rGSg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si13854796edd.249.2019.10.14.06.52.20; Mon, 14 Oct 2019 06:52:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732303AbfJNNtF (ORCPT + 99 others); Mon, 14 Oct 2019 09:49:05 -0400 Received: from inca-roads.misterjones.org ([213.251.177.50]:57382 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732275AbfJNNtE (ORCPT ); Mon, 14 Oct 2019 09:49:04 -0400 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1iK0iY-0001Qb-NC; Mon, 14 Oct 2019 15:48:58 +0200 To: Benjamin GAIGNARD Subject: Re: [PATCH] ARM: dts: stm32: Enable high resolution timer X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 14 Oct 2019 14:48:58 +0100 From: Marc Zyngier Cc: Alexandre TORGUE , , , , , , In-Reply-To: <61dda183-cd53-153b-8ed1-e2ecb8f96e03@st.com> References: <20190927084819.645-1-benjamin.gaignard@st.com> <341949c8-7864-5d65-2797-988022724a4c@st.com> <69af57d1-13a9-9e35-78f2-4a0d17bdaf6d@st.com> <61dda183-cd53-153b-8ed1-e2ecb8f96e03@st.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: benjamin.gaignard@st.com, alexandre.torgue@st.com, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-10-14 10:31, Benjamin GAIGNARD wrote: > On 9/27/19 2:59 PM, Marc Zyngier wrote: >> On 2019-09-27 13:44, Benjamin GAIGNARD wrote: >>> On 9/27/19 2:41 PM, Marc Zyngier wrote: >>>> On 2019-09-27 13:36, Benjamin GAIGNARD wrote: >>>>> On 9/27/19 1:22 PM, Marc Zyngier wrote: >>>>>> On 2019-09-27 09:48, Benjamin Gaignard wrote: >>>>>>> Adding always-on makes arm arch_timer claim to be an high >>>>>>> resolution >>>>>>> timer. >>>>>>> That is possible because power mode won't stop clocking the >>>>>>> timer. >>>>>> >>>>>> The "always-on" is not about the clock. It is about the >>>>>> comparator. >>>>>> The clock itself is *guaranteed* to always tick. If it didn't, >>>>>> that'd be >>>>>> an integration bug, and a pretty bad one. >>>>>> >>>>>> What you're claiming here is that your CPU never enters a >>>>>> low-power >>>>>> mode? >>>>>> Ever? I find this very hard to believe. >>>>>> >>>>>> Furthermore, claiming that always-on is the way to force the >>>>>> arch-timer >>>>>> to be an hrtimer is factually wrong. This is what happens *if* >>>>>> this is >>>>>> the only timer in the system. The only case this is true is for >>>>>> virtual >>>>>> machines. Anything else has a global timer somewhere that will >>>>>> allow >>>>>> the arch timers to be used as an hrtimer. >>>>>> >>>>>> I'm pretty sure you too have a global timer somewhere in your >>>>>> system. >>>>>> Enable it, and enjoy hrtimers without having to lie about the >>>>>> properties >>>>>> of your system! ;-) >>>>> >>>>> Hi Marc, >>>>> >>>>> This SoC doesn't have any other global timer. Use arch_time is >>>>> the >>>>> only >>>>> we have to provide hrtimer on this system. >>>> >>>> And you don't have any form of power management either? What >>>> happens >>>> when >>>> your CPU goes into idle? If your system does any form of power >>>> management >>>> *and* doesn't have a separate timer, it is remarkably broken. >>> >>> Even in low-power modes this timer is always powered and clocked so >>> it >>> is working fine. >> >> You're missing the point again. It is not about the clock, but the >> comparator >> that is internal to the CPU, and not functional when the CPU is in >> its >> lowest >> power mode. See also the verbiage in [1] (44.3 STGEN functional >> description), >> which indicates that the clock source actually dies in low-power >> mode >> (going >> against the architecture which mandates it to be always-on). >> >> Also, coming back to your earlier assertion ("This SoC doesn't have >> any other >> global timer"): The documentation at [1] shows at least 17 timers >> that >> could >> be used and avoid this dirty hack. >> >> So for what it is worth, NAK to this patch. > > > Hi Marc, > > I have listen your remarks and propose another way to solve this > issue: > > https://lkml.org/lkml/2019/10/9/690 I don't think you have. You're just trying to move the same dirty hack to another place instead of properly describing your hardware, and Thomas has pointed you in the same direction. M. -- Jazz is not dead. It just smells funny...