1. 21 5月, 2011 1 次提交
    • J
      [media] rc: add locking to fix register/show race · 08aeb7c9
      Jarod Wilson 提交于
      When device_add is called in rc_register_device, the rc sysfs nodes show
      up, and there's a window in which ir-keytable can be launched via udev
      and trigger a show_protocols call, which runs without various rc_dev
      fields filled in yet. Add some locking around registration and
      store/show_protocols to prevent that from happening.
      
      The problem manifests thusly:
      
      [64692.957872] BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
      [64692.957878] IP: [<ffffffffa036a4c1>] show_protocols+0x47/0xf1 [rc_core]
      [64692.957890] PGD 19cfc7067 PUD 19cfc6067 PMD 0
      [64692.957894] Oops: 0000 [#1] SMP
      [64692.957897] last sysfs file: /sys/devices/pci0000:00/0000:00:03.1/usb3/3-1/3-1:1.0/rc/rc2/protocols
      [64692.957902] CPU 3
      [64692.957903] Modules linked in: redrat3(+) ir_lirc_codec lirc_dev ir_sony_decoder ir_jvc_decoder ir_rc6_decoder ir_rc5_decoder rc_hauppauge ir_nec
      _decoder rc_core ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_mi
      di_event snd_seq_midi_emul snd_emu10k1 snd_rawmidi snd_ac97_codec ac97_bus snd_seq snd_pcm snd_seq_device snd_timer snd_page_alloc snd_util_mem pcsp
      kr tg3 snd_hwdep emu10k1_gp snd amd64_edac_mod gameport edac_core soundcore edac_mce_amd k8temp shpchp i2c_piix4 lm63 e100 mii uinput ipv6 raid0 rai
      d1 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t sata_svw pata_serverworks floppy radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core
      [last unloaded: redrat3]
      [64692.957949] [64692.957952] Pid: 12265, comm: ir-keytable Tainted: G   M    W   2.6.39-rc6+ #2 empty empty/TYAN Thunder K8HM S3892
      [64692.957957] RIP: 0010:[<ffffffffa036a4c1>]  [<ffffffffa036a4c1>] show_protocols+0x47/0xf1 [rc_core]
      [64692.957962] RSP: 0018:ffff880194509e38  EFLAGS: 00010202
      [64692.957964] RAX: 0000000000000000 RBX: ffffffffa036d1e0 RCX: ffffffffa036a47a
      [64692.957966] RDX: ffff88019a84d000 RSI: ffffffffa036d1e0 RDI: ffff88019cf2f3f0
      [64692.957969] RBP: ffff880194509e68 R08: 0000000000000002 R09: 0000000000000000
      [64692.957971] R10: 0000000000000002 R11: 0000000000001617 R12: ffff88019a84d000
      [64692.957973] R13: 0000000000001000 R14: ffff8801944d2e38 R15: ffff88019ce5f190
      [64692.957976] FS:  00007f0a30c9a720(0000) GS:ffff88019fc00000(0000) knlGS:0000000000000000
      [64692.957979] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [64692.957981] CR2: 0000000000000090 CR3: 000000019a8e0000 CR4: 00000000000006e0
      [64692.957983] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [64692.957986] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [64692.957989] Process ir-keytable (pid: 12265, threadinfo ffff880194508000, task ffff88019a9fc720)
      [64692.957991] Stack:
      [64692.957992]  0000000000000002 ffffffffa036d1e0 ffff880194509f58 0000000000001000
      [64692.957997]  ffff8801944d2e38 ffff88019ce5f190 ffff880194509e98 ffffffff8131484b
      [64692.958001]  ffffffff8118e923 ffffffff810e9b2f ffff880194509e98 ffff8801944d2e18
      [64692.958005] Call Trace:
      [64692.958014]  [<ffffffff8131484b>] dev_attr_show+0x27/0x4e
      [64692.958014]  [<ffffffff8118e923>] ? sysfs_read_file+0x94/0x172
      [64692.958014]  [<ffffffff810e9b2f>] ? __get_free_pages+0x16/0x52
      [64692.958014]  [<ffffffff8118e94c>] sysfs_read_file+0xbd/0x172
      [64692.958014]  [<ffffffff8113205e>] vfs_read+0xac/0xf3
      [64692.958014]  [<ffffffff8113347b>] ? fget_light+0x3a/0xa1
      [64692.958014]  [<ffffffff811320f2>] sys_read+0x4d/0x74
      [64692.958014]  [<ffffffff814c19c2>] system_call_fastpath+0x16/0x1b
      
      Its a bit difficult to reproduce, but I'm fairly confident this has
      fixed the problem.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      08aeb7c9
  2. 29 4月, 2011 2 次提交
  3. 31 3月, 2011 1 次提交
  4. 03 3月, 2011 1 次提交
  5. 01 2月, 2011 1 次提交
  6. 31 1月, 2011 1 次提交
  7. 29 12月, 2010 15 次提交
  8. 01 11月, 2010 1 次提交
  9. 31 10月, 2010 1 次提交
  10. 21 10月, 2010 3 次提交
  11. 28 9月, 2010 2 次提交
    • M
      V4L/DVB: IR: fix keys beeing stuck down forever · e0172fd3
      Maxim Levitsky 提交于
      The logic in ir_timer_keyup was inverted.
      
      In case that values aren't equal,
      the meaning of the time_is_after_eq_jiffies(ir->keyup_jiffies) is that
      ir->keyup_jiffies is after the the jiffies or equally that
      that jiffies are before the the ir->keyup_jiffies which is
      exactly the situation we want to avoid (that the timeout is in the future)
      Confusing Eh?
      Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      e0172fd3
    • M
      V4L/DVB: rc-core: increase repeat time · 04cab131
      Mauro Carvalho Chehab 提交于
      As reported by Anton Blanchard <anton@samba.org>, double IR events on
      2.6.36-rc2 and a DViCO FusionHDTV DVB-T Dual Express are happening:
      
      [ 1351.032084] ir_keydown: i2c IR (FusionHDTV): key down event, key 0x0067, scancode 0x0051
      [ 1351.281284] ir_keyup: keyup key 0x0067
      
      ie one key down event and one key up event 250ms later.
      
      So, we need to increase the repeat timeout, to avoid this bug to hit.
      
      As we're doing it at core, this fix is not needed anymore at dib0700 driver.
      
      Thanks-to: Anton Blanchard <anton@samba.org>
      Cc: stable@kernel.org
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      04cab131
  12. 10 9月, 2010 1 次提交
  13. 09 8月, 2010 3 次提交
  14. 03 8月, 2010 1 次提交
    • M
      V4L/DVB: sms: Convert IR support to use the Remote Controller core · 844a9e93
      Mauro Carvalho Chehab 提交于
      Rewrites the siano IR implementation. The previous implementation were
      non-standard. As such, it has issues if more than one device registers IR,
      as there used to have some static constants used during protocol decoding
      phase. Also, it used to implement its on RAW decoder, and only for RC5.
      
      The new code uses RC core subsystem for handling IR. This brings several
      new features to the driver, including:
      	- Allow to dynamically replace the IR keycodes;
      	- Supports all existing raw decoders (JVC, NEC, RC-5, RC-6, SONY);
      	- Supports lirc dev;
      	- Doesn't have race conditions when more than one sms IR is
      	  registered;
      	- The code size for the IR implementation is very small;
      	- it exports the IR features via /sys/class/rc.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      844a9e93
  15. 01 6月, 2010 1 次提交
  16. 19 5月, 2010 5 次提交
    • D
      V4L/DVB: ir-core: fix some confusing comments · dd3f616d
      David Härdeman 提交于
      Fix some confusing comments in drivers/media/IR/*
      Signed-off-by: NDavid Härdeman <david@hardeman.nu>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      dd3f616d
    • M
      V4L/DVB: ir-core: fix table resize during keymap init · 42880cd4
      Mauro Carvalho Chehab 提交于
      drivers/media/IR/ir-keytable.c would alloc a suitably sized keymap table
      only to have it resized as it is populated with the initial keymap.
      Signed-off-by: NDavid Härdeman <david@hardeman.nu>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      42880cd4
    • M
      ir-core: Fix the delete logic · 09bd00e7
      Mauro Carvalho Chehab 提交于
      Instead of removing an entry, the logic were doing both a deletion and
      a key addition, as shown by the log:
      
      [11517.323314] ir_getkeycode: unknown key for scancode 0x0050
      [11517.326529] ir_do_setkeycode: #80: Deleting scan 0x0050
      [11517.326529] ir_do_setkeycode: #80: New scan 0x0050 with key 0x0000
      [11517.340598] ir_getkeycode: unknown key for scancode 0x0051
      [11517.343811] ir_do_setkeycode: #81: Deleting scan 0x0051
      [11517.343811] ir_do_setkeycode: #81: New scan 0x0051 with key 0x0000
      [11517.357889] ir_getkeycode: unknown key for scancode 0x0052
      [11517.361104] ir_do_setkeycode: #82: Deleting scan 0x0052
      [11517.361104] ir_do_setkeycode: #82: New scan 0x0052 with key 0x0000
      [11517.375453] ir_getkeycode: unknown key for scancode 0x0053
      [11517.378474] ir_do_setkeycode: #83: Deleting scan 0x0053
      [11517.378474] ir_do_setkeycode: #83: New scan 0x0053 with key 0x0000
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      09bd00e7
    • M
      V4L/DVB: ir-core: move subsystem internal calls to ir-core-priv.h · 3f113e36
      Mauro Carvalho Chehab 提交于
      ir-core.h has the kABI to be used by the bridge drivers, when needing to register
      IR protocols and pass IR events. However, the same file also contains IR subsystem
      internal calls, meant to be used inside ir-core and between ir-core and the raw
      decoders.
      
      Better to move those functions to an internal header, for some reasons:
      
      1) Header will be a little more cleaner;
      
      2) It avoids the need of recompile everything (bridge/hardware drivers, etc),
         just because a new decoder were added, or some other internal change were needed;
      
      3) Better organize the ir-core API, splitting the functions that are internal to
         IR core and the ancillary drivers (decoders, lirc_dev) from the features that
         should be exported to IR subsystem clients.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      3f113e36
    • M
      V4L/DVB: ir-core: Distinguish sysfs attributes for in-hardware and raw decoders · 626cf697
      Mauro Carvalho Chehab 提交于
      Some devices have in-hardware Remote Controller decoder, while others
      need a software decoder to get the IR code. As each software decoder
      can be enabled/disabled individually, allowing multiple protocol
      decoding capability.
      
      On the other hand, hardware decoders have a limited protocol
      support, often being able of decoding just one protocol each time.
      So, each type needs a different set of capabilities to control the
      supported protocol(s).
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      626cf697