Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/exec: Fix minor bug related to xe_sync_entry_cleanup
@ 2024-07-11 20:45 Ashutosh Dixit
  2024-07-11 20:50 ` Matthew Brost
  0 siblings, 1 reply; 3+ messages in thread
From: Ashutosh Dixit @ 2024-07-11 20:45 UTC (permalink / raw)
  To: intel-xe; +Cc: Matthew Brost

Increment num_syncs after xe_sync_entry_parse() is successful to ensure
the xe_sync_entry_cleanup() logic under "err_syncs" label works correctly.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 drivers/gpu/drm/xe/xe_exec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index 2d72cdec3a0b..95c0b21096f0 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -156,8 +156,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 
 	vm = q->vm;
 
-	for (i = 0; i < args->num_syncs; i++) {
-		err = xe_sync_entry_parse(xe, xef, &syncs[num_syncs++],
+	for (i = 0; i < args->num_syncs; i++, num_syncs++) {
+		err = xe_sync_entry_parse(xe, xef, &syncs[i],
 					  &syncs_user[i], SYNC_PARSE_FLAG_EXEC |
 					  (xe_vm_in_lr_mode(vm) ?
 					   SYNC_PARSE_FLAG_LR_MODE : 0));
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] drm/xe/exec: Fix minor bug related to xe_sync_entry_cleanup
@ 2024-07-11 20:48 Ashutosh Dixit
  0 siblings, 0 replies; 3+ messages in thread
From: Ashutosh Dixit @ 2024-07-11 20:48 UTC (permalink / raw)
  To: intel-xe; +Cc: Matthew Brost

Increment num_syncs after xe_sync_entry_parse() is successful to ensure
the xe_sync_entry_cleanup() logic under "err_syncs" label works correctly.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 drivers/gpu/drm/xe/xe_exec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index 2d72cdec3a0b..95c0b21096f0 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -156,8 +156,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 
 	vm = q->vm;
 
-	for (i = 0; i < args->num_syncs; i++) {
-		err = xe_sync_entry_parse(xe, xef, &syncs[num_syncs++],
+	for (i = 0; i < args->num_syncs; i++, num_syncs++) {
+		err = xe_sync_entry_parse(xe, xef, &syncs[i],
 					  &syncs_user[i], SYNC_PARSE_FLAG_EXEC |
 					  (xe_vm_in_lr_mode(vm) ?
 					   SYNC_PARSE_FLAG_LR_MODE : 0));
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/xe/exec: Fix minor bug related to xe_sync_entry_cleanup
  2024-07-11 20:45 [PATCH] drm/xe/exec: Fix minor bug related to xe_sync_entry_cleanup Ashutosh Dixit
@ 2024-07-11 20:50 ` Matthew Brost
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Brost @ 2024-07-11 20:50 UTC (permalink / raw)
  To: Ashutosh Dixit; +Cc: intel-xe

On Thu, Jul 11, 2024 at 01:45:52PM -0700, Ashutosh Dixit wrote:
> Increment num_syncs after xe_sync_entry_parse() is successful to ensure
> the xe_sync_entry_cleanup() logic under "err_syncs" label works correctly.
>

Patch LGTM. A couple of nits though.

Fixes tag?
 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_exec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
> index 2d72cdec3a0b..95c0b21096f0 100644
> --- a/drivers/gpu/drm/xe/xe_exec.c
> +++ b/drivers/gpu/drm/xe/xe_exec.c
> @@ -156,8 +156,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
>  
>  	vm = q->vm;
>  
> -	for (i = 0; i < args->num_syncs; i++) {
> -		err = xe_sync_entry_parse(xe, xef, &syncs[num_syncs++],
> +	for (i = 0; i < args->num_syncs; i++, num_syncs++) {

How about?

'for (num_syncs = 0; num_syncs < args->num_syncs; num_syncs++) {'

This is what we do in xe_vm.c.

Matt

> +		err = xe_sync_entry_parse(xe, xef, &syncs[i],
>  					  &syncs_user[i], SYNC_PARSE_FLAG_EXEC |
>  					  (xe_vm_in_lr_mode(vm) ?
>  					   SYNC_PARSE_FLAG_LR_MODE : 0));
> -- 
> 2.41.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-11 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-11 20:45 [PATCH] drm/xe/exec: Fix minor bug related to xe_sync_entry_cleanup Ashutosh Dixit
2024-07-11 20:50 ` Matthew Brost
  -- strict thread matches above, loose matches on Subject: below --
2024-07-11 20:48 Ashutosh Dixit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox