Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4937875ybl; Mon, 26 Aug 2019 19:15:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqylfQpjPE7j54a1Sr5LKdW2dDds24CGkWrLcW+yAp1FziDy6RUPnUo48TXKqY7xqGeymt5k X-Received: by 2002:a17:90a:170c:: with SMTP id z12mr23058597pjd.119.1566872127846; Mon, 26 Aug 2019 19:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566872127; cv=none; d=google.com; s=arc-20160816; b=t/iwYC1zv2A0sfxlMaoBw1JmV1Qi2M2Nt4AVdunnsL0FLwnTCUlqLlkt/QpRn9v0on Gy5V+yFNvySf0TCcPLo/HWI1QQq8BHi644CiMWxSKuH3ookD4xqMr9qUUxCIUGywQfFh X5hJTsL8x9NxxrWgMVC53W/ttHlNlWNte3mEcgJEBHzf/U/ae9CoBUe/CIRX4Qm7IakK dYvML5HA22j15b76Rr0zZqH4VOLs39CJLhyj/HfY0LVYo0o7trjYMyroWIvitgPtHY1J zazvS4nQmGy/xCKbkP9Qw0gRULxOJTs7JbAuLhCWX6aXgkemkTOI4ylWYTdJTKVJuHOz pBcg== 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:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=uQA0l1GJk9iGJeJh0pWGiUINz1Day+JaRvkFGsDez2o=; b=iPJABxAK/WCOA0nG6kD6mIBsFlDYTvmiMeh6SWNYm/ErV9omgVSSRlv9jEv6ZS6dl5 CcUL3G/ViApEtbKaxgZRWFq61F1f+jdLT8ivHhXjnSdHheLSGLhK7Z4GGSfiAJp36osS XF5NoTANOXC0HreAIslunfemPY3tBGYWjebPI7p6Z1MQj4iRMjGXO1BwMu2DBpuDARs2 7rr7QyJtJo8hvbC1cpogIzpQ5S/ftS3yxWJUeiW4Vim5d/34xOXyhluaJGHeE98M8LvN dxBdlkkDoJZ/uIe71cvxz58MMy78MLVzTMlQAoajkTCvxQyaS5/lKwkOa8Ao4MS9r67R uFqw== 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 y11si1115128pjp.54.2019.08.26.19.15.10; Mon, 26 Aug 2019 19:15:27 -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 S1728704AbfH0CNy convert rfc822-to-8bit (ORCPT + 99 others); Mon, 26 Aug 2019 22:13:54 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:57203 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfH0CNx (ORCPT ); Mon, 26 Aug 2019 22:13:53 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46HXVR3PjFz9s7T; Tue, 27 Aug 2019 12:13:51 +1000 (AEST) From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature. In-Reply-To: References: <55c267ac6e0cd289970accfafbf9dda11a324c2e.1566802736.git.christophe.leroy@c-s.fr> <87blwc40i4.fsf@concordia.ellerman.id.au> Date: Tue, 27 Aug 2019 12:13:51 +1000 Message-ID: <87v9uj2w4g.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Le 26/08/2019 à 13:41, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> sched_clock(), used by printk(), calls __USE_RTC() to know >>> whether to use realtime clock or timebase. >>> >>> __USE_RTC() uses cpu_has_feature() which is initialised by >>> machine_init(). Before machine_init(), __USE_RTC() returns true, >>> leading to a program check exception on CPUs not having realtime >>> clock. >>> >>> In order to be able to use printk() earlier, use feature fixup. >>> Feature fixups are applies in early_init(), enabling the use of >>> printk() earlier. >>> >>> Signed-off-by: Christophe Leroy >>> --- >>> arch/powerpc/include/asm/time.h | 9 ++++++++- >>> 1 file changed, 8 insertions(+), 1 deletion(-) >> >> The other option would be just to make this a compile time decision, eg. >> add CONFIG_PPC_601 and use that to gate whether we use RTC. > > Euh ... yes OK, why not. And that would help simplify many places in the > code. I can propose something in that direction, but it will be a bigger > change. Thanks. >> Given how many 601 users there are, maybe 1?, I think that would be a >> simpler option and avoids complicating the code / binary for everyone >> else. > > However this patch doesn't complicate things more than it was with > cpu_has_feature() which does exactly the same but using static keys, > does it ? It's more complicated in that it's not using cpu_has_feature() it's doing some custom thing that is not used anywhere else. But yeah I guess it's not much extra complication. cheers