From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH 2/6] TXx9: Microoptimize interrupt handlers
Date: Wed, 03 Sep 2008 14:13:26 +0400 [thread overview]
Message-ID: <48BE6346.4070207@ru.mvista.com> (raw)
In-Reply-To: <1220275361-5001-2-git-send-email-anemo@mba.ocn.ne.jp>
Hello.
Atsushi Nemoto wrote:
> The IOC interrupt status register on RBTX49XX only have 8 bits. Use
> 8-bit version of __fls() to optimize interrupt handlers.
>
But doesn't the patch also change the result of
toshiba_rbtx49{27|38}_irq_nested() if the register reads back as 0?
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
> arch/mips/txx9/rbtx4927/irq.c | 6 +++---
> arch/mips/txx9/rbtx4938/irq.c | 8 ++++----
> include/asm-mips/txx9/generic.h | 18 ++++++++++++++++++
> 3 files changed, 25 insertions(+), 7 deletions(-)
>
> diff --git a/arch/mips/txx9/rbtx4927/irq.c b/arch/mips/txx9/rbtx4927/irq.c
> index 22076e3..9c14ebb 100644
> --- a/arch/mips/txx9/rbtx4927/irq.c
> +++ b/arch/mips/txx9/rbtx4927/irq.c
> @@ -133,9 +133,9 @@ static int toshiba_rbtx4927_irq_nested(int sw_irq)
> u8 level3;
>
> level3 = readb(rbtx4927_imstat_addr) & 0x1f;
> - if (level3)
> - sw_irq = RBTX4927_IRQ_IOC + fls(level3) - 1;
> - return sw_irq;
> + if (unlikely(!level3))
> + return -1;
> + return RBTX4927_IRQ_IOC + __fls8(level3);
> }
>
> static void __init toshiba_rbtx4927_irq_ioc_init(void)
> diff --git a/arch/mips/txx9/rbtx4938/irq.c b/arch/mips/txx9/rbtx4938/irq.c
> index ca2f830..7d21bef 100644
> --- a/arch/mips/txx9/rbtx4938/irq.c
> +++ b/arch/mips/txx9/rbtx4938/irq.c
> @@ -85,10 +85,10 @@ static int toshiba_rbtx4938_irq_nested(int sw_irq)
> u8 level3;
>
> level3 = readb(rbtx4938_imstat_addr);
> - if (level3)
> - /* must use fls so onboard ATA has priority */
> - sw_irq = RBTX4938_IRQ_IOC + fls(level3) - 1;
> - return sw_irq;
> + if (unlikely(!level3))
> + return -1;
> + /* must use fls so onboard ATA has priority */
> + return RBTX4938_IRQ_IOC + __fls8(level3);
> }
>
> static void __init
WBR, Sergei
next prev parent reply other threads:[~2008-09-03 10:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 13:22 [PATCH 2/6] TXx9: Microoptimize interrupt handlers Atsushi Nemoto
2008-09-03 10:13 ` Sergei Shtylyov [this message]
2008-09-03 15:52 ` Atsushi Nemoto
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=48BE6346.4070207@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/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