Skip to contentSkip to conversation

clocksource/drivers/jcore: Use request_percpu_irq()

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

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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]>
---
 drivers/clocksource/jcore-pit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/clocksource/jcore-pit.c +2 -3
index a4a991101fa3..5b79347ce6d5 100644
@@ -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.45.2
#1 lore raw
Quoted 7 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

Quoted 6 lines

Compile tested only.

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

---

Added Rich Felker in Cc

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
#2 lore raw
Quoted 11 lines · Daniel Lezcano
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
Quoted 4 lines
Cc Daniel Lezcano <[email protected]>
Cc Thomas Gleixner <[email protected]>

---

Added Rich Felker in Cc

Applied, thanks

I think we also need the following patch, since we changed request_irq to request_percpu_irq:

Uros.

drivers/clocksource/jcore-pit.c +1 -1
index a4a991101fa3..840d09afb947 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);
#3 lore raw
Quoted 18 lines · Uros Bizjak
Quoted 16 lines · Daniel Lezcano
Quoted 13 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.

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

---

Quoted 6 lines
Quoted 3 lines

Added Rich Felker in Cc

Applied, thanks

I think we also need the following patch, since we changed request_irq to request_percpu_irq:

Hmm, I think you are right:

I would say it is:

static irqreturn_t jcore_timer_interrupt(int irq, void *dev_id)

{
        struct jcore_pit *pit = dev_id;

	OR

	struct jcore_pit *pit = this_cpu_ptr(jcore_pit_percpu);

	[ ... ]
}

The former the better for the encapsulation.

Do you mind to update the patch ?

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
#4 lore raw
Quoted 42 lines · Daniel Lezcano
Quoted 18 lines · Uros Bizjak
Quoted 16 lines · Daniel Lezcano
Quoted 13 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.

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

---

Quoted 6 lines
Quoted 3 lines

Added Rich Felker in Cc

Applied, thanks

I think we also need the following patch, since we changed request_irq to request_percpu_irq:

Hmm, I think you are right:

I would say it is:

static irqreturn_t jcore_timer_interrupt(int irq, void *dev_id)

{
         struct jcore_pit *pit = dev_id;

        OR

        struct jcore_pit *pit = this_cpu_ptr(jcore_pit_percpu);

        [ ... ]
}
Quoted 3 lines

The former the better for the encapsulation.

Do you mind to update the patch ?

Done, v2 with changed jcore_timer_interrupt() was just sent.

Sorry for the inconvenience.

Thanks,
Uros.

#5 lore raw
Quoted 44 lines · Uros Bizjak
Quoted 42 lines · Daniel Lezcano
Quoted 18 lines · Uros Bizjak
Quoted 16 lines · Daniel Lezcano
Quoted 13 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.

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

---

Quoted 6 lines
Quoted 3 lines

Added Rich Felker in Cc

Applied, thanks

I think we also need the following patch, since we changed request_irq to request_percpu_irq:

Hmm, I think you are right:

I would say it is:

static irqreturn_t jcore_timer_interrupt(int irq, void *dev_id)

{
          struct jcore_pit *pit = dev_id;

         OR

         struct jcore_pit *pit = this_cpu_ptr(jcore_pit_percpu);

         [ ... ]
}
Quoted 7 lines
Quoted 3 lines

The former the better for the encapsulation.

Do you mind to update the patch ?

Done, v2 with changed jcore_timer_interrupt() was just sent.

Sorry for the inconvenience.

No worries, thanks for the v2

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