From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linux-kernel@vger.kernel.org, linus.walleij@stericsson.com
Subject: Re: [PATCH v3] gpio: langwell: convert to use irq_domain
Date: Wed, 9 May 2012 12:56:24 +0300 [thread overview]
Message-ID: <20120509095624.GK31494@intel.com> (raw)
In-Reply-To: <20120508174434.80D773E05D0@localhost>
On Tue, May 08, 2012 at 11:44:34AM -0600, Grant Likely wrote:
> On Wed, 2 May 2012 11:15:50 +0300, Mika Westerberg <mika.westerberg@linux.intel.com> wrote:
> > irq_domain already provides a facility to translate from hardware IRQ
> > numbers to Linux IRQ numbers so use that instead of open-coding the logic
> > in the driver.
> >
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> Applied, thanks.
Thanks.
> BTW, I noticed a bug below (unrelated to this patch)...
>
> > ---
> > static int lnw_irq_type(struct irq_data *d, unsigned type)
> > {
> > struct lnw_gpio *lnw = irq_data_get_irq_chip_data(d);
> > - u32 gpio = d->irq - lnw->irq_base;
> > + u32 gpio = irqd_to_hwirq(d);
> > unsigned long flags;
> > u32 value;
> > void __iomem *grer = gpio_reg(&lnw->chip, gpio, GRER);
> > @@ -256,7 +257,8 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
> > pending &= ~mask;
> > /* Clear before handling so we can't lose an edge */
> > writel(mask, gedr);
> > - generic_handle_irq(lnw->irq_base + base + gpio);
> > + generic_handle_irq(irq_find_mapping(lnw->domain,
> > + base + gpio));
> > }
> > }
>
> This while loop is actually buggy. After handling each pending irq
> bit the status register should be re-read. Otherwise if the same irq
> gets raised again after it is handled, then this loop will ignore it.
>
> It's not a major issue, but it would mean unnecessary exiting and
> reentering the handler function.
Indeed. I'll take a look.
prev parent reply other threads:[~2012-05-09 9:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-02 8:15 [PATCH v3] gpio: langwell: convert to use irq_domain Mika Westerberg
2012-05-08 17:44 ` Grant Likely
2012-05-09 9:56 ` Mika Westerberg [this message]
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=20120509095624.GK31494@intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.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