From: Thomas Gleixner <tglx@linutronix.de>
To: richard clark <richard.xnu.clark@gmail.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
torvalds@linux-foundation.org
Subject: Re: [PATCH] irq: fix the interrupt trigger type override issue
Date: Mon, 02 Sep 2024 11:51:33 +0200 [thread overview]
Message-ID: <877cbu7596.ffs@tglx> (raw)
In-Reply-To: <CAJNi4rPm2N=_H7LjT3X3_b2-UVZP+EEOw-ztwBwWBs=vMtfYQQ@mail.gmail.com>
Richard!
On Mon, Sep 02 2024 at 16:42, richard clark wrote:
> On Mon, Sep 2, 2024 at 3:34 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>> 1) insmod()
>> irq_create_fwspec_mapping(fwspec)
>> irq_domain_translate(fwspec, ... &type); <- Sets type to the FW value
>>
>> virq = irq_find_mapping(domain, hwirq);
>> if (virq) {
>> // Path not taken
>> }
>>
>> // Map interrupt
>> ...
>>
>> irqd_set_trigger_type(..., type);
>>
>> 2) rmmod()
>> tears down mapping
>>
> This just tears down the action allocated and installed by
> request_irq(...), but does not teardown the irq's node inserted in the
> revmap_tree.
So what creates the mapping? If the driver creates it then why doesn't
it unmap it when it exits?
>> 3) insmod()
>>
>> Should be exactly the same as #1 because the previous mapping was
>> torn down by rmmod()
>>
> Not the same exactly, the {irq, irq_data} will still be in the
> revmap_tree, so it will enter another path in this case:
That's exactly the question. Why does the mapping persist?
>> So how exactly does that happen what you describe?
>>
> The logic is if the trigger type specified by request_irq(...) is not
> consistent with the firmware one, the request_irq will override the
> FW. We need to keep this logic the same as when we insmod the same
> kmod next time -- override the FW's too instead of returning a
> mismatch type error.
I can see how that can happen, but what's missing is the information why
this mapping persists and why it's tried to be set up again.
Thanks,
tglx
next prev parent reply other threads:[~2024-09-02 9:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 3:17 [PATCH] irq: fix the interrupt trigger type override issue Richard Clark
2024-09-02 7:34 ` Thomas Gleixner
2024-09-02 8:42 ` richard clark
2024-09-02 9:51 ` Thomas Gleixner [this message]
2024-09-02 12:50 ` richard clark
2024-09-02 14:39 ` Thomas Gleixner
2024-09-03 7:55 ` Richard Clark
2024-09-03 10:18 ` 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=877cbu7596.ffs@tglx \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.xnu.clark@gmail.com \
--cc=torvalds@linux-foundation.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).