Skip to content

Commit 0a9ee93

Browse files
Pranjal Ramajor Asha Kanojiyaquic-jhugo
authored andcommitted
accel/qaic: Clean up BO during flushing of transfer list
Variables that are set while adding the corresponding BO in transfer list should be cleaned when flushing them out of transfer list prematurely. After this patch we do not need some of the cleanup done in release_dbc() This patch would also pave the way to have a central location to clean BO, during an undesired situation. Signed-off-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-6-quic_jhugo@quicinc.com
1 parent b3107e7 commit 0a9ee93

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

drivers/accel/qaic/qaic_data.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,12 @@ static void empty_xfer_list(struct qaic_device *qdev, struct dma_bridge_chan *db
18081808
bo->queued = false;
18091809
list_del(&bo->xfer_list);
18101810
spin_unlock_irqrestore(&dbc->xfer_lock, flags);
1811+
bo->nr_slice_xfer_done = 0;
1812+
bo->req_id = 0;
1813+
bo->perf_stats.req_received_ts = 0;
1814+
bo->perf_stats.req_submit_ts = 0;
1815+
bo->perf_stats.req_processed_ts = 0;
1816+
bo->perf_stats.queue_level_before = 0;
18111817
dma_sync_sgtable_for_cpu(&qdev->pdev->dev, bo->sgt, bo->dir);
18121818
complete_all(&bo->xfer_done);
18131819
drm_gem_object_put(&bo->base);
@@ -1876,16 +1882,8 @@ void release_dbc(struct qaic_device *qdev, u32 dbc_id)
18761882
qaic_unprepare_bo(qdev, bo);
18771883
bo->sliced = false;
18781884
INIT_LIST_HEAD(&bo->slices);
1879-
bo->nr_slice_xfer_done = 0;
1880-
bo->queued = false;
1881-
bo->req_id = 0;
18821885
init_completion(&bo->xfer_done);
1883-
complete_all(&bo->xfer_done);
18841886
list_del(&bo->bo_list);
1885-
bo->perf_stats.req_received_ts = 0;
1886-
bo->perf_stats.req_submit_ts = 0;
1887-
bo->perf_stats.req_processed_ts = 0;
1888-
bo->perf_stats.queue_level_before = 0;
18891887
}
18901888

18911889
dbc->in_use = false;

0 commit comments

Comments
 (0)