Commit 0585df46 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'media/v4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

 - a deadlock regression at vsp1 driver

 - some Remote Controller fixes related to the new BPF filter logic
   added on it for Kernel 4.18.

* tag 'media/v4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  media: v4l: vsp1: Fix deadlock in VSPDL DRM pipelines
  media: rc: read out of bounds if bpf reports high protocol number
  media: bpf: ensure bpf program is freed on detach
  media: rc: be less noisy when driver misbehaves
parents ed0093d9 8eb0e642
...@@ -728,9 +728,6 @@ EXPORT_SYMBOL_GPL(vsp1_du_setup_lif); ...@@ -728,9 +728,6 @@ EXPORT_SYMBOL_GPL(vsp1_du_setup_lif);
*/ */
void vsp1_du_atomic_begin(struct device *dev, unsigned int pipe_index) void vsp1_du_atomic_begin(struct device *dev, unsigned int pipe_index)
{ {
struct vsp1_device *vsp1 = dev_get_drvdata(dev);
mutex_lock(&vsp1->drm->lock);
} }
EXPORT_SYMBOL_GPL(vsp1_du_atomic_begin); EXPORT_SYMBOL_GPL(vsp1_du_atomic_begin);
...@@ -846,6 +843,7 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index, ...@@ -846,6 +843,7 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index,
drm_pipe->crc = cfg->crc; drm_pipe->crc = cfg->crc;
mutex_lock(&vsp1->drm->lock);
vsp1_du_pipeline_setup_inputs(vsp1, pipe); vsp1_du_pipeline_setup_inputs(vsp1, pipe);
vsp1_du_pipeline_configure(pipe); vsp1_du_pipeline_configure(pipe);
mutex_unlock(&vsp1->drm->lock); mutex_unlock(&vsp1->drm->lock);
......
...@@ -174,6 +174,7 @@ static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog) ...@@ -174,6 +174,7 @@ static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog)
rcu_assign_pointer(raw->progs, new_array); rcu_assign_pointer(raw->progs, new_array);
bpf_prog_array_free(old_array); bpf_prog_array_free(old_array);
bpf_prog_put(prog);
unlock: unlock:
mutex_unlock(&ir_raw_handler_lock); mutex_unlock(&ir_raw_handler_lock);
return ret; return ret;
......
...@@ -30,13 +30,13 @@ static int ir_raw_event_thread(void *data) ...@@ -30,13 +30,13 @@ static int ir_raw_event_thread(void *data)
while (kfifo_out(&raw->kfifo, &ev, 1)) { while (kfifo_out(&raw->kfifo, &ev, 1)) {
if (is_timing_event(ev)) { if (is_timing_event(ev)) {
if (ev.duration == 0) if (ev.duration == 0)
dev_err(&dev->dev, "nonsensical timing event of duration 0"); dev_warn_once(&dev->dev, "nonsensical timing event of duration 0");
if (is_timing_event(raw->prev_ev) && if (is_timing_event(raw->prev_ev) &&
!is_transition(&ev, &raw->prev_ev)) !is_transition(&ev, &raw->prev_ev))
dev_err(&dev->dev, "two consecutive events of type %s", dev_warn_once(&dev->dev, "two consecutive events of type %s",
TO_STR(ev.pulse)); TO_STR(ev.pulse));
if (raw->prev_ev.reset && ev.pulse == 0) if (raw->prev_ev.reset && ev.pulse == 0)
dev_err(&dev->dev, "timing event after reset should be pulse"); dev_warn_once(&dev->dev, "timing event after reset should be pulse");
} }
list_for_each_entry(handler, &ir_raw_handler_list, list) list_for_each_entry(handler, &ir_raw_handler_list, list)
if (dev->enabled_protocols & if (dev->enabled_protocols &
......
...@@ -679,6 +679,14 @@ static void ir_timer_repeat(struct timer_list *t) ...@@ -679,6 +679,14 @@ static void ir_timer_repeat(struct timer_list *t)
spin_unlock_irqrestore(&dev->keylock, flags); spin_unlock_irqrestore(&dev->keylock, flags);
} }
static unsigned int repeat_period(int protocol)
{
if (protocol >= ARRAY_SIZE(protocols))
return 100;
return protocols[protocol].repeat_period;
}
/** /**
* rc_repeat() - signals that a key is still pressed * rc_repeat() - signals that a key is still pressed
* @dev: the struct rc_dev descriptor of the device * @dev: the struct rc_dev descriptor of the device
...@@ -691,7 +699,7 @@ void rc_repeat(struct rc_dev *dev) ...@@ -691,7 +699,7 @@ void rc_repeat(struct rc_dev *dev)
{ {
unsigned long flags; unsigned long flags;
unsigned int timeout = nsecs_to_jiffies(dev->timeout) + unsigned int timeout = nsecs_to_jiffies(dev->timeout) +
msecs_to_jiffies(protocols[dev->last_protocol].repeat_period); msecs_to_jiffies(repeat_period(dev->last_protocol));
struct lirc_scancode sc = { struct lirc_scancode sc = {
.scancode = dev->last_scancode, .rc_proto = dev->last_protocol, .scancode = dev->last_scancode, .rc_proto = dev->last_protocol,
.keycode = dev->keypressed ? dev->last_keycode : KEY_RESERVED, .keycode = dev->keypressed ? dev->last_keycode : KEY_RESERVED,
...@@ -803,7 +811,7 @@ void rc_keydown(struct rc_dev *dev, enum rc_proto protocol, u32 scancode, ...@@ -803,7 +811,7 @@ void rc_keydown(struct rc_dev *dev, enum rc_proto protocol, u32 scancode,
if (dev->keypressed) { if (dev->keypressed) {
dev->keyup_jiffies = jiffies + nsecs_to_jiffies(dev->timeout) + dev->keyup_jiffies = jiffies + nsecs_to_jiffies(dev->timeout) +
msecs_to_jiffies(protocols[protocol].repeat_period); msecs_to_jiffies(repeat_period(protocol));
mod_timer(&dev->timer_keyup, dev->keyup_jiffies); mod_timer(&dev->timer_keyup, dev->keyup_jiffies);
} }
spin_unlock_irqrestore(&dev->keylock, flags); spin_unlock_irqrestore(&dev->keylock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment