Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4866pxf; Wed, 24 Mar 2021 19:00:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCLDhpN2lmS+X+VRQqEG+Bz4NlURdlGIc3rl3Ix6gWdUTSxdZuu+bF8RqlVsvFa4koXCGT X-Received: by 2002:a17:906:22d2:: with SMTP id q18mr6770178eja.437.1616637638495; Wed, 24 Mar 2021 19:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616637638; cv=none; d=google.com; s=arc-20160816; b=Tgp6jlsPj5m45y/a0vj+EoS82O7AI9bGP/NVAOMtF997htEPqFOR7v9TS+02SjuH1A ZXuzMgAFy/SgsPqBWA3bFhI10CvfPEZecAHbg96ykOPakqODLrAP2tCzq1s+H/BbMUBM m5BSd/K4NIIBJhPiG/THDMeTD4RdtVlIe0+IMn95wrNVnrtYz3WkJdHvNtkp2lMW/73i YzJETikOYA/22VR5W+MPmBzogXyeJOjwG2AbVxUKSq9I9+3n7YdlIUC5WzmDjko0/p2Z vWNHnQlMTwJzHBLvsc3LkPx6jWH3V5komCZxqRT+1qViuRU7jwapyh14xd+D2dWvNyQN fpyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=EtS80WqB3SvFg/g6Y7rgYllhw8uXOSVDkCpyex7eWV4=; b=aknlOKwVREStYoWR1bcyaIQQb0xQbtt9evxzumYlf75LO9Ao78miiv5uPa6MLg24rP rhcaHdfcp+MhnfJFfhOjcSGYK370wxadmpe2WRQOtONCDWNY3CX6MaE8hVBcXXkgBKq1 vcn1TUT+fcAa9NyeOJI/fALW0bfMu56x9WK7pzjJoVH8pPFRHQCFCW5adjUN0u+YZVaB nKVtZuc2u3TlxpYjg4CtNsX350KtW9berDwgNCcfePZ0G2WCDW6Gc5xSqByc8yyQviYC iEsmC139iTklR/Y8YqMqGDARODSDdG0438m/dD8iRcdc0j2zHWmK9etxUa11xK19VVq2 CO4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si3363742eje.499.2021.03.24.19.00.14; Wed, 24 Mar 2021 19:00:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234479AbhCXJJr (ORCPT + 99 others); Wed, 24 Mar 2021 05:09:47 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:52855 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234200AbhCXJJS (ORCPT ); Wed, 24 Mar 2021 05:09:18 -0400 X-Originating-IP: 90.65.108.55 Received: from localhost (lfbn-lyo-1-1676-55.w90-65.abo.wanadoo.fr [90.65.108.55]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id BE7824000B; Wed, 24 Mar 2021 09:09:14 +0000 (UTC) Date: Wed, 24 Mar 2021 10:09:14 +0100 From: Alexandre Belloni To: Geert Uytterhoeven Cc: He Ying , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Alessandro Zummo , Christophe Leroy , Nicholas Piggin , Michal Suchanek , Thomas Gleixner , Peter Zijlstra , Geert Uytterhoeven , kernelfans@gmail.com, frederic@kernel.org, linuxppc-dev , Linux Kernel Mailing List , linux-rtc@vger.kernel.org Subject: Re: [PATCH v2 -next] powerpc: kernel/time.c - cleanup warnings Message-ID: References: <20210323091257.90054-1-heying24@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/03/2021 09:19:58+0100, Geert Uytterhoeven wrote: > Hi Alexandre, > > On Tue, Mar 23, 2021 at 11:18 PM Alexandre Belloni > wrote: > > On 23/03/2021 05:12:57-0400, He Ying wrote: > > > We found these warnings in arch/powerpc/kernel/time.c as follows: > > > warning: symbol 'decrementer_max' was not declared. Should it be static? > > > warning: symbol 'rtc_lock' was not declared. Should it be static? > > > warning: symbol 'dtl_consumer' was not declared. Should it be static? > > > > > > Declare 'decrementer_max' and 'rtc_lock' in powerpc asm/time.h. > > > Rename 'rtc_lock' in drviers/rtc/rtc-vr41xx.c to 'vr41xx_rtc_lock' to > > > avoid the conflict with the variable in powerpc asm/time.h. > > > Move 'dtl_consumer' definition behind "include " because it > > > is declared there. > > > > > > Reported-by: Hulk Robot > > > Signed-off-by: He Ying > > > --- > > > v2: > > > - Instead of including linux/mc146818rtc.h in powerpc kernel/time.c, declare > > > rtc_lock in powerpc asm/time.h. > > > > > > > V1 was actually the correct thing to do. rtc_lock is there exactly > > because chrp and maple are using mc146818 compatible RTCs. This is then > > useful because then drivers/char/nvram.c is enabled. The proper fix > > would be to scrap all of that and use rtc-cmos for those platforms as > > this drives the RTC properly and exposes the NVRAM for the mc146818. > > > > Or at least, if there are no users for the char/nvram driver on those > > two platforms, remove the spinlock and stop enabling CONFIG_NVRAM or > > more likely rename the symbol as it seems to be abused by both chrp and > > powermac. > > IIRC, on CHRP LongTrail, NVRAM was inherited from CHRP's Mac ancestry, > not from CHRP's PC ancestry, and thus NVRAM is not the one in the > mc146818-compatible RTC. > > http://users.telenet.be/geertu/Linux/PPC/DeviceTree.html confirms that, > showing that nvram is a different device node than rtc. > Yes, what I missed was the ifdefery in drivers/char/nvram.c that makes it a completely different driver on both platforms. I tend to forget about that as reading this driver is not a pleasant experience. I would really like to get rid of the x86 part which would in turn allow to remove the global rtc_lock spinlock on all architectures. -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com