All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Felipe Balbi <balbi@ti.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	Jason Cooper <jason@lakedaemon.net>,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>,
	Aaro Koskinen <aaro.koskinen@iki.fi>
Subject: Re: [PATCH] irqchip: omap-intc: improve IRQ handler
Date: Wed, 15 Jul 2015 01:15:42 -0700	[thread overview]
Message-ID: <20150715064923.GA17550@atomide.com> (raw)
In-Reply-To: <20150119213458.GK18552@atomide.com>

Felipe,

* Tony Lindgren <tony@atomide.com> [150119 13:41]:
> * Felipe Balbi <balbi@ti.com> [150102 10:50]:
> > as it turns out the current IRQ number will
> > *always* be available from SIR register which
> > renders the reads of PENDING registers as plain
> > unnecessary overhead.
> > 
> > In order to catch any situation where SIR reads
> > as zero, we're adding a WARN() to turn it into
> > a very verbose error and users actually report
> > it.
> > 
> > With this patch average running time of
> > omap_intc_handle_irq() reduced from about 28.5us
> > to 19.8us as measured by the kernel function
> > profiler.
> > 
> > Tested with BeagleBoneBlack Rev A5C.
> > 
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> 
> Jason, looks like this is not showing up in Linux next. The
> same for the changes I did for dm81xx.

Can you please resend this to Jason? Looks like this
is still not merged.

Regards,

Tony

> > Before applying, it would be very nice to get reports
> > from other folks on different platforms, specially OMAP2/3
> > ones which I don't have (easy) access.
> > 
> >  drivers/irqchip/irq-omap-intc.c | 35 +++++------------------------------
> >  1 file changed, 5 insertions(+), 30 deletions(-)
> > 
> > diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
> > index 28718d3..a2da6d5 100644
> > --- a/drivers/irqchip/irq-omap-intc.c
> > +++ b/drivers/irqchip/irq-omap-intc.c
> > @@ -315,37 +315,12 @@ static int __init omap_init_irq(u32 base, struct device_node *node)
> >  static asmlinkage void __exception_irq_entry
> >  omap_intc_handle_irq(struct pt_regs *regs)
> >  {
> > -	u32 irqnr = 0;
> > -	int handled_irq = 0;
> > -	int i;
> > -
> > -	do {
> > -		for (i = 0; i < omap_nr_pending; i++) {
> > -			irqnr = intc_readl(INTC_PENDING_IRQ0 + (0x20 * i));
> > -			if (irqnr)
> > -				goto out;
> > -		}
> > -
> > -out:
> > -		if (!irqnr)
> > -			break;
> > -
> > -		irqnr = intc_readl(INTC_SIR);
> > -		irqnr &= ACTIVEIRQ_MASK;
> > +	u32 irqnr;
> >  
> > -		if (irqnr) {
> > -			handle_domain_irq(domain, irqnr, regs);
> > -			handled_irq = 1;
> > -		}
> > -	} while (irqnr);
> > -
> > -	/*
> > -	 * If an irq is masked or deasserted while active, we will
> > -	 * keep ending up here with no irq handled. So remove it from
> > -	 * the INTC with an ack.
> > -	 */
> > -	if (!handled_irq)
> > -		omap_ack_irq(NULL);
> > +	irqnr = intc_readl(INTC_SIR);
> > +	irqnr &= ACTIVEIRQ_MASK;
> > +	WARN(!irqnr, "Spuriour IRQ ?\n");
> > +	handle_domain_irq(domain, irqnr, regs);
> >  }
> >  
> >  void __init omap2_init_irq(void)
> > -- 
> > 2.2.0
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] irqchip: omap-intc: improve IRQ handler
Date: Wed, 15 Jul 2015 01:15:42 -0700	[thread overview]
Message-ID: <20150715064923.GA17550@atomide.com> (raw)
In-Reply-To: <20150119213458.GK18552@atomide.com>

Felipe,

* Tony Lindgren <tony@atomide.com> [150119 13:41]:
> * Felipe Balbi <balbi@ti.com> [150102 10:50]:
> > as it turns out the current IRQ number will
> > *always* be available from SIR register which
> > renders the reads of PENDING registers as plain
> > unnecessary overhead.
> > 
> > In order to catch any situation where SIR reads
> > as zero, we're adding a WARN() to turn it into
> > a very verbose error and users actually report
> > it.
> > 
> > With this patch average running time of
> > omap_intc_handle_irq() reduced from about 28.5us
> > to 19.8us as measured by the kernel function
> > profiler.
> > 
> > Tested with BeagleBoneBlack Rev A5C.
> > 
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> 
> Jason, looks like this is not showing up in Linux next. The
> same for the changes I did for dm81xx.

Can you please resend this to Jason? Looks like this
is still not merged.

Regards,

Tony

> > Before applying, it would be very nice to get reports
> > from other folks on different platforms, specially OMAP2/3
> > ones which I don't have (easy) access.
> > 
> >  drivers/irqchip/irq-omap-intc.c | 35 +++++------------------------------
> >  1 file changed, 5 insertions(+), 30 deletions(-)
> > 
> > diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
> > index 28718d3..a2da6d5 100644
> > --- a/drivers/irqchip/irq-omap-intc.c
> > +++ b/drivers/irqchip/irq-omap-intc.c
> > @@ -315,37 +315,12 @@ static int __init omap_init_irq(u32 base, struct device_node *node)
> >  static asmlinkage void __exception_irq_entry
> >  omap_intc_handle_irq(struct pt_regs *regs)
> >  {
> > -	u32 irqnr = 0;
> > -	int handled_irq = 0;
> > -	int i;
> > -
> > -	do {
> > -		for (i = 0; i < omap_nr_pending; i++) {
> > -			irqnr = intc_readl(INTC_PENDING_IRQ0 + (0x20 * i));
> > -			if (irqnr)
> > -				goto out;
> > -		}
> > -
> > -out:
> > -		if (!irqnr)
> > -			break;
> > -
> > -		irqnr = intc_readl(INTC_SIR);
> > -		irqnr &= ACTIVEIRQ_MASK;
> > +	u32 irqnr;
> >  
> > -		if (irqnr) {
> > -			handle_domain_irq(domain, irqnr, regs);
> > -			handled_irq = 1;
> > -		}
> > -	} while (irqnr);
> > -
> > -	/*
> > -	 * If an irq is masked or deasserted while active, we will
> > -	 * keep ending up here with no irq handled. So remove it from
> > -	 * the INTC with an ack.
> > -	 */
> > -	if (!handled_irq)
> > -		omap_ack_irq(NULL);
> > +	irqnr = intc_readl(INTC_SIR);
> > +	irqnr &= ACTIVEIRQ_MASK;
> > +	WARN(!irqnr, "Spuriour IRQ ?\n");
> > +	handle_domain_irq(domain, irqnr, regs);
> >  }
> >  
> >  void __init omap2_init_irq(void)
> > -- 
> > 2.2.0
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-07-15  8:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02 18:47 [PATCH] irqchip: omap-intc: improve IRQ handler Felipe Balbi
2015-01-02 18:47 ` Felipe Balbi
2015-01-02 21:32 ` Tony Lindgren
2015-01-02 21:32   ` Tony Lindgren
2015-01-02 21:39   ` Felipe Balbi
2015-01-02 21:39     ` Felipe Balbi
2015-01-02 22:18 ` [PATCH v2] " Felipe Balbi
2015-01-02 22:18   ` Felipe Balbi
2015-01-19 21:34 ` [PATCH] " Tony Lindgren
2015-01-19 21:34   ` Tony Lindgren
2015-07-15  8:15   ` Tony Lindgren [this message]
2015-07-15  8:15     ` Tony Lindgren
2015-07-15 12:36     ` Thomas Gleixner
2015-07-15 12:36       ` Thomas Gleixner
2015-07-20 16:44       ` Felipe Balbi
2015-07-20 16:44         ` Felipe Balbi

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=20150715064923.GA17550@atomide.com \
    --to=tony@atomide.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=balbi@ti.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.