diff options
author | Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> | 2017-12-08 23:08:53 -0500 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2017-12-08 23:08:53 -0500 |
commit | 6d82eb0ef209dcf637e2b7fb9a69672d3a455a3f (patch) | |
tree | fef158c64637280b7c921f75d9ba51aac701a8d2 /drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | |
parent | drm/amdkfd: Decouple CRAT parsing from device list update (diff) | |
download | linux-dev-6d82eb0ef209dcf637e2b7fb9a69672d3a455a3f.tar.xz linux-dev-6d82eb0ef209dcf637e2b7fb9a69672d3a455a3f.zip |
drm/amdkfd: Support enumerating non-GPU devices
Modify kfd_topology_enum_kfd_devices(..) function to support non-GPU
nodes. The function returned NULL when it encountered non-GPU (say CPU)
nodes. This caused kfd_ioctl_create_event and kfd_init_apertures to fail
for Intel + Tonga.
kfd_topology_enum_kfd_devices will now parse all the nodes and return
valid kfd_dev for nodes with GPU.
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c index c59384bbbc5f..7377513050e6 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c @@ -300,9 +300,14 @@ int kfd_init_apertures(struct kfd_process *process) struct kfd_process_device *pdd; /*Iterating over all devices*/ - while ((dev = kfd_topology_enum_kfd_devices(id)) != NULL && + while (kfd_topology_enum_kfd_devices(id, &dev) == 0 && id < NUM_OF_SUPPORTED_GPUS) { + if (!dev) { + id++; /* Skip non GPU devices */ + continue; + } + pdd = kfd_create_process_device_data(dev, process); if (!pdd) { pr_err("Failed to create process device data\n"); |