Skip to content

Commit 4119734

Browse files
mukjoshialexdeucher
authored andcommitted
drm/amdkfd: Use correct drm device for cgroup permission check
On GFX 9.4.3, for a given KFD node, fetch the correct drm device from XCP manager when checking for cgroup permissions. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent c49bf4f commit 4119734

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_priv.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,10 +1488,15 @@ void kfd_dec_compute_active(struct kfd_node *dev);
14881488

14891489
/* Cgroup Support */
14901490
/* Check with device cgroup if @kfd device is accessible */
1491-
static inline int kfd_devcgroup_check_permission(struct kfd_node *kfd)
1491+
static inline int kfd_devcgroup_check_permission(struct kfd_node *node)
14921492
{
14931493
#if defined(CONFIG_CGROUP_DEVICE) || defined(CONFIG_CGROUP_BPF)
1494-
struct drm_device *ddev = adev_to_drm(kfd->adev);
1494+
struct drm_device *ddev;
1495+
1496+
if (node->xcp)
1497+
ddev = node->xcp->ddev;
1498+
else
1499+
ddev = adev_to_drm(node->adev);
14951500

14961501
return devcgroup_check_permission(DEVCG_DEV_CHAR, DRM_MAJOR,
14971502
ddev->render->index,

0 commit comments

Comments
 (0)