Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754133AbaKRKkY (ORCPT ); Tue, 18 Nov 2014 05:40:24 -0500 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]:59967 "EHLO foss-mx-na.foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbaKRKkX (ORCPT ); Tue, 18 Nov 2014 05:40:23 -0500 Date: Tue, 18 Nov 2014 10:40:12 +0000 From: Will Deacon To: Mark Rutland Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 09/11] arm: perf: parse cpu affinity from dt Message-ID: <20141118104012.GF18842@arm.com> References: <1415377536-12841-1-git-send-email-mark.rutland@arm.com> <1415377536-12841-10-git-send-email-mark.rutland@arm.com> <20141117112033.GF18061@arm.com> <20141117150804.GC25416@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141117150804.GC25416@leverpostej> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 17, 2014 at 03:08:04PM +0000, Mark Rutland wrote: > On Mon, Nov 17, 2014 at 11:20:35AM +0000, Will Deacon wrote: > > On Fri, Nov 07, 2014 at 04:25:34PM +0000, Mark Rutland wrote: > > > diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c > > > index dfcaba5..f09c8a0 100644 > > > --- a/arch/arm/kernel/perf_event_cpu.c > > > +++ b/arch/arm/kernel/perf_event_cpu.c > > > @@ -85,20 +85,27 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) > > > struct platform_device *pmu_device = cpu_pmu->plat_device; > > > struct pmu_hw_events __percpu *hw_events = cpu_pmu->hw_events; > > > > > > - irqs = min(pmu_device->num_resources, num_possible_cpus()); > > > + irqs = cpu_pmu->nr_irqs; > > > > > > - irq = platform_get_irq(pmu_device, 0); > > > - if (irq >= 0 && irq_is_percpu(irq)) { > > > - on_each_cpu(cpu_pmu_disable_percpu_irq, &irq, 1); > > > - free_percpu_irq(irq, &hw_events->percpu_pmu); > > > - } else { > > > - for (i = 0; i < irqs; ++i) { > > > - if (!cpumask_test_and_clear_cpu(i, &cpu_pmu->active_irqs)) > > > - continue; > > > - irq = platform_get_irq(pmu_device, i); > > > - if (irq >= 0) > > > - free_irq(irq, per_cpu_ptr(&hw_events->percpu_pmu, i)); > > > + for (i = 0; i < irqs; i++) { > > > + struct cpu_irq *map = &cpu_pmu->irq_map[i]; > > > + irq = map->irq; > > > + > > > + if (irq <= 0) > > > + continue; > > > + > > > + if (irq_is_percpu(irq)) { > > > + on_each_cpu(cpu_pmu_disable_percpu_irq, &irq, 1); > > > > Hmm, ok, so we're assuming that all the PMUs will be wired with PPIs in this > > case. I have a patch allowing per-cpu interrupts to be requested for a > > cpumask, but I suppose that can wait until it's actually needed. > > I wasn't too keen on assuming all CPUs, but I didn't have the facility > to request a PPI on a subset of CPUs. If you can point me at your patch, > I'd be happy to take a look. The patch is here: https://git.kernel.org/cgit/linux/kernel/git/will/linux.git/commit/?h=irq&id=774f7bc54577b6875d96e670ee34580077fc10be But I think we can avoid it until we find a platform that needs it. I can't see a DT/ABI issue with that, can you? Will -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/