Revert "clocksource/drivers/timer-of: Remove percpu irq related code"

This reverts commit 0a821fa735.
This commit is contained in:
Ksawlii 2024-11-24 00:23:37 +01:00
parent d5a08b5325
commit ad0197fe73
2 changed files with 14 additions and 4 deletions
drivers/clocksource

View file

@ -25,7 +25,10 @@ static void timer_of_irq_exit(struct of_timer_irq *of_irq)
struct clock_event_device *clkevt = &to->clkevt;
free_irq(of_irq->irq, clkevt);
if (of_irq->percpu)
free_percpu_irq(of_irq->irq, clkevt);
else
free_irq(of_irq->irq, clkevt);
}
/**
@ -39,6 +42,9 @@ static void timer_of_irq_exit(struct of_timer_irq *of_irq)
* - Get interrupt number by name
* - Get interrupt number by index
*
* When the interrupt is per CPU, 'request_percpu_irq()' is called,
* otherwise 'request_irq()' is used.
*
* Returns 0 on success, < 0 otherwise
*/
static int timer_of_irq_init(struct device_node *np,
@ -63,9 +69,12 @@ static int timer_of_irq_init(struct device_node *np,
return -EINVAL;
}
ret = request_irq(of_irq->irq, of_irq->handler,
of_irq->flags ? of_irq->flags : IRQF_TIMER,
np->full_name, clkevt);
ret = of_irq->percpu ?
request_percpu_irq(of_irq->irq, of_irq->handler,
np->full_name, clkevt) :
request_irq(of_irq->irq, of_irq->handler,
of_irq->flags ? of_irq->flags : IRQF_TIMER,
np->full_name, clkevt);
if (ret) {
pr_err("Failed to request irq %d for %pOF\n", of_irq->irq, np);
return ret;

View file

@ -11,6 +11,7 @@
struct of_timer_irq {
int irq;
int index;
int percpu;
const char *name;
unsigned long flags;
irq_handler_t handler;