* [PATCH v3] [media] rc-core: fix protocol_change regression in ir_raw_event_register
@ 2014-10-28 18:43 Tomas Melin
2014-10-28 18:50 ` Mauro Carvalho Chehab
2014-10-28 19:37 ` David Härdeman
0 siblings, 2 replies; 3+ messages in thread
From: Tomas Melin @ 2014-10-28 18:43 UTC (permalink / raw)
To: m.chehab
Cc: david, james.hogan, a.seppala, bay, linux-media, linux-kernel,
Tomas Melin
IR receiver using nuvoton-cir and lirc required additional configuration
steps after upgrade from kernel 3.16 to 3.17-rcX.
Bisected regression to commit da6e162d6a4607362f8478c715c797d84d449f8b
("[media] rc-core: simplify sysfs code").
The regression comes from adding function change_protocol in
ir-raw.c. It changes behaviour so that only the protocol enabled by driver's
map_name will be active after registration. This breaks user space behaviour,
lirc does not get key press signals anymore.
Enable lirc protocol by default for ir raw decoders to restore original behaviour.
Signed-off-by: Tomas Melin <tomas.melin@iki.fi>
---
drivers/media/rc/rc-ir-raw.c | 1 -
drivers/media/rc/rc-main.c | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
index e8fff2a..b732ac6 100644
--- a/drivers/media/rc/rc-ir-raw.c
+++ b/drivers/media/rc/rc-ir-raw.c
@@ -262,7 +262,6 @@ int ir_raw_event_register(struct rc_dev *dev)
return -ENOMEM;
dev->raw->dev = dev;
- dev->enabled_protocols = ~0;
dev->change_protocol = change_protocol;
rc = kfifo_alloc(&dev->raw->kfifo,
sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE,
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index a7991c7..8d3b74c 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1421,6 +1421,8 @@ int rc_register_device(struct rc_dev *dev)
if (dev->change_protocol) {
u64 rc_type = (1 << rc_map->rc_type);
+ if (dev->driver_type == RC_DRIVER_IR_RAW)
+ rc_type |= RC_BIT_LIRC;
rc = dev->change_protocol(dev, &rc_type);
if (rc < 0)
goto out_raw;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] [media] rc-core: fix protocol_change regression in ir_raw_event_register
2014-10-28 18:43 [PATCH v3] [media] rc-core: fix protocol_change regression in ir_raw_event_register Tomas Melin
@ 2014-10-28 18:50 ` Mauro Carvalho Chehab
2014-10-28 19:37 ` David Härdeman
1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2014-10-28 18:50 UTC (permalink / raw)
To: Tomas Melin; +Cc: david, james.hogan, a.seppala, bay, linux-media, linux-kernel
Em Tue, 28 Oct 2014 20:43:14 +0200
Tomas Melin <tomas.melin@iki.fi> escreveu:
> IR receiver using nuvoton-cir and lirc required additional configuration
> steps after upgrade from kernel 3.16 to 3.17-rcX.
> Bisected regression to commit da6e162d6a4607362f8478c715c797d84d449f8b
> ("[media] rc-core: simplify sysfs code").
>
> The regression comes from adding function change_protocol in
> ir-raw.c. It changes behaviour so that only the protocol enabled by driver's
> map_name will be active after registration. This breaks user space behaviour,
> lirc does not get key press signals anymore.
>
> Enable lirc protocol by default for ir raw decoders to restore original behaviour.
Yeah, this patch looks ok on my eyes.
Regards,
Mauro
>
> Signed-off-by: Tomas Melin <tomas.melin@iki.fi>
> ---
> drivers/media/rc/rc-ir-raw.c | 1 -
> drivers/media/rc/rc-main.c | 2 ++
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
> index e8fff2a..b732ac6 100644
> --- a/drivers/media/rc/rc-ir-raw.c
> +++ b/drivers/media/rc/rc-ir-raw.c
> @@ -262,7 +262,6 @@ int ir_raw_event_register(struct rc_dev *dev)
> return -ENOMEM;
>
> dev->raw->dev = dev;
> - dev->enabled_protocols = ~0;
> dev->change_protocol = change_protocol;
> rc = kfifo_alloc(&dev->raw->kfifo,
> sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE,
> diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
> index a7991c7..8d3b74c 100644
> --- a/drivers/media/rc/rc-main.c
> +++ b/drivers/media/rc/rc-main.c
> @@ -1421,6 +1421,8 @@ int rc_register_device(struct rc_dev *dev)
>
> if (dev->change_protocol) {
> u64 rc_type = (1 << rc_map->rc_type);
> + if (dev->driver_type == RC_DRIVER_IR_RAW)
> + rc_type |= RC_BIT_LIRC;
> rc = dev->change_protocol(dev, &rc_type);
> if (rc < 0)
> goto out_raw;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] [media] rc-core: fix protocol_change regression in ir_raw_event_register
2014-10-28 18:43 [PATCH v3] [media] rc-core: fix protocol_change regression in ir_raw_event_register Tomas Melin
2014-10-28 18:50 ` Mauro Carvalho Chehab
@ 2014-10-28 19:37 ` David Härdeman
1 sibling, 0 replies; 3+ messages in thread
From: David Härdeman @ 2014-10-28 19:37 UTC (permalink / raw)
To: Tomas Melin
Cc: m.chehab, james.hogan, a.seppala, bay, linux-media, linux-kernel
On Tue, Oct 28, 2014 at 08:43:14PM +0200, Tomas Melin wrote:
>IR receiver using nuvoton-cir and lirc required additional configuration
>steps after upgrade from kernel 3.16 to 3.17-rcX.
>Bisected regression to commit da6e162d6a4607362f8478c715c797d84d449f8b
>("[media] rc-core: simplify sysfs code").
>
>The regression comes from adding function change_protocol in
>ir-raw.c. It changes behaviour so that only the protocol enabled by driver's
>map_name will be active after registration. This breaks user space behaviour,
>lirc does not get key press signals anymore.
>
>Enable lirc protocol by default for ir raw decoders to restore original behaviour.
>
>Signed-off-by: Tomas Melin <tomas.melin@iki.fi>
Acked-by: David Härdeman <david@hardeman.nu>
>---
> drivers/media/rc/rc-ir-raw.c | 1 -
> drivers/media/rc/rc-main.c | 2 ++
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
>index e8fff2a..b732ac6 100644
>--- a/drivers/media/rc/rc-ir-raw.c
>+++ b/drivers/media/rc/rc-ir-raw.c
>@@ -262,7 +262,6 @@ int ir_raw_event_register(struct rc_dev *dev)
> return -ENOMEM;
>
> dev->raw->dev = dev;
>- dev->enabled_protocols = ~0;
> dev->change_protocol = change_protocol;
> rc = kfifo_alloc(&dev->raw->kfifo,
> sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE,
>diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
>index a7991c7..8d3b74c 100644
>--- a/drivers/media/rc/rc-main.c
>+++ b/drivers/media/rc/rc-main.c
>@@ -1421,6 +1421,8 @@ int rc_register_device(struct rc_dev *dev)
>
> if (dev->change_protocol) {
> u64 rc_type = (1 << rc_map->rc_type);
>+ if (dev->driver_type == RC_DRIVER_IR_RAW)
>+ rc_type |= RC_BIT_LIRC;
> rc = dev->change_protocol(dev, &rc_type);
> if (rc < 0)
> goto out_raw;
>--
>1.7.10.4
>
--
David Härdeman
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-28 19:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28 18:43 [PATCH v3] [media] rc-core: fix protocol_change regression in ir_raw_event_register Tomas Melin
2014-10-28 18:50 ` Mauro Carvalho Chehab
2014-10-28 19:37 ` David Härdeman
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).