Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
@ 2023-09-20 17:54 Pallavi Mishra
  2023-09-20 19:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for " Patchwork
  2023-09-20 19:24 ` [Intel-xe] [PATCH] " Lucas De Marchi
  0 siblings, 2 replies; 7+ messages in thread
From: Pallavi Mishra @ 2023-09-20 17:54 UTC (permalink / raw)
  To: intel-xe; +Cc: stuart.summers, matthew.d.roper

Ensure alignment with PAGE_SIZE for the size parameter
passed to __xe_bo_create_locked()

Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
---
 drivers/gpu/drm/xe/xe_bo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 1ab682d61e3c..014d084632f2 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -1199,6 +1199,9 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
 	/* Only kernel objects should set GT */
 	XE_WARN_ON(tile && type != ttm_bo_type_kernel);
 
+	if ((size & (PAGE_SIZE - 1)) != 0)
+		size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+
 	if (XE_WARN_ON(!size)) {
 		xe_bo_free(bo);
 		return ERR_PTR(-EINVAL);
-- 
2.25.1


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

* [Intel-xe] ✗ CI.Patch_applied: failure for drm/xe: Align size to PAGE_SIZE
  2023-09-20 17:54 [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE Pallavi Mishra
@ 2023-09-20 19:14 ` Patchwork
  2023-09-20 19:24 ` [Intel-xe] [PATCH] " Lucas De Marchi
  1 sibling, 0 replies; 7+ messages in thread
From: Patchwork @ 2023-09-20 19:14 UTC (permalink / raw)
  To: Pallavi Mishra; +Cc: intel-xe

== Series Details ==

Series: drm/xe: Align size to PAGE_SIZE
URL   : https://patchwork.freedesktop.org/series/123997/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-xe-next' with base: ===
Base commit: 805557401 fixup! drm/xe/display: Implement display support
=== git am output follows ===
error: patch failed: drivers/gpu/drm/xe/xe_bo.c:1199
error: drivers/gpu/drm/xe/xe_bo.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: drm/xe: Align size to PAGE_SIZE
Patch failed at 0001 drm/xe: Align size to PAGE_SIZE
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



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

* Re: [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
  2023-09-20 17:54 [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE Pallavi Mishra
  2023-09-20 19:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for " Patchwork
@ 2023-09-20 19:24 ` Lucas De Marchi
  2023-09-20 19:30   ` Mishra, Pallavi
  1 sibling, 1 reply; 7+ messages in thread
From: Lucas De Marchi @ 2023-09-20 19:24 UTC (permalink / raw)
  To: Pallavi Mishra; +Cc: stuart.summers, matthew.d.roper, intel-xe

On Wed, Sep 20, 2023 at 11:24:31PM +0530, Pallavi Mishra wrote:
>Ensure alignment with PAGE_SIZE for the size parameter
>passed to __xe_bo_create_locked()
>
>Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
>---
> drivers/gpu/drm/xe/xe_bo.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
>index 1ab682d61e3c..014d084632f2 100644
>--- a/drivers/gpu/drm/xe/xe_bo.c
>+++ b/drivers/gpu/drm/xe/xe_bo.c
>@@ -1199,6 +1199,9 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
> 	/* Only kernel objects should set GT */
> 	XE_WARN_ON(tile && type != ttm_bo_type_kernel);
>
>+	if ((size & (PAGE_SIZE - 1)) != 0)

ALIGN()... but note that there is already a call to ALIGN() a few lines
below this hunk. Probably missing the `size = ALIGN(size, PAGE_SIZE)` in
the else condition?

Lucas De Marchi

>+		size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
>+
> 	if (XE_WARN_ON(!size)) {
> 		xe_bo_free(bo);
> 		return ERR_PTR(-EINVAL);
>-- 
>2.25.1
>

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

* Re: [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
  2023-09-20 19:24 ` [Intel-xe] [PATCH] " Lucas De Marchi
@ 2023-09-20 19:30   ` Mishra, Pallavi
  0 siblings, 0 replies; 7+ messages in thread
From: Mishra, Pallavi @ 2023-09-20 19:30 UTC (permalink / raw)
  To: De Marchi, Lucas
  Cc: Summers, Stuart, Roper, Matthew D, intel-xe@lists.freedesktop.org



> -----Original Message-----
> From: De Marchi, Lucas <lucas.demarchi@intel.com>
> Sent: Wednesday, September 20, 2023 12:25 PM
> To: Mishra, Pallavi <pallavi.mishra@intel.com>
> Cc: intel-xe@lists.freedesktop.org; Summers, Stuart
> <stuart.summers@intel.com>; Roper, Matthew D
> <matthew.d.roper@intel.com>
> Subject: Re: [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
> 
> On Wed, Sep 20, 2023 at 11:24:31PM +0530, Pallavi Mishra wrote:
> >Ensure alignment with PAGE_SIZE for the size parameter passed to
> >__xe_bo_create_locked()
> >
> >Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
> >---
> > drivers/gpu/drm/xe/xe_bo.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> >diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> >index 1ab682d61e3c..014d084632f2 100644
> >--- a/drivers/gpu/drm/xe/xe_bo.c
> >+++ b/drivers/gpu/drm/xe/xe_bo.c
> >@@ -1199,6 +1199,9 @@ struct xe_bo *__xe_bo_create_locked(struct
> xe_device *xe, struct xe_bo *bo,
> > 	/* Only kernel objects should set GT */
> > 	XE_WARN_ON(tile && type != ttm_bo_type_kernel);
> >
> >+	if ((size & (PAGE_SIZE - 1)) != 0)
> 
> ALIGN()... but note that there is already a call to ALIGN() a few lines below
> this hunk. Probably missing the `size = ALIGN(size, PAGE_SIZE)` in the else
> condition?
> 
Yes. Let me add that under else.

Thanks! 
> Lucas De Marchi
> 
> >+		size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
> >+
> > 	if (XE_WARN_ON(!size)) {
> > 		xe_bo_free(bo);
> > 		return ERR_PTR(-EINVAL);
> >--
> >2.25.1
> >

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

* [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
@ 2023-09-20 21:32 Pallavi Mishra
  2023-09-25 16:54 ` Lucas De Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Pallavi Mishra @ 2023-09-20 21:32 UTC (permalink / raw)
  To: intel-xe; +Cc: stuart.summers, matthew.d.roper, lucas.demarchi

Ensure alignment with PAGE_SIZE for the size parameter
passed to __xe_bo_create_locked()

v2: move size alignment under else condition (Lucas)

Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
---
 drivers/gpu/drm/xe/xe_bo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index c5e4d04c4d58..59c57430918b 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -1218,6 +1218,7 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
 		flags |= XE_BO_INTERNAL_64K;
 		alignment = SZ_64K >> PAGE_SHIFT;
 	} else {
+		size = ALIGN(size, PAGE_SIZE);
 		alignment = SZ_4K >> PAGE_SHIFT;
 	}
 
-- 
2.25.1


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

* Re: [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
  2023-09-20 21:32 Pallavi Mishra
@ 2023-09-25 16:54 ` Lucas De Marchi
  2023-09-25 16:59   ` Lucas De Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Lucas De Marchi @ 2023-09-25 16:54 UTC (permalink / raw)
  To: Pallavi Mishra; +Cc: stuart.summers, matthew.d.roper, intel-xe

On Thu, Sep 21, 2023 at 03:02:59AM +0530, Pallavi Mishra wrote:
>Ensure alignment with PAGE_SIZE for the size parameter
>passed to __xe_bo_create_locked()
>
>v2: move size alignment under else condition (Lucas)
>
>Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

>---
> drivers/gpu/drm/xe/xe_bo.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
>index c5e4d04c4d58..59c57430918b 100644
>--- a/drivers/gpu/drm/xe/xe_bo.c
>+++ b/drivers/gpu/drm/xe/xe_bo.c
>@@ -1218,6 +1218,7 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
> 		flags |= XE_BO_INTERNAL_64K;
> 		alignment = SZ_64K >> PAGE_SHIFT;
> 	} else {
>+		size = ALIGN(size, PAGE_SIZE);
> 		alignment = SZ_4K >> PAGE_SHIFT;
> 	}
>
>-- 
>2.25.1
>

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

* Re: [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
  2023-09-25 16:54 ` Lucas De Marchi
@ 2023-09-25 16:59   ` Lucas De Marchi
  0 siblings, 0 replies; 7+ messages in thread
From: Lucas De Marchi @ 2023-09-25 16:59 UTC (permalink / raw)
  To: Pallavi Mishra; +Cc: stuart.summers, matthew.d.roper, intel-xe

On Mon, Sep 25, 2023 at 11:54:58AM -0500, Lucas De Marchi wrote:
>On Thu, Sep 21, 2023 at 03:02:59AM +0530, Pallavi Mishra wrote:
>>Ensure alignment with PAGE_SIZE for the size parameter
>>passed to __xe_bo_create_locked()
>>
>>v2: move size alignment under else condition (Lucas)
>>
>>Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
>
>
>Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

and pushed, thanks

Lucas De Marchi

>
>Lucas De Marchi
>
>>---
>>drivers/gpu/drm/xe/xe_bo.c | 1 +
>>1 file changed, 1 insertion(+)
>>
>>diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
>>index c5e4d04c4d58..59c57430918b 100644
>>--- a/drivers/gpu/drm/xe/xe_bo.c
>>+++ b/drivers/gpu/drm/xe/xe_bo.c
>>@@ -1218,6 +1218,7 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
>>		flags |= XE_BO_INTERNAL_64K;
>>		alignment = SZ_64K >> PAGE_SHIFT;
>>	} else {
>>+		size = ALIGN(size, PAGE_SIZE);
>>		alignment = SZ_4K >> PAGE_SHIFT;
>>	}
>>
>>-- 
>>2.25.1
>>

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

end of thread, other threads:[~2023-09-25 16:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20 17:54 [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE Pallavi Mishra
2023-09-20 19:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for " Patchwork
2023-09-20 19:24 ` [Intel-xe] [PATCH] " Lucas De Marchi
2023-09-20 19:30   ` Mishra, Pallavi
  -- strict thread matches above, loose matches on Subject: below --
2023-09-20 21:32 Pallavi Mishra
2023-09-25 16:54 ` Lucas De Marchi
2023-09-25 16:59   ` Lucas De Marchi

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