linux-stable/drivers/media
Heiner Kallweit 74d47d75be [media] rc: refactor raw handler kthread
I think we can get rid of the spinlock protecting the kthread from being
interrupted by a wakeup in certain parts.
Even with the current implementation of the kthread the only lost wakeup
scenario could happen if the wakeup occurs between the kfifo_len check
and setting the state to TASK_INTERRUPTIBLE.

In the changed version we could lose a wakeup if it occurs between
processing the fifo content and setting the state to TASK_INTERRUPTIBLE.
This scenario is covered by an additional check for available events in
the fifo and setting the state to TASK_RUNNING in this case.

In addition the changed version flushes the kfifo before ending
when the kthread is stopped.

With this patch we gain:
- Get rid of the spinlock
- Simplify code
- Don't grep / release the mutex for each individual event but just once
  for the complete fifo content. This reduces overhead if a driver e.g.
  triggers processing after writing the content of a hw fifo to the kfifo.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-30 11:46:55 -02:00
..
cec [media] cec: fix race between configuring and unconfiguring 2016-12-21 07:03:27 -02:00
common [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
dvb-core [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
dvb-frontends [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
firewire [media] firewire: don't break long lines 2016-10-21 10:06:00 -02:00
i2c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
mmc
pci [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
platform [media] xilinx: Use a local media device pointer instead 2017-01-30 11:35:02 -02:00
radio [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
rc [media] rc: refactor raw handler kthread 2017-01-30 11:46:55 -02:00
spi [media] gs1662: drop kfree for memory allocated with devm_kzalloc 2016-10-24 17:59:08 -02:00
tuners [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
usb [media] media: Rename graph and pipeline structs and functions 2017-01-27 16:13:24 -02:00
v4l2-core [media] media: Rename graph and pipeline structs and functions 2017-01-27 16:13:24 -02:00
cec-edid.c [media] cec-edid: check for IEEE identifier 2016-08-22 14:04:51 -03:00
Kconfig [media] Kconfig: fix breakages when DVB_CORE is not selected 2016-11-18 17:59:17 -02:00
Makefile [media] cec: move the CEC framework out of staging and to media 2016-11-16 15:40:20 -02:00
media-device.c [media] media: Rename graph and pipeline structs and functions 2017-01-27 16:13:24 -02:00
media-devnode.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
media-entity.c [media] media: entity: Add debug information to graph walk 2017-01-30 11:33:26 -02:00