lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 4 May 2011 16:22:53 -0400 (EDT)
From:	Nicolas Pitre <nicolas.pitre@...aro.org>
To:	Per Forlin <per.forlin@...aro.org>
cc:	linux-mmc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	lkml <linux-kernel@...r.kernel.org>, linaro-dev@...ts.linaro.org,
	Stefan Nilsson XK <stefan.xk.nilsson@...ricsson.com>
Subject: Re: [PATCH v2] sdio: optimized SDIO IRQ handling for single irq

On Wed, 4 May 2011, Per Forlin wrote:

> On 4 May 2011 19:34, Nicolas Pitre <nicolas.pitre@...aro.org> wrote:
> > On Wed, 4 May 2011, Per Forlin wrote:
> >
> >> From: Stefan Nilsson XK <stefan.xk.nilsson@...ricsson.com>
> >>
> >> If there is only 1 function registered it is possible to
> >> improve performance by directly calling the irq handler
> >> and avoiding the overhead of reading the CCCR registers.
> >>
> >> Signed-off-by: Per Forlin <per.forlin@...aro.org>
> >> Acked-by: Ulf Hansson <ulf.hansson@...ricsson.com>
> >> ---
> >>  drivers/mmc/core/sdio_irq.c |   30 ++++++++++++++++++++++++++++++
> >>  include/linux/mmc/card.h    |    1 +
> >>  2 files changed, 31 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
> >> index b300161..64c4409 100644
> >> --- a/drivers/mmc/core/sdio_irq.c
> >> +++ b/drivers/mmc/core/sdio_irq.c
> >> @@ -32,6 +32,16 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
> >>       int i, ret, count;
> >>       unsigned char pending;
> >>
> >> +     /*
> >> +      * Optimization, if there is only 1 function registered
> >> +      * call irq handler directly
> >> +      */
> >> +     if (card->sdio_single_irq && card->sdio_single_irq->irq_handler) {
> >> +             struct sdio_func *func = card->sdio_single_irq;
> >> +             func->irq_handler(func);
> >
> > I think there is little point using a func variable here, especially
> > since you already reference the handler pointer in the if() statement.
> > Hence:
> >
> >        if (card->sdio_single_irq && card->sdio_single_irq->irq_handler) {
> >                card->sdio_single_irq->irq_handler();
> >                return 1;
> >        }
> >
> What do you think about:
> +       struct sdio_func *func = card->sdio_single_irq;
> +
> +       /*
> +        * Optimization, if there is only 1 function interrupt registered
> +        * call irq handler directly
> +        */
> +       if (func) {
> +               func->irq_handler(func);
> +               return 1;
> +       }

Sure, but I'd move the assignment right before the if() in that case for 
clarity:

       struct sdio_func *func;

       /*
        * Optimization, if there is only 1 function interrupt registered
        * call irq handler directly
        */
       func = card->sdio_single_irq;
       if (func) {
               func->irq_handler(func);
               return 1;
       }
       [...]


Nicolas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ