Helps with disconnecting fences from Xe module.
Signed-off-by: Matthew Brost <[email protected]>
---
drivers/gpu/drm/xe/xe_hw_fence.c | 25 ++-----------------------
drivers/gpu/drm/xe/xe_hw_fence.h | 3 ---
drivers/gpu/drm/xe/xe_module.c | 5 -----
3 files changed, 2 insertions(+), 31 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_hw_fence.c b/drivers/gpu/drm/xe/xe_hw_fence.c
index 3456bec93c70..5edcf057aceb 100644
--- a/drivers/gpu/drm/xe/xe_hw_fence.c
+++ b/drivers/gpu/drm/xe/xe_hw_fence.c
@@ -6,7 +6,6 @@
#include "xe_hw_fence.h"
#include <linux/device.h>
-#include <linux/slab.h>
#include "xe_bo.h"
#include "xe_device.h"
@@ -16,28 +15,9 @@
#include "xe_map.h"
#include "xe_trace.h"
-static struct kmem_cache *xe_hw_fence_slab;
-
-int __init xe_hw_fence_module_init(void)
-{
- xe_hw_fence_slab = kmem_cache_create("xe_hw_fence",
- sizeof(struct xe_hw_fence), 0,
- SLAB_HWCACHE_ALIGN, NULL);
- if (!xe_hw_fence_slab)
- return -ENOMEM;
-
- return 0;
-}
-
-void xe_hw_fence_module_exit(void)
-{
- rcu_barrier();
- kmem_cache_destroy(xe_hw_fence_slab);
-}
-
static struct xe_hw_fence *fence_alloc(void)
{
- return kmem_cache_zalloc(xe_hw_fence_slab, GFP_KERNEL);
+ return kzalloc(sizeof(struct xe_hw_fence), GFP_KERNEL);
}
static void fence_free(struct rcu_head *rcu)
@@ -45,8 +25,7 @@ static void fence_free(struct rcu_head *rcu)
struct xe_hw_fence *fence =
container_of(rcu, struct xe_hw_fence, dma.rcu);
- if (!WARN_ON_ONCE(!fence))
- kmem_cache_free(xe_hw_fence_slab, fence);
+ kfree(fence);
}
static void hw_fence_irq_run_cb(struct irq_work *work)
diff --git a/drivers/gpu/drm/xe/xe_hw_fence.h b/drivers/gpu/drm/xe/xe_hw_fence.h
index f13a1c4982c7..96f34332fd8d 100644
--- a/drivers/gpu/drm/xe/xe_hw_fence.h
+++ b/drivers/gpu/drm/xe/xe_hw_fence.h
@@ -11,9 +11,6 @@
/* Cause an early wrap to catch wrapping errors */
#define XE_FENCE_INITIAL_SEQNO (-127)
-int xe_hw_fence_module_init(void);
-void xe_hw_fence_module_exit(void);
-
void xe_hw_fence_irq_init(struct xe_hw_fence_irq *irq);
void xe_hw_fence_irq_finish(struct xe_hw_fence_irq *irq);
void xe_hw_fence_irq_run(struct xe_hw_fence_irq *irq);
diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
index d08338fc3bc1..32517bcd533c 100644
--- a/drivers/gpu/drm/xe/xe_module.c
+++ b/drivers/gpu/drm/xe/xe_module.c
@@ -12,7 +12,6 @@
#include "xe_drv.h"
#include "xe_configfs.h"
-#include "xe_hw_fence.h"
#include "xe_pci.h"
#include "xe_pm.h"
#include "xe_observation.h"
@@ -114,10 +113,6 @@ static const struct init_funcs init_funcs[] = {
.init = xe_configfs_init,
.exit = xe_configfs_exit,
},
- {
- .init = xe_hw_fence_module_init,
- .exit = xe_hw_fence_module_exit,
- },
{
.init = xe_sched_job_module_init,
.exit = xe_sched_job_module_exit,
--
2.34.1