linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sekhar Nori <nsekhar@ti.com>
To: Felipe Balbi <balbi@ti.com>, Tony Lindgren <tony@atomide.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Marc Zyngier <marc.zyngier@arm.com>
Cc: John Ogness <john.ogness@linutronix.de>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] irqchip: omap-intc: add support for spurious irq handling
Date: Thu, 10 Dec 2015 20:46:50 +0530	[thread overview]
Message-ID: <56699762.1030501@ti.com> (raw)
In-Reply-To: <87mvtlm4ts.fsf@saruman.tx.rr.com>

Hi Felipe,

On Tuesday 08 December 2015 07:15 PM, Felipe Balbi wrote:
> Sekhar Nori <nsekhar@ti.com> writes:

>> +	/*
>> +	 * A spurious IRQ can result if interrupt that triggered the
>> +	 * sorting is no longer active during the sorting (10 INTC
>> +	 * functional clock cycles after interrupt assertion). Or a
>> +	 * change in interrupt mask affected the result during sorting
>> +	 * time. There is no special handling required except ignoring
>> +	 * the SIR register value just read and retrying.
>> +	 * See section 6.2.5 of AM335x TRM Literature Number: SPRUH73K
>> +	 *
>> +	 * Many a times, a spurious interrupt situation has been fixed
>> +	 * by adding a flush for the posted write acking the IRQ in
>> +	 * the device driver. Typically, this is going be the device
>> +	 * driver whose interrupt was handled just before the spurious
>> +	 * IRQ occurred. Pay attention to those device drivers if you
>> +	 * run into hitting the spurious IRQ condition below.
>> +	 */
>> +	if ((irqnr & SPURIOUSIRQ_MASK) == SPURIOUSIRQ_MASK) {
> 
> sounds like unlikely() wouldn't hurt here.

I can add, but looks like it does not make a big difference. See below.

> 
>> +		pr_err_once("%s: spurious irq!\n", __func__);
>> +		irq_err_count++;
>> +		omap_ack_irq(NULL);
>> +		return;
>> +	}
>> +
>>  	irqnr &= ACTIVEIRQ_MASK;
>> -	WARN_ONCE(!irqnr, "Spurious IRQ ?\n");
>>  	handle_domain_irq(domain, irqnr, regs);
> 
> care to run kernel function profiler against omap_intc_handle_irq()
> before and after this patch ?

Before this patch I see average running time time of 34us. That
increases to 37.8us after this patch. With unlikely() the number I got
was 37.4us. So the benefit with unlikely() is in the noise range.

This was using AM335x EVM at 720 MHz.

Thanks,
Sekhar

  reply	other threads:[~2015-12-10 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 11:02 [PATCH v2] irqchip: omap-intc: add support for spurious irq handling Sekhar Nori
2015-12-08 13:45 ` Felipe Balbi
2015-12-10 15:16   ` Sekhar Nori [this message]
2015-12-15 14:27     ` Sekhar Nori

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=56699762.1030501@ti.com \
    --to=nsekhar@ti.com \
    --cc=balbi@ti.com \
    --cc=jason@lakedaemon.net \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).