drm/amdkfd: pause autosuspend when creating pdd
authorJesse.zhang@amd.com <Jesse.zhang@amd.com>
Thu, 5 Dec 2024 09:41:26 +0000 (17:41 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Dec 2024 15:26:18 +0000 (10:26 -0500)
commit438b39ac74e2a9dc0a5c9d653b7d8066877e86b1
tree8b15a3c824327d37a8fc70053cc3458428923ae1
parentf4df208177d02f1c90f3644da3a2453080b8c24f
drm/amdkfd: pause autosuspend when creating pdd

When using MES creating a pdd will require talking to the GPU to
setup the relevant context. The code here forgot to wake up the GPU
in case it was in suspend, this causes KVM to EFAULT for passthrough
GPU for example. This issue can be masked if the GPU was woken up by
other things (e.g. opening the KMS node) first and have not yet gone to sleep.

v4: do the allocation of proc_ctx_bo in a lazy fashion
when the first queue is created in a process (Felix)

Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Reviewed-by: Yunxiang Li <Yunxiang.Li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_process.c