[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230517193540.14323-4-quic_jhugo@quicinc.com>
Date: Wed, 17 May 2023 13:35:38 -0600
From: Jeffrey Hugo <quic_jhugo@...cinc.com>
To: <ogabbay@...nel.org>, <jacek.lawrynowicz@...ux.intel.com>,
<quic_pkanojiy@...cinc.com>, <stanislaw.gruszka@...ux.intel.com>,
<quic_carlv@...cinc.com>, <quic_ajitpals@...cinc.com>
CC: <linux-arm-msm@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
<linux-kernel@...r.kernel.org>,
Jeffrey Hugo <quic_jhugo@...cinc.com>
Subject: [PATCH 3/5] accel/qaic: Flush the transfer list again
From: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@...cinc.com>
Before calling synchronize_srcu() we clear the transfer list, this is to
allow all the QAIC_WAIT_BO callers to exit otherwise the system could
deadlock. There could be a corner case where more elements get added to
transfer list after we have flushed it. Re-flush the transfer list once
all the holders of dbc->ch_lock have completed execution i.e.
synchronize_srcu() is complete.
Fixes: ff13be830333 ("accel/qaic: Add datapath")
Signed-off-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@...cinc.com>
Reviewed-by: Carl Vanderlip <quic_carlv@...cinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@...cinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@...cinc.com>
---
drivers/accel/qaic/qaic_data.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
index 1285c3dc9aef..8603e99a2a61 100644
--- a/drivers/accel/qaic/qaic_data.c
+++ b/drivers/accel/qaic/qaic_data.c
@@ -1845,6 +1845,11 @@ void wakeup_dbc(struct qaic_device *qdev, u32 dbc_id)
dbc->usr = NULL;
empty_xfer_list(qdev, dbc);
synchronize_srcu(&dbc->ch_lock);
+ /*
+ * Threads holding channel lock, may add more elements in the xfer_list.
+ * Flush out these elements from xfer_list.
+ */
+ empty_xfer_list(qdev, dbc);
}
void release_dbc(struct qaic_device *qdev, u32 dbc_id)
--
2.40.1
Powered by blists - more mailing lists