* [PATCH] [media] cec: improve MEDIA_CEC_RC dependencies
@ 2017-04-21 10:52 Arnd Bergmann
2017-05-12 9:49 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2017-04-21 10:52 UTC (permalink / raw)
To: Hans Verkuil, Mauro Carvalho Chehab
Cc: Arnd Bergmann, Benjamin Gaignard, linux-media, linux-kernel
Changing the IS_REACHABLE() into a plain #ifdef broke the case of
CONFIG_MEDIA_RC=m && CONFIG_MEDIA_CEC=y:
drivers/media/cec/cec-core.o: In function `cec_unregister_adapter':
cec-core.c:(.text.cec_unregister_adapter+0x18): undefined reference to `rc_unregister_device'
drivers/media/cec/cec-core.o: In function `cec_delete_adapter':
cec-core.c:(.text.cec_delete_adapter+0x54): undefined reference to `rc_free_device'
drivers/media/cec/cec-core.o: In function `cec_register_adapter':
cec-core.c:(.text.cec_register_adapter+0x94): undefined reference to `rc_register_device'
cec-core.c:(.text.cec_register_adapter+0xa4): undefined reference to `rc_free_device'
cec-core.c:(.text.cec_register_adapter+0x110): undefined reference to `rc_unregister_device'
drivers/media/cec/cec-core.o: In function `cec_allocate_adapter':
cec-core.c:(.text.cec_allocate_adapter+0x234): undefined reference to `rc_allocate_device'
drivers/media/cec/cec-adap.o: In function `cec_received_msg':
cec-adap.c:(.text.cec_received_msg+0x734): undefined reference to `rc_keydown'
cec-adap.c:(.text.cec_received_msg+0x768): undefined reference to `rc_keyup'
This adds an additional dependency to explicitly forbid this combination.
Fixes: 5f2c467c54f5 ("[media] cec: add MEDIA_CEC_RC config option")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/cec/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/cec/Kconfig b/drivers/media/cec/Kconfig
index f944d93e3167..488fb908244d 100644
--- a/drivers/media/cec/Kconfig
+++ b/drivers/media/cec/Kconfig
@@ -9,6 +9,7 @@ config MEDIA_CEC_NOTIFIER
config MEDIA_CEC_RC
bool "HDMI CEC RC integration"
depends on CEC_CORE && RC_CORE
+ depends on CEC_CORE=m || RC_CORE=y
---help---
Pass on CEC remote control messages to the RC framework.
--
2.9.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] [media] cec: improve MEDIA_CEC_RC dependencies 2017-04-21 10:52 [PATCH] [media] cec: improve MEDIA_CEC_RC dependencies Arnd Bergmann @ 2017-05-12 9:49 ` Arnd Bergmann 2017-05-12 10:00 ` Hans Verkuil 0 siblings, 1 reply; 4+ messages in thread From: Arnd Bergmann @ 2017-05-12 9:49 UTC (permalink / raw) To: Hans Verkuil, Mauro Carvalho Chehab Cc: Arnd Bergmann, Benjamin Gaignard, linux-media, Linux Kernel Mailing List On Fri, Apr 21, 2017 at 12:52 PM, Arnd Bergmann <arnd@arndb.de> wrote: > Changing the IS_REACHABLE() into a plain #ifdef broke the case of > CONFIG_MEDIA_RC=m && CONFIG_MEDIA_CEC=y: > > drivers/media/cec/cec-core.o: In function `cec_unregister_adapter': > cec-core.c:(.text.cec_unregister_adapter+0x18): undefined reference to `rc_unregister_device' > drivers/media/cec/cec-core.o: In function `cec_delete_adapter': > cec-core.c:(.text.cec_delete_adapter+0x54): undefined reference to `rc_free_device' > drivers/media/cec/cec-core.o: In function `cec_register_adapter': > cec-core.c:(.text.cec_register_adapter+0x94): undefined reference to `rc_register_device' > cec-core.c:(.text.cec_register_adapter+0xa4): undefined reference to `rc_free_device' > cec-core.c:(.text.cec_register_adapter+0x110): undefined reference to `rc_unregister_device' > drivers/media/cec/cec-core.o: In function `cec_allocate_adapter': > cec-core.c:(.text.cec_allocate_adapter+0x234): undefined reference to `rc_allocate_device' > drivers/media/cec/cec-adap.o: In function `cec_received_msg': > cec-adap.c:(.text.cec_received_msg+0x734): undefined reference to `rc_keydown' > cec-adap.c:(.text.cec_received_msg+0x768): undefined reference to `rc_keyup' > > This adds an additional dependency to explicitly forbid this combination. > > Fixes: 5f2c467c54f5 ("[media] cec: add MEDIA_CEC_RC config option") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- What is the status of this patch? According to https://patchwork.linuxtv.org/patch/40934/ it is marked 'accepted', but the patch that caused the problem has made it into mainline in the merge window, and the fix is still needed on top. On a related note, I've run into another link error now: drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_remove': sti_hdmi.c:(.text.sti_hdmi_remove+0x10): undefined reference to `cec_notifier_set_phys_addr' sti_hdmi.c:(.text.sti_hdmi_remove+0x34): undefined reference to `cec_notifier_put' drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_connector_get_modes': sti_hdmi.c:(.text.sti_hdmi_connector_get_modes+0x4a): undefined reference to `cec_notifier_set_phys_addr_from_edid' drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_probe': sti_hdmi.c:(.text.sti_hdmi_probe+0x204): undefined reference to `cec_notifier_get' drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_connector_detect': sti_hdmi.c:(.text.sti_hdmi_connector_detect+0x36): undefined reference to `cec_notifier_set_phys_addr' drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_disable': sti_hdmi.c:(.text.sti_hdmi_disable+0xc0): undefined reference to `cec_notifier_set_phys_addr' The config options leading to the second failure are: CONFIG_MEDIA_CEC_SUPPORT=y CONFIG_CEC_CORE=m CONFIG_MEDIA_CEC_NOTIFIER=y CONFIG_VIDEO_STI_HDMI_CEC=m CONFIG_DRM_STI=y I can probably come up with a workaround, but haven't completely thought through all the combinations yet. Also, I assume the same fix will be needed for exynos, though that has not come up in randconfig testing so far. Arnd > drivers/media/cec/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/media/cec/Kconfig b/drivers/media/cec/Kconfig > index f944d93e3167..488fb908244d 100644 > --- a/drivers/media/cec/Kconfig > +++ b/drivers/media/cec/Kconfig > @@ -9,6 +9,7 @@ config MEDIA_CEC_NOTIFIER > config MEDIA_CEC_RC > bool "HDMI CEC RC integration" > depends on CEC_CORE && RC_CORE > + depends on CEC_CORE=m || RC_CORE=y > ---help--- > Pass on CEC remote control messages to the RC framework. > > -- > 2.9.0 > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [media] cec: improve MEDIA_CEC_RC dependencies 2017-05-12 9:49 ` Arnd Bergmann @ 2017-05-12 10:00 ` Hans Verkuil 2017-05-12 19:39 ` Arnd Bergmann 0 siblings, 1 reply; 4+ messages in thread From: Hans Verkuil @ 2017-05-12 10:00 UTC (permalink / raw) To: Arnd Bergmann, Hans Verkuil, Mauro Carvalho Chehab Cc: Benjamin Gaignard, linux-media, Linux Kernel Mailing List On 05/12/17 11:49, Arnd Bergmann wrote: > On Fri, Apr 21, 2017 at 12:52 PM, Arnd Bergmann <arnd@arndb.de> wrote: >> Changing the IS_REACHABLE() into a plain #ifdef broke the case of >> CONFIG_MEDIA_RC=m && CONFIG_MEDIA_CEC=y: >> >> drivers/media/cec/cec-core.o: In function `cec_unregister_adapter': >> cec-core.c:(.text.cec_unregister_adapter+0x18): undefined reference to `rc_unregister_device' >> drivers/media/cec/cec-core.o: In function `cec_delete_adapter': >> cec-core.c:(.text.cec_delete_adapter+0x54): undefined reference to `rc_free_device' >> drivers/media/cec/cec-core.o: In function `cec_register_adapter': >> cec-core.c:(.text.cec_register_adapter+0x94): undefined reference to `rc_register_device' >> cec-core.c:(.text.cec_register_adapter+0xa4): undefined reference to `rc_free_device' >> cec-core.c:(.text.cec_register_adapter+0x110): undefined reference to `rc_unregister_device' >> drivers/media/cec/cec-core.o: In function `cec_allocate_adapter': >> cec-core.c:(.text.cec_allocate_adapter+0x234): undefined reference to `rc_allocate_device' >> drivers/media/cec/cec-adap.o: In function `cec_received_msg': >> cec-adap.c:(.text.cec_received_msg+0x734): undefined reference to `rc_keydown' >> cec-adap.c:(.text.cec_received_msg+0x768): undefined reference to `rc_keyup' >> >> This adds an additional dependency to explicitly forbid this combination. >> >> Fixes: 5f2c467c54f5 ("[media] cec: add MEDIA_CEC_RC config option") >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> >> --- > > What is the status of this patch? According to > https://patchwork.linuxtv.org/patch/40934/ it is marked 'accepted', > but the patch that caused the problem has made it into mainline > in the merge window, and the fix is still needed on top. It's in a pull request for 4.12 that Mauro hasn't picked up yet. I pinged him, but he seems to be very busy lately. > > On a related note, I've run into another link error now: > > drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_remove': > sti_hdmi.c:(.text.sti_hdmi_remove+0x10): undefined reference to > `cec_notifier_set_phys_addr' > sti_hdmi.c:(.text.sti_hdmi_remove+0x34): undefined reference to > `cec_notifier_put' > drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_connector_get_modes': > sti_hdmi.c:(.text.sti_hdmi_connector_get_modes+0x4a): undefined > reference to `cec_notifier_set_phys_addr_from_edid' > drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_probe': > sti_hdmi.c:(.text.sti_hdmi_probe+0x204): undefined reference to > `cec_notifier_get' > drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_connector_detect': > sti_hdmi.c:(.text.sti_hdmi_connector_detect+0x36): undefined reference > to `cec_notifier_set_phys_addr' > drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_disable': > sti_hdmi.c:(.text.sti_hdmi_disable+0xc0): undefined reference to > `cec_notifier_set_phys_addr' > > The config options leading to the second failure are: > > CONFIG_MEDIA_CEC_SUPPORT=y > CONFIG_CEC_CORE=m > CONFIG_MEDIA_CEC_NOTIFIER=y > CONFIG_VIDEO_STI_HDMI_CEC=m > CONFIG_DRM_STI=y > > I can probably come up with a workaround, but haven't completely thought > through all the combinations yet. Also, I assume the same fix will be needed > for exynos, though that has not come up in randconfig testing so far. Try this patch: Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> --- diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h index eb50ce54b759..da3528c8edb9 100644 --- a/include/media/cec-notifier.h +++ b/include/media/cec-notifier.h @@ -29,7 +29,7 @@ struct edid; struct cec_adapter; struct cec_notifier; -#ifdef CONFIG_MEDIA_CEC_NOTIFIER +#if IS_REACHABLE(CONFIG_MEDIA_CEC_NOTIFIER) /** * cec_notifier_get - find or create a new cec_notifier for the given device. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [media] cec: improve MEDIA_CEC_RC dependencies 2017-05-12 10:00 ` Hans Verkuil @ 2017-05-12 19:39 ` Arnd Bergmann 0 siblings, 0 replies; 4+ messages in thread From: Arnd Bergmann @ 2017-05-12 19:39 UTC (permalink / raw) To: Hans Verkuil Cc: Hans Verkuil, Mauro Carvalho Chehab, Benjamin Gaignard, linux-media, Linux Kernel Mailing List On Fri, May 12, 2017 at 12:00 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote: > On 05/12/17 11:49, Arnd Bergmann wrote: >> I can probably come up with a workaround, but haven't completely thought >> through all the combinations yet. Also, I assume the same fix will be needed >> for exynos, though that has not come up in randconfig testing so far. > > Try this patch: > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > --- > diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h > index eb50ce54b759..da3528c8edb9 100644 > --- a/include/media/cec-notifier.h > +++ b/include/media/cec-notifier.h > @@ -29,7 +29,7 @@ struct edid; > struct cec_adapter; > struct cec_notifier; > > -#ifdef CONFIG_MEDIA_CEC_NOTIFIER > +#if IS_REACHABLE(CONFIG_MEDIA_CEC_NOTIFIER) > This misses how CONFIG_MEDIA_CEC_NOTIFIER is just a 'bool' option to the 'MEDIA_CEC_CORE' symbol that controls whether the code is built-in or in a module, and it lacks helpers for cec_notifier_{un,}register. The version below seems to work, though I don't particularly like the IS_REACHABLE() addition since that can be confusing to users. Signed-off-by: Arnd Bergmann <arnd@arndb.de> diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h index eb50ce54b759..69f7d8eed1b0 100644 --- a/include/media/cec-notifier.h +++ b/include/media/cec-notifier.h @@ -29,7 +29,7 @@ struct edid; struct cec_adapter; struct cec_notifier; -#ifdef CONFIG_MEDIA_CEC_NOTIFIER +#if IS_REACHABLE(CONFIG_CEC_CORE) && IS_ENABLED(CONFIG_MEDIA_CEC_NOTIFIER) /** * cec_notifier_get - find or create a new cec_notifier for the given device. @@ -106,6 +106,17 @@ static inline void cec_notifier_set_phys_addr_from_edid(struct cec_notifier *n, { } +static inline void cec_notifier_register(struct cec_notifier *n, + struct cec_adapter *adap, + void (*callback)(struct cec_adapter *adap, u16 pa)) +{ +} + +static inline void cec_notifier_unregister(struct cec_notifier *n) +{ +} + + #endif #endif ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-12 19:39 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-04-21 10:52 [PATCH] [media] cec: improve MEDIA_CEC_RC dependencies Arnd Bergmann 2017-05-12 9:49 ` Arnd Bergmann 2017-05-12 10:00 ` Hans Verkuil 2017-05-12 19:39 ` Arnd Bergmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®