History

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

Linus Torvalds committed 8 years ago

Commit 0585df42 parents ed0093d 8eb0e644 files · +16 −9Browse files

Unified · Split

4 files
  1. drivers/media/platform/vsp1/vsp1_drm.c +1 −3
  2. drivers/media/rc/bpf-lirc.c +1 −0
  3. drivers/media/rc/rc-ir-raw.c +4 −4
  4. drivers/media/rc/rc-main.c +10 −2
drivers/media/platform/vsp1/vsp1_drm.c+1−3
@@ -728,9 +728,6 @@ EXPORT_SYMBOL_GPL(vsp1_du_setup_lif); · 727 unmodified lines
728 */728 */
729void vsp1_du_atomic_begin(struct device *dev, unsigned int pipe_index)729void 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}
735EXPORT_SYMBOL_GPL(vsp1_du_atomic_begin);732EXPORT_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);
drivers/media/rc/bpf-lirc.c+1−0
@@ -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);
177unlock:178unlock:
178 mutex_unlock(&ir_raw_handler_lock);179 mutex_unlock(&ir_raw_handler_lock);
179 return ret;180 return ret;
drivers/media/rc/rc-ir-raw.c+4−4
@@ -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 &
drivers/media/rc/rc-main.c+10−2
@@ -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
682static 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 pressed691 * rc_repeat() - signals that a key is still pressed
684 * @dev: the struct rc_dev descriptor of the device692 * @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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t