From: Jisheng Zhang <jszhang@marvell.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: xgchenshy@gmail.com, Hoan Tran <hotran@apm.com>,
Jiang Qiu <qiujiang@huawei.com>, Jamie Iles <jamie@jamieiles.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH] gpio: dwapb: fix missing first irq for edgeboth irq type
Date: Mon, 12 Jun 2017 13:05:30 +0800 [thread overview]
Message-ID: <20170612130530.724305b5@xhacker> (raw)
In-Reply-To: <CACRpkdbnXOab-wn3z9BQrs7RVrqag8wtdwsmUvekYLY29rxdVw@mail.gmail.com>
On Fri, 9 Jun 2017 11:26:19 +0200 Linus Walleij wrote:
>
> On Fri, Jun 2, 2017 at 1:27 AM, <xgchenshy@gmail.com> wrote:
> > From: Xiaoguang Chen <xgchenshy@gmail.com>
> >
> > dwapb_irq_set_type overwrites polarity register value for
> > IRQ_TYPE_EDGE_BOTH case. If the polarity of one gpio is 0
> > by default, then it will set falling edge irq trigger.
> > and the gpio may requires rising edge irq for the first time,
> > and it will be missed.
> >
> > Do not overwrite polarity register for IRQ_TYPE_EDGE_BOTH case
> > can solve this issue.
I think this is a correct fix.
> >
> > Signed-off-by: Xiaoguang Chen <xgchenshy@gmail.com>
Tested-by: Jisheng Zhang <jszhang@marvell.com>
> > ---
> > drivers/gpio/gpio-dwapb.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> > index f051c45..80913e4 100644
> > --- a/drivers/gpio/gpio-dwapb.c
> > +++ b/drivers/gpio/gpio-dwapb.c
> > @@ -288,7 +288,8 @@ static int dwapb_irq_set_type(struct irq_data *d, u32 type)
> > irq_setup_alt_chip(d, type);
> >
> > dwapb_write(gpio, GPIO_INTTYPE_LEVEL, level);
> > - dwapb_write(gpio, GPIO_INT_POLARITY, polarity);
> > + if (type != IRQ_TYPE_EDGE_BOTH)
> > + dwapb_write(gpio, GPIO_INT_POLARITY, polarity);
> > spin_unlock_irqrestore(&gc->bgpio_lock, flags);
> >
> > return 0;
> > --
> > 2.8.4 (Apple Git-73)
> >
next prev parent reply other threads:[~2017-06-12 5:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170601232715.2788-1-xgchenshy@gmail.com>
2017-06-05 6:50 ` [PATCH] gpio: dwapb: fix missing first irq for edgeboth irq type 陈晓光
2017-06-09 9:26 ` Linus Walleij
2017-06-12 5:05 ` Jisheng Zhang [this message]
2017-06-20 2:40 ` Jisheng Zhang
2017-06-20 11:34 ` Linus Walleij
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=20170612130530.724305b5@xhacker \
--to=jszhang@marvell.com \
--cc=hotran@apm.com \
--cc=jamie@jamieiles.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=qiujiang@huawei.com \
--cc=xgchenshy@gmail.com \
/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