public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi: fix for lapic_timer_propagate_broadcast()
@ 2009-12-14  8:10 Hidetoshi Seto
  2009-12-14 18:37 ` Suresh Siddha
  0 siblings, 1 reply; 3+ messages in thread
From: Hidetoshi Seto @ 2009-12-14  8:10 UTC (permalink / raw)
  To: linux-kernel, linux-acpi; +Cc: Suresh Siddha, Len Brown

I got following warning on ia64 box:
  In function 'acpi_processor_power_verify':
  642: warning: passing argument 2 of 'smp_call_function_single' from
  incompatible pointer type

This smp_call_function_single() was introduced by a commit
f833bab87fca5c3ce13778421b1365845843b976:

 > @@ -162,8 +162,9 @@
 >               pr->power.timer_broadcast_on_state = state;
 >  }
 >
 > -static void lapic_timer_propagate_broadcast(struct acpi_processor *pr)
 > +static void lapic_timer_propagate_broadcast(void *arg)
 >  {
 > +       struct acpi_processor *pr = (struct acpi_processor *) arg;
 >         unsigned long reason;
 >
 >         reason = pr->power.timer_broadcast_on_state < INT_MAX ?
 > @@ -635,7 +636,8 @@
 >                 working++;
 >         }
 >
 > -       lapic_timer_propagate_broadcast(pr);
 > +       smp_call_function_single(pr->id, lapic_timer_propagate_broadcast,
 > +                                pr, 1);
 >
 >         return (working);
 >  }

The problem is that the lapic_timer_propagate_broadcast() has 2 versions:
One is real code that modified in the above commit, and the other is NOP
code that used when !ARCH_APICTIMER_STOPS_ON_C3:

  static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }

So I got warning because of !ARCH_APICTIMER_STOPS_ON_C3.

We really want to do nothing here on !ARCH_APICTIMER_STOPS_ON_C3, so
modify lapic_timer_propagate_broadcast() of real version to use
smp_call_function_single() in it.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Len Brown <len.brown@intel.com>
---
 drivers/acpi/processor_idle.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index bbd066e..d1676b1 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -164,7 +164,7 @@ static void lapic_timer_check_state(int state, struct acpi_processor *pr,
 		pr->power.timer_broadcast_on_state = state;
 }
 
-static void lapic_timer_propagate_broadcast(void *arg)
+static void __lapic_timer_propagate_broadcast(void *arg)
 {
 	struct acpi_processor *pr = (struct acpi_processor *) arg;
 	unsigned long reason;
@@ -175,6 +175,12 @@ static void lapic_timer_propagate_broadcast(void *arg)
 	clockevents_notify(reason, &pr->id);
 }
 
+static void lapic_timer_propagate_broadcast(struct acpi_processor *pr)
+{
+	smp_call_function_single(pr->id, __lapic_timer_propagate_broadcast,
+				 (void *)pr, 1);
+}
+
 /* Power(C) State timer broadcast control */
 static void lapic_timer_state_broadcast(struct acpi_processor *pr,
 				       struct acpi_processor_cx *cx,
@@ -638,8 +644,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
 		working++;
 	}
 
-	smp_call_function_single(pr->id, lapic_timer_propagate_broadcast,
-				 pr, 1);
+	lapic_timer_propagate_broadcast(pr);
 
 	return (working);
 }
-- 
1.6.5.6



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] acpi: fix for lapic_timer_propagate_broadcast()
  2009-12-14  8:10 [PATCH] acpi: fix for lapic_timer_propagate_broadcast() Hidetoshi Seto
@ 2009-12-14 18:37 ` Suresh Siddha
  2009-12-16  9:14   ` Len Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Suresh Siddha @ 2009-12-14 18:37 UTC (permalink / raw)
  To: Hidetoshi Seto
  Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	Brown, Len

On Mon, 2009-12-14 at 00:10 -0800, Hidetoshi Seto wrote:
> I got following warning on ia64 box:
>   In function 'acpi_processor_power_verify':
>   642: warning: passing argument 2 of 'smp_call_function_single' from
>   incompatible pointer type
> 
> This smp_call_function_single() was introduced by a commit
> f833bab87fca5c3ce13778421b1365845843b976:
> 
>  > @@ -162,8 +162,9 @@
>  >               pr->power.timer_broadcast_on_state = state;
>  >  }
>  >
>  > -static void lapic_timer_propagate_broadcast(struct acpi_processor *pr)
>  > +static void lapic_timer_propagate_broadcast(void *arg)
>  >  {
>  > +       struct acpi_processor *pr = (struct acpi_processor *) arg;
>  >         unsigned long reason;
>  >
>  >         reason = pr->power.timer_broadcast_on_state < INT_MAX ?
>  > @@ -635,7 +636,8 @@
>  >                 working++;
>  >         }
>  >
>  > -       lapic_timer_propagate_broadcast(pr);
>  > +       smp_call_function_single(pr->id, lapic_timer_propagate_broadcast,
>  > +                                pr, 1);
>  >
>  >         return (working);
>  >  }
> 
> The problem is that the lapic_timer_propagate_broadcast() has 2 versions:
> One is real code that modified in the above commit, and the other is NOP
> code that used when !ARCH_APICTIMER_STOPS_ON_C3:
> 
>   static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }
> 
> So I got warning because of !ARCH_APICTIMER_STOPS_ON_C3.
> 
> We really want to do nothing here on !ARCH_APICTIMER_STOPS_ON_C3, so
> modify lapic_timer_propagate_broadcast() of real version to use
> smp_call_function_single() in it.
> 
> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>

Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>

Len, please push this in to your tree.

thanks,
suresh


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] acpi: fix for lapic_timer_propagate_broadcast()
  2009-12-14 18:37 ` Suresh Siddha
@ 2009-12-16  9:14   ` Len Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Len Brown @ 2009-12-16  9:14 UTC (permalink / raw)
  To: Suresh Siddha
  Cc: Hidetoshi Seto, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org, Brown, Len


> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>

applied

thanks,
Len Brown, Intel Open Source Technology Center





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-16  9:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14  8:10 [PATCH] acpi: fix for lapic_timer_propagate_broadcast() Hidetoshi Seto
2009-12-14 18:37 ` Suresh Siddha
2009-12-16  9:14   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox