]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rc-main: Re-apply filter for no-op protocol change
authorJames Hogan <james.hogan@imgtec.com>
Mon, 8 Dec 2014 16:17:07 +0000 (13:17 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 22:52:51 +0000 (14:52 -0800)
commit7497d7d1b6306cf823d208453f80bf167a4dcb9a
tree45abafaf878bfb8c665b8be0356055086fdcc367
parentaedfcf14cd5177d9fa42f235f31211edbd34b3e1
rc-main: Re-apply filter for no-op protocol change

commit 983c5bd26b86ba1c0d79b770e596bb8b77e42f32 upstream.

Since commit da6e162d6a46 ("[media] rc-core: simplify sysfs code"), when
the IR protocol is set using the sysfs interface to the same set of
protocols that are already set, store_protocols() does not refresh the
scancode filter with the new protocol, even if it has already called the
change_protocol() callback successfully. This results in the filter
being disabled in the hardware and not re-enabled until the filter is
set again using sysfs.

Fix in store_protocols() by still re-applying the filter whenever the
change_protocol() driver callback succeeded.

The problem can be reproduced with the img-ir driver by setting a
filter, and then setting the protocol to the same protocol that is
already set:
$ echo nec > protocols
$ echo 0xffff > filter_mask
$ echo nec > protocols

After this, messages which don't match the filter were still being
received.

Fixes: da6e162d6a46 ("[media] rc-core: simplify sysfs code")
Reported-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/rc/rc-main.c