[PATCHv2 7/8] arm_pmu: note IRQs and PMUs per-cpu

Mark Rutland mark.rutland at arm.com
Wed Feb 14 05:45:43 PST 2018


On Wed, Feb 14, 2018 at 01:26:41PM +0000, Will Deacon wrote:
> On Wed, Feb 14, 2018 at 01:24:17PM +0000, Mark Rutland wrote:
> > On Wed, Feb 14, 2018 at 01:11:41PM +0000, Will Deacon wrote:
> > > On Mon, Feb 05, 2018 at 04:42:01PM +0000, Mark Rutland wrote:
> > > > @@ -560,16 +577,16 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
> > > >  
> > > >  		irq_set_status_flags(irq, IRQ_NOAUTOEN);
> > > >  		err = request_irq(irq, handler, irq_flags, "arm-pmu",
> > > > -				  per_cpu_ptr(&hw_events->percpu_pmu, cpu));
> > > > -	} else if (cpumask_empty(&armpmu->active_irqs)) {
> > > > +				  NULL);
> > > > +	} else if (armpmu_count_irq_users(irq) == 0) {
> > > >  		err = request_percpu_irq(irq, handler, "arm-pmu",
> > > > -					 &hw_events->percpu_pmu);
> > > > +					 cpu_armpmu);
> > > 
> > > This should be &cpu_armpmu.
> > 
> > I'm not sure that's the case, given the way we statically define
> > cpu_armpmu, but I'll try to figure that out.
> 
> Well that's what you pass to free_percpu_irq :p

Ugh. One of the two is clearly wrnog...

> > > Would it be possible to pass &cpu_armpmu as the devid even in the normal
> > > request_irq case and have the dispatcher just pass it through to the
> > > underlying handler, rather than access cpu_armpmu directly?
> > 
> > Do you mean so that the dispatcher takes a struct arm_pmu ** in all
> > cases?
> 
> Yes.

Ok. I'll try to piece that together (which should allow us to revert
some changes to the dispatcher).

Thanks,
Mark.



More information about the linux-arm-kernel mailing list