diff mbox series

[v4,1/6] drivers/clocksource/hyper-v: non ACPI support in hyperv clock

Message ID 1675756199-5917-2-git-send-email-ssengar@linux.microsoft.com
State Accepted
Commit a4fea9b78ebea6df9a61f34cfc2f7ed0bbc8a9fc
Headers show
Series [v4,1/6] drivers/clocksource/hyper-v: non ACPI support in hyperv clock | expand

Commit Message

Saurabh Singh Sengar Feb. 7, 2023, 7:49 a.m. UTC
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.

This change will make it easier to add device tree support for VMBus in
subsequent commits.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
---
 drivers/clocksource/hyperv_timer.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Comments

Michael Kelley Feb. 8, 2023, 1:22 a.m. UTC | #1
From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Monday, February 6, 2023 11:50 PM
> 
> 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.
> 
> This change will make it easier to add device tree support for VMBus in
> subsequent commits.
> 
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> ---
>  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 c0cef92..f32948c 100644
> --- a/drivers/clocksource/hyperv_timer.c
> +++ b/drivers/clocksource/hyperv_timer.c
> @@ -49,7 +49,7 @@
> 
>  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 @@ void hv_stimer0_isr(void)
>   * 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)
> --
> 1.8.3.1

Reviewed-by: Michael Kelley <mikelley@microsoft.com>
diff mbox series

Patch

diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index c0cef92..f32948c 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -49,7 +49,7 @@ 
 
 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 @@  void hv_stimer0_isr(void)
  * 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)