]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: apple: Configure RID to SID mapper on device addition
authorMarc Zyngier <maz@kernel.org>
Wed, 29 Sep 2021 16:38:42 +0000 (17:38 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 4 Nov 2021 21:29:31 +0000 (16:29 -0500)
commit20d17fef894448fa6167a214ff97930fc8cabdff
tree8618ec7eb0157d4a74fba4227f5b205697c37cef
parent2275635e61eb046b7b65e4769a0727e61b78acd5
PCI: apple: Configure RID to SID mapper on device addition

The Apple PCIe controller doesn't directly feed the endpoint's Requester ID
to the IOMMU (DART), but instead maps RIDs onto Stream IDs (SIDs). The DART
and the PCIe controller must thus agree on the SIDs that are used for
translation (by using the 'iommu-map' property).

For this purpose, parse the 'iommu-map' property each time a device gets
added, and use the resulting translation to configure the PCIe RID-to-SID
mapper. Similarly, remove the translation if/when the device gets removed.

This is all driven from a bus notifier which gets registered at probe time.
Hopefully this is the only PCI controller driver in the whole system.

[bhelgaas: squash indentation from Zhaoyu Liu <zackary.liu.pro@gmail.com>:
https://lore.kernel.org/r/20211031135544.GA1616@pc]
Link: https://lore.kernel.org/r/20210929163847.2807812-10-maz@kernel.org
Tested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Sven Peter <sven@svenpeter.dev>
drivers/pci/controller/pcie-apple.c