hello mmcly,
would you please update the kernel image to add below patch for capture-ivc.c
.
for example,
diff --git a/drivers/platform/tegra/rtcpu/capture-ivc-priv.h b/drivers/platform/tegra/rtcpu/capture-ivc-priv.h
index 04c95aef3..f6cb92497 100644
--- a/drivers/platform/tegra/rtcpu/capture-ivc-priv.h
+++ b/drivers/platform/tegra/rtcpu/capture-ivc-priv.h
@@ -37,6 +37,7 @@ struct tegra_capture_ivc_cb_ctx {
tegra_capture_ivc_cb_func cb_func;
/** Private context of a VI/ISP capture context */
const void *priv_context;
+ struct semaphore sem_ch;
};
/**
diff --git a/drivers/platform/tegra/rtcpu/capture-ivc.c b/drivers/platform/tegra/rtcpu/capture-ivc.c
index c5e1bc519..7aae4920e 100644
--- a/drivers/platform/tegra/rtcpu/capture-ivc.c
+++ b/drivers/platform/tegra/rtcpu/capture-ivc.c
@@ -28,11 +28,15 @@
#include <linux/tegra-ivc.h>
#include <linux/tegra-ivc-bus.h>
#include <linux/nospec.h>
-
+#include <linux/semaphore.h>
#include <asm/barrier.h>
#include "capture-ivc-priv.h"
+
+/* Timeout for acquiring channel-id */
+#define TIMEOUT_ACQUIRE_CHANNEL_ID 120
+
static int tegra_capture_ivc_tx(struct tegra_capture_ivc *civc,
const void *req, size_t len)
{
@@ -165,6 +169,11 @@ int tegra_capture_ivc_notify_chan_id(uint32_t chan_id, uint32_t trans_id)
civc = __scivc_control;
+ if (down_timeout(&civc->cb_ctx[chan_id].sem_ch,
+ TIMEOUT_ACQUIRE_CHANNEL_ID)) {
+ return -EBUSY;
+ }
+
mutex_lock(&civc->cb_ctx_lock);
if (WARN(civc->cb_ctx[trans_id].cb_func == NULL,
@@ -269,6 +278,7 @@ int tegra_capture_ivc_unregister_control_cb(uint32_t id)
civc->cb_ctx[id].priv_context = NULL;
mutex_unlock(&civc->cb_ctx_lock);
+ up(&civc->cb_ctx[id].sem_ch);
/*
* If it's trans_id, client encountered an error before or during
@@ -415,6 +425,9 @@ static int tegra_capture_ivc_probe(struct tegra_ivc_channel *chan)
mutex_init(&civc->cb_ctx_lock);
mutex_init(&civc->ivc_wr_lock);
+ for (i = 0; i < TOTAL_CHANNELS; i++)
+ sema_init(&civc->cb_ctx[i].sem_ch, 1);
+
/* Initialize ivc_work */
INIT_WORK(&civc->work, tegra_capture_ivc_worker);