Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/1] PCI: dwc: Use regular interrupt instead of chained
@ 2023-06-29 18:30 Radu Rendec
  2023-06-29 18:30 ` [PATCH 1/1] " Radu Rendec
  0 siblings, 1 reply; 11+ messages in thread
From: Radu Rendec @ 2023-06-29 18:30 UTC (permalink / raw)
  To: Jingoo Han, Gustavo Pimentel
  Cc: Lorenzo Pieralisi, Krzysztof Wilczynski, Rob Herring,
	Bjorn Helgaas, Marc Zyngier, Thomas Gleixner, linux-pci,
	linux-kernel

The DesignWare PCIe host driver uses a chained interrupt to demultiplex
the downstream MSI interrupts. In some circumstances, the system can get
into a state where the parent interrupt is triggered continuously, even
though reading the PCIe host registers doesn't identify any child MSI
interrupt source. This effectively locks up CPU0, which spends all the
time servicing these interrupts. This behavior has been observed on a
Qualcomm SA8540P Ride, with pcie2a and pcie3a enabled at the same time.

This is a clear example of how bypassing the interrupt core by using
chained interrupts can be very dangerous if the hardware misbehaves.
These issues are particularly hard to investigate, because the system
appears to be completely locked up.

The proposed solution is to use regular interrupts instead of chained
interrupts for the demultiplex handler in the PCI dwc driver. This
allows the interrupt storm detector to kick in and disable the faulty
interrupt. Testing showed that the interrupt storm is mitigated with no
visible impact (other than the specific log message), and the system
continues to run as expected. This is a much more desirable behavior
than a system lockup.

In a different thread [1], further advantages of regular over chained
interrupts were presented. This patch follows the guidelines set out in
that thread, and represents another real-life example of how things can
go really wrong with chained interrupts.

[1] https://lore.kernel.org/all/877csohcll.ffs@tglx/

Radu Rendec (1):
  PCI: dwc: Use regular interrupt instead of chained

 .../pci/controller/dwc/pcie-designware-host.c | 35 +++++++++----------
 1 file changed, 17 insertions(+), 18 deletions(-)

-- 
2.41.0


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

end of thread, other threads:[~2023-11-21 21:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-29 18:30 [PATCH 0/1] PCI: dwc: Use regular interrupt instead of chained Radu Rendec
2023-06-29 18:30 ` [PATCH 1/1] " Radu Rendec
2023-06-29 19:57   ` Bjorn Helgaas
2023-06-29 20:42     ` Radu Rendec
2023-06-29 20:58       ` Bjorn Helgaas
2023-06-29 21:27         ` Radu Rendec
2023-06-29 22:11           ` Bjorn Helgaas
2023-06-30  3:04             ` Radu Rendec
2023-07-13 17:03               ` Bjorn Helgaas
2023-07-13 20:26                 ` Radu Rendec
2023-11-21 21:57   ` Radu Rendec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox