From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 174C5C433C1 for ; Wed, 24 Mar 2021 06:15:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFD1E619E4 for ; Wed, 24 Mar 2021 06:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233174AbhCXGP1 (ORCPT ); Wed, 24 Mar 2021 02:15:27 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:61347 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232833AbhCXGPC (ORCPT ); Wed, 24 Mar 2021 02:15:02 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4F4ydH3K1sz9v0SD; Wed, 24 Mar 2021 07:14:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id S9cQDlsfD6rS; Wed, 24 Mar 2021 07:14:59 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4F4ydH2Qgmz9v0SB; Wed, 24 Mar 2021 07:14:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2E5498B812; Wed, 24 Mar 2021 07:15:00 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id B0ip2SmJdw6T; Wed, 24 Mar 2021 07:15:00 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5800D8B76A; Wed, 24 Mar 2021 07:14:59 +0100 (CET) Subject: Re: [PATCH v2 -next] powerpc: kernel/time.c - cleanup warnings To: Alexandre Belloni , He Ying Cc: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, a.zummo@towertech.it, npiggin@gmail.com, msuchanek@suse.de, tglx@linutronix.de, peterz@infradead.org, geert+renesas@glider.be, kernelfans@gmail.com, frederic@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org References: <20210323091257.90054-1-heying24@huawei.com> From: Christophe Leroy Message-ID: <95cd80c5-40ff-1316-9c89-2e8e7836fb6a@csgroup.eu> Date: Wed, 24 Mar 2021 07:14:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 24/03/2021 à 00:05, Alexandre Belloni a écrit : > On 23/03/2021 23:18:17+0100, Alexandre Belloni wrote: >> Hello, >> >> 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. >> > > Ok so rtc_lock is not even used by the char/nvram.c driver as it is > completely compiled out. > > I guess it is fine having it move to the individual platform as looking > very quickly at the Kconfig, it is not possible to select both > simultaneously. Tentative patch: > Looking at it once more, it looks like including linux/mc146818rtc.h is the thing to do, at least for now. Several platforms are defining the rtc_lock exactly the same way as powerpc does, and including mc146818rtc.h I think that to get it clean, this change should go in a dedicated patch and do a bit more and explain exactly what is being do and why. I'll try to draft something for it. He Y., can you make a version v3 of your patch excluding the rtc_lock change ? Christophe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8FBCC433C1 for ; Wed, 24 Mar 2021 06:15:29 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 987E661974 for ; Wed, 24 Mar 2021 06:15:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 987E661974 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4F4ydp4P5tz3bqH for ; Wed, 24 Mar 2021 17:15:26 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr; envelope-from=christophe.leroy@csgroup.eu; receiver=) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4F4ydR4Kvjz2yy4 for ; Wed, 24 Mar 2021 17:15:03 +1100 (AEDT) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4F4ydH3K1sz9v0SD; Wed, 24 Mar 2021 07:14:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id S9cQDlsfD6rS; Wed, 24 Mar 2021 07:14:59 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4F4ydH2Qgmz9v0SB; Wed, 24 Mar 2021 07:14:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2E5498B812; Wed, 24 Mar 2021 07:15:00 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id B0ip2SmJdw6T; Wed, 24 Mar 2021 07:15:00 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5800D8B76A; Wed, 24 Mar 2021 07:14:59 +0100 (CET) Subject: Re: [PATCH v2 -next] powerpc: kernel/time.c - cleanup warnings To: Alexandre Belloni , He Ying References: <20210323091257.90054-1-heying24@huawei.com> From: Christophe Leroy Message-ID: <95cd80c5-40ff-1316-9c89-2e8e7836fb6a@csgroup.eu> Date: Wed, 24 Mar 2021 07:14:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, a.zummo@towertech.it, geert+renesas@glider.be, peterz@infradead.org, frederic@kernel.org, linux-kernel@vger.kernel.org, npiggin@gmail.com, paulus@samba.org, kernelfans@gmail.com, tglx@linutronix.de, msuchanek@suse.de, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Le 24/03/2021 à 00:05, Alexandre Belloni a écrit : > On 23/03/2021 23:18:17+0100, Alexandre Belloni wrote: >> Hello, >> >> 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. >> > > Ok so rtc_lock is not even used by the char/nvram.c driver as it is > completely compiled out. > > I guess it is fine having it move to the individual platform as looking > very quickly at the Kconfig, it is not possible to select both > simultaneously. Tentative patch: > Looking at it once more, it looks like including linux/mc146818rtc.h is the thing to do, at least for now. Several platforms are defining the rtc_lock exactly the same way as powerpc does, and including mc146818rtc.h I think that to get it clean, this change should go in a dedicated patch and do a bit more and explain exactly what is being do and why. I'll try to draft something for it. He Y., can you make a version v3 of your patch excluding the rtc_lock change ? Christophe