Re: [RFC PATCH v1 6/9] MIPS: perf: percpu_devid interrupt support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 7 Sep 2017, Paul Burton wrote:
>  
> +static struct irqaction c0_perf_irqaction = {
> +	.handler = mipsxx_pmu_handle_irq,
> +	.flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED | IRQF_NOAUTOEN,
> +	.name = "mips_perf_pmu",
> +	.percpu_dev_id = &mipspmu,
> +};
> +
>  static int mipspmu_get_irq(void)
>  {
> -	int err;
> +	if (irq_is_percpu_devid(mipspmu.irq))
> +		return setup_percpu_irq(mipspmu.irq, &c0_perf_irqaction);
>  
> -	err = request_irq(mipspmu.irq, mipsxx_pmu_handle_irq,
> -			  IRQF_PERCPU | IRQF_NOBALANCING |
> -			  IRQF_NO_THREAD | IRQF_NO_SUSPEND |
> -			  IRQF_SHARED,
> -			  "mips_perf_pmu", &mipspmu);
> -	if (err)
> -		pr_warn("Unable to request IRQ%d for MIPS performance counters!\n",
> -			mipspmu.irq);
> -	return err;
> +	return setup_irq(mipspmu.irq, &c0_perf_irqaction);

request_irq() is really preferred over setup_irq(). setup_irq() exists for
historical reasons because back in the days the allocators were not working
when early interrupts got initialized. Today that's a non issue, but I
never got around to remove the setup_irq() cruft.

Thanks,

	tglx






[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux