summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-04-21 09:44:08 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-04-21 09:44:08 +0000
commit2138d0d8fe342ffae61be85bf49d442218828ffb (patch)
treeaa7c835b537ee5f1bc7d6969cfaecda0f4b14bcf
parentdc36497a28d395a42a561b4a82dfa2d8dfbc34f3 (diff)
drm/amdkfd: Fix Incorrect VMIDs passed to HWS
From Tushar Patel 25efb191d86b108f100f82f414229f8269d00b28 in linux 5.15.y/5.15.35 b7dfbd2e601f3fee545bc158feceba4f340fe7cf in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c2
-rw-r--r--sys/dev/pci/drm/amd/amdkfd/kfd_device.c11
2 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c
index 938a39d00c6..9d7f33d9aea 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c
@@ -680,7 +680,7 @@ MODULE_PARM_DESC(sched_policy,
* Maximum number of processes that HWS can schedule concurrently. The maximum is the
* number of VMIDs assigned to the HWS, which is also the default.
*/
-int hws_max_conc_proc = 8;
+int hws_max_conc_proc = -1;
module_param(hws_max_conc_proc, int, 0444);
MODULE_PARM_DESC(hws_max_conc_proc,
"Max # processes HWS can execute concurrently when sched_policy=0 (0 = no concurrency, #VMIDs for KFD = Maximum(default))");
diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_device.c b/sys/dev/pci/drm/amd/amdkfd/kfd_device.c
index 88c483f6998..660eb7097cf 100644
--- a/sys/dev/pci/drm/amd/amdkfd/kfd_device.c
+++ b/sys/dev/pci/drm/amd/amdkfd/kfd_device.c
@@ -834,15 +834,10 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
}
/* Verify module parameters regarding mapped process number*/
- if ((hws_max_conc_proc < 0)
- || (hws_max_conc_proc > kfd->vm_info.vmid_num_kfd)) {
- dev_err(kfd_device,
- "hws_max_conc_proc %d must be between 0 and %d, use %d instead\n",
- hws_max_conc_proc, kfd->vm_info.vmid_num_kfd,
- kfd->vm_info.vmid_num_kfd);
+ if (hws_max_conc_proc >= 0)
+ kfd->max_proc_per_quantum = min((u32)hws_max_conc_proc, kfd->vm_info.vmid_num_kfd);
+ else
kfd->max_proc_per_quantum = kfd->vm_info.vmid_num_kfd;
- } else
- kfd->max_proc_per_quantum = hws_max_conc_proc;
/* calculate max size of mqds needed for queues */
size = max_num_of_queues_per_device *