Commit 6016498f authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: omap4iss: Propagate stop timeouts from submodules to the driver core

Return an error from the s_stream handlers when stopping the stream
failed instead of just logging the error and ignoring it. While we're
at it, move the logging code from submodules to the driver code.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 0b1d4249
...@@ -614,6 +614,8 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe) ...@@ -614,6 +614,8 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe)
struct media_entity *entity; struct media_entity *entity;
struct media_pad *pad; struct media_pad *pad;
struct v4l2_subdev *subdev; struct v4l2_subdev *subdev;
int failure = 0;
int ret;
entity = &pipe->output->video.entity; entity = &pipe->output->video.entity;
while (1) { while (1) {
...@@ -629,10 +631,15 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe) ...@@ -629,10 +631,15 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe)
entity = pad->entity; entity = pad->entity;
subdev = media_entity_to_v4l2_subdev(entity); subdev = media_entity_to_v4l2_subdev(entity);
v4l2_subdev_call(subdev, video, s_stream, 0); ret = v4l2_subdev_call(subdev, video, s_stream, 0);
if (ret < 0) {
dev_dbg(iss->dev, "%s: module stop timeout.\n",
subdev->name);
failure = -ETIMEDOUT;
}
} }
return 0; return failure;
} }
/* /*
......
...@@ -1056,6 +1056,7 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -1056,6 +1056,7 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable)
struct iss_device *iss = csi2->iss; struct iss_device *iss = csi2->iss;
struct iss_pipeline *pipe = to_iss_pipeline(&csi2->subdev.entity); struct iss_pipeline *pipe = to_iss_pipeline(&csi2->subdev.entity);
struct iss_video *video_out = &csi2->video_out; struct iss_video *video_out = &csi2->video_out;
int ret = 0;
if (csi2->state == ISS_PIPELINE_STREAM_STOPPED) { if (csi2->state == ISS_PIPELINE_STREAM_STOPPED) {
if (enable == ISS_PIPELINE_STREAM_STOPPED) if (enable == ISS_PIPELINE_STREAM_STOPPED)
...@@ -1069,8 +1070,6 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -1069,8 +1070,6 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable)
switch (enable) { switch (enable) {
case ISS_PIPELINE_STREAM_CONTINUOUS: { case ISS_PIPELINE_STREAM_CONTINUOUS: {
int ret;
ret = omap4iss_csiphy_config(iss, sd); ret = omap4iss_csiphy_config(iss, sd);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1102,8 +1101,7 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -1102,8 +1101,7 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable)
return 0; return 0;
if (omap4iss_module_sync_idle(&sd->entity, &csi2->wait, if (omap4iss_module_sync_idle(&sd->entity, &csi2->wait,
&csi2->stopping)) &csi2->stopping))
dev_dbg(iss->dev, "%s: module stop timeout.\n", ret = -ETIMEDOUT;
sd->name);
csi2_ctx_enable(csi2, 0, 0); csi2_ctx_enable(csi2, 0, 0);
csi2_if_enable(csi2, 0); csi2_if_enable(csi2, 0);
csi2_irq_ctx_set(csi2, 0); csi2_irq_ctx_set(csi2, 0);
...@@ -1117,7 +1115,7 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -1117,7 +1115,7 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable)
} }
csi2->state = enable; csi2->state = enable;
return 0; return ret;
} }
/* subdev video operations */ /* subdev video operations */
......
...@@ -166,8 +166,7 @@ static int ipipe_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -166,8 +166,7 @@ static int ipipe_set_stream(struct v4l2_subdev *sd, int enable)
return 0; return 0;
if (omap4iss_module_sync_idle(&sd->entity, &ipipe->wait, if (omap4iss_module_sync_idle(&sd->entity, &ipipe->wait,
&ipipe->stopping)) &ipipe->stopping))
dev_dbg(iss->dev, "%s: module stop timeout.\n", ret = -ETIMEDOUT;
sd->name);
ipipe_enable(ipipe, 0); ipipe_enable(ipipe, 0);
omap4iss_isp_disable_interrupts(iss); omap4iss_isp_disable_interrupts(iss);
......
...@@ -363,8 +363,7 @@ static int ipipeif_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -363,8 +363,7 @@ static int ipipeif_set_stream(struct v4l2_subdev *sd, int enable)
return 0; return 0;
if (omap4iss_module_sync_idle(&sd->entity, &ipipeif->wait, if (omap4iss_module_sync_idle(&sd->entity, &ipipeif->wait,
&ipipeif->stopping)) &ipipeif->stopping))
dev_dbg(iss->dev, "%s: module stop timeout.\n", ret = -ETIMEDOUT;
sd->name);
if (ipipeif->output & IPIPEIF_OUTPUT_MEMORY) if (ipipeif->output & IPIPEIF_OUTPUT_MEMORY)
ipipeif_write_enable(ipipeif, 0); ipipeif_write_enable(ipipeif, 0);
......
...@@ -416,8 +416,7 @@ static int resizer_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -416,8 +416,7 @@ static int resizer_set_stream(struct v4l2_subdev *sd, int enable)
return 0; return 0;
if (omap4iss_module_sync_idle(&sd->entity, &resizer->wait, if (omap4iss_module_sync_idle(&sd->entity, &resizer->wait,
&resizer->stopping)) &resizer->stopping))
dev_dbg(iss->dev, "%s: module stop timeout.\n", ret = -ETIMEDOUT;
sd->name);
resizer_enable(resizer, 0); resizer_enable(resizer, 0);
omap4iss_isp_disable_interrupts(iss); omap4iss_isp_disable_interrupts(iss);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment