Skip to contentSkip to conversation

acpi: fix for lapic_timer_propagate_broadcast()

PATCH Applied Hidetoshi Seto 3 participants 3 messages Dec 14, 2009 – Dec 16, 2009 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: fix for lapic_timer_propagate_broadcast()

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:

Quoted 12 lines
(quoted diff) +2 -1
@@ -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 ?

Review line 643

Quoted 9 lines
(quoted diff) +2 -1
@@ -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.

Cc Suresh Siddha <[email protected]>
Cc Len Brown <[email protected]>
---
 drivers/acpi/processor_idle.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
drivers/acpi/processor_idle.c +8 -3
index bbd066e..d1676b1 100644
@@ -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);
 }
Signature · 1 line
1.6.5.6
Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Hidetoshi Seto

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:

Quoted 12 lines
drivers/acpi/processor_idle.c +2 -1
@@ -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 ?

drivers/acpi/processor_idle.c line 643

Quoted 9 lines
drivers/acpi/processor_idle.c +2 -1
@@ -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) { }

Quoted 7 lines

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.

Len, please push this in to your tree.

thanks,
suresh