This patch series adds support for dGPU topology to KFD and implements everything needed to initialize KFD on dGPUs. This is still missing dGPU memory management APIs, so it's not going to be able to run any user mode tests yet. But device information about CPUs and supported dGPUs should be reported correctly in /sys/class/kfd/kfd/topology/nodes/*. Patches 1-10 are small fixes and additions to the topology code. Patches 11-19 reorganize the topology code to prepare for dGPU support. Patches 20 and 21 add topology support for CPUs and dGPUs respectively. Patches 22-28 add more topology features and fixes/workarounds. Patch 29 adds a helper to enable PCIe atomics to the PCI driver. Patches 30-36 enable KFD initialization on dGPUs Patch 37 enables KFD initialization on supported dGPUs in AMDGPU. This is my last patch series this year. I worked hard to finish this before my year-end vacation. Amber Lin (1): drm/amdkfd: Add perf counters to topology Ben Goz (1): drm/amdkfd: Add AQL Queue Memory flag on topology Felix Kuehling (13): drm/amdkfd: Group up CRAT related functions drm/amdkfd: Turn verbose topology messages into pr_debug drm/amdkfd: Simplify counting of memory banks drm/amdkfd: Add topology support for CPUs drm/amdkfd: Module option to disable CRAT table drm/amdkfd: Conditionally enable PCIe atomics drm/amdkfd: Make IOMMUv2 code conditional drm/amdkfd: Make sched_policy a per-device setting drm/amdkfd: Add dGPU support to the device queue manager drm/amdkfd: Add dGPU support to the MQD manager drm/amdkfd: Add dGPU support to kernel_queue_init drm/amdkfd: Add dGPU device IDs and device info drm/amdgpu: Enable KFD initialization on dGPUs Flora Cui (3): drm/amd: add new interface to query cu info drm/amdgpu: add amdgpu interface to query cu info drm/amdkfd: Update number of compute unit from KGD Harish Kasiviswanathan (13): drm/amd: Add get_local_mem_info to KGD-KFD interface drm/amdgpu: Implement get_local_mem_info drm/amdkfd: Stop using get_vmem_size KGD-KFD interface drm/amdkfd: Remove deprecated get_vmem_size drm/amd: Remove get_vmem_size from KGD-KFD interface drm/amdkfd: Topology: Fix location_id drm/amdkfd: Reorganize CRAT fetching from ACPI drm/amdkfd: Decouple CRAT parsing from device list update drm/amdkfd: Support enumerating non-GPU devices drm/amdkfd: sync IOLINK defines to thunk spec drm/amdkfd: Fix sibling_map[] size drm/amdkfd: Add topology support for dGPUs drm/amdkfd: Ignore ACPI CRAT for non-APU systems Jay Cornwall (1): PCI: Add pci_enable_atomic_ops_to_root Kent Russell (3): drm/amdkfd: Coding style cleanup drm/amdgpu: Add support for reporting VRAM usage drm/amdkfd: Add support for displaying VRAM usage Philip Cox (1): drm/amdkfd: Fixup incorrect info in the CZ CRAT table Yong Zhao (1): drm/amdkfd: Fix memory leaks in kfd topology drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 65 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 4 +- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 7 + drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 5 + drivers/gpu/drm/amd/amdkfd/Kconfig | 2 +- drivers/gpu/drm/amd/amdkfd/Makefile | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 1271 ++++++++++++++++++++ drivers/gpu/drm/amd/amdkfd/kfd_crat.h | 42 +- drivers/gpu/drm/amd/amdkfd/kfd_dbgmgr.c | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 230 +++- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 33 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 5 + .../drm/amd/amdkfd/kfd_device_queue_manager_cik.c | 56 + .../drm/amd/amdkfd/kfd_device_queue_manager_vi.c | 93 ++ drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 + drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 7 +- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 5 + drivers/gpu/drm/amd/amdkfd/kfd_module.c | 5 + drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 7 + drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 35 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 21 + drivers/gpu/drm/amd/amdkfd/kfd_pasid.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 21 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 17 +- .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 1054 +++++++++------- drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 39 +- drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 35 +- drivers/pci/pci.c | 81 ++ include/linux/pci.h | 1 + include/uapi/linux/pci_regs.h | 2 + 35 files changed, 2656 insertions(+), 512 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_crat.c -- 2.7.4