From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH 2/2] arm/arm64: pmu: Distinguish percpu irq and percpu_devid irq
Date: Fri, 13 Oct 2017 17:47:15 +0100 [thread overview]
Message-ID: <20171013164715.GB5919@leverpostej> (raw)
In-Reply-To: <1507894005-53778-3-git-send-email-julien.thierry@arm.com>
On Fri, Oct 13, 2017 at 12:26:45PM +0100, Julien Thierry wrote:
> arm_pmu interrupts are maked as PERCPU even when these are not local
> physical interrupts to a single CPU. When using non-local interrupts,
> interrupts marked as PERCPU will not get freed not disabled properly
> by the PMU driver.
>
> Check if interrupts are local to a single CPU with PERCPU_DEVID since
> this is what the PMU driver really needs to know.
>
> Signed-off-by: Julien Thierry <julien.thierry@arm.com>
> Will Deacon <will.deacon@arm.com>
> Mark Rutland <mark.rutland@arm.com>
I guess these should have been with prefixed 'Cc: '.
The patch itself looks good to me:
Acked-by: Mark Rutland <mark.rutland@arm.com>
I suspect we'll need to take both patches via the usual arm pmu tree, so
it'd be good if we could get an ack on patch 1.
Thanks,
Mark.
> ---
> drivers/perf/arm_pmu.c | 10 +++++-----
> drivers/perf/arm_pmu_platform.c | 4 ++--
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> index d14fc2e..7bc5eee 100644
> --- a/drivers/perf/arm_pmu.c
> +++ b/drivers/perf/arm_pmu.c
> @@ -539,7 +539,7 @@ void armpmu_free_irq(struct arm_pmu *armpmu, int cpu)
> if (!cpumask_test_and_clear_cpu(cpu, &armpmu->active_irqs))
> return;
>
> - if (irq_is_percpu(irq)) {
> + if (irq_is_percpu_devid(irq)) {
> free_percpu_irq(irq, &hw_events->percpu_pmu);
> cpumask_clear(&armpmu->active_irqs);
> return;
> @@ -565,10 +565,10 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
> if (!irq)
> return 0;
>
> - if (irq_is_percpu(irq) && cpumask_empty(&armpmu->active_irqs)) {
> + if (irq_is_percpu_devid(irq) && cpumask_empty(&armpmu->active_irqs)) {
> err = request_percpu_irq(irq, handler, "arm-pmu",
> &hw_events->percpu_pmu);
> - } else if (irq_is_percpu(irq)) {
> + } else if (irq_is_percpu_devid(irq)) {
> int other_cpu = cpumask_first(&armpmu->active_irqs);
> int other_irq = per_cpu(hw_events->irq, other_cpu);
>
> @@ -649,7 +649,7 @@ static int arm_perf_starting_cpu(unsigned int cpu, struct hlist_node *node)
>
> irq = armpmu_get_cpu_irq(pmu, cpu);
> if (irq) {
> - if (irq_is_percpu(irq)) {
> + if (irq_is_percpu_devid(irq)) {
> enable_percpu_irq(irq, IRQ_TYPE_NONE);
> return 0;
> }
> @@ -667,7 +667,7 @@ static int arm_perf_teardown_cpu(unsigned int cpu, struct hlist_node *node)
> return 0;
>
> irq = armpmu_get_cpu_irq(pmu, cpu);
> - if (irq && irq_is_percpu(irq))
> + if (irq && irq_is_percpu_devid(irq))
> disable_percpu_irq(irq);
>
> return 0;
> diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
> index 4eafa7a..bbc64ee 100644
> --- a/drivers/perf/arm_pmu_platform.c
> +++ b/drivers/perf/arm_pmu_platform.c
> @@ -126,7 +126,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
>
> if (num_irqs == 1) {
> int irq = platform_get_irq(pdev, 0);
> - if (irq && irq_is_percpu(irq))
> + if (irq && irq_is_percpu_devid(irq))
> return pmu_parse_percpu_irq(pmu, irq);
> }
>
> @@ -149,7 +149,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
> if (WARN_ON(irq <= 0))
> continue;
>
> - if (irq_is_percpu(irq)) {
> + if (irq_is_percpu_devid(irq)) {
> pr_warn("multiple PPIs or mismatched SPI/PPI detected\n");
> return -EINVAL;
> }
> --
> 1.9.1
next prev parent reply other threads:[~2017-10-13 16:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 11:26 [RESEND PATCH 0/2] Distinguish percpu irq and percpu_devid irq Julien Thierry
2017-10-13 11:26 ` [RESEND PATCH 1/2] irqdesc: Add function to identify percpu_devid irqs Julien Thierry
2017-10-13 16:53 ` Marc Zyngier
2017-10-13 17:44 ` Mark Rutland
2017-10-24 14:46 ` Will Deacon
2017-10-24 14:50 ` Thomas Gleixner
2017-10-24 14:52 ` Will Deacon
2017-10-13 11:26 ` [RESEND PATCH 2/2] arm/arm64: pmu: Distinguish percpu irq and percpu_devid irq Julien Thierry
2017-10-13 16:47 ` Mark Rutland [this message]
2017-10-16 8:19 ` Julien Thierry
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=20171013164715.GB5919@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.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