From patchwork Thu Feb 9 12:15:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurabh Singh Sengar X-Patchwork-Id: 54917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp300953wrn; Thu, 9 Feb 2023 04:19:45 -0800 (PST) X-Google-Smtp-Source: AK7set9uHNFT7COEmZiAMdkvsrxA4HDb0Hls5ALFdZfnL/1YljlIQNp+0egTUdREojTPbJRx78Nd X-Received: by 2002:a17:90b:4aca:b0:230:b643:1f90 with SMTP id mh10-20020a17090b4aca00b00230b6431f90mr12510233pjb.29.1675945185314; Thu, 09 Feb 2023 04:19:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675945185; cv=none; d=google.com; s=arc-20160816; b=lpyJuZPYcs7CbQrwYvU4IMju6LOWw2pdC5PXivBaW4h3X4HmayPbmqmrSL/VhBFF5S 6gQR57NfAl4iHw5SNdO2+JOoo7xZjrKTT068tQFS+t6Uc3Y/bYk+Hx6S1jpMTlRC0uvA VbklBLu1Mk/o7r8yyKxrroIotRy9sDQkqoNI0T85BvEyXN4D7Xe38afso3rfxH3jXmDs DYNQhHIVGt2B31cGFJs+wrg/2Ty0AXqMownjPyGGoTMXmuSKqxE+xPhLZK4+HHh0iXNv yv7QJ17B11pjDAYMlj5VEY2KN5vKlAc5J88zK2yMpXJkcdJrZ52Y/hrvaegFVUq0mryT Y0KA== 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=9hqMgwt+9rfgzKvMywqn/H23HiHnKG9S9L6A/+1pzh0=; b=t0e2+pqLXA+ocopKMX5Se+0ojvdnOeP2xmSPOgHnJRd8fGuanWcfd2sdcFfrnevcXZ +JQ30ZuFU+w5igE0Wrl9JStc5vA4Pbz7+7O2fdwQ78Q4NSBPttGvwuRkTdnPN3du8cYA XZpW/c9AK1aTvUnIoxUOVxexdTeQTmwzh3z4xqwWe/jaRioqTBZ+r7Fz6jUMsst7oPft yim71dF1tJTo0G+GZMUrJTXKrOMMwdYdRrPAyh8fMcIaPdYVfa3+pdn4chLmugwScRyN JxIzenpxC251En7REBLAywN2dRrHLR7RCv+ErP4EY+8e18aKpU5mLmUBFd951WIpAu7M 1KSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=rBqKiHDj; 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 nv15-20020a17090b1b4f00b00226c700afe3si6076859pjb.37.2023.02.09.04.19.28; Thu, 09 Feb 2023 04:19:45 -0800 (PST) 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=rBqKiHDj; 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 S229733AbjBIMQ4 (ORCPT + 99 others); Thu, 9 Feb 2023 07:16:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbjBIMQt (ORCPT ); Thu, 9 Feb 2023 07:16:49 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B16EDE05B; Thu, 9 Feb 2023 04:16:30 -0800 (PST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 9B2BC20C8AEB; Thu, 9 Feb 2023 04:15:43 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9B2BC20C8AEB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1675944943; bh=9hqMgwt+9rfgzKvMywqn/H23HiHnKG9S9L6A/+1pzh0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rBqKiHDjeqm1sqXJAWL58/QjVyUXWPX1F68PIyJd3/YVlz4rOXdJ4A9SkkxbDoQd7 ZqTIXyrhNzyYAC5NJ3YkXo+9kefqiRuGRKw+D62Q/x0sR16jeikqMQeBjLZzxDQUVp aJQ1BA4rgHxi9+wde3lkNg5NRP2gsxQ3T7pK/nrY= From: Saurabh Sengar To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, daniel.lezcano@linaro.org, tglx@linutronix.de, virtualization@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, mikelley@microsoft.com, ssengar@linux.microsoft.com, dphadke@linux.microsoft.com Subject: [PATCH v5 1/5] drivers/clocksource/hyper-v: non ACPI support in hyperv clock Date: Thu, 9 Feb 2023 04:15:35 -0800 Message-Id: <1675944939-22631-2-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1675944939-22631-1-git-send-email-ssengar@linux.microsoft.com> References: <1675944939-22631-1-git-send-email-ssengar@linux.microsoft.com> X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,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=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757355898686366920?= X-GMAIL-MSGID: =?utf-8?q?1757355898686366920?= Add a placeholder function for the hv_setup_stimer0_irq API to accommodate systems without ACPI support. Since this function is not utilized on x86/x64 systems and non-ACPI support is only intended for x86/x64 systems, a placeholder function is sufficient for now and can be improved upon if necessary in the future. Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley --- drivers/clocksource/hyperv_timer.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c index c0cef92b12b8..f32948c8a96f 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -49,7 +49,7 @@ static bool direct_mode_enabled; static int stimer0_irq = -1; static int stimer0_message_sint; -static DEFINE_PER_CPU(long, stimer0_evt); +static __maybe_unused DEFINE_PER_CPU(long, stimer0_evt); /* * Common code for stimer0 interrupts coming via Direct Mode or @@ -68,7 +68,7 @@ EXPORT_SYMBOL_GPL(hv_stimer0_isr); * stimer0 interrupt handler for architectures that support * per-cpu interrupts, which also implies Direct Mode. */ -static irqreturn_t hv_stimer0_percpu_isr(int irq, void *dev_id) +static irqreturn_t __maybe_unused hv_stimer0_percpu_isr(int irq, void *dev_id) { hv_stimer0_isr(); return IRQ_HANDLED; @@ -196,6 +196,7 @@ void __weak hv_remove_stimer0_handler(void) { }; +#ifdef CONFIG_ACPI /* Called only on architectures with per-cpu IRQs (i.e., not x86/x64) */ static int hv_setup_stimer0_irq(void) { @@ -230,6 +231,16 @@ static void hv_remove_stimer0_irq(void) stimer0_irq = -1; } } +#else +static int hv_setup_stimer0_irq(void) +{ + return 0; +} + +static void hv_remove_stimer0_irq(void) +{ +} +#endif /* hv_stimer_alloc - Global initialization of the clockevent and stimer0 */ int hv_stimer_alloc(bool have_percpu_irqs)