]> asedeno.scripts.mit.edu Git - linux.git/commit
ACPI/IORT: Handle PCI aliases properly for IOMMUs
authorRobin Murphy <robin.murphy@arm.com>
Fri, 4 Aug 2017 16:42:06 +0000 (17:42 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 8 Aug 2017 14:44:27 +0000 (15:44 +0100)
commitbc8648d49a958148bb84444252b96d19659a42e1
tree8178cb174cef8f3a92837a783ba8ae2aa0abbfef
parentaae4e7a8bc44722fe70d58920a36916b1043195e
ACPI/IORT: Handle PCI aliases properly for IOMMUs

When a PCI device has DMA quirks, we need to ensure that an upstream
IOMMU knows about all possible aliases, since the presence of a DMA
quirk does not preclude the device still also emitting transactions
(e.g. MSIs) on its 'real' RID. Similarly, the rules for bridge aliasing
are relatively complex, and some bridges may only take ownership of
transactions under particular transient circumstances, leading again to
multiple RIDs potentially being seen at the IOMMU for the given device.

Take all this into account in iort_iommu_configure() by mapping every
RID produced by the alias walk, not just whichever one comes out last.
Since adding any more internal PTR_ERR() juggling would have confused me
no end, a bit of refactoring happens in the process - we know where to
find the ops if everything succeeded, so we're free to just pass regular
error codes around up until then.

CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
CC: Hanjun Guo <hanjun.guo@linaro.org>
CC: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
[lorenzo.pieralisi@arm.com: tagged __get_pci_rid __maybe_unused]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/acpi/arm64/iort.c