aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArindam Nath <arindam.nath@amd.com>2018-09-18 06:10:58 -0400
committerJoerg Roedel <jroedel@suse.de>2018-09-26 03:41:11 -0400
commit5ebb1bc2d63d90dd204169e21fd7a0b4bb8c776e (patch)
treecdf359424d5976aaea14e033b34251812a772da4
parentbe9e6598aeb0db70a7927d6b3bb4d3d6fb1c3e18 (diff)
iommu/amd: Return devid as alias for ACPI HID devices
ACPI HID devices do not actually have an alias for them in the IVRS. But dev_data->alias is still used for indexing into the IOMMU device table for devices being handled by the IOMMU. So for ACPI HID devices, we simply return the corresponding devid as an alias, as parsed from IVRS table. Signed-off-by: Arindam Nath <arindam.nath@amd.com> Fixes: 2bf9a0a12749 ('iommu/amd: Add iommu support for ACPI HID devices') Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/iommu/amd_iommu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 4e04fff23977..73e47d93e7a0 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -246,7 +246,13 @@ static u16 get_alias(struct device *dev)
246 246
247 /* The callers make sure that get_device_id() does not fail here */ 247 /* The callers make sure that get_device_id() does not fail here */
248 devid = get_device_id(dev); 248 devid = get_device_id(dev);
249
250 /* For ACPI HID devices, we simply return the devid as such */
251 if (!dev_is_pci(dev))
252 return devid;
253
249 ivrs_alias = amd_iommu_alias_table[devid]; 254 ivrs_alias = amd_iommu_alias_table[devid];
255
250 pci_for_each_dma_alias(pdev, __last_alias, &pci_alias); 256 pci_for_each_dma_alias(pdev, __last_alias, &pci_alias);
251 257
252 if (ivrs_alias == pci_alias) 258 if (ivrs_alias == pci_alias)