Re: [PATCH 3/3] drm/amdkfd: Fix a bug when calculating save_area_used_size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+ Laurent

From: Zhao, Yong <Yong.Zhao@xxxxxxx>
Sent: Monday, November 11, 2019 6:25 PM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>; Cornwall, Jay <Jay.Cornwall@xxxxxxx>
Cc: Zhao, Yong <Yong.Zhao@xxxxxxx>
Subject: [PATCH 3/3] drm/amdkfd: Fix a bug when calculating save_area_used_size
 
workgroup context data writes from m->cp_hqd_cntl_stack_size, so we
should deduct it when calculating the used size.

Change-Id: I5252e25662c3b8221f451c39115bf084d1911eae
Signed-off-by: Yong Zhao <Yong.Zhao@xxxxxxx>
---
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
index d3380c5bdbde..3a2ee1f01aae 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
@@ -302,7 +302,8 @@ static int get_wave_state(struct mqd_manager *mm, void *mqd,
 
         *ctl_stack_used_size = m->cp_hqd_cntl_stack_size -
                 m->cp_hqd_cntl_stack_offset;
-       *save_area_used_size = m->cp_hqd_wg_state_offset;
+       *save_area_used_size = m->cp_hqd_wg_state_offset -
+               m->cp_hqd_cntl_stack_size;;
 
         if (copy_to_user(ctl_stack, mqd_ctl_stack, m->cp_hqd_cntl_stack_size))
                 return -EFAULT;
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux