* [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition [not found] <CGME20200323023045epcas2p12007502edd2a65efcccb00eb899d5532@epcas2p1.samsung.com> @ 2020-03-23 2:30 ` Seungchul Kim 2020-03-25 8:59 ` Greg KH 2020-03-25 16:54 ` Hans Verkuil 0 siblings, 2 replies; 9+ messages in thread From: Seungchul Kim @ 2020-03-23 2:30 UTC (permalink / raw) To: mchehab; +Cc: linux-media, linux-kernel, sc377.kim v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the mismatch of v4l2_fh sturct. By the mismatch, the following error occurs. =============================== [ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) [ 7.535319] v4l2_mem2mem: disagrees about version of symbol v4l2_event_pending [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) =============================== So v4l2_fh struct is modified to does not have dependency for CONFIG_V4L2_MEM2MEM_DEV. Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> --- include/media/v4l2-fh.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 53b4dbb..b5b3e00 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -53,9 +53,7 @@ struct v4l2_fh { unsigned int navailable; u32 sequence; -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) struct v4l2_m2m_ctx *m2m_ctx; -#endif }; /** -- 2.7.4 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition 2020-03-23 2:30 ` [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition Seungchul Kim @ 2020-03-25 8:59 ` Greg KH 2020-03-25 16:54 ` Hans Verkuil 1 sibling, 0 replies; 9+ messages in thread From: Greg KH @ 2020-03-25 8:59 UTC (permalink / raw) To: Seungchul Kim; +Cc: mchehab, linux-media, linux-kernel On Mon, Mar 23, 2020 at 11:30:45AM +0900, Seungchul Kim wrote: > v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. > If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the > mismatch of v4l2_fh sturct. > > By the mismatch, the following error occurs. > =============================== > [ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata > [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) > [ 7.535319] v4l2_mem2mem: disagrees about version of symbol > v4l2_event_pending > [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) > =============================== > > So v4l2_fh struct is modified to does not have dependency for > CONFIG_V4L2_MEM2MEM_DEV. > > Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> > --- > include/media/v4l2-fh.h | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition 2020-03-23 2:30 ` [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition Seungchul Kim 2020-03-25 8:59 ` Greg KH @ 2020-03-25 16:54 ` Hans Verkuil 2020-03-26 2:30 ` Seungchul Kim 1 sibling, 1 reply; 9+ messages in thread From: Hans Verkuil @ 2020-03-25 16:54 UTC (permalink / raw) To: Seungchul Kim, mchehab; +Cc: linux-media, linux-kernel On 3/23/20 3:30 AM, Seungchul Kim wrote: > v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. > If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the > mismatch of v4l2_fh sturct. > > By the mismatch, the following error occurs. > =============================== > [ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata > [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) > [ 7.535319] v4l2_mem2mem: disagrees about version of symbol > v4l2_event_pending > [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) > =============================== > > So v4l2_fh struct is modified to does not have dependency for > CONFIG_V4L2_MEM2MEM_DEV. > > Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> > --- > include/media/v4l2-fh.h | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index > 53b4dbb..b5b3e00 100644 > --- a/include/media/v4l2-fh.h > +++ b/include/media/v4l2-fh.h > @@ -53,9 +53,7 @@ struct v4l2_fh { > unsigned int navailable; > u32 sequence; > > -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) > struct v4l2_m2m_ctx *m2m_ctx; > -#endif This is a good change, but please also remove the same #if from v4l2_ioctl_get_lock() in drivers/media/v4l2-core/v4l2-ioctl.c. That is now no longer needed there either and without removing that those vendor drivers would be using the wrong lock. Regards, Hans > }; > > /** > -- > 2.7.4 > ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition 2020-03-25 16:54 ` Hans Verkuil @ 2020-03-26 2:30 ` Seungchul Kim 2020-03-26 8:16 ` Hans Verkuil 0 siblings, 1 reply; 9+ messages in thread From: Seungchul Kim @ 2020-03-26 2:30 UTC (permalink / raw) To: 'Hans Verkuil', mchehab; +Cc: linux-media, linux-kernel On 3/25/20 5:54 PM, Hans Verkuil wrote: > On 3/23/20 3:30 AM, Seungchul Kim wrote: > > v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. > > If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the > > mismatch of v4l2_fh sturct. > > > > By the mismatch, the following error occurs. > > =============================== > > [ 7.533506] v4l2_mem2mem: disagrees about version of symbol > video_devdata > > [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) > > [ 7.535319] v4l2_mem2mem: disagrees about version of symbol > > v4l2_event_pending > > [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) > > =============================== > > > > So v4l2_fh struct is modified to does not have dependency for > > CONFIG_V4L2_MEM2MEM_DEV. > > > > Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> > > --- > > include/media/v4l2-fh.h | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index > > 53b4dbb..b5b3e00 100644 > > --- a/include/media/v4l2-fh.h > > +++ b/include/media/v4l2-fh.h > > @@ -53,9 +53,7 @@ struct v4l2_fh { > > unsigned int navailable; > > u32 sequence; > > > > -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) > > struct v4l2_m2m_ctx *m2m_ctx; > > -#endif > > This is a good change, but please also remove the same #if from > v4l2_ioctl_get_lock() in drivers/media/v4l2-core/v4l2-ioctl.c. That is now > no longer needed there either and without removing that those vendor > drivers would be using the wrong lock. > > Regards, > > Hans Thank you for your comment. I worried about the same thing with you. But vfh->m2m_ctx on v4l2_ioctl_get_lock() is always null without CONFIG_V4L2_MEM2MEM_DEV, because m2m_ctx of v4l2-fh is initialized only in v4l2_mem2mem.c. Therefore it doesn't have a problem using an wrong lock regardless of modification, so I did not fix it. Regards, Seungchul Kim ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition 2020-03-26 2:30 ` Seungchul Kim @ 2020-03-26 8:16 ` Hans Verkuil 2020-03-26 9:13 ` Seungchul Kim 0 siblings, 1 reply; 9+ messages in thread From: Hans Verkuil @ 2020-03-26 8:16 UTC (permalink / raw) To: Seungchul Kim, mchehab; +Cc: linux-media, linux-kernel On 3/26/20 3:30 AM, Seungchul Kim wrote: > On 3/25/20 5:54 PM, Hans Verkuil wrote: >> On 3/23/20 3:30 AM, Seungchul Kim wrote: >>> v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. >>> If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the >>> mismatch of v4l2_fh sturct. >>> >>> By the mismatch, the following error occurs. >>> =============================== >>> [ 7.533506] v4l2_mem2mem: disagrees about version of symbol >> video_devdata >>> [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) >>> [ 7.535319] v4l2_mem2mem: disagrees about version of symbol >>> v4l2_event_pending >>> [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) >>> =============================== >>> >>> So v4l2_fh struct is modified to does not have dependency for >>> CONFIG_V4L2_MEM2MEM_DEV. >>> >>> Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> >>> --- >>> include/media/v4l2-fh.h | 2 -- >>> 1 file changed, 2 deletions(-) >>> >>> diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index >>> 53b4dbb..b5b3e00 100644 >>> --- a/include/media/v4l2-fh.h >>> +++ b/include/media/v4l2-fh.h >>> @@ -53,9 +53,7 @@ struct v4l2_fh { >>> unsigned int navailable; >>> u32 sequence; >>> >>> -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) >>> struct v4l2_m2m_ctx *m2m_ctx; >>> -#endif >> >> This is a good change, but please also remove the same #if from >> v4l2_ioctl_get_lock() in drivers/media/v4l2-core/v4l2-ioctl.c. That is now >> no longer needed there either and without removing that those vendor >> drivers would be using the wrong lock. >> >> Regards, >> >> Hans > > Thank you for your comment. I worried about the same thing with you. > But vfh->m2m_ctx on v4l2_ioctl_get_lock() is always null > without CONFIG_V4L2_MEM2MEM_DEV, because m2m_ctx of v4l2-fh > is initialized only in v4l2_mem2mem.c. > Therefore it doesn't have a problem using an wrong lock > regardless of modification, so I did not fix it. It is: if your out-of-tree driver sets CONFIG_V4L2_MEM2MEM_DEV, then I assume it will set vfh->m2m_ctx, and so the v4l2 core should also return the right lock for that out-of-tree driver. But in any case, if m2m_ctx is always part of v4l2-fh.h, then that #if in v4l2-ioctl.c has become pointless and should be removed in any case. Regards, Hans ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition 2020-03-26 8:16 ` Hans Verkuil @ 2020-03-26 9:13 ` Seungchul Kim 0 siblings, 0 replies; 9+ messages in thread From: Seungchul Kim @ 2020-03-26 9:13 UTC (permalink / raw) To: 'Hans Verkuil', mchehab; +Cc: linux-media, linux-kernel, sc377.kim On 3/26/20 5:17 PM, Hans Verkuil wrote: > On 3/26/20 3:30 AM, Seungchul Kim wrote: > > On 3/25/20 5:54 PM, Hans Verkuil wrote: > >> On 3/23/20 3:30 AM, Seungchul Kim wrote: > >>> v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. > >>> If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make > >>> the mismatch of v4l2_fh sturct. > >>> > >>> By the mismatch, the following error occurs. > >>> =============================== > >>> [ 7.533506] v4l2_mem2mem: disagrees about version of symbol > >> video_devdata > >>> [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) > >>> [ 7.535319] v4l2_mem2mem: disagrees about version of symbol > >>> v4l2_event_pending > >>> [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) > >>> =============================== > >>> > >>> So v4l2_fh struct is modified to does not have dependency for > >>> CONFIG_V4L2_MEM2MEM_DEV. > >>> > >>> Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> > >>> --- > >>> include/media/v4l2-fh.h | 2 -- > >>> 1 file changed, 2 deletions(-) > >>> > >>> diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index > >>> 53b4dbb..b5b3e00 100644 > >>> --- a/include/media/v4l2-fh.h > >>> +++ b/include/media/v4l2-fh.h > >>> @@ -53,9 +53,7 @@ struct v4l2_fh { > >>> unsigned int navailable; > >>> u32 sequence; > >>> > >>> -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) > >>> struct v4l2_m2m_ctx *m2m_ctx; > >>> -#endif > >> > >> This is a good change, but please also remove the same #if from > >> v4l2_ioctl_get_lock() in drivers/media/v4l2-core/v4l2-ioctl.c. That > >> is now no longer needed there either and without removing that those > >> vendor drivers would be using the wrong lock. > >> > >> Regards, > >> > >> Hans > > > > Thank you for your comment. I worried about the same thing with you. > > But vfh->m2m_ctx on v4l2_ioctl_get_lock() is always null without > > CONFIG_V4L2_MEM2MEM_DEV, because m2m_ctx of v4l2-fh is initialized > > only in v4l2_mem2mem.c. > > Therefore it doesn't have a problem using an wrong lock regardless of > > modification, so I did not fix it. > > It is: if your out-of-tree driver sets CONFIG_V4L2_MEM2MEM_DEV, then I > assume it will set vfh->m2m_ctx, and so the v4l2 core should also return > the right lock for that out-of-tree driver. > > But in any case, if m2m_ctx is always part of v4l2-fh.h, then that #if in > v4l2-ioctl.c has become pointless and should be removed in any case. > > Regards, > > Hans I agree with you, so I will update a patch, soon ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <CGME20200326091732epcas2p2be24b70dca0039b10b828e8b9102f6bf@epcas2p2.samsung.com>]
* [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition [not found] <CGME20200326091732epcas2p2be24b70dca0039b10b828e8b9102f6bf@epcas2p2.samsung.com> @ 2020-03-26 9:09 ` Seungchul Kim 0 siblings, 0 replies; 9+ messages in thread From: Seungchul Kim @ 2020-03-26 9:09 UTC (permalink / raw) To: Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel, Seungchul Kim v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the mismatch of v4l2_fh sturct. By the mismatch, the following error occurs. =============================== [ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) [ 7.535319] v4l2_mem2mem: disagrees about version of symbol v4l2_event_pending [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) =============================== So v4l2_fh struct is modified to does not have dependency for CONFIG_V4L2_MEM2MEM_DEV. Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 -- include/media/v4l2-fh.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index fbcc7a2..befafcd 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2800,13 +2800,11 @@ static struct mutex *v4l2_ioctl_get_lock(struct video_device *vdev, { if (_IOC_NR(cmd) >= V4L2_IOCTLS) return vdev->lock; -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) if (vfh && vfh->m2m_ctx && (v4l2_ioctls[_IOC_NR(cmd)].flags & INFO_FL_QUEUE)) { if (vfh->m2m_ctx->q_lock) return vfh->m2m_ctx->q_lock; } -#endif if (vdev->queue && vdev->queue->lock && (v4l2_ioctls[_IOC_NR(cmd)].flags & INFO_FL_QUEUE)) return vdev->queue->lock; diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 53b4dbb..b5b3e00 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -53,9 +53,7 @@ struct v4l2_fh { unsigned int navailable; u32 sequence; -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) struct v4l2_m2m_ctx *m2m_ctx; -#endif }; /** -- 2.7.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <CGME20200320095559epcas2p2732ccb391573ba99e2dd08d6c50a18f2@epcas2p2.samsung.com>]
* [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition [not found] <CGME20200320095559epcas2p2732ccb391573ba99e2dd08d6c50a18f2@epcas2p2.samsung.com> @ 2020-03-20 9:55 ` 김승철 0 siblings, 0 replies; 9+ messages in thread From: 김승철 @ 2020-03-20 9:55 UTC (permalink / raw) To: mchehab; +Cc: linux-media, linux-kernel, sc377.kim v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the mismatch of v4l2_fh sturct. By the mismatch, the following error occurs. =============================== [ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) [ 7.535319] v4l2_mem2mem: disagrees about version of symbol v4l2_event_pending [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) =============================== So v4l2_fh struct is modified to does not have dependency for CONFIG_V4L2_MEM2MEM_DEV. Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> --- include/media/v4l2-fh.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 53b4dbb..b5b3e00 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -53,9 +53,7 @@ struct v4l2_fh { unsigned int navailable; u32 sequence; -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) struct v4l2_m2m_ctx *m2m_ctx; -#endif }; /** -- 2.7.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <CGME20200320022445epcas2p40ea2f166aff45e67825b3e1a4e2308dd@epcas2p4.samsung.com>]
* [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition [not found] <CGME20200320022445epcas2p40ea2f166aff45e67825b3e1a4e2308dd@epcas2p4.samsung.com> @ 2020-03-20 2:16 ` Seungchul Kim 0 siblings, 0 replies; 9+ messages in thread From: Seungchul Kim @ 2020-03-20 2:16 UTC (permalink / raw) To: Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel, Seungchul Kim v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the mismatch of v4l2_fh sturct. By the mismatch, the following error occurs. =============================== [ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) [ 7.535319] v4l2_mem2mem: disagrees about version of symbol v4l2_event_pending [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) =============================== So v4l2_fh struct is modified to does not have dependency for CONFIG_V4L2_MEM2MEM_DEV. Signed-off-by: Seungchul Kim <sc377.kim@samsung.com> --- include/media/v4l2-fh.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 53b4dbb..b5b3e00 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -53,9 +53,7 @@ struct v4l2_fh { unsigned int navailable; u32 sequence; -#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) struct v4l2_m2m_ctx *m2m_ctx; -#endif }; /** -- 2.7.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-03-26 9:17 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20200323023045epcas2p12007502edd2a65efcccb00eb899d5532@epcas2p1.samsung.com> 2020-03-23 2:30 ` [PATCH] media: v4l2-fh: define v4l2_fh struct regardless of condition Seungchul Kim 2020-03-25 8:59 ` Greg KH 2020-03-25 16:54 ` Hans Verkuil 2020-03-26 2:30 ` Seungchul Kim 2020-03-26 8:16 ` Hans Verkuil 2020-03-26 9:13 ` Seungchul Kim [not found] <CGME20200326091732epcas2p2be24b70dca0039b10b828e8b9102f6bf@epcas2p2.samsung.com> 2020-03-26 9:09 ` Seungchul Kim [not found] <CGME20200320095559epcas2p2732ccb391573ba99e2dd08d6c50a18f2@epcas2p2.samsung.com> 2020-03-20 9:55 ` 김승철 [not found] <CGME20200320022445epcas2p40ea2f166aff45e67825b3e1a4e2308dd@epcas2p4.samsung.com> 2020-03-20 2:16 ` Seungchul Kim
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).