Skip to contentSkip to conversation

clocksource/drivers/jcore: Use request_percpu_irq()

PATCH Applied Uros Bizjak 3 participants 3 messages Sep 2, 2024 – Sep 6, 2024 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clocksource/drivers/jcore: Use request_percpu_irq()

Use request_percpu_irq() instead of request_irq() to solve the following sparse warning:

jcore-pit.c:173:40: warning: incorrect type in argument 5 (different address spaces)
jcore-pit.c:173:40: expected void *dev
jcore-pit.c:173:40: got struct jcore_pit [noderef] __percpu *static [assigned] [toplevel] jcore_pit_percpu

Compile tested only.

Cc Daniel Lezcano <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Rich Felker <[email protected]>

---
v2: Also remove this_cpu_ptr() from jcore_timer_interrupt().

---
 drivers/clocksource/jcore-pit.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/clocksource/jcore-pit.c +3 -4
index a4a991101fa3..a3fe98cd3838 100644
@@ -120,7 +120,7 @@ static int jcore_pit_local_init(unsigned cpu)
 
 static irqreturn_t jcore_timer_interrupt(int irq, void *dev_id)
 {
-	struct jcore_pit *pit = this_cpu_ptr(dev_id);
+	struct jcore_pit *pit = dev_id;
 
 	if (clockevent_state_oneshot(&pit->ced))
 		jcore_pit_disable(pit);
@@ -168,9 +168,8 @@ static int __init jcore_pit_init(struct device_node *node)
 		return -ENOMEM;
 	}
 
-	err = request_irq(pit_irq, jcore_timer_interrupt,
-			  IRQF_TIMER | IRQF_PERCPU,
-			  "jcore_pit", jcore_pit_percpu);
+	err = request_percpu_irq(pit_irq, jcore_timer_interrupt,
+				 "jcore_pit", jcore_pit_percpu);
 	if (err) {
 		pr_err("pit irq request failed: %d\n", err);
 		free_percpu(jcore_pit_percpu);
Signature · 1 line
2.46.0
#1 lore raw
Quoted 9 lines · Uros Bizjak

Use request_percpu_irq() instead of request_irq() to solve the following sparse warning:

jcore-pit.c:173:40: warning: incorrect type in argument 5 (different address spaces)
jcore-pit.c:173:40: expected void *dev
jcore-pit.c:173:40: got struct jcore_pit [noderef] __percpu *static [assigned] [toplevel] jcore_pit_percpu

Compile tested only.

Quoted 8 lines
Cc Daniel Lezcano <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Rich Felker <[email protected]>

---
v2: Also remove this_cpu_ptr() from jcore_timer_interrupt().

---
  drivers/clocksource/jcore-pit.c | 7 +++----

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
merge bot Applied
#2 lore raw
In reply to Uros Bizjak
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     69a9dcbd2d65217cf52f55dc57b50845dc9d8d3f
Gitweb:        https://git.kernel.org/tip/69a9dcbd2d65217cf52f55dc57b50845dc9d8d3f
Author:        Uros Bizjak <[email protected]>
AuthorDate:    Mon, 02 Sep 2024 12:48:04 +02:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Fri, 06 Sep 2024 14:49:21 +02:00

clocksource/drivers/jcore: Use request_percpu_irq()

Use request_percpu_irq() instead of request_irq() to solve the following sparse warning:

jcore-pit.c:173:40: warning: incorrect type in argument 5 (different address spaces)
jcore-pit.c:173:40: expected void *dev
jcore-pit.c:173:40: got struct jcore_pit [noderef] __percpu *static [assigned] [toplevel] jcore_pit_percpu

Compile tested only.

---
 drivers/clocksource/jcore-pit.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/clocksource/jcore-pit.c +3 -4
index a4a9911..a3fe98c 100644
@@ -120,7 +120,7 @@ static int jcore_pit_local_init(unsigned cpu)
 
 static irqreturn_t jcore_timer_interrupt(int irq, void *dev_id)
 {
-	struct jcore_pit *pit = this_cpu_ptr(dev_id);
+	struct jcore_pit *pit = dev_id;
 
 	if (clockevent_state_oneshot(&pit->ced))
 		jcore_pit_disable(pit);
@@ -168,9 +168,8 @@ static int __init jcore_pit_init(struct device_node *node)
 		return -ENOMEM;
 	}
 
-	err = request_irq(pit_irq, jcore_timer_interrupt,
-			  IRQF_TIMER | IRQF_PERCPU,
-			  "jcore_pit", jcore_pit_percpu);
+	err = request_percpu_irq(pit_irq, jcore_timer_interrupt,
+				 "jcore_pit", jcore_pit_percpu);
 	if (err) {
 		pr_err("pit irq request failed: %d\n", err);
 		free_percpu(jcore_pit_percpu);