summaryrefslogtreecommitdiff
path: root/tools/testing/shared
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@intel.com>2024-12-02 11:22:11 -0500
committerRodrigo Vivi <rodrigo.vivi@intel.com>2024-12-02 11:22:11 -0500
commit8f109f287fdc7b8fc7dcb6b2190c8b17dc22fcda (patch)
tree8c59d34866fcb6d121bbb30014ca46a49a818f1b /tools/testing/shared
parent54254727837440966c3381ea688df002ff14f269 (diff)
parent40384c840ea1944d7c5a392e8975ed088ecf0b37 (diff)
Merge drm/drm-next into drm-xe-next
A backmerge to get the PMT preparation work for merging the BMG PMT support. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'tools/testing/shared')
-rw-r--r--tools/testing/shared/linux.c14
-rw-r--r--tools/testing/shared/shared.mk1
2 files changed, 10 insertions, 5 deletions
diff --git a/tools/testing/shared/linux.c b/tools/testing/shared/linux.c
index 17263696b5d8..66dbb362385f 100644
--- a/tools/testing/shared/linux.c
+++ b/tools/testing/shared/linux.c
@@ -96,10 +96,13 @@ void *kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru,
p = node;
} else {
pthread_mutex_unlock(&cachep->lock);
- if (cachep->align)
- posix_memalign(&p, cachep->align, cachep->size);
- else
+ if (cachep->align) {
+ if (posix_memalign(&p, cachep->align, cachep->size) < 0)
+ return NULL;
+ } else {
p = malloc(cachep->size);
+ }
+
if (cachep->ctor)
cachep->ctor(p);
else if (gfp & __GFP_ZERO)
@@ -195,8 +198,9 @@ int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size,
}
if (cachep->align) {
- posix_memalign(&p[i], cachep->align,
- cachep->size);
+ if (posix_memalign(&p[i], cachep->align,
+ cachep->size) < 0)
+ break;
} else {
p[i] = malloc(cachep->size);
if (!p[i])
diff --git a/tools/testing/shared/shared.mk b/tools/testing/shared/shared.mk
index a6bc51d0b0bf..923ee2492256 100644
--- a/tools/testing/shared/shared.mk
+++ b/tools/testing/shared/shared.mk
@@ -69,6 +69,7 @@ generated/bit-length.h: FORCE
@if ! grep -qws CONFIG_$(LONG_BIT)BIT generated/bit-length.h; then \
echo "Generating $@"; \
echo "#define CONFIG_$(LONG_BIT)BIT 1" > $@; \
+ echo "#define CONFIG_PHYS_ADDR_T_$(LONG_BIT)BIT 1" >> $@; \
fi
FORCE: ;