diff options
author | Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com> | 2023-09-01 11:22:45 -0600 |
---|---|---|
committer | Jeffrey Hugo <quic_jhugo@quicinc.com> | 2023-09-22 09:57:46 -0600 |
commit | 0a9ee93b8294e479f9ee845241246a83477233b3 (patch) | |
tree | 98563127f72cf19c9b21e886007cc56658540376 /drivers/accel | |
parent | b3107e75a96ee17a510deabf4b00b0c37d2351d4 (diff) |
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
Diffstat (limited to 'drivers/accel')
-rw-r--r-- | drivers/accel/qaic/qaic_data.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c index c4b8b4bf0200..6e44e00937af 100644 --- a/drivers/accel/qaic/qaic_data.c +++ b/drivers/accel/qaic/qaic_data.c @@ -1808,6 +1808,12 @@ static void empty_xfer_list(struct qaic_device *qdev, struct dma_bridge_chan *db bo->queued = false; list_del(&bo->xfer_list); spin_unlock_irqrestore(&dbc->xfer_lock, flags); + bo->nr_slice_xfer_done = 0; + bo->req_id = 0; + bo->perf_stats.req_received_ts = 0; + bo->perf_stats.req_submit_ts = 0; + bo->perf_stats.req_processed_ts = 0; + bo->perf_stats.queue_level_before = 0; dma_sync_sgtable_for_cpu(&qdev->pdev->dev, bo->sgt, bo->dir); complete_all(&bo->xfer_done); drm_gem_object_put(&bo->base); @@ -1876,16 +1882,8 @@ void release_dbc(struct qaic_device *qdev, u32 dbc_id) qaic_unprepare_bo(qdev, bo); bo->sliced = false; INIT_LIST_HEAD(&bo->slices); - bo->nr_slice_xfer_done = 0; - bo->queued = false; - bo->req_id = 0; init_completion(&bo->xfer_done); - complete_all(&bo->xfer_done); list_del(&bo->bo_list); - bo->perf_stats.req_received_ts = 0; - bo->perf_stats.req_submit_ts = 0; - bo->perf_stats.req_processed_ts = 0; - bo->perf_stats.queue_level_before = 0; } dbc->in_use = false; |