All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] gpio: dwapb: fix missing first irq for edgeboth irq type
       [not found] <20170601232715.2788-1-xgchenshy@gmail.com>
@ 2017-06-05  6:50 ` 陈晓光
  2017-06-09  9:26 ` Linus Walleij
  2017-06-20 11:34 ` Linus Walleij
  2 siblings, 0 replies; 5+ messages in thread
From: 陈晓光 @ 2017-06-05  6:50 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, gnurou, Xiaoguang Chen

Hi, Guys
Any comments for this change?


Thanks
Xiaoguang

2017-06-02 7:27 GMT+08:00  <xgchenshy@gmail.com>:
> 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.
>
> Signed-off-by: Xiaoguang Chen <xgchenshy@gmail.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)
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpio: dwapb: fix missing first irq for edgeboth irq type
       [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
  2017-06-20 11:34 ` Linus Walleij
  2 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2017-06-09  9:26 UTC (permalink / raw)
  To: xgchenshy, Jisheng Zhang, Hoan Tran, Jiang Qiu, Jamie Iles; +Cc: linux-gpio

Adding driver authors to the To: Line and top posting to get some
review.

Yours,
Linus Walleij


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.
>
> Signed-off-by: Xiaoguang Chen <xgchenshy@gmail.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)
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [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
  2017-06-20  2:40     ` Jisheng Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Jisheng Zhang @ 2017-06-12  5:05 UTC (permalink / raw)
  To: Linus Walleij; +Cc: xgchenshy, Hoan Tran, Jiang Qiu, Jamie Iles, linux-gpio

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)
> >  


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpio: dwapb: fix missing first irq for edgeboth irq type
  2017-06-12  5:05   ` Jisheng Zhang
@ 2017-06-20  2:40     ` Jisheng Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Jisheng Zhang @ 2017-06-20  2:40 UTC (permalink / raw)
  To: Linus Walleij; +Cc: xgchenshy, Hoan Tran, Jiang Qiu, Jamie Iles, linux-gpio

On Mon, 12 Jun 2017 13:05:30 +0800 Jisheng Zhang wrote:

> 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>

Per my test, this patch fixes the following bug:

make use of CD-GPIO mechanism. Cold boot with sdcard inserted, hot-unplug
the sdcard, sometimes, kernel won't get the remove interrupt.

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpio: dwapb: fix missing first irq for edgeboth irq type
       [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-20 11:34 ` Linus Walleij
  2 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2017-06-20 11:34 UTC (permalink / raw)
  To: Xiaoguang Chen; +Cc: linux-gpio, Alexandre Courbot

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.
>
> Signed-off-by: Xiaoguang Chen <xgchenshy@gmail.com>

Patch applied with Jisheng's tested tag.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-20 11:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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
2017-06-20  2:40     ` Jisheng Zhang
2017-06-20 11:34 ` Linus Walleij

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.