[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87cydmvdu3.ffs@tglx>
Date: Tue, 08 Apr 2025 18:05:08 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Huacai Chen <chenhuacai@...il.com>
Cc: Huacai Chen <chenhuacai@...ngson.cn>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org, Xuefeng Li <lixuefeng@...ngson.cn>, Jiaxun
Yang <jiaxun.yang@...goat.com>, stable@...r.kernel.org, Yinbo Zhu
<zhuyinbo@...ngson.cn>
Subject: Re: [PATCH] irqchip/loongson-liointc: Support to set
IRQ_TYPE_EDGE_BOTH
On Tue, Apr 08 2025 at 20:37, Huacai Chen wrote:
> On Sun, Apr 6, 2025 at 10:20 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>> This is the card change detection and it uses a GPIO. Insert raises one
>> edge and remove the opposite one.
>>
>> Which means whatever edge you chose randomly the detection will only
>> work in one direction. Please don't tell me that this is correct by any
>> meaning of correct. It's not.
>
> From experiments, either setting to EDGE_RISING or EDGE_FALLING, card
> detection (inserting and removing) works.
You might get lucky in that case because the switch bounces and there is
no debounce mechanism in place.
> Maybe the driver request "BOTH", but it really need "ANY"? I've
> searched git log, but I haven't get any useful information.
There is no maybe at all and speculation is not a technical argument.
It's well defined by the hardware:
Present ________________
| |
Not present _____| |_______________
How can you detect that with a single edge?
If the switch bounces then the signal is:
Present __ ___________ __
| | | | | |
Not present _____| |_| |_| |_______________
which makes it "work" by accident, but not by design.
There is ZERO guarantee that this will work with all other drivers which
request EDGE_BOTH.
Thanks,
tglx
Powered by blists - more mailing lists