All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Dmitry Osipenko <digetx@gmail.com>,
	Sowjanya Komatineni <skomatineni@nvidia.com>,
	Venkat Reddy Talla <vreddytalla@nvidia.com>,
	kernel-team@android.com
Subject: Re: [PATCH v2 1/4] genirq/irqdomain: Allow partial trimming of irq_data hierarchy
Date: Wed, 07 Oct 2020 13:23:58 +0100	[thread overview]
Message-ID: <02226efd42fdb249b81c01eb702100e9@kernel.org> (raw)
In-Reply-To: <738593a42b62ea7905e4a680775cb996@kernel.org>

On 2020-10-07 09:53, Marc Zyngier wrote:
> On 2020-10-07 09:05, Marc Zyngier wrote:
>> On 2020-10-06 21:39, Thomas Gleixner wrote:

[...]

>>> This is butt ugly, really. Especially the use case where the tegra 
>>> PMC
>>> domain removes itself from the hierarchy from .alloc()
>> 
>> I don't disagree at all. It is both horrible and dangerous.
>> 
>> My preference would have been to split the PMC domain into discrete
>> domains, each one having having its own depth. But that's incredibly
>> hard to express in DT, and would break the combination of old/new
>> DT and kernel.
>> 
>>> That said, I don't have a better idea either. Sigh...
>> 
>> A (very minor) improvement would be to turn the trim call in the PMC 
>> driver into
>> a flag set in the first invalid irq_data structure, and let
>> __irq_domain_alloc_irqs() do the dirty work.
>> 
>> Still crap, but at least would prevent some form of abuse. Thoughts?
> 
> Actually, I wonder whether we can have a more general approach:
> 
> A partial hierarchy that doesn't have an irq_data->chip pointer 
> populated
> cannot be valid. So I wonder if the least ugly thing to do is to just 
> drop
> any messing about in the PMC driver, and instead to let
> __irq_domain_alloc_irqs()
> do the culling, always, by looking for a NULL pointer in 
> irq_data->chip.
> 
> Not any less ugly, but at least doesn't need any driver intervention.

[still talking to myself...]

I implemented that, and it has the advantage of placing the hack in a
single location. It even booted on a garden variety of systems.

I'll post an updated series, and we can compare the various levels
of ugliness.

         M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Venkat Reddy Talla <vreddytalla@nvidia.com>,
	linux-kernel@vger.kernel.org,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Sowjanya Komatineni <skomatineni@nvidia.com>,
	linux-tegra@vger.kernel.org, Dmitry Osipenko <digetx@gmail.com>,
	kernel-team@android.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/4] genirq/irqdomain: Allow partial trimming of irq_data hierarchy
Date: Wed, 07 Oct 2020 13:23:58 +0100	[thread overview]
Message-ID: <02226efd42fdb249b81c01eb702100e9@kernel.org> (raw)
In-Reply-To: <738593a42b62ea7905e4a680775cb996@kernel.org>

On 2020-10-07 09:53, Marc Zyngier wrote:
> On 2020-10-07 09:05, Marc Zyngier wrote:
>> On 2020-10-06 21:39, Thomas Gleixner wrote:

[...]

>>> This is butt ugly, really. Especially the use case where the tegra 
>>> PMC
>>> domain removes itself from the hierarchy from .alloc()
>> 
>> I don't disagree at all. It is both horrible and dangerous.
>> 
>> My preference would have been to split the PMC domain into discrete
>> domains, each one having having its own depth. But that's incredibly
>> hard to express in DT, and would break the combination of old/new
>> DT and kernel.
>> 
>>> That said, I don't have a better idea either. Sigh...
>> 
>> A (very minor) improvement would be to turn the trim call in the PMC 
>> driver into
>> a flag set in the first invalid irq_data structure, and let
>> __irq_domain_alloc_irqs() do the dirty work.
>> 
>> Still crap, but at least would prevent some form of abuse. Thoughts?
> 
> Actually, I wonder whether we can have a more general approach:
> 
> A partial hierarchy that doesn't have an irq_data->chip pointer 
> populated
> cannot be valid. So I wonder if the least ugly thing to do is to just 
> drop
> any messing about in the PMC driver, and instead to let
> __irq_domain_alloc_irqs()
> do the culling, always, by looking for a NULL pointer in 
> irq_data->chip.
> 
> Not any less ugly, but at least doesn't need any driver intervention.

[still talking to myself...]

I implemented that, and it has the advantage of placing the hack in a
single location. It even booted on a garden variety of systems.

I'll post an updated series, and we can compare the various levels
of ugliness.

         M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-10-07 12:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 10:11 [PATCH v2 0/4] soc/tegra: Prevent the PMC driver from corrupting interrupt routing Marc Zyngier
2020-10-06 10:11 ` Marc Zyngier
2020-10-06 10:11 ` [PATCH v2 1/4] genirq/irqdomain: Allow partial trimming of irq_data hierarchy Marc Zyngier
2020-10-06 10:11   ` Marc Zyngier
2020-10-06 20:39   ` Thomas Gleixner
2020-10-06 20:39     ` Thomas Gleixner
2020-10-07  8:05     ` Marc Zyngier
2020-10-07  8:05       ` Marc Zyngier
2020-10-07  8:53       ` Marc Zyngier
2020-10-07  8:53         ` Marc Zyngier
2020-10-07 12:23         ` Marc Zyngier [this message]
2020-10-07 12:23           ` Marc Zyngier
2020-10-07 12:54         ` Thomas Gleixner
2020-10-07 12:54           ` Thomas Gleixner
2020-10-06 10:11 ` [PATCH v2 2/4] gpio: tegra186: Allow optional irq parent callbacks Marc Zyngier
2020-10-06 10:11   ` Marc Zyngier
2020-10-06 10:11 ` [PATCH v2 3/4] soc/tegra: pmc: " Marc Zyngier
2020-10-06 10:11   ` Marc Zyngier
2020-10-06 10:11 ` [PATCH v2 4/4] soc/tegra: pmc: Don't create fake interrupt hierarchy levels Marc Zyngier
2020-10-06 10:11   ` Marc Zyngier
2020-10-06 12:39 ` [PATCH v2 0/4] soc/tegra: Prevent the PMC driver from corrupting interrupt routing Thierry Reding
2020-10-06 12:39   ` Thierry Reding

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=02226efd42fdb249b81c01eb702100e9@kernel.org \
    --to=maz@kernel.org \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=skomatineni@nvidia.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=vreddytalla@nvidia.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.