DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] bus/fslmc: unlock spinlock in case of timeout
@ 2022-12-25 13:45 Alvaro Karsz
  2022-12-25 13:50 ` Alvaro Karsz
  0 siblings, 1 reply; 2+ messages in thread
From: Alvaro Karsz @ 2022-12-25 13:45 UTC (permalink / raw)
  To: dev; +Cc: sachin.saxena, hemant.agrawal, Alvaro Karsz

Commit 79711846f6 introduces timeouts to mc, but in case of
a timeout, the spinlock that was locked before isn't unlocked.

Fixes: 79711846f6 ("bus/fslmc: add timeout in MC send command API")
Signed-off-by: Alvaro Karsz <alvaro.karsz@solid-run.com>
---
 drivers/bus/fslmc/mc/mc_sys.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/mc/mc_sys.c b/drivers/bus/fslmc/mc/mc_sys.c
index ab9a074835..a78e504bd2 100644
--- a/drivers/bus/fslmc/mc/mc_sys.c
+++ b/drivers/bus/fslmc/mc/mc_sys.c
@@ -77,8 +77,12 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd)
 		total_time = rte_get_timer_cycles() - start_time;
 	} while (status == MC_CMD_STATUS_READY && total_time <= time_to_wait);
 
-	if (status == MC_CMD_STATUS_READY)
+	if (status == MC_CMD_STATUS_READY) {
+		/* --- Call unlock function here in case portal is shared --- */
+	        rte_spinlock_unlock(&mc_portal_lock);
+
 		return mc_status_to_error(MC_CMD_STATUS_TIMEOUT);
+	}
 
 	/* Read the response back into the command buffer */
 	mc_read_response(mc_io->regs, cmd);
-- 
2.32.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bus/fslmc: unlock spinlock in case of timeout
  2022-12-25 13:45 [PATCH] bus/fslmc: unlock spinlock in case of timeout Alvaro Karsz
@ 2022-12-25 13:50 ` Alvaro Karsz
  0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Karsz @ 2022-12-25 13:50 UTC (permalink / raw)
  To: dev; +Cc: sachin.saxena, hemant.agrawal

Sorry guys, I got test-report errors.
The commit id format is wrong and it seems that I have an indentation error.

I will fix it and submit a new version.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-25 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-25 13:45 [PATCH] bus/fslmc: unlock spinlock in case of timeout Alvaro Karsz
2022-12-25 13:50 ` Alvaro Karsz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).