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
Unified · Split
| @@ -728,9 +728,6 @@ EXPORT_SYMBOL_GPL(vsp1_du_setup_lif); · 727 unmodified lines | |||
| 728 | */ | 728 | */ |
| 729 | void vsp1_du_atomic_begin(struct device *dev, unsigned int pipe_index) | 729 | void vsp1_du_atomic_begin(struct device *dev, unsigned int pipe_index) |
| 730 | { | 730 | { |
| 731 | struct vsp1_device *vsp1 = dev_get_drvdata(dev); | ||
| 732 | |||
| 733 | mutex_lock(&vsp1->drm->lock); | ||
| 734 | } | 731 | } |
| 735 | EXPORT_SYMBOL_GPL(vsp1_du_atomic_begin); | 732 | EXPORT_SYMBOL_GPL(vsp1_du_atomic_begin); |
| 736 | 733 | ||
| @@ -846,6 +843,7 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index, · 109 unmodified lines | |||
| 846 | 843 | ||
| 847 | drm_pipe->crc = cfg->crc; | 844 | drm_pipe->crc = cfg->crc; |
| 848 | 845 | ||
| 846 | mutex_lock(&vsp1->drm->lock); | ||
| 849 | vsp1_du_pipeline_setup_inputs(vsp1, pipe); | 847 | vsp1_du_pipeline_setup_inputs(vsp1, pipe); |
| 850 | vsp1_du_pipeline_configure(pipe); | 848 | vsp1_du_pipeline_configure(pipe); |
| 851 | mutex_unlock(&vsp1->drm->lock); | 849 | mutex_unlock(&vsp1->drm->lock); |
| @@ -174,6 +174,7 @@ static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog) · 173 unmodified lines | |||
| 174 | 174 | ||
| 175 | rcu_assign_pointer(raw->progs, new_array); | 175 | rcu_assign_pointer(raw->progs, new_array); |
| 176 | bpf_prog_array_free(old_array); | 176 | bpf_prog_array_free(old_array); |
| 177 | bpf_prog_put(prog); | ||
| 177 | unlock: | 178 | unlock: |
| 178 | mutex_unlock(&ir_raw_handler_lock); | 179 | mutex_unlock(&ir_raw_handler_lock); |
| 179 | return ret; | 180 | return ret; |
| @@ -30,13 +30,13 @@ static int ir_raw_event_thread(void *data) · 29 unmodified lines | |||
| 30 | while (kfifo_out(&raw->kfifo, &ev, 1)) { | 30 | while (kfifo_out(&raw->kfifo, &ev, 1)) { |
| 31 | if (is_timing_event(ev)) { | 31 | if (is_timing_event(ev)) { |
| 32 | if (ev.duration == 0) | 32 | if (ev.duration == 0) |
| 33 | dev_err(&dev->dev, "nonsensical timing event of duration 0"); | 33 | dev_warn_once(&dev->dev, "nonsensical timing event of duration 0"); |
| 34 | if (is_timing_event(raw->prev_ev) && | 34 | if (is_timing_event(raw->prev_ev) && |
| 35 | !is_transition(&ev, &raw->prev_ev)) | 35 | !is_transition(&ev, &raw->prev_ev)) |
| 36 | dev_err(&dev->dev, "two consecutive events of type %s", | 36 | dev_warn_once(&dev->dev, "two consecutive events of type %s", |
| 37 | TO_STR(ev.pulse)); | 37 | TO_STR(ev.pulse)); |
| 38 | if (raw->prev_ev.reset && ev.pulse == 0) | 38 | if (raw->prev_ev.reset && ev.pulse == 0) |
| 39 | dev_err(&dev->dev, "timing event after reset should be pulse"); | 39 | dev_warn_once(&dev->dev, "timing event after reset should be pulse"); |
| 40 | } | 40 | } |
| 41 | list_for_each_entry(handler, &ir_raw_handler_list, list) | 41 | list_for_each_entry(handler, &ir_raw_handler_list, list) |
| 42 | if (dev->enabled_protocols & | 42 | if (dev->enabled_protocols & |
| @@ -679,6 +679,14 @@ static void ir_timer_repeat(struct timer_list *t) · 678 unmodified lines | |||
| 679 | spin_unlock_irqrestore(&dev->keylock, flags); | 679 | spin_unlock_irqrestore(&dev->keylock, flags); |
| 680 | } | 680 | } |
| 681 | 681 | ||
| 682 | static unsigned int repeat_period(int protocol) | ||
| 683 | { | ||
| 684 | if (protocol >= ARRAY_SIZE(protocols)) | ||
| 685 | return 100; | ||
| 686 | |||
| 687 | return protocols[protocol].repeat_period; | ||
| 688 | } | ||
| 689 | |||
| 682 | /** | 690 | /** |
| 683 | * rc_repeat() - signals that a key is still pressed | 691 | * rc_repeat() - signals that a key is still pressed |
| 684 | * @dev: the struct rc_dev descriptor of the device | 692 | * @dev: the struct rc_dev descriptor of the device |
| @@ -691,7 +699,7 @@ void rc_repeat(struct rc_dev *dev) · 6 unmodified lines | |||
| 691 | { | 699 | { |
| 692 | unsigned long flags; | 700 | unsigned long flags; |
| 693 | unsigned int timeout = nsecs_to_jiffies(dev->timeout) + | 701 | unsigned int timeout = nsecs_to_jiffies(dev->timeout) + |
| 694 | msecs_to_jiffies(protocols[dev->last_protocol].repeat_period); | 702 | msecs_to_jiffies(repeat_period(dev->last_protocol)); |
| 695 | struct lirc_scancode sc = { | 703 | struct lirc_scancode sc = { |
| 696 | .scancode = dev->last_scancode, .rc_proto = dev->last_protocol, | 704 | .scancode = dev->last_scancode, .rc_proto = dev->last_protocol, |
| 697 | .keycode = dev->keypressed ? dev->last_keycode : KEY_RESERVED, | 705 | .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, · 105 unmodified lines | |||
| 803 | 811 | ||
| 804 | if (dev->keypressed) { | 812 | if (dev->keypressed) { |
| 805 | dev->keyup_jiffies = jiffies + nsecs_to_jiffies(dev->timeout) + | 813 | dev->keyup_jiffies = jiffies + nsecs_to_jiffies(dev->timeout) + |
| 806 | msecs_to_jiffies(protocols[protocol].repeat_period); | 814 | msecs_to_jiffies(repeat_period(protocol)); |
| 807 | mod_timer(&dev->timer_keyup, dev->keyup_jiffies); | 815 | mod_timer(&dev->timer_keyup, dev->keyup_jiffies); |
| 808 | } | 816 | } |
| 809 | spin_unlock_irqrestore(&dev->keylock, flags); | 817 | spin_unlock_irqrestore(&dev->keylock, flags); |