linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
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 08:59:29 +0000	[thread overview]
Message-ID: <874k5s8a32.wl-maz@kernel.org> (raw)
In-Reply-To: <a179c80c-7ce8-da1a-f344-5d72b65c3da4@cogentembedded.com>

On Tue, 25 Jan 2022 05:47:37 +0000,
Nikita Yushchenko <nikita.yoush@cogentembedded.com> wrote:
> 
> Hi
> 
> > I also don't see why you model this as the actual device that triggers
> > the interrupt.
> 
> Well, that somehow matches the physical reality. In the case of wl18xx
> on KF, physically the interrupt signal indeed originates from the
> intermediate chip - the inverting level-shifter.

Reality? By allowing something like an edge-to-level conversion? How
can that work?

> 
> I remember your suggestion to configure interrupt source's node with
> interrupt-parent set to inverter and interrupt details for inverter's
> parent. But this looks hacky and inconsistent for me.

We'll have to agree to disagree.

> 
> In contrary, an abstraction of intermediate entity that does a static
> conversion of the trigger type and does not need any software control,
> looks sane. And, hardware designers do strange things sometimes, I
> won't be surprised observing a change from level to edge one day.

If you think that it can happen without a HW register that latches the
edge and requires an ack, you need to question your understanding of
an interrupt life cycle, and of the properties of the various trigger
types.

> Thus it looked a good idea not to limit the conversion to inversion,
> but support arbitrary one. Then, irqspec inside the node for the
> intermediate entity obtains a meaning, making the entire model
> consistent.

Again, this cannot work, because the very *semantics* of an edge
interrupt (event) cannot directly be converted in a level (state).

> 
> I don't strongly insist on this approach, it just looks cleaner for me.
> 
> 
> > I'm also pretty sure that with the current code,
> > you end-up with *two* interrupts (one for the inverter and one for the
> > end-point).
> 
> In driver's init, I only call of_irq_parse_one() for interrupt defined
> in the changer's node. This does not create a mapping for it. The
> mapping is only created when changer's "interrupt-child" creates a
> mapping for their interrupt - then changer's alloc() routine calls
> irq_domain_alloc_irqs_parent() in the same way as all other
> hierarchical irqchips do.
> 
> I don't see where double mapping can appear here. Please explain.

Just look at your code. You start probing a device that has an
'interrupts' property. This triggers the allocation of an interrupt.
Then the endpoint also has an 'interrupts' property, also allocating
an interrupt. You then happily override the mapping of the first IRQ
with the second one in the parent irqchip.

That's just broken.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2022-01-25  9:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  9:56 [PATCH v2] drivers: irqchip: add irq-type-changer Nikita Yushchenko
2022-01-24 12:28 ` Marc Zyngier
2022-01-25  5:47   ` Nikita Yushchenko
2022-01-25  8:59     ` Marc Zyngier [this message]
2022-01-25  9:35       ` Nikita Yushchenko
2022-01-25 10:08         ` Marc Zyngier
2022-01-25 19:33           ` Nikita Yushchenko

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=874k5s8a32.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=erosca@de.adit-jv.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikita.yoush@cogentembedded.com \
    --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;
as well as URLs for NNTP newsgroup(s).