msm: kgsl: Defer drawobj_sync_timeline_fence_work() to a workqueue

drawobj_sync_timeline_fence_work() does a cleanup of fence and syncobj
allocations. Doing this cleanup in irq context requires the irq_work
struct to remain valid after the function executes. Avoid this constraint
by deferring this work to the memory workqueue.

Change-Id: Icf648a61686c1ef3fd84467a2376b11a9a4bb803
Signed-off-by: Lynus Vaz <quic_lvaz@quicinc.com>
This commit is contained in:
Lynus Vaz 2023-06-15 14:12:21 -07:00 committed by Gerrit - the friendly Code Review server
parent afe20da34b
commit dc674586ed
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
/*
@ -253,7 +254,7 @@ static void drawobj_sync_func(struct kgsl_device *device,
kgsl_drawobj_put(&event->syncobj->base);
}
static void drawobj_sync_timeline_fence_work(struct irq_work *work)
static void drawobj_sync_timeline_fence_work(struct work_struct *work)
{
struct kgsl_drawobj_sync_event *event = container_of(work,
struct kgsl_drawobj_sync_event, work);
@ -301,7 +302,7 @@ static void drawobj_sync_timeline_fence_callback(struct dma_fence *f,
* removing the fence
*/
if (drawobj_sync_expire(event->device, event))
irq_work_queue(&event->work);
queue_work(kgsl_driver.mem_workqueue, &event->work);
}
static void syncobj_destroy(struct kgsl_drawobj *drawobj)
@ -498,7 +499,7 @@ static int drawobj_add_sync_timeline(struct kgsl_device *device,
event->device = device;
event->context = NULL;
event->fence = fence;
init_irq_work(&event->work, drawobj_sync_timeline_fence_work);
INIT_WORK(&event->work, drawobj_sync_timeline_fence_work);
INIT_LIST_HEAD(&event->cb.node);

View File

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __KGSL_DRAWOBJ_H
@ -170,8 +171,8 @@ struct kgsl_drawobj_sync_event {
struct dma_fence *fence;
/** @cb: Callback struct for KGSL_CMD_SYNCPOINT_TYPE_TIMELINE */
struct dma_fence_cb cb;
/** @work : irq worker for KGSL_CMD_SYNCPOINT_TYPE_TIMELINE */
struct irq_work work;
/** @work : work_struct for KGSL_CMD_SYNCPOINT_TYPE_TIMELINE */
struct work_struct work;
};
#define KGSL_DRAWOBJ_FLAGS \