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

Mark Rutland mark.rutland at arm.com
Mon Feb 5 09:13:53 PST 2018


On Mon, Feb 05, 2018 at 05:07:23PM +0000, Robin Murphy wrote:
> Hi Mark,
> 
> Just a couple of nits spotted in passing...
> 
> On 05/02/18 16:42, Mark Rutland wrote:

> > +void armpmu_free_cpu_irq(int irq, int cpu)
> > +{
> > +	if (per_cpu(cpu_irq, cpu) == 0)
> > +		return;
> > +	if (WARN_ON(irq != per_cpu(cpu_irq, cpu)))
> >   		return;
> >   	if (irq_is_percpu_devid(irq)) {
> > -		free_percpu_irq(irq, &hw_events->percpu_pmu);
> > -		cpumask_clear(&armpmu->active_irqs);
> > -		return;
> > +		if (armpmu_count_irq_users(irq) == 1)
> > +			free_percpu_irq(irq, &cpu_armpmu);
> > +	} else {
> > +		free_irq(irq, NULL);
> >   	}
> 
> Following the same pattern as the request would make this marginally simpler
> (and nicely symmetric), i.e.
> 
> 	if (!irq_is_percpu_devid(irq))
> 		free_irq(irq, NULL);
> 	else if (armpmu_count_irq_users(irq) == 1)
> 		free_percpu_irq(irq, &cpu_armpmu);

Sure; done.

> > +int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
> > +{
> > +	struct pmu_hw_events __percpu *hw_events = armpmu->hw_events;
> > +	int irq = per_cpu(hw_events->irq, cpu);
> > +	if (!irq)
> > +		return 0;
> > +
> > +
> 
> Double blank line here.

... and gone.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list