[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdYTrdrSVWSfpEqP7Wekk+_j+rO60Xrn1jY1OzjmNHJLcA@mail.gmail.com>
Date: Fri, 26 Aug 2022 10:12:14 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Jianqun Xu <jay.xu@...k-chips.com>
Cc: heiko@...ech.de, jeffy.chen@...k-chips.com,
linux-gpio@...r.kernel.org, linux-rockchip@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio/rockchip: handle irq before toggle trigger for edge
type irq
On Fri, Aug 19, 2022 at 3:41 AM Jianqun Xu <jay.xu@...k-chips.com> wrote:
> The irq demux for rockchip gpio interrupts do real irq handle after loop
> over the bits from int status register. Some oldder SoCs such as RK3308
> has no both edge trigger type support, replaced by a soft both type
> which switch trigger type once a level type triggered.
>
> For example, a irq is set to a IRQ_TYPE_EDGE_BOTH trigger type, but the
> SoC not support really both edge trigger type, use a
> IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING instead.
>
> --------
> ____| |______
>
> ^ ^
> | |
> | [0] the falling edge come before irq ack set by driver !
> |
> rockchip_irq_demux set to EDGE_FALLING type
> rockchip_irq_demux call generic_handle_irq
> -> handle_edge_irq
> -> irq_gc_ack_set_bit
>
> The [0] irq will lost by software on board test.
>
> With this patch, the generic_handle_irq has been move ahead before
> trigger toggle to fix the [0] lost issue.
>
> Signed-off-by: Jianqun Xu <jay.xu@...k-chips.com>
This looks fragile, but such is the nature of this dual-edge emulation.
If it works better in practice like this, it is better.
Acked-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists