linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] soc/tegra: Prevent the PMC driver from corrupting interrupt routing
@ 2020-10-05 11:14 Marc Zyngier
  2020-10-05 11:14 ` [PATCH 1/3] gpio: tegra186: Allow optional irq parent callbacks Marc Zyngier
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Marc Zyngier @ 2020-10-05 11:14 UTC (permalink / raw)
  To: linux-tegra, linux-kernel, linux-arm-kernel
  Cc: Thierry Reding, Jonathan Hunter, Dmitry Osipenko,
	Sowjanya Komatineni, Venkat Reddy Talla, Thomas Gleixner,
	kernel-team

Jon recently reported that one of the Tegra systems (Jetson TX2, aka
tegra186) stopped booting with the introduction of the "IPI as IRQs"
series. After a few weeks of head scratching and complete puzzlement,
I obtained a board and started looking at what was happening.

The interrupt hierarchy looks like this:

	[DEVICE] -A-> [PMC] -B-> [GIC]

which seems simple enough. However, not all the devices attached to
the PMC follow this hierarchy, and in some cases, the 'B' link isn't
present in the HW. In other cases, neither 'A' nor 'B' are present.
And yet the PMC driver creates such linkages using random hwirq values
for the non-existent links, potentially overriding existing mappings
in the process. "What could possibly go wrong?"

It turns out that for the 'B' link, the PMC driver uses hwirq 0, which
is SGI0 for the GIC, and used as the rescheduling IPI. Obviously, this
doesn't go very well, nor very far, as the IPI gets routed to random
drivers. Also, as the handling flow has been overridden, this
interrupt never gets deactivated and can't fire anymore. Yes, this is
bad.

The 'A' link is less problematic, but the hwirq value is still out of
the irqdomain range, and gets remapped every time a new 'A'-less
driver comes up.

Instead, let's trim the unused hierarchy levels as needed. This
requires some checks in the upper levels of the hierarchy as we now
have optional levels, but this looks a lot saner than what we
currently have. With this, tegra186 is back booting on -next.

I haven't tested any wake-up stuff, nor any other nvidia system (this
is the only one I have). If people agree to these changes, I can take
them via the irqchip tree so that they make it into the next merge
window.

	M.

Marc Zyngier (3):
  gpio: tegra186: Allow optional irq parent callbacks
  soc/tegra: pmc: Allow optional irq parent callbacks
  soc/tegra: pmc: Don't create fake interrupt hierarchy levels

 drivers/gpio/gpio-tegra186.c |  15 +++-
 drivers/soc/tegra/pmc.c      | 142 ++++++++++++++++++++---------------
 2 files changed, 95 insertions(+), 62 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-10-05 18:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 11:14 [PATCH 0/3] soc/tegra: Prevent the PMC driver from corrupting interrupt routing Marc Zyngier
2020-10-05 11:14 ` [PATCH 1/3] gpio: tegra186: Allow optional irq parent callbacks Marc Zyngier
2020-10-05 11:14 ` [PATCH 2/3] soc/tegra: pmc: " Marc Zyngier
2020-10-05 11:27   ` Thierry Reding
2020-10-05 12:59     ` Marc Zyngier
2020-10-05 11:14 ` [PATCH 3/3] soc/tegra: pmc: Don't create fake interrupt hierarchy levels Marc Zyngier
2020-10-05 11:33   ` Thierry Reding
2020-10-05 13:10     ` Marc Zyngier
2020-10-05 11:22 ` [PATCH 0/3] soc/tegra: Prevent the PMC driver from corrupting interrupt routing Thierry Reding
2020-10-05 13:06   ` Marc Zyngier
2020-10-05 15:45     ` Thierry Reding
2020-10-05 18:23       ` Jon Hunter

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).