devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hongkun.cao <hongkun.cao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	hongzhou.yang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	erin.lo-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] pinctrl: mediatek: fix dual-edge code defect
Date: Tue, 24 May 2016 11:10:54 +0800	[thread overview]
Message-ID: <1464059454.27362.16.camel@mtksdaap41> (raw)
In-Reply-To: <5742DDE5.7050701-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Mon, 2016-05-23 at 12:39 +0200, Matthias Brugger wrote:
> 
> On 21/05/16 09:23, hongkun.cao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org wrote:
> > From: "hongkun.cao" <hongkun.cao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> >
> > When a dual-edge irq is triggered, an incorrect irq will be reported on
> > condition that the external signal is not stable and this incorrect irq
> > has been registered.
> > Correct the register offset.
> >
> 
> I'm not sure what you want to say. From what I can see the without this 
> fix, the the wrong IRQ will be cleared and raised. Is this what you are 
> addressing?
> 
> If so:

Hi, Matthias,
Thanks for your comments.
Yes, you are right.
Suppose there are two irqs registered in our system with special
relationship, One hardware irq  number is 17 with both edge trigger, and
the other hardware irq number is 49(17+32),then hardware irq 49 may be
reported unexpectedly if hardware irq 17 occurred.

> Reviewed-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> > Signed-off-by: hongkun.cao <hongkun.cao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> > ---
> >   drivers/pinctrl/mediatek/pinctrl-mtk-common.c |    5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > index 2bbe6f7..92ae49f 100644
> > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > @@ -1255,9 +1255,10 @@ static void mtk_eint_irq_handler(struct irq_desc *desc)
> >   	const struct mtk_desc_pin *pin;
> >
> >   	chained_irq_enter(chip, desc);
> > -	for (eint_num = 0; eint_num < pctl->devdata->ap_num; eint_num += 32) {
> > +	for (eint_num = 0;
> > +	     eint_num < pctl->devdata->ap_num;
> > +	     eint_num += 32, reg += 4) {
> >   		status = readl(reg);
> > -		reg += 4;
> >   		while (status) {
> >   			offset = __ffs(status);
> >   			index = eint_num + offset;
> >

  parent reply	other threads:[~2016-05-24  3:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-21  7:23 [PATCH] pinctrl: mediatek: fix dual-edge code defect hongkun.cao
2016-05-23 10:39 ` Matthias Brugger
     [not found]   ` <5742DDE5.7050701-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-24  3:10     ` hongkun.cao [this message]
2016-05-31  8:13 ` 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=1464059454.27362.16.camel@mtksdaap41 \
    --to=hongkun.cao-nus5lvnupcjwk0htik3j/w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=erin.lo-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=hongzhou.yang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).