From: Niklas Cassel <cassel@kernel.org>
To: Frank Li <Frank.li@nxp.com>
Cc: "Jingoo Han" <jingoohan1@gmail.com>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Gustavo Pimentel" <gustavo.pimentel@synopsys.com>,
"Shinichiro Kawasaki" <shinichiro.kawasaki@wdc.com>,
"Damien Le Moal" <dlemoal@kernel.org>,
"Koichiro Den" <den@valinux.co.jp>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: dwc: ep: Flush before unmap in dw_pcie_ep_raise_msix_irq()
Date: Thu, 12 Feb 2026 13:47:15 +0100 [thread overview]
Message-ID: <aY3L03mLeJnPUNVz@ryzen> (raw)
In-Reply-To: <aYzX70JDerv8Zm1H@lizhi-Precision-Tower-5810>
On Wed, Feb 11, 2026 at 02:26:39PM -0500, Frank Li wrote:
> On Wed, Feb 11, 2026 at 06:55:41PM +0100, Niklas Cassel wrote:
> > When running e.g. fio with a larger queue depth against nvmet-pci-epf we
> > get IOMMU errors on the host, e.g.:
> >
> > arm-smmu-v3 fc900000.iommu: 0x0000010000000010
> > arm-smmu-v3 fc900000.iommu: 0x0000020000000000
> > arm-smmu-v3 fc900000.iommu: 0x000000090000f040
> > arm-smmu-v3 fc900000.iommu: 0x0000000000000000
> > arm-smmu-v3 fc900000.iommu: event: F_TRANSLATION client: 0000:01:00.0 sid: 0x100 ssid: 0x0 iova: 0x90000f040 ipa: 0x0
> > arm-smmu-v3 fc900000.iommu: unpriv data write s1 "Input address caused fault" stag: 0x0
> >
> > The reason for this is that the writel() is immediately followed by a call
> > to unmap(), which will tear down the outbound address translation.
> >
> > PCI writes are posted, i.e. don't wait for a completion. Thus, when the
> > writel() returns, might not have completed yet, and could even still be
> > buffered in the PCI bridge, at the time unmap() is called.
> >
> > Flush the write by performing a read() of the same address, to ensure that
> > the write has reached the destination before calling unmap().
> >
> > This will add some latency, but that is certainly preferred over corrupting
> > the host memory.
> >
> > The same problem was solved for dw_pcie_ep_raise_msi_irq(), in commit
> > 8719c64e76bf ("PCI: dwc: ep: Cache MSI outbound iATU mapping"), however
> > there it was solved by dedicating an outbound iATU only for MSI. For MSI-X,
> > we can't do the same, as each vector can have a different msg_addr, and
> > because the msg_addr is allowed to be changed while the vector is masked.
> >
> > Fixes: beb4641a787d ("PCI: dwc: Add MSI-X callbacks handler")
>
> Cc stable?
Considering that the stable tooling backports everything with a Fixes: tag
nowadays, I don't really see the point in adding Cc: stable anymore.
Perhaps the maintainers can amend the commit message when applying if they
think that it will give it an even higher chance of being backported.
Kind regards,
Niklas
next prev parent reply other threads:[~2026-02-12 12:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 17:55 [PATCH] PCI: dwc: ep: Flush before unmap in dw_pcie_ep_raise_msix_irq() Niklas Cassel
2026-02-11 19:26 ` Frank Li
2026-02-12 12:47 ` Niklas Cassel [this message]
2026-02-25 21:44 ` Bjorn Helgaas
2026-02-25 22:34 ` Niklas Cassel
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=aY3L03mLeJnPUNVz@ryzen \
--to=cassel@kernel.org \
--cc=Frank.li@nxp.com \
--cc=bhelgaas@google.com \
--cc=den@valinux.co.jp \
--cc=dlemoal@kernel.org \
--cc=gustavo.pimentel@synopsys.com \
--cc=jingoohan1@gmail.com \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--cc=shinichiro.kawasaki@wdc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox