stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Huacai Chen <chenhuacai@gmail.com>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
	loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
	Xuefeng Li <lixuefeng@loongson.cn>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	stable@vger.kernel.org, Yinbo Zhu <zhuyinbo@loongson.cn>
Subject: Re: [PATCH] irqchip/loongson-liointc: Support to set IRQ_TYPE_EDGE_BOTH
Date: Sun, 06 Apr 2025 16:19:59 +0200	[thread overview]
Message-ID: <875xjhwewg.ffs@tglx> (raw)
In-Reply-To: <CAAhV-H6r_iiKauPB=7eWhyTetvsTvxt5O9HtmmKb72y62yvXnA@mail.gmail.com>

On Sun, Apr 06 2025 at 20:46, Huacai Chen wrote:
> On Sun, Apr 6, 2025 at 6:18 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>> On Sun, Apr 06 2025 at 17:46, Huacai Chen wrote:
>> > On Thu, Apr 3, 2025 at 11:48 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>> >> But it won't trigger on both. So no, you cannot claim that this fixes
>> >> anything.
>> > Yes, it won't trigger on both (not perfect), but it allows drivers
>> > that request "both" work (better than fail to request), and there are
>>
>> By some definition of 'work'. There is probably a good technical reason
>> why those drivers expect EDGE_BOTH to work correctly and otherwise fail
>> to load.
> The real problem we encounter is the MMC driver. In
> drivers/mmc/core/slot-gpio.c there is
> devm_request_threaded_irq(host->parent, irq,
>                         NULL, ctx->cd_gpio_isr,
>                         IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
> IRQF_ONESHOT,
>                         ctx->cd_label, host);
>
> "IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING" is an alias of
> "IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING", and
> "IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING" is
> "IRQ_TYPE_EDGE_BOTH".

I know that.

> Except MMC, "grep IRQ_TYPE_EDGE_BOTH drivers" can give some more examples.

Sure, but you still do not explain why this works even when the driver
is obviously depending on EDGE_BOTH. If it does not then the driver is
bogus.

Looking at it, there is obviously a reason for this particular driver to
request BOTH. Why?

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. 

The driver is perfectly fine, when the request fails. It then does the
obvious right thing to poll the card detection pin.

So your change makes it worse as it screws up the detection mechanism.

What are you actually making "work"?

Thanks,

        tglx

  reply	other threads:[~2025-04-06 14:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02  9:25 [PATCH] irqchip/loongson-liointc: Support to set IRQ_TYPE_EDGE_BOTH Huacai Chen
2025-04-03 15:48 ` Thomas Gleixner
2025-04-06  9:46   ` Huacai Chen
2025-04-06 10:18     ` Thomas Gleixner
2025-04-06 12:46       ` Huacai Chen
2025-04-06 14:19         ` Thomas Gleixner [this message]
2025-04-08 12:37           ` Huacai Chen
2025-04-08 16:05             ` Thomas Gleixner

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=875xjhwewg.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=chenhuacai@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=zhuyinbo@loongson.cn \
    /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).