Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4936598ybl; Mon, 26 Aug 2019 19:13:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXiLIVvZsFZ21V+KklWbt7O4IkkUglAnUyOEhziBP+wsXa7Cr4u62mWNz1OfCO/G01yzt+ X-Received: by 2002:a17:90a:342d:: with SMTP id o42mr23499404pjb.27.1566872010198; Mon, 26 Aug 2019 19:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566872010; cv=none; d=google.com; s=arc-20160816; b=pz/3doYBtbelKxeFpyDe6EWZPDkTOQ5T1/Y812thExFWngnPEis1FONiZ6bZJr1iFV /eq8Hb+KUef2Qmi3/85qaF+tTEJ7lHNgs2X7EABMR9cUPNQ4YXBbp55bA8AvZvTiNoE3 o/aafHjFKVEhCpw/CzaqPyXUiMRFSWd4WEIB7feD1kO7wdKIdVXQEv9cU9wA7gyzwBUa gFwD3WTTujJ9GIelheEDHlAIXNkZoxILqZetgO9gmKSDOdLpTIvcgWtl6APQoG2ATdxB CKgmhcZZ7Luv552YoFd1SbhL7aVFJdPKdEnevElck4xN7n4iLb6yupo/1iBs9ahfVLkE vhiA== 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=H09cTE8muhQTBpdHw9TNCyeIEeudeXAtTAu/5UJA4RY=; b=oH+vL962e34ObXNp8BuvllsDv7nCd9i8CkFb5tXRDTMdQsHbl5wd3jjz9mGvaNiGDF gARnle4rvqt4LdJiPRBVEw6sCDkmbxVhURwI08TE79vpYTJroKrIUutm7RmPTNQUgtrc N4A9vP65L+CpojyNzUtessR6gktzZIIHNTP64GU0Rfv6dO7GCeVtSqCuhdx8n9zZ32gK 5gtK9Ms8wntAlneBgUb8FxMtBI+9D4ROkgG+UI6uGEysMVBLFH8Ekt/Tq7K8RgPS3nnN U0pclpx6PE/9vjhzD1N+Baf/S+0Mu6SOngGdvHA0ZzkDFP/u/FxdFw8O1nyjR+BJ6yUn ClQA== 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 y184si12553344pfb.162.2019.08.26.19.13.13; Mon, 26 Aug 2019 19:13:30 -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 S1728648AbfH0CMY (ORCPT + 99 others); Mon, 26 Aug 2019 22:12:24 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:35597 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfH0CMX (ORCPT ); Mon, 26 Aug 2019 22:12:23 -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 46HXSj4x2Yz9s7T; Tue, 27 Aug 2019 12:12:21 +1000 (AEST) From: Michael Ellerman To: Benjamin Herrenschmidt , Christophe Leroy , 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: <60da7620a43dc29317a062f1d58dcfde8d32b258.camel@kernel.crashing.org> References: <55c267ac6e0cd289970accfafbf9dda11a324c2e.1566802736.git.christophe.leroy@c-s.fr> <87blwc40i4.fsf@concordia.ellerman.id.au> <60da7620a43dc29317a062f1d58dcfde8d32b258.camel@kernel.crashing.org> Date: Tue, 27 Aug 2019 12:12:20 +1000 Message-ID: <87y2zf2w6z.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Benjamin Herrenschmidt writes: > On Mon, 2019-08-26 at 21:41 +1000, Michael Ellerman wrote: >> 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. >> >> 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. > > Didn't we ditch 601 support years ago anyway ? We had workaround we > threw out I think... Paul said his still booted recently. cheers