Skip to content

Commit 7bcb940

Browse files
authored
Tracked-on: RSDSO-20564 - D415 capture timeout robustness fix (#299)
1 parent b76a91e commit 7bcb940

8 files changed

+1602
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From dd18e8be0085284127b347bc3f30a4ccda1de590 Mon Sep 17 00:00:00 2001
2+
From: ejgoldik <[email protected]>
3+
Date: Thu, 18 Sep 2025 16:42:11 +0300
4+
Subject: [PATCH] Adding stream restart upon capture timeout
5+
6+
Ehud J. Goldik <[email protected]>
7+
---
8+
.../media/platform/tegra/camera/vi/vi5_fops.c | 25 ++++++++++++++++++-
9+
1 file changed, 24 insertions(+), 1 deletion(-)
10+
11+
diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
12+
index 6d6e1777e..67dc5179b 100644
13+
--- a/drivers/media/platform/tegra/camera/vi/vi5_fops.c
14+
+++ b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
15+
@@ -501,6 +501,24 @@ done:
16+
return err;
17+
}
18+
19+
+static int vi5_attempt_restart_stream(struct tegra_channel *chan)
20+
+{
21+
+ int err = -EPERM;
22+
+
23+
+ if (chan->num_subdevs > 1) {
24+
+ /* Restart meant for D4xx devices where device 1 is DS5 mux */
25+
+ if (strncmp(chan->subdev[1]->name, "DS5 mux", 7) == 0) {
26+
+ /* Stream OFF */
27+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 0);
28+
+ if (err == 0) {
29+
+ /* Stream ON */
30+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 1);
31+
+ }
32+
+ }
33+
+ }
34+
+ return err;
35+
+}
36+
+
37+
static void vi5_capture_dequeue(struct tegra_channel *chan,
38+
struct tegra_channel_buffer *buf)
39+
{
40+
@@ -524,8 +540,13 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
41+
if (err) {
42+
if (err == -ETIMEDOUT) {
43+
dev_err(vi->dev,
44+
- "uncorr_err: request timed out after %d ms\n",
45+
+ "uncorr_err: request timed out after %d ms - attempting restart\n",
46+
CAPTURE_TIMEOUT_MS);
47+
+ err = vi5_attempt_restart_stream(chan);
48+
+ if (err != 0) {
49+
+ dev_err(vi->dev,
50+
+ "uncorr_err: Restart failed\n");
51+
+ }
52+
} else {
53+
dev_err(vi->dev, "uncorr_err: request err %d\n", err);
54+
}
55+
--
56+
2.43.0
57+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 4e04992b8983480df6e02054753933cf29270064 Mon Sep 17 00:00:00 2001
2+
From: ejgoldik <[email protected]>
3+
Date: Thu, 18 Sep 2025 13:27:00 +0300
4+
Subject: [PATCH] Adding stream restart upon capture timeout
5+
6+
Ehud J. Goldik <[email protected]>
7+
---
8+
.../media/platform/tegra/camera/vi/vi5_fops.c | 25 ++++++++++++++++++-
9+
1 file changed, 24 insertions(+), 1 deletion(-)
10+
11+
diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
12+
index afaf3d742..83b96c254 100644
13+
--- a/drivers/media/platform/tegra/camera/vi/vi5_fops.c
14+
+++ b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
15+
@@ -550,6 +550,24 @@ done:
16+
return err;
17+
}
18+
19+
+static int vi5_attempt_restart_stream(struct tegra_channel *chan)
20+
+{
21+
+ int err = -EPERM;
22+
+
23+
+ if (chan->num_subdevs > 1) {
24+
+ /* Restart meant for D4xx devices where device 1 is DS5 mux */
25+
+ if (strncmp(chan->subdev[1]->name, "DS5 mux", 7) == 0) {
26+
+ /* Stream OFF */
27+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 0);
28+
+ if (err == 0) {
29+
+ /* Stream ON */
30+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 1);
31+
+ }
32+
+ }
33+
+ }
34+
+ return err;
35+
+}
36+
+
37+
static void vi5_capture_dequeue(struct tegra_channel *chan,
38+
struct tegra_channel_buffer *buf)
39+
{
40+
@@ -579,8 +595,13 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
41+
if (err) {
42+
if (err == -ETIMEDOUT) {
43+
dev_err(vi->dev,
44+
- "uncorr_err: request timed out after %d ms\n",
45+
+ "uncorr_err: request timed out after %d ms - attempting restart\n",
46+
CAPTURE_TIMEOUT_MS);
47+
+ err = vi5_attempt_restart_stream(chan);
48+
+ if (err != 0) {
49+
+ dev_err(vi->dev,
50+
+ "uncorr_err: Restart failed\n");
51+
+ }
52+
} else {
53+
dev_err(vi->dev, "uncorr_err: request err %d\n", err);
54+
}
55+
--
56+
2.43.0
57+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From b1eff1f01ec7acc200d18a6bf84cfd5825fe894e Mon Sep 17 00:00:00 2001
2+
From: ejgoldik <[email protected]>
3+
Date: Thu, 18 Sep 2025 16:05:31 +0300
4+
Subject: [PATCH] Adding stream restart upon capture timeout
5+
6+
Ehud J. Goldik <[email protected]>
7+
---
8+
.../media/platform/tegra/camera/vi/vi5_fops.c | 25 ++++++++++++++++++-
9+
1 file changed, 24 insertions(+), 1 deletion(-)
10+
11+
diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
12+
index 8ba911c4d..877b8a281 100644
13+
--- a/drivers/media/platform/tegra/camera/vi/vi5_fops.c
14+
+++ b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
15+
@@ -601,6 +601,24 @@ done:
16+
return err;
17+
}
18+
19+
+static int vi5_attempt_restart_stream(struct tegra_channel *chan)
20+
+{
21+
+ int err = -EPERM;
22+
+
23+
+ if (chan->num_subdevs > 1) {
24+
+ /* Restart meant for D4xx devices where device 1 is DS5 mux */
25+
+ if (strncmp(chan->subdev[1]->name, "DS5 mux", 7) == 0) {
26+
+ /* Stream OFF */
27+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 0);
28+
+ if (err == 0) {
29+
+ /* Stream ON */
30+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 1);
31+
+ }
32+
+ }
33+
+ }
34+
+ return err;
35+
+}
36+
+
37+
static void vi5_capture_dequeue(struct tegra_channel *chan,
38+
struct tegra_channel_buffer *buf)
39+
{
40+
@@ -630,8 +646,13 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
41+
if (err) {
42+
if (err == -ETIMEDOUT) {
43+
dev_err(vi->dev,
44+
- "uncorr_err: request timed out after %d ms\n",
45+
+ "uncorr_err: request timed out after %d ms - attempting restart\n",
46+
CAPTURE_TIMEOUT_MS);
47+
+ err = vi5_attempt_restart_stream(chan);
48+
+ if (err != 0) {
49+
+ dev_err(vi->dev,
50+
+ "uncorr_err: Restart failed\n");
51+
+ }
52+
} else {
53+
dev_err(vi->dev, "uncorr_err: request err %d\n", err);
54+
}
55+
--
56+
2.43.0
57+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From e2143770cd567d58f502077f483c8cdce4eef572 Mon Sep 17 00:00:00 2001
2+
From: ejgoldik <[email protected]>
3+
Date: Thu, 18 Sep 2025 15:07:20 +0300
4+
Subject: [PATCH] Adding stream restart upon capture timeout
5+
6+
Ehud J. Goldik <[email protected]>
7+
---
8+
.../media/platform/tegra/camera/vi/vi5_fops.c | 25 ++++++++++++++++++-
9+
1 file changed, 24 insertions(+), 1 deletion(-)
10+
11+
diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
12+
index 487ae44b..f92c9616 100644
13+
--- a/drivers/media/platform/tegra/camera/vi/vi5_fops.c
14+
+++ b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
15+
@@ -523,6 +523,24 @@ uncorr_err:
16+
spin_unlock_irqrestore(&chan->capture_state_lock, flags);
17+
}
18+
19+
+static int vi5_attempt_restart_stream(struct tegra_channel *chan)
20+
+{
21+
+ int err = -EPERM;
22+
+
23+
+ if (chan->num_subdevs > 1) {
24+
+ /* Restart meant for D4xx devices where device 1 is DS5 mux */
25+
+ if (strncmp(chan->subdev[1]->name, "DS5 mux", 7) == 0) {
26+
+ /* Stream OFF */
27+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 0);
28+
+ if (err == 0) {
29+
+ /* Stream ON */
30+
+ err = v4l2_subdev_call(chan->subdev[1], video, s_stream, 1);
31+
+ }
32+
+ }
33+
+ }
34+
+ return err;
35+
+}
36+
+
37+
static void vi5_capture_dequeue(struct tegra_channel *chan,
38+
struct tegra_channel_buffer *buf)
39+
{
40+
@@ -547,8 +563,13 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
41+
if (err) {
42+
if (err == -ETIMEDOUT) {
43+
dev_err(vi->dev,
44+
- "uncorr_err: request timed out after %d ms\n",
45+
+ "uncorr_err: request timed out after %d ms - attempting restart\n",
46+
CAPTURE_TIMEOUT_MS);
47+
+ err = vi5_attempt_restart_stream(chan);
48+
+ if (err != 0) {
49+
+ dev_err(vi->dev,
50+
+ "uncorr_err: Restart failed\n");
51+
+ }
52+
} else {
53+
dev_err(vi->dev, "uncorr_err: request err %d\n", err);
54+
}
55+
--
56+
2.43.0
57+

nvidia-oot/6.1

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)