]>
Commit | Line | Data |
---|---|---|
be7e94f8 GKH |
1 | From foo@baz Thu Oct 18 11:11:32 CEST 2018 |
2 | From: Arindam Nath <arindam.nath@amd.com> | |
3 | Date: Tue, 18 Sep 2018 15:40:58 +0530 | |
4 | Subject: iommu/amd: Return devid as alias for ACPI HID devices | |
5 | ||
6 | From: Arindam Nath <arindam.nath@amd.com> | |
7 | ||
8 | [ Upstream commit 5ebb1bc2d63d90dd204169e21fd7a0b4bb8c776e ] | |
9 | ||
10 | ACPI HID devices do not actually have an alias for | |
11 | them in the IVRS. But dev_data->alias is still used | |
12 | for indexing into the IOMMU device table for devices | |
13 | being handled by the IOMMU. So for ACPI HID devices, | |
14 | we simply return the corresponding devid as an alias, | |
15 | as parsed from IVRS table. | |
16 | ||
17 | Signed-off-by: Arindam Nath <arindam.nath@amd.com> | |
18 | Fixes: 2bf9a0a12749 ('iommu/amd: Add iommu support for ACPI HID devices') | |
19 | Signed-off-by: Joerg Roedel <jroedel@suse.de> | |
20 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
22 | --- | |
23 | drivers/iommu/amd_iommu.c | 6 ++++++ | |
24 | 1 file changed, 6 insertions(+) | |
25 | ||
26 | --- a/drivers/iommu/amd_iommu.c | |
27 | +++ b/drivers/iommu/amd_iommu.c | |
28 | @@ -288,7 +288,13 @@ static u16 get_alias(struct device *dev) | |
29 | ||
30 | /* The callers make sure that get_device_id() does not fail here */ | |
31 | devid = get_device_id(dev); | |
32 | + | |
33 | + /* For ACPI HID devices, we simply return the devid as such */ | |
34 | + if (!dev_is_pci(dev)) | |
35 | + return devid; | |
36 | + | |
37 | ivrs_alias = amd_iommu_alias_table[devid]; | |
38 | + | |
39 | pci_for_each_dma_alias(pdev, __last_alias, &pci_alias); | |
40 | ||
41 | if (ivrs_alias == pci_alias) |