Commit 8c6ecdd7 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] s5p-fimc: Do not attempt to disable not enabled media pipeline

This fixes following warnings when all links are being disconnected:
[   20.080000] WARNING: at drivers/media/platform/s5p-fimc/fimc-mdevice.c:1269 __fimc_md_set_camclk+0x208/0x20c()
[   20.090000] Modules linked in:
[   20.095000] [<c001603c>] (unwind_backtrace+0x0/0x13c) from [<c00246dc>] (warn_slowpath_common+0x54/0x64)
[   20.105000] [<c00246dc>] (warn_slowpath_common+0x54/0x64) from [<c0024708>] (warn_slowpath_null+0x1c/0x24)
[   20.115000] [<c0024708>] (warn_slowpath_null+0x1c/0x24) from [<c0323fe8>] (__fimc_md_set_camclk+0x208/0x20c)
[   20.125000] [<c0323fe8>] (__fimc_md_set_camclk+0x208/0x20c) from [<c0324368>] (__fimc_pipeline_close+0x38/0x48)
[   20.135000] [<c0324368>] (__fimc_pipeline_close+0x38/0x48) from [<c0325848>] (fimc_md_link_notify+0x10c/0x198)
[   20.145000] [<c0325848>] (fimc_md_link_notify+0x10c/0x198) from [<c02f9dd4>] (__media_entity_setup_link+0x1c0/0x1e8)
[   20.155000] [<c02f9dd4>] (__media_entity_setup_link+0x1c0/0x1e8) from [<c02f9710>] (media_device_ioctl+0x2c0/0x41c)
[   20.165000] [<c02f9710>] (media_device_ioctl+0x2c0/0x41c) from [<c02f9938>] (media_ioctl+0x30/0x34)
[   20.175000] [<c02f9938>] (media_ioctl+0x30/0x34) from [<c00cf0bc>] (do_vfs_ioctl+0x84/0x5e8)
[   20.185000] [<c00cf0bc>] (do_vfs_ioctl+0x84/0x5e8) from [<c00cf65c>] (sys_ioctl+0x3c/0x60)
[   20.190000] [<c00cf65c>] (sys_ioctl+0x3c/0x60) from [<c000f040>] (ret_fast_syscall+0x0/0x30)
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 053e09f3
...@@ -827,7 +827,7 @@ static int fimc_md_link_notify(struct media_pad *source, ...@@ -827,7 +827,7 @@ static int fimc_md_link_notify(struct media_pad *source,
struct fimc_pipeline *pipeline; struct fimc_pipeline *pipeline;
struct v4l2_subdev *sd; struct v4l2_subdev *sd;
struct mutex *lock; struct mutex *lock;
int ret = 0; int i, ret = 0;
int ref_count; int ref_count;
if (media_entity_type(sink->entity) != MEDIA_ENT_T_V4L2_SUBDEV) if (media_entity_type(sink->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
...@@ -854,29 +854,28 @@ static int fimc_md_link_notify(struct media_pad *source, ...@@ -854,29 +854,28 @@ static int fimc_md_link_notify(struct media_pad *source,
return 0; return 0;
} }
if (!(flags & MEDIA_LNK_FL_ENABLED)) {
int i;
mutex_lock(lock); mutex_lock(lock);
ref_count = fimc ? fimc->vid_cap.refcnt : fimc_lite->ref_count;
if (!(flags & MEDIA_LNK_FL_ENABLED)) {
if (ref_count > 0) {
ret = __fimc_pipeline_close(pipeline); ret = __fimc_pipeline_close(pipeline);
for (i = 0; i < IDX_MAX; i++) if (!ret && fimc)
pipeline->subdevs[i] = NULL;
if (fimc)
fimc_ctrls_delete(fimc->vid_cap.ctx); fimc_ctrls_delete(fimc->vid_cap.ctx);
mutex_unlock(lock);
return ret;
} }
for (i = 0; i < IDX_MAX; i++)
pipeline->subdevs[i] = NULL;
} else if (ref_count > 0) {
/* /*
* Link activation. Enable power of pipeline elements only if the * Link activation. Enable power of pipeline elements only if
* pipeline is already in use, i.e. its video node is opened. * the pipeline is already in use, i.e. its video node is open.
* Recreate the controls destroyed during the link deactivation. * Recreate the controls destroyed during the link deactivation.
*/ */
mutex_lock(lock); ret = __fimc_pipeline_open(pipeline,
source->entity, true);
ref_count = fimc ? fimc->vid_cap.refcnt : fimc_lite->ref_count;
if (ref_count > 0)
ret = __fimc_pipeline_open(pipeline, source->entity, true);
if (!ret && fimc) if (!ret && fimc)
ret = fimc_capture_ctrls_create(fimc); ret = fimc_capture_ctrls_create(fimc);
}
mutex_unlock(lock); mutex_unlock(lock);
return ret ? -EPIPE : ret; return ret ? -EPIPE : ret;
......
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