mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Vinayak Kale <vkale@apm.com>
Cc: Marc Zyngier <Marc.Zyngier@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"jcm@redhat.com" <jcm@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	Tuan Phan <tphan@apm.com>
Subject: Re: [PATCH V4 2/2] arm64: perf: add support for percpu pmu interrupt
Date: Wed, 20 Nov 2013 18:00:12 +0000	[thread overview]
Message-ID: <20131120180012.GJ19352@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <CAPrCYkcu7wVjoV5Q=pd55Zn8+PR30n3WJ8F6t=qV4BMLhZFcxA@mail.gmail.com>

On Wed, Nov 20, 2013 at 05:28:50PM +0000, Vinayak Kale wrote:
> In Will's existing code, I think he was taking care of 'no IRQ' case
> by comparing pmu_device->num_resources. Do you think this is not
> enough and we must enforce the check after each platform_get_irq()?
> Existing driver code snippet as below for quick reference.
> 
> [snip]
> static int
> armpmu_reserve_hardware(struct arm_pmu *armpmu)
> {
>         int i, err, irq, irqs;
>         struct platform_device *pmu_device = armpmu->plat_device;
> 
>         if (!pmu_device) {
>                 pr_err("no PMU device registered\n");
>                 return -ENODEV;
>         }
> 
>         irqs = min(pmu_device->num_resources, num_possible_cpus());
>         if (irqs < 1) {
>                 pr_err("no irqs for PMUs defined\n");
>                 return -ENODEV;
>         }

This bit is fine.

>         for (i = 0; i < irqs; ++i) {
>                 err = 0;
>                 irq = platform_get_irq(pmu_device, i);
>                 if (irq < 0)
>                          continue;

This is a bug, which you can fix in your patch. IRQ0 isn't valid.

Will

  reply	other threads:[~2013-11-20 18:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20 11:13 [PATCH V4 0/2] genirq: arm64: perf: " Vinayak Kale
2013-11-20 11:13 ` [PATCH V4 1/2] genirq: Add an accessor for IRQ_PER_CPU flag Vinayak Kale
2013-11-20 18:16   ` Stephen Boyd
2013-11-21  6:06     ` Vinayak Kale
2013-11-21  6:10       ` Vinayak Kale
2013-11-22  0:54         ` Stephen Boyd
2013-11-22  6:45           ` Vinayak Kale
2013-11-20 11:13 ` [PATCH V4 2/2] arm64: perf: add support for percpu pmu interrupt Vinayak Kale
2013-11-20 13:14   ` Marc Zyngier
2013-11-20 17:28     ` Vinayak Kale
2013-11-20 18:00       ` Will Deacon [this message]
2013-11-21  6:22         ` Vinayak Kale

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=20131120180012.GJ19352@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=Marc.Zyngier@arm.com \
    --cc=jcm@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tphan@apm.com \
    --cc=vkale@apm.com \
    /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

all inboxes | Powered by JetHome®