]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdkfd: Report domain with topology
authorOri Messinger <Ori.Messinger@amd.com>
Wed, 21 Aug 2019 14:48:43 +0000 (10:48 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 1 May 2020 13:59:51 +0000 (09:59 -0400)
PCI domain has moved to 32-bits to accommodate virtualization,
so a 32-bit integer is exposed for domain to reflect this change.

Domain can be found in here:
/sys/class/kfd/kfd/topology/nodes/X/properties
Where X is the card number

Signed-off-by: Ori Messinger <ori.messinger@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c
drivers/gpu/drm/amd/amdkfd/kfd_topology.h

index bc4a22df12d79a0badfac7ce937b9c89e90d74d1..bb77f7af2b6d9e3f37ce33d56614952021dbd01c 100644 (file)
@@ -478,6 +478,8 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
                        dev->node_props.device_id);
        sysfs_show_32bit_prop(buffer, "location_id",
                        dev->node_props.location_id);
+       sysfs_show_32bit_prop(buffer, "domain",
+                       dev->node_props.domain);
        sysfs_show_32bit_prop(buffer, "drm_render_minor",
                        dev->node_props.drm_render_minor);
        sysfs_show_64bit_prop(buffer, "hive_id",
@@ -1306,6 +1308,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
                        HSA_CAP_ASIC_REVISION_SHIFT) &
                        HSA_CAP_ASIC_REVISION_MASK);
        dev->node_props.location_id = pci_dev_id(gpu->pdev);
+       dev->node_props.domain = pci_domain_nr(gpu->pdev->bus);
        dev->node_props.max_engine_clk_fcompute =
                amdgpu_amdkfd_get_max_engine_clock_in_mhz(dev->gpu->kgd);
        dev->node_props.max_engine_clk_ccompute =
index 0c51bd3dcd590c66dee93b4e297ca212de4da27a..326d9b26b7aa7fbbab553671ee1a0d348739d8bf 100644 (file)
@@ -80,6 +80,7 @@ struct kfd_node_properties {
        uint32_t vendor_id;
        uint32_t device_id;
        uint32_t location_id;
+       uint32_t domain;
        uint32_t max_engine_clk_fcompute;
        uint32_t max_engine_clk_ccompute;
        int32_t  drm_render_minor;