All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhao, Yong" <Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
To: "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Cornwall, Jay" <Jay.Cornwall-5C7GfCeVMHo@public.gmane.org>,
	"Morichetti,
	Laurent" <Laurent.Morichetti-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH 3/3] drm/amdkfd: Fix a bug when calculating save_area_used_size
Date: Tue, 12 Nov 2019 21:14:50 +0000	[thread overview]
Message-ID: <DM6PR12MB277837E8CD2700465A7AFE1CF0770@DM6PR12MB2778.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20191111232521.10528-3-Yong.Zhao-5C7GfCeVMHo@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1573 bytes --]

+ Laurent
________________________________
From: Zhao, Yong <Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
Sent: Monday, November 11, 2019 6:25 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>; Cornwall, Jay <Jay.Cornwall-5C7GfCeVMHo@public.gmane.org>
Cc: Zhao, Yong <Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
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-5C7GfCeVMHo@public.gmane.org>
---
 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


[-- Attachment #1.2: Type: text/html, Size: 2866 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

WARNING: multiple messages have this Message-ID (diff)
From: "Zhao, Yong" <Yong.Zhao@amd.com>
To: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"Cornwall, Jay" <Jay.Cornwall@amd.com>,
	"Morichetti, Laurent" <Laurent.Morichetti@amd.com>
Subject: Re: [PATCH 3/3] drm/amdkfd: Fix a bug when calculating save_area_used_size
Date: Tue, 12 Nov 2019 21:14:50 +0000	[thread overview]
Message-ID: <DM6PR12MB277837E8CD2700465A7AFE1CF0770@DM6PR12MB2778.namprd12.prod.outlook.com> (raw)
Message-ID: <20191112211450.1s_tOpg-MFIkj48cBQcvw5-Cx3sfhspNsIuOVExZluU@z> (raw)
In-Reply-To: <20191111232521.10528-3-Yong.Zhao@amd.com>


[-- Attachment #1.1: Type: text/plain, Size: 1433 bytes --]

+ Laurent
________________________________
From: Zhao, Yong <Yong.Zhao@amd.com>
Sent: Monday, November 11, 2019 6:25 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Cornwall, Jay <Jay.Cornwall@amd.com>
Cc: Zhao, Yong <Yong.Zhao@amd.com>
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@amd.com>
---
 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


[-- Attachment #1.2: Type: text/html, Size: 2726 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

  parent reply	other threads:[~2019-11-12 21:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 23:25 [PATCH 1/3] drm/amdkfd: Implement queue priority controls for gfx10 Yong Zhao
2019-11-11 23:25 ` Yong Zhao
     [not found] ` <20191111232521.10528-1-Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
2019-11-11 23:25   ` [PATCH 2/3] drm/amdkfd: Update get_wave_state() for GFX10 Yong Zhao
2019-11-11 23:25     ` Yong Zhao
     [not found]     ` <20191111232521.10528-2-Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
2019-11-12 21:52       ` Felix Kuehling
2019-11-12 21:52         ` Felix Kuehling
2019-11-11 23:25   ` [PATCH 3/3] drm/amdkfd: Fix a bug when calculating save_area_used_size Yong Zhao
2019-11-11 23:25     ` Yong Zhao
     [not found]     ` <20191111232521.10528-3-Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
2019-11-12 21:14       ` Zhao, Yong [this message]
2019-11-12 21:14         ` Zhao, Yong
2019-11-12 21:43       ` Felix Kuehling
2019-11-12 21:43         ` Felix Kuehling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR12MB277837E8CD2700465A7AFE1CF0770@DM6PR12MB2778.namprd12.prod.outlook.com \
    --to=yong.zhao-5c7gfcevmho@public.gmane.org \
    --cc=Jay.Cornwall-5C7GfCeVMHo@public.gmane.org \
    --cc=Laurent.Morichetti-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.