* [PATCH v2] drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds
@ 2024-07-22 20:26 Matthew Brost
2024-07-22 20:34 ` ✓ CI.Patch_applied: success for drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2) Patchwork
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Matthew Brost @ 2024-07-22 20:26 UTC (permalink / raw)
To: intel-xe
The size of an array of binds is directly tied to several kmalloc in the
KMD, thus making these kmalloc more likely to fail. Return -ENOBUFS in
the case of these failures.
The expected UMD behavior upon returning -ENOBUFS is to split an array
of binds into a series of single binds.
v2:
- Resend for CI
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
---
drivers/gpu/drm/xe/xe_vm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index e703e3bf8748..3b321da14096 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -718,7 +718,7 @@ int xe_vm_userptr_check_repin(struct xe_vm *vm)
list_empty_careful(&vm->userptr.invalidated)) ? 0 : -EAGAIN;
}
-static int xe_vma_ops_alloc(struct xe_vma_ops *vops)
+static int xe_vma_ops_alloc(struct xe_vma_ops *vops, bool array_of_binds)
{
int i;
@@ -731,7 +731,7 @@ static int xe_vma_ops_alloc(struct xe_vma_ops *vops)
sizeof(*vops->pt_update_ops[i].ops),
GFP_KERNEL);
if (!vops->pt_update_ops[i].ops)
- return -ENOMEM;
+ return array_of_binds ? -ENOBUFS : -ENOMEM;
}
return 0;
@@ -824,7 +824,7 @@ int xe_vm_rebind(struct xe_vm *vm, bool rebind_worker)
goto free_ops;
}
- err = xe_vma_ops_alloc(&vops);
+ err = xe_vma_ops_alloc(&vops, false);
if (err)
goto free_ops;
@@ -871,7 +871,7 @@ struct dma_fence *xe_vma_rebind(struct xe_vm *vm, struct xe_vma *vma, u8 tile_ma
if (err)
return ERR_PTR(err);
- err = xe_vma_ops_alloc(&vops);
+ err = xe_vma_ops_alloc(&vops, false);
if (err) {
fence = ERR_PTR(err);
goto free_ops;
@@ -2765,7 +2765,7 @@ static int vm_bind_ioctl_check_args(struct xe_device *xe,
sizeof(struct drm_xe_vm_bind_op),
GFP_KERNEL | __GFP_ACCOUNT);
if (!*bind_ops)
- return -ENOMEM;
+ return args->num_binds > 1 ? -ENOBUFS : -ENOMEM;
err = __copy_from_user(*bind_ops, bind_user,
sizeof(struct drm_xe_vm_bind_op) *
@@ -3104,7 +3104,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
goto unwind_ops;
}
- err = xe_vma_ops_alloc(&vops);
+ err = xe_vma_ops_alloc(&vops, args->num_binds > 1);
if (err)
goto unwind_ops;
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* ✓ CI.Patch_applied: success for drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2)
2024-07-22 20:26 [PATCH v2] drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds Matthew Brost
@ 2024-07-22 20:34 ` Patchwork
2024-07-22 20:34 ` ✓ CI.checkpatch: " Patchwork
2024-07-22 20:35 ` ✗ CI.KUnit: failure " Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2024-07-22 20:34 UTC (permalink / raw)
To: Matthew Brost; +Cc: intel-xe
== Series Details ==
Series: drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2)
URL : https://patchwork.freedesktop.org/series/136292/
State : success
== Summary ==
=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: 16dc06e8fb1a drm-tip: 2024y-07m-22d-19h-07m-03s UTC integration manifest
=== git am output follows ===
Applying: drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds
^ permalink raw reply [flat|nested] 4+ messages in thread
* ✓ CI.checkpatch: success for drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2)
2024-07-22 20:26 [PATCH v2] drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds Matthew Brost
2024-07-22 20:34 ` ✓ CI.Patch_applied: success for drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2) Patchwork
@ 2024-07-22 20:34 ` Patchwork
2024-07-22 20:35 ` ✗ CI.KUnit: failure " Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2024-07-22 20:34 UTC (permalink / raw)
To: Matthew Brost; +Cc: intel-xe
== Series Details ==
Series: drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2)
URL : https://patchwork.freedesktop.org/series/136292/
State : success
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
5ce3e132caaa5b45e5e50201b574a097d130967c
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 4b7557ffb4dda0e6ada1f3c0baa08ad4f6577240
Author: Matthew Brost <matthew.brost@intel.com>
Date: Mon Jul 22 13:26:57 2024 -0700
drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds
The size of an array of binds is directly tied to several kmalloc in the
KMD, thus making these kmalloc more likely to fail. Return -ENOBUFS in
the case of these failures.
The expected UMD behavior upon returning -ENOBUFS is to split an array
of binds into a series of single binds.
v2:
- Resend for CI
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
+ /mt/dim checkpatch 16dc06e8fb1aaf484c4914f1fecc22502c9ab641 drm-intel
4b7557ffb4dd drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds
^ permalink raw reply [flat|nested] 4+ messages in thread
* ✗ CI.KUnit: failure for drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2)
2024-07-22 20:26 [PATCH v2] drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds Matthew Brost
2024-07-22 20:34 ` ✓ CI.Patch_applied: success for drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2) Patchwork
2024-07-22 20:34 ` ✓ CI.checkpatch: " Patchwork
@ 2024-07-22 20:35 ` Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2024-07-22 20:35 UTC (permalink / raw)
To: Matthew Brost; +Cc: intel-xe
== Series Details ==
Series: drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2)
URL : https://patchwork.freedesktop.org/series/136292/
State : failure
== Summary ==
+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
ERROR:root:../drivers/gpu/drm/xe/xe_device.c: In function ‘xe_file_close’:
../drivers/gpu/drm/xe/xe_device.c:149:20: error: ‘xe’ undeclared (first use in this function); did you mean ‘xef’?
149 | xe_pm_runtime_get(xe);
| ^~
| xef
../drivers/gpu/drm/xe/xe_device.c:149:20: note: each undeclared identifier is reported only once for each function it appears in
make[7]: *** [../scripts/Makefile.build:244: drivers/gpu/drm/xe/xe_device.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[6]: *** [../scripts/Makefile.build:485: drivers/gpu/drm/xe] Error 2
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [../scripts/Makefile.build:485: drivers/gpu/drm] Error 2
make[4]: *** [../scripts/Makefile.build:485: drivers/gpu] Error 2
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [../scripts/Makefile.build:485: drivers] Error 2
make[3]: *** Waiting for unfinished jobs....
../lib/iomap.c:156:5: warning: no previous prototype for ‘ioread64_lo_hi’ [-Wmissing-prototypes]
156 | u64 ioread64_lo_hi(const void __iomem *addr)
| ^~~~~~~~~~~~~~
../lib/iomap.c:163:5: warning: no previous prototype for ‘ioread64_hi_lo’ [-Wmissing-prototypes]
163 | u64 ioread64_hi_lo(const void __iomem *addr)
| ^~~~~~~~~~~~~~
../lib/iomap.c:170:5: warning: no previous prototype for ‘ioread64be_lo_hi’ [-Wmissing-prototypes]
170 | u64 ioread64be_lo_hi(const void __iomem *addr)
| ^~~~~~~~~~~~~~~~
../lib/iomap.c:178:5: warning: no previous prototype for ‘ioread64be_hi_lo’ [-Wmissing-prototypes]
178 | u64 ioread64be_hi_lo(const void __iomem *addr)
| ^~~~~~~~~~~~~~~~
../lib/iomap.c:264:6: warning: no previous prototype for ‘iowrite64_lo_hi’ [-Wmissing-prototypes]
264 | void iowrite64_lo_hi(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~
../lib/iomap.c:272:6: warning: no previous prototype for ‘iowrite64_hi_lo’ [-Wmissing-prototypes]
272 | void iowrite64_hi_lo(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~
../lib/iomap.c:280:6: warning: no previous prototype for ‘iowrite64be_lo_hi’ [-Wmissing-prototypes]
280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~~~
../lib/iomap.c:288:6: warning: no previous prototype for ‘iowrite64be_hi_lo’ [-Wmissing-prototypes]
288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~~~
make[2]: *** [/kernel/Makefile:1934: .] Error 2
make[1]: *** [/kernel/Makefile:240: __sub-make] Error 2
make: *** [Makefile:240: __sub-make] Error 2
[20:34:50] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[20:34:54] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make ARCH=um O=.kunit --jobs=48
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-22 20:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22 20:26 [PATCH v2] drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds Matthew Brost
2024-07-22 20:34 ` ✓ CI.Patch_applied: success for drm/xe: Return -ENOBUFS if a kmalloc fails which is tied to an array of binds (rev2) Patchwork
2024-07-22 20:34 ` ✓ CI.checkpatch: " Patchwork
2024-07-22 20:35 ` ✗ CI.KUnit: failure " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox