public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clocksource/drivers/jcore: Use request_percpu_irq()
@ 2024-07-30 13:20 Uros Bizjak
  2024-09-02  9:17 ` Daniel Lezcano
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2024-07-30 13:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Uros Bizjak, Daniel Lezcano, Thomas Gleixner

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.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/clocksource/jcore-pit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/jcore-pit.c b/drivers/clocksource/jcore-pit.c
index a4a991101fa3..5b79347ce6d5 100644
--- a/drivers/clocksource/jcore-pit.c
+++ b/drivers/clocksource/jcore-pit.c
@@ -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);
-- 
2.45.2


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

* Re: [PATCH] clocksource/drivers/jcore: Use request_percpu_irq()
  2024-07-30 13:20 [PATCH] clocksource/drivers/jcore: Use request_percpu_irq() Uros Bizjak
@ 2024-09-02  9:17 ` Daniel Lezcano
  2024-09-02 10:11   ` Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2024-09-02  9:17 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Thomas Gleixner, Rich Felker, linux-kernel

On 30/07/2024 15:20, Uros Bizjak wrote:
> 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.
> 
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---

Added Rich Felker in Cc

Applied, thanks

-- 
<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

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

* Re: [PATCH] clocksource/drivers/jcore: Use request_percpu_irq()
  2024-09-02  9:17 ` Daniel Lezcano
@ 2024-09-02 10:11   ` Uros Bizjak
  2024-09-02 10:33     ` Daniel Lezcano
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2024-09-02 10:11 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Thomas Gleixner, Rich Felker, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 842 bytes --]

On Mon, Sep 2, 2024 at 11:17 AM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 30/07/2024 15:20, Uros Bizjak wrote:
> > 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.
> >
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> > Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > ---
>
> 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.

[-- Attachment #2: p.txt --]
[-- Type: text/plain, Size: 485 bytes --]

diff --git a/drivers/clocksource/jcore-pit.c b/drivers/clocksource/jcore-pit.c
index a4a991101fa3..840d09afb947 100644
--- a/drivers/clocksource/jcore-pit.c
+++ b/drivers/clocksource/jcore-pit.c
@@ -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);

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

* Re: [PATCH] clocksource/drivers/jcore: Use request_percpu_irq()
  2024-09-02 10:11   ` Uros Bizjak
@ 2024-09-02 10:33     ` Daniel Lezcano
  2024-09-02 10:50       ` Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2024-09-02 10:33 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Thomas Gleixner, Rich Felker, linux-kernel

On 02/09/2024 12:11, Uros Bizjak wrote:
> On Mon, Sep 2, 2024 at 11:17 AM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 30/07/2024 15:20, Uros Bizjak wrote:
>>> 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.
>>>
>>> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
>>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>>> Cc: Thomas Gleixner <tglx@linutronix.de>
>>> ---
>>
>> 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 ?

-- 
<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

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

* Re: [PATCH] clocksource/drivers/jcore: Use request_percpu_irq()
  2024-09-02 10:33     ` Daniel Lezcano
@ 2024-09-02 10:50       ` Uros Bizjak
  2024-09-02 12:52         ` Daniel Lezcano
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2024-09-02 10:50 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Thomas Gleixner, Rich Felker, linux-kernel

On Mon, Sep 2, 2024 at 12:33 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 02/09/2024 12:11, Uros Bizjak wrote:
> > On Mon, Sep 2, 2024 at 11:17 AM Daniel Lezcano
> > <daniel.lezcano@linaro.org> wrote:
> >>
> >> On 30/07/2024 15:20, Uros Bizjak wrote:
> >>> 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.
> >>>
> >>> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> >>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> >>> Cc: Thomas Gleixner <tglx@linutronix.de>
> >>> ---
> >>
> >> 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 ?

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

Sorry for the inconvenience.

Thanks,
Uros.

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

* Re: [PATCH] clocksource/drivers/jcore: Use request_percpu_irq()
  2024-09-02 10:50       ` Uros Bizjak
@ 2024-09-02 12:52         ` Daniel Lezcano
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2024-09-02 12:52 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Thomas Gleixner, Rich Felker, linux-kernel

On 02/09/2024 12:50, Uros Bizjak wrote:
> On Mon, Sep 2, 2024 at 12:33 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 02/09/2024 12:11, Uros Bizjak wrote:
>>> On Mon, Sep 2, 2024 at 11:17 AM Daniel Lezcano
>>> <daniel.lezcano@linaro.org> wrote:
>>>>
>>>> On 30/07/2024 15:20, Uros Bizjak wrote:
>>>>> 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.
>>>>>
>>>>> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
>>>>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>>>>> Cc: Thomas Gleixner <tglx@linutronix.de>
>>>>> ---
>>>>
>>>> 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 ?
> 
> Done, v2 with changed jcore_timer_interrupt() was just sent.
> 
> Sorry for the inconvenience.

No worries, thanks for the v2

-- 
<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

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

end of thread, other threads:[~2024-09-02 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 13:20 [PATCH] clocksource/drivers/jcore: Use request_percpu_irq() Uros Bizjak
2024-09-02  9:17 ` Daniel Lezcano
2024-09-02 10:11   ` Uros Bizjak
2024-09-02 10:33     ` Daniel Lezcano
2024-09-02 10:50       ` Uros Bizjak
2024-09-02 12:52         ` Daniel Lezcano

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