All of lore.kernel.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] pinctrl: sunxi: Implement multiple interrupt banks support
Date: Thu, 29 May 2014 19:59:37 +0200	[thread overview]
Message-ID: <20140529175937.GW4730@lukather> (raw)
In-Reply-To: <CAGb2v65KU9UYU9Vn7X0b4-hE7WJchPxuF1UQDeECqc=-147gsA@mail.gmail.com>

On Wed, May 28, 2014 at 07:47:15PM +0800, Chen-Yu Tsai wrote:
> Hi,
> 
> On Wed, May 28, 2014 at 6:27 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > The A23 and A31 support multiple interrupt banks. Support it by adding a linear
> > domain covering all the banks. It's trickier than it should because there's an
> > interrupt per bank, so we have multiple interrupts using the same domain.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  drivers/pinctrl/sunxi/pinctrl-sunxi.c | 62 +++++++++++++++++++++++++++--------
> >  drivers/pinctrl/sunxi/pinctrl-sunxi.h | 11 +++++--
> >  2 files changed, 57 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> > index 71d6cd10d56f..69b58aacc636 100644
> > --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> > +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> > @@ -635,17 +635,25 @@ static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
> >  {
> >         struct irq_chip *chip = irq_get_chip(irq);
> >         struct sunxi_pinctrl *pctl = irq_get_handler_data(irq);
> > -       const unsigned long reg = readl(pctl->membase + IRQ_STATUS_REG);
> > +       unsigned long bank, reg, val;
> > +
> > +       for (bank = 0; bank < pctl->desc->irq_banks; bank++)
> > +               if (irq == pctl->irq[bank])
> > +                       break;
> 
> bail out or BUG_ON(bank == pctl->desc->irq_banks)?
> (dumb question: would this even happen?)

This can be a spurious interrupt, so I'd prefer to just bail out.

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140529/6ea9a852/attachment.sig>

  parent reply	other threads:[~2014-05-29 17:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 10:27 [PATCH 0/5] pinctrl: sunxi: Add A31 external interrupts support Maxime Ripard
2014-05-28 10:27 ` [PATCH 1/5] pinctrl: sunxi: Remove irq_mask_ack and use irq_ack instead Maxime Ripard
2014-05-28 10:27 ` [PATCH 2/5] pinctrl: sunxi: Add macro definition for pinctrl with more than one interrupt Maxime Ripard
2014-05-28 10:27 ` [PATCH 3/5] pinctrl: sunxi: Declare the number of interrupt banks in the descriptor Maxime Ripard
2014-05-28 10:27 ` [PATCH 4/5] pinctrl: sunxi: Declare the interrupt function for the A31 Maxime Ripard
2014-05-28 10:27 ` [PATCH 5/5] pinctrl: sunxi: Implement multiple interrupt banks support Maxime Ripard
2014-05-28 11:47   ` Chen-Yu Tsai
2014-05-28 12:04     ` Chen-Yu Tsai
2014-05-29 18:32       ` Maxime Ripard
2014-05-29 17:59     ` Maxime Ripard [this message]
2014-05-28 12:14 ` [PATCH 0/5] pinctrl: sunxi: Add A31 external interrupts support Chen-Yu Tsai

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=20140529175937.GW4730@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.