IOMMU path in sysfs is renamed
IOMMU path in sysfs was amd_iommu. After implementing multiple devices
support, the path is replaced with amd_iommu_<index>. Current Thunk spec
is not clear about how to support multiple instances in one block. There
is no products having multiple IOMMUs yet at this point. This patch
changes the path to support both amd_iommu and amd_iommu_0 for Carizo.
Change-Id: I3beea2fc78d96296232226191501a02ccf20d6b1
Signed-off-by: Amber Lin <Amber.Lin@amd.com>
[ROCm/ROCR-Runtime commit: 369902bf5b]
This commit is contained in:
@@ -365,9 +365,16 @@ static unsigned int get_perf_event_type(enum perf_block_id block_id)
|
||||
FILE *file = NULL;
|
||||
unsigned int type = 0;
|
||||
|
||||
if (block_id == PERFCOUNTER_BLOCKID__IOMMUV2)
|
||||
file = fopen("/sys/bus/event_source/devices/amd_iommu/type",
|
||||
if (block_id == PERFCOUNTER_BLOCKID__IOMMUV2) {
|
||||
/* Starting from kernel 4.12, amd_iommu_0 is used */
|
||||
file = fopen("/sys/bus/event_source/devices/amd_iommu_0/type",
|
||||
"r");
|
||||
if (!file)
|
||||
file = fopen(/* kernel 4.11 and older */
|
||||
"/sys/bus/event_source/devices/amd_iommu/type",
|
||||
"r");
|
||||
}
|
||||
|
||||
if (!file)
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user