linux/drivers
Koichiro Den 8719c64e76 PCI: dwc: ep: Cache MSI outbound iATU mapping
dw_pcie_ep_raise_msi_irq() currently programs an outbound iATU window
for the MSI target address on every interrupt and tears it down again
via dw_pcie_ep_unmap_addr().

On systems that heavily use the AXI bridge interface (for example when
the integrated eDMA engine is active), this means the outbound iATU
registers are updated while traffic is in flight. The DesignWare
endpoint databook 5.40a - "3.10.6.1 iATU Outbound Programming Overview"
warns that updating iATU registers in this situation is not supported,
and the behavior is undefined.

Under high MSI and eDMA load this pattern results in occasional bogus
outbound transactions and IOMMU faults, on the RC side, such as:

  ipmmu-vmsa eed40000.iommu: Unhandled fault: status 0x00001502 iova 0xfe000000

followed by the system becoming unresponsive. This is the actual output
observed on Renesas R-Car S4, with its ipmmu_hc used with PCIe ch0.

There is no need to reprogram the iATU region used for MSI on every
interrupt. The host-provided MSI address is stable while MSI is enabled,
and the endpoint driver already dedicates a scratch buffer for MSI
generation.

Cache the aligned MSI address and map size, program the outbound iATU
once, and keep the window enabled. Subsequent interrupts only perform a
write to the MSI scratch buffer, avoiding dynamic iATU reprogramming in
the hot path and fixing the lockups seen under load.

dw_pcie_ep_raise_msix_irq() is not modified, as each vector can have a
different msg_addr, and because the msg_addr is allowed to be changed
while the vector is masked. Neither problem is easy to solve with the
current design. Instead, the plan is for the DWC vendor drivers to
transition to dw_pcie_ep_raise_msix_irq_doorbell(), which does not rely
on the iATU.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
[cassel: improve commit message]
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20251222110144.3299523-2-cassel@kernel.org
2025-12-23 16:47:53 +05:30
..
accel
accessibility
acpi platform-drivers-x86 for v6.19-1 2025-12-10 06:38:17 +09:00
amba
android
ata
atm
auxdisplay
base More power management updates for 6.19-rc1 2025-12-10 06:29:40 +09:00
bcma
block We have a patch that adds an initial set of tracepoints to the MDS 2025-12-14 15:24:10 +12:00
bluetooth
bus
cache
cdrom
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dibs
dio
dma
dma-buf
dpll
edac
eisa
extcon
firewire
firmware LoongArch changes for v6.19 2025-12-13 05:44:03 +12:00
fpga
fsi
fwctl
gnss
gpib
gpio gpio updates for v6.19-rc1 2025-12-13 16:36:57 +12:00
gpu drm fixes for 6.19-rc1 2025-12-13 17:39:28 +12:00
greybus
hid platform-drivers-x86 for v6.19-1 2025-12-10 06:38:17 +09:00
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c-for-6.19-rc1 2025-12-10 07:48:05 +09:00
i3c i3c: adi: Fix confusing cleanup.h syntax 2025-12-12 23:59:39 +01:00
idle
iio
infiniband
input Input updates for v6.19-rc0 2025-12-10 16:44:18 +09:00
interconnect
iommu
ipack
irqchip Misc fixes: 2025-12-14 06:07:09 +12:00
isdn
leds
macintosh
mailbox
mcb
md SCSI misc on 20251214 2025-12-14 15:35:35 +12:00
media
memory
memstick
message
mfd
misc SCSI misc on 20251214 2025-12-14 15:35:35 +12:00
mmc
most
mtd
mux
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of soundwire updates for 6.19 2025-12-13 16:26:55 +12:00
opp
parisc
parport
pci PCI: dwc: ep: Cache MSI outbound iATU mapping 2025-12-23 16:47:53 +05:30
pcmcia
peci
perf
phy
pinctrl
platform platform-drivers-x86 for v6.19-1 2025-12-10 06:38:17 +09:00
pmdomain
pnp
power
powercap
pps
ps3
ptp
pwm pwm: th1520: Fix missing Kconfig dependencies 2025-12-13 16:41:50 +12:00
rapidio
ras
regulator regulator: Fixes for v6.19 2025-12-11 09:54:59 +09:00
remoteproc
resctrl
reset
rpmsg
rtc RTC for 6.19 2025-12-13 17:09:06 +12:00
s390
sbus
scsi SCSI misc on 20251214 2025-12-14 15:35:35 +12:00
sh
siox
slimbus
soc
soundwire
spi spi: Fixes for v6.19 2025-12-11 09:57:08 +09:00
spmi
ssb
staging
target SCSI misc on 20251214 2025-12-14 15:35:35 +12:00
tc
tee
thermal
thunderbolt
tty
ufs scsi: ufs: qcom: Fix confusing cleanup.h syntax 2025-12-08 22:11:00 -05:00
uio
usb
vdpa
vfio
vhost
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile