From: "tip-bot2 for Artur Rojek" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Artur Rojek <contact@artur-rojek.eu>,
Thomas Gleixner <tglx@linutronix.de>,
Uros Bizjak <ubizjak@gmail.com>,
x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/urgent] irqchip/jcore-aic, clocksource/drivers/jcore: Fix jcore-pit interrupt request
Date: Mon, 17 Feb 2025 22:35:52 -0000 [thread overview]
Message-ID: <173983175288.10177.2680129742009360731.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250216175545.35079-3-contact@artur-rojek.eu>
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: d7e3fd658248f257006227285095d190e70ee73a
Gitweb: https://git.kernel.org/tip/d7e3fd658248f257006227285095d190e70ee73a
Author: Artur Rojek <contact@artur-rojek.eu>
AuthorDate: Sun, 16 Feb 2025 18:55:45 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 17 Feb 2025 23:27:49 +01:00
irqchip/jcore-aic, clocksource/drivers/jcore: Fix jcore-pit interrupt request
The jcore-aic irqchip does not have separate interrupt numbers reserved for
cpu-local vs global interrupts. Therefore the device drivers need to
request the given interrupt as per CPU interrupt.
69a9dcbd2d65 ("clocksource/drivers/jcore: Use request_percpu_irq()")
converted the clocksource driver over to request_percpu_irq(), but failed
to do add all the required changes, resulting in a failure to register PIT
interrupts.
Fix this by:
1) Explicitly mark the interrupt via irq_set_percpu_devid() in
jcore_pit_init().
2) Enable and disable the per CPU interrupt in the CPU hotplug callbacks.
3) Pass the correct per-cpu cookie to the irq handler by using
handle_percpu_devid_irq() instead of handle_percpu_irq() in
handle_jcore_irq().
[ tglx: Massage change log ]
Fixes: 69a9dcbd2d65 ("clocksource/drivers/jcore: Use request_percpu_irq()")
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/all/20250216175545.35079-3-contact@artur-rojek.eu
---
drivers/clocksource/jcore-pit.c | 15 ++++++++++++++-
drivers/irqchip/irq-jcore-aic.c | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/jcore-pit.c b/drivers/clocksource/jcore-pit.c
index a3fe98c..8281542 100644
--- a/drivers/clocksource/jcore-pit.c
+++ b/drivers/clocksource/jcore-pit.c
@@ -114,6 +114,18 @@ static int jcore_pit_local_init(unsigned cpu)
pit->periodic_delta = DIV_ROUND_CLOSEST(NSEC_PER_SEC, HZ * buspd);
clockevents_config_and_register(&pit->ced, freq, 1, ULONG_MAX);
+ enable_percpu_irq(pit->ced.irq, IRQ_TYPE_NONE);
+
+ return 0;
+}
+
+static int jcore_pit_local_teardown(unsigned cpu)
+{
+ struct jcore_pit *pit = this_cpu_ptr(jcore_pit_percpu);
+
+ pr_info("Local J-Core PIT teardown on cpu %u\n", cpu);
+
+ disable_percpu_irq(pit->ced.irq);
return 0;
}
@@ -168,6 +180,7 @@ static int __init jcore_pit_init(struct device_node *node)
return -ENOMEM;
}
+ irq_set_percpu_devid(pit_irq);
err = request_percpu_irq(pit_irq, jcore_timer_interrupt,
"jcore_pit", jcore_pit_percpu);
if (err) {
@@ -237,7 +250,7 @@ static int __init jcore_pit_init(struct device_node *node)
cpuhp_setup_state(CPUHP_AP_JCORE_TIMER_STARTING,
"clockevents/jcore:starting",
- jcore_pit_local_init, NULL);
+ jcore_pit_local_init, jcore_pit_local_teardown);
return 0;
}
diff --git a/drivers/irqchip/irq-jcore-aic.c b/drivers/irqchip/irq-jcore-aic.c
index b9dcc8e..1f613eb 100644
--- a/drivers/irqchip/irq-jcore-aic.c
+++ b/drivers/irqchip/irq-jcore-aic.c
@@ -38,7 +38,7 @@ static struct irq_chip jcore_aic;
static void handle_jcore_irq(struct irq_desc *desc)
{
if (irqd_is_per_cpu(irq_desc_get_irq_data(desc)))
- handle_percpu_irq(desc);
+ handle_percpu_devid_irq(desc);
else
handle_simple_irq(desc);
}
next prev parent reply other threads:[~2025-02-17 22:35 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 17:55 [PATCH 0/2] J2 Turtle Board fixes Artur Rojek
2025-02-16 17:55 ` [PATCH 1/2] sh: align .bss section padding to 8-byte boundary Artur Rojek
2025-02-18 12:41 ` Rob Landley
2025-03-11 17:28 ` John Paul Adrian Glaubitz
2025-03-11 23:40 ` Artur Rojek
2025-03-12 8:06 ` Geert Uytterhoeven
2025-03-13 10:36 ` John Paul Adrian Glaubitz
2025-03-12 8:21 ` John Paul Adrian Glaubitz
2025-03-12 8:32 ` Uros Bizjak
2025-03-12 8:44 ` John Paul Adrian Glaubitz
2025-03-12 9:47 ` Geert Uytterhoeven
2025-03-12 9:55 ` Uros Bizjak
2025-03-13 9:38 ` David Laight
2025-04-05 17:38 ` John Paul Adrian Glaubitz
2025-02-16 17:55 ` [PATCH 2/2] irqchip: clocksource: fix jcore-pit irq request Artur Rojek
2025-02-17 7:14 ` Uros Bizjak
2025-02-17 22:35 ` tip-bot2 for Artur Rojek [this message]
2025-02-18 12:43 ` Rob Landley
2025-02-19 14:43 ` Daniel Lezcano
2025-02-19 14:50 ` Geert Uytterhoeven
2025-02-19 14:52 ` Daniel Lezcano
2025-02-27 7:52 ` [PATCH 0/2] J2 Turtle Board fixes John Paul Adrian Glaubitz
2025-02-28 3:03 ` Rob Landley
2025-02-28 8:34 ` John Paul Adrian Glaubitz
2025-02-28 22:19 ` Rob Landley
2025-02-28 22:34 ` John Paul Adrian Glaubitz
2025-03-01 3:20 ` Rob Landley
2025-04-08 15:23 ` John Paul Adrian Glaubitz
2025-04-11 11:25 ` Rob Landley
2025-06-09 10:01 ` John Paul Adrian Glaubitz
2025-06-10 20:22 ` Rob Landley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=173983175288.10177.2680129742009360731.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=contact@artur-rojek.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=maz@kernel.org \
--cc=tglx@linutronix.de \
--cc=ubizjak@gmail.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®