Message ID | 1680598864-16981-2-git-send-email-ssengar@linux.microsoft.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2881604vqo; Tue, 4 Apr 2023 02:09:03 -0700 (PDT) X-Google-Smtp-Source: AKy350YWqS4o0wA0siMx1VjiJiYfwNV0LtqIBSLpuL319D6BL21VFQziECmVhwlvhhHKOsxNpC0t X-Received: by 2002:a17:90b:1c91:b0:234:d78:9b4c with SMTP id oo17-20020a17090b1c9100b002340d789b4cmr2053185pjb.18.1680599343452; Tue, 04 Apr 2023 02:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680599343; cv=none; d=google.com; s=arc-20160816; b=FnKG4SzUgtKyPUpGBIWEeega17DxWwFeM8ifRdWkoS+BdGkvswdhb5nqLFBEwwH2fg uRGfAJbcuVHoKdgrU+310IYRWU+6FYiVkrbyQAlch14HobnZdHie36Qb6iAwSTaJyZe3 +82viHvlvrIF5tyPlsG8g70lCBUHllpZureQxqm3qXWuo8dRAZdKzYgEILj9z/8wMjDk WurS2z0XV/o/LlVneFgciBJTKNLLlSjRQyruX5IaLEiqmpCbBKaWfX1yjduFLHjkn1bv wMv+fQhihBN4pJmpE/FMQQMvoMirA9QjZPMXzqyY+m7Yf/Ei503EiSKFI9DkPv/zWdRc geiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter; bh=sYN20W6hPtwdUe2Zl//cBVNvF4+/oIZeshaAhbV6svU=; b=LXlq/3OWgrU01c9Eg31PJ9KEH7jTNfvaMcZdWb486zdGvhOUtZTwttj0OT3+oxonsC AGO0kW23M4cZo8EB0rpjr3nEJ48neTaoS9yFG9eqsKj6DUk6vK470qRZoB76w7cE6zLx ScXtzqsQ51RrXmH9rZFAdZ3fHPayZ2qxp03AxGcD+4xAwvFzjPOm57kW2JXOQXASSb4Z Vx0u4mXopkXvSwDuHI5Ajej7Grcb4zksHq0jmrPRtvIsTreyFvnwFTLTCfcOuINiu66J TJjs8AEWpsbVnPm1zeXw4DA2eJNmX9POYE3Vb4P2QSBTwoUasSXirVkp1rVc97kWzkNA pbCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=c24aht4+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ob2-20020a17090b390200b0022bb71938casi15030034pjb.50.2023.04.04.02.08.51; Tue, 04 Apr 2023 02:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=c24aht4+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234159AbjDDJBN (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Tue, 4 Apr 2023 05:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233699AbjDDJBK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Apr 2023 05:01:10 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B8C081FF2; Tue, 4 Apr 2023 02:01:09 -0700 (PDT) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 0F2A2210DD89; Tue, 4 Apr 2023 02:01:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0F2A2210DD89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680598869; bh=sYN20W6hPtwdUe2Zl//cBVNvF4+/oIZeshaAhbV6svU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c24aht4+rgL1vFOc6GlSj4vkyDCbYylqmnNBwQq8UWB2LY0NjGfwKhg8cUfsoSwjq CC5oOOk4GH6M+BpJaTfLaNVUTbwsjeKRBsZU3L93UBD4yHzDmX8gMY6oLgk+7z3XBO 1H9BaW9zObxI9Y1SEFeSDC03nsb5bjCt0KBQqNSU= From: Saurabh Sengar <ssengar@linux.microsoft.com> To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, arnd@arndb.de, tiala@microsoft.com, mikelley@microsoft.com, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-arch@vger.kernel.org, jgross@suse.com, mat.jonczyk@o2.pl Subject: [PATCH v4 1/5] x86/init: Make get/set_rtc_noop() public Date: Tue, 4 Apr 2023 02:01:00 -0700 Message-Id: <1680598864-16981-2-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1680598864-16981-1-git-send-email-ssengar@linux.microsoft.com> References: <1680598864-16981-1-git-send-email-ssengar@linux.microsoft.com> X-Spam-Status: No, score=-17.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762236136996518633?= X-GMAIL-MSGID: =?utf-8?q?1762236136996518633?= |
Series | Hyper-V VTL support | |
Commit Message
Saurabh Singh Sengar
April 4, 2023, 9:01 a.m. UTC
Make get/set_rtc_noop() to be public so that they can be used in other modules as well. Co-developed-by: Tianyu Lan <tiala@microsoft.com> Signed-off-by: Tianyu Lan <tiala@microsoft.com> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> Reviewed-by: Wei Liu <wei.liu@kernel.org> Reviewed-by: Michael Kelley <mikelley@microsoft.com> --- arch/x86/include/asm/x86_init.h | 2 ++ arch/x86/kernel/x86_init.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
Comments
On Tue, Apr 04, 2023 at 02:01:00AM -0700, Saurabh Sengar wrote: > Make get/set_rtc_noop() to be public so that they can be used > in other modules as well. > > Co-developed-by: Tianyu Lan <tiala@microsoft.com> > Signed-off-by: Tianyu Lan <tiala@microsoft.com> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> > Reviewed-by: Wei Liu <wei.liu@kernel.org> > Reviewed-by: Michael Kelley <mikelley@microsoft.com> > --- > arch/x86/include/asm/x86_init.h | 2 ++ > arch/x86/kernel/x86_init.c | 4 ++-- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h > index acc20ae4079d..88085f369ff6 100644 > --- a/arch/x86/include/asm/x86_init.h > +++ b/arch/x86/include/asm/x86_init.h > @@ -330,5 +330,7 @@ extern void x86_init_uint_noop(unsigned int unused); > extern bool bool_x86_init_noop(void); > extern void x86_op_int_noop(int cpu); > extern bool x86_pnpbios_disabled(void); > +extern int set_rtc_noop(const struct timespec64 *now); > +extern void get_rtc_noop(struct timespec64 *now); > > #endif > diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c > index 95be3831df73..d82f4fa2f1bf 100644 > --- a/arch/x86/kernel/x86_init.c > +++ b/arch/x86/kernel/x86_init.c > @@ -33,8 +33,8 @@ static int __init iommu_init_noop(void) { return 0; } > static void iommu_shutdown_noop(void) { } > bool __init bool_x86_init_noop(void) { return false; } > void x86_op_int_noop(int cpu) { } > -static __init int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } > -static __init void get_rtc_noop(struct timespec64 *now) { } > +int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } > +void get_rtc_noop(struct timespec64 *now) { } > These functions are just empty place holders. What is the value in having then exported at all? Also, if you do want to use exactly there functions, a better option would be to move them to the header file as "static inline" ones. > static __initconst const struct of_device_id of_cmos_match[] = { > { .compatible = "motorola,mc146818" }, > -- > 2.34.1
On Tue, Apr 04, 2023 at 02:01:00AM -0700, Saurabh Sengar wrote: > Make get/set_rtc_noop() to be public so that they can be used > in other modules as well. > > Co-developed-by: Tianyu Lan <tiala@microsoft.com> > Signed-off-by: Tianyu Lan <tiala@microsoft.com> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> > Reviewed-by: Wei Liu <wei.liu@kernel.org> > Reviewed-by: Michael Kelley <mikelley@microsoft.com> > --- > arch/x86/include/asm/x86_init.h | 2 ++ > arch/x86/kernel/x86_init.c | 4 ++-- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h > index acc20ae4079d..88085f369ff6 100644 > --- a/arch/x86/include/asm/x86_init.h > +++ b/arch/x86/include/asm/x86_init.h > @@ -330,5 +330,7 @@ extern void x86_init_uint_noop(unsigned int unused); > extern bool bool_x86_init_noop(void); > extern void x86_op_int_noop(int cpu); > extern bool x86_pnpbios_disabled(void); > +extern int set_rtc_noop(const struct timespec64 *now); > +extern void get_rtc_noop(struct timespec64 *now); > > #endif > diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c > index 95be3831df73..d82f4fa2f1bf 100644 > --- a/arch/x86/kernel/x86_init.c > +++ b/arch/x86/kernel/x86_init.c > @@ -33,8 +33,8 @@ static int __init iommu_init_noop(void) { return 0; } > static void iommu_shutdown_noop(void) { } > bool __init bool_x86_init_noop(void) { return false; } > void x86_op_int_noop(int cpu) { } > -static __init int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } > -static __init void get_rtc_noop(struct timespec64 *now) { } > +int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } > +void get_rtc_noop(struct timespec64 *now) { } I just had a second thought on this -- do you really need to drop the __init annotation for these two functions? Thanks, Wei. > > static __initconst const struct of_device_id of_cmos_match[] = { > { .compatible = "motorola,mc146818" }, > -- > 2.34.1 >
From: Wei Liu <wei.liu@kernel.org> Sent: Friday, April 7, 2023 10:26 AM > > On Tue, Apr 04, 2023 at 02:01:00AM -0700, Saurabh Sengar wrote: > > Make get/set_rtc_noop() to be public so that they can be used > > in other modules as well. > > > > Co-developed-by: Tianyu Lan <tiala@microsoft.com> > > Signed-off-by: Tianyu Lan <tiala@microsoft.com> > > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> > > Reviewed-by: Wei Liu <wei.liu@kernel.org> > > Reviewed-by: Michael Kelley <mikelley@microsoft.com> > > --- > > arch/x86/include/asm/x86_init.h | 2 ++ > > arch/x86/kernel/x86_init.c | 4 ++-- > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h > > index acc20ae4079d..88085f369ff6 100644 > > --- a/arch/x86/include/asm/x86_init.h > > +++ b/arch/x86/include/asm/x86_init.h > > @@ -330,5 +330,7 @@ extern void x86_init_uint_noop(unsigned int unused); > > extern bool bool_x86_init_noop(void); > > extern void x86_op_int_noop(int cpu); > > extern bool x86_pnpbios_disabled(void); > > +extern int set_rtc_noop(const struct timespec64 *now); > > +extern void get_rtc_noop(struct timespec64 *now); > > > > #endif > > diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c > > index 95be3831df73..d82f4fa2f1bf 100644 > > --- a/arch/x86/kernel/x86_init.c > > +++ b/arch/x86/kernel/x86_init.c > > @@ -33,8 +33,8 @@ static int __init iommu_init_noop(void) { return 0; } > > static void iommu_shutdown_noop(void) { } > > bool __init bool_x86_init_noop(void) { return false; } > > void x86_op_int_noop(int cpu) { } > > -static __init int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } > > -static __init void get_rtc_noop(struct timespec64 *now) { } > > +int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } > > +void get_rtc_noop(struct timespec64 *now) { } > > I just had a second thought on this -- do you really need to drop the > __init annotation for these two functions? > > Thanks, > Wei. I think "yes". In Patch 5 of the series, these are plugged into x86_platform.get_wallclock() and set_wallclock(). The x86_platform.get_wallclock() function can be called by read_persistent_clock64(), which is not a __init function and that may be called during resume from hibernation. x86_platform.set_wallclock() is also called by a non __init function update_persistent_clock64(), which is called by sync_hw_clock(). Michael > > > > > static __initconst const struct of_device_id of_cmos_match[] = { > > { .compatible = "motorola,mc146818" }, > > -- > > 2.34.1 > >
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index acc20ae4079d..88085f369ff6 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -330,5 +330,7 @@ extern void x86_init_uint_noop(unsigned int unused); extern bool bool_x86_init_noop(void); extern void x86_op_int_noop(int cpu); extern bool x86_pnpbios_disabled(void); +extern int set_rtc_noop(const struct timespec64 *now); +extern void get_rtc_noop(struct timespec64 *now); #endif diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 95be3831df73..d82f4fa2f1bf 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -33,8 +33,8 @@ static int __init iommu_init_noop(void) { return 0; } static void iommu_shutdown_noop(void) { } bool __init bool_x86_init_noop(void) { return false; } void x86_op_int_noop(int cpu) { } -static __init int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } -static __init void get_rtc_noop(struct timespec64 *now) { } +int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } +void get_rtc_noop(struct timespec64 *now) { } static __initconst const struct of_device_id of_cmos_match[] = { { .compatible = "motorola,mc146818" },