From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Eugeniu Rosca <erosca@de.adit-jv.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drivers: irqchip: add irq-type-changer
Date: Tue, 25 Jan 2022 22:33:47 +0300 [thread overview]
Message-ID: <8b5681a0-a9ab-8ad7-b293-ce1342e43099@cogentembedded.com> (raw)
In-Reply-To: <871r0w86wv.wl-maz@kernel.org>
> Such HW can stay in the bin.
Huh? Industry is full of ugly hardware (that is still surprisingly useful to cover practical needs at
low cost - which ensures it will persist). Sure I'd prefer to spend time for something better than
negotiating workarounds to keep ugly hardware working. But after 20+ years in the industry, I can only
agree with the statement Linus wrote back in 2006 in [1]:
| For a driver writer, there is one rule above _all_ other rules:
|
| "Reality sucks, deal with it"
|
| That rule is inviolate, and no amount of "I wish", and "it _should_
| work this way" or "..but the documentation says" matters at all.
[1] https://lore.kernel.org/lkml/Pine.LNX.4.64.0604241156340.3701@g5.osdl.org/
Can we finally stop blaming and propose a practical way to solve the original issue?
If the only solution you are ready to accept is the code that supports inversion only, and uses node's
"interrupts" property to provide info for interrupt-grand-parent, please state that explicitly.
<skipping all the statements I don't agree with>
> (I really should put a WARN_ON() in the irqdomain
> code to catch this sort of things).
I do support this idea.
Is a WARN_ON() in irq_domain_set_mapping() checking that nothing is already assigned to this hwirq in
this domain good enough to serve this purpose?
I.e. for a linear domain (which shall be enough to catch the wl18xx-on-kf case where both parent domain
and irq-type-changer's domain are linear):
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -521,9 +521,10 @@ static void irq_domain_set_mapping(struct irq_domain *domain,
return;
mutex_lock(&domain->revmap_mutex);
- if (hwirq < domain->revmap_size)
+ if (hwirq < domain->revmap_size) {
+ WARN_ON(domain->revmap[hwirq] != NULL);
rcu_assign_pointer(domain->revmap[hwirq], irq_data);
- else
+ } else
radix_tree_insert(&domain->revmap_tree, hwirq, irq_data);
mutex_unlock(&domain->revmap_mutex);
}
This does not hit on my code.
Could you please suggest a better location for WARN_ON() that will hit?
Nikita
prev parent reply other threads:[~2022-01-25 19:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 9:56 Nikita Yushchenko
2022-01-24 12:28 ` Marc Zyngier
2022-01-25 5:47 ` Nikita Yushchenko
2022-01-25 8:59 ` Marc Zyngier
2022-01-25 9:35 ` Nikita Yushchenko
2022-01-25 10:08 ` Marc Zyngier
2022-01-25 19:33 ` Nikita Yushchenko [this message]
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=8b5681a0-a9ab-8ad7-b293-ce1342e43099@cogentembedded.com \
--to=nikita.yoush@cogentembedded.com \
--cc=erosca@de.adit-jv.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®