Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp467pxf; Wed, 24 Mar 2021 18:52:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl5mK0u71oDpFEKWaID9B1mt8J7MK62j7fPB0zsw7XqgHcND/jvwEehSv/s7hJT21xhL5x X-Received: by 2002:a17:906:1453:: with SMTP id q19mr6890127ejc.76.1616637165898; Wed, 24 Mar 2021 18:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616637165; cv=none; d=google.com; s=arc-20160816; b=F35qdlpTNl2maaa5ijfajpXEU9Ufcd8rwnCgHMBPCQoDM6PxrhW6CS4Ja6szI/Ko+k F3oXV9wEA5MxnUCej0jYGyLGSofJ57+FhaTOcMNaRKFre5X8JTWlddsGtSlwwMnzwE01 ZKtzdyqPE/8Rg9QTo0Gxk/b8N5iTEpdlk+0jf6URcVY+GQyHTz5YIpnyV++gi9NTUTF7 +WFcmkAob88DMkfEL4yqAh+RLgLDpv9SE+wW/GbTBVLSmv3ivl9Sl2jvmrj11FnAEAuA zDlpVkMzaPbzTl9iQGDXGYacxu6yFc6d6kzWJAr3uoHIU100hOZvHtdvoLSlNnmm5G3i UMIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=KwUBvHYEaYHDyRrAyMwUvUGco+poffuLUaS3wEjSV5Y=; b=PylNdt/n8LlLwHqXKtQlgnS3676OASA6HzXF1RDWHOVArc8AbAhJrK5XQh7Os1x6Dc U/qdZ+5270r1nCB9/tR8nVrqdMYY/vrPSvbTSrWuw+n13NGCl80Ilze2KhFyoh6f13/v jFp9RA4l2vSSQB771XCAGmFnJGQcjG6+6VOrAAVYR+Pjoa763PT3yeRZntNqpL5VKG8J nqKOfRsxdJds6XCI3iQAlEEcjE31YcddPwyBi1MDSe/IyI2AVsfvHiRMpBWtw0sSSlaU Qohu/WERvlQcX/Ooetp9UxBrSvRX2llxgGhqf0C8GIsoM36+fSh0ZoSpYXAn3jEoZOLi 4meQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy27si2963561ejc.748.2021.03.24.18.52.22; Wed, 24 Mar 2021 18:52:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233651AbhCXIaD (ORCPT + 99 others); Wed, 24 Mar 2021 04:30:03 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:14883 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233644AbhCXI3x (ORCPT ); Wed, 24 Mar 2021 04:29:53 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4F51b04wnPzkdjt; Wed, 24 Mar 2021 16:28:12 +0800 (CST) Received: from [10.67.110.136] (10.67.110.136) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Wed, 24 Mar 2021 16:29:45 +0800 Subject: Re: [PATCH v2 -next] powerpc: kernel/time.c - cleanup warnings To: Christophe Leroy , Alexandre Belloni CC: , , , , , , , , , , , , , References: <20210323091257.90054-1-heying24@huawei.com> <95cd80c5-40ff-1316-9c89-2e8e7836fb6a@csgroup.eu> From: "heying (H)" Message-ID: Date: Wed, 24 Mar 2021 16:29:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; 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-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.136] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear, 在 2021/3/24 14:22, Christophe Leroy 写道: > > > Le 24/03/2021 à 07:14, Christophe Leroy a écrit : >> >> >> 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 ? >> > > Finally, I think there is not enough changes to justify a separate patch. > > So you can send a V3 based on your V1. In addition to the changes you > had in V1, please remove the declaration of rfc_lock in > arch/powerpc/platforms/chrp/chrp.h So glad to hear that. I'll do that and send my V3. Thanks.