<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/media/dvb-core, branch v4.8-rc2</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[media] doc-rst: add some needed escape codes</title>
<updated>2016-07-23T11:05:02+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@s-opensource.com</email>
</author>
<published>2016-07-23T10:12:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=564aaf69208d6f9e37cd82c06b889e5d9c59bfb6'/>
<id>564aaf69208d6f9e37cd82c06b889e5d9c59bfb6</id>
<content type='text'>
Some extra escape codes are needed to avoid Sphinx to not
identify the tags.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some extra escape codes are needed to avoid Sphinx to not
identify the tags.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] dvb_ringbuffer.h: some documentation improvements</title>
<updated>2016-07-23T11:04:21+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@s-opensource.com</email>
</author>
<published>2016-07-22T16:58:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7a23c2574d0c7cf3d2ddbf967e3fc32531037a16'/>
<id>7a23c2574d0c7cf3d2ddbf967e3fc32531037a16</id>
<content type='text'>
Better document a note on this header.

While here, better format dvb_ringbuffer_pkt_read_user()
to adjust it to CodingStyle.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Better document a note on this header.

While here, better format dvb_ringbuffer_pkt_read_user()
to adjust it to CodingStyle.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] doc-rst: Fix some Sphinx warnings</title>
<updated>2016-07-23T11:03:24+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@s-opensource.com</email>
</author>
<published>2016-07-20T12:22:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5b8700e9f909d8fb2802d7ea2626460d3a233256'/>
<id>5b8700e9f909d8fb2802d7ea2626460d3a233256</id>
<content type='text'>
Fix all remaining media warnings with ReST that are fixable
without changing at the Sphinx code.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix all remaining media warnings with ReST that are fixable
without changing at the Sphinx code.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'patchwork' into topic/docs-next</title>
<updated>2016-07-23T10:59:19+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@s-opensource.com</email>
</author>
<published>2016-07-23T10:59:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c278256d05a2fc75b427fa6a5dc0024faa93465d'/>
<id>c278256d05a2fc75b427fa6a5dc0024faa93465d</id>
<content type='text'>
* patchwork: (1492 commits)
  [media] cec: always check all_device_types and features
  [media] cec: poll should check if there is room in the tx queue
  [media] vivid: support monitor all mode
  [media] cec: fix test for unconfigured adapter in main message loop
  [media] cec: limit the size of the transmit queue
  [media] cec: zero unused msg part after msg-&gt;len
  [media] cec: don't set fh to NULL in CEC_TRANSMIT
  [media] cec: clear all status fields before transmit and always fill in sequence
  [media] cec: CEC_RECEIVE overwrote the timeout field
  [media] cxd2841er: Reading SNR for DVB-C added
  [media] cxd2841er: Reading BER and UCB for DVB-C added
  [media] cxd2841er: fix switch-case for DVB-C
  [media] cxd2841er: fix signal strength scale for ISDB-T
  [media] cxd2841er: adjust the dB scale for DVB-C
  [media] cxd2841er: provide signal strength for DVB-C
  [media] cxd2841er: fix BER report via DVBv5 stats API
  [media] mb86a20s: apply mask to val after checking for read failure
  [media] airspy: fix error logic during device register
  [media] s5p-cec/TODO: add TODO item
  [media] cec/TODO: drop comment about sphinx documentation
  ...

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* patchwork: (1492 commits)
  [media] cec: always check all_device_types and features
  [media] cec: poll should check if there is room in the tx queue
  [media] vivid: support monitor all mode
  [media] cec: fix test for unconfigured adapter in main message loop
  [media] cec: limit the size of the transmit queue
  [media] cec: zero unused msg part after msg-&gt;len
  [media] cec: don't set fh to NULL in CEC_TRANSMIT
  [media] cec: clear all status fields before transmit and always fill in sequence
  [media] cec: CEC_RECEIVE overwrote the timeout field
  [media] cxd2841er: Reading SNR for DVB-C added
  [media] cxd2841er: Reading BER and UCB for DVB-C added
  [media] cxd2841er: fix switch-case for DVB-C
  [media] cxd2841er: fix signal strength scale for ISDB-T
  [media] cxd2841er: adjust the dB scale for DVB-C
  [media] cxd2841er: provide signal strength for DVB-C
  [media] cxd2841er: fix BER report via DVBv5 stats API
  [media] mb86a20s: apply mask to val after checking for read failure
  [media] airspy: fix error logic during device register
  [media] s5p-cec/TODO: add TODO item
  [media] cec/TODO: drop comment about sphinx documentation
  ...

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] doc-rst: Fix conversion for dvb-core.rst</title>
<updated>2016-07-17T17:02:45+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@s-opensource.com</email>
</author>
<published>2016-07-17T14:25:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2f019851a404d71f6581b62b721f0b8222c3521'/>
<id>d2f019851a404d71f6581b62b721f0b8222c3521</id>
<content type='text'>
The conversion from DocBook required some fixes:

- Now, the C files with the exported symbols also need to be
  added. So, all headers need to be included twice: one to
  get the structs/enums/.. and another one for the functions;

- Notes should use the ReST tag, as kernel-doc doesn't
  recognizes it anymore;

- Identation needs to be fixed, as ReST uses it to identify
  when a format "tag" ends.

- Fix the cross-references at the media controller description.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The conversion from DocBook required some fixes:

- Now, the C files with the exported symbols also need to be
  added. So, all headers need to be included twice: one to
  get the structs/enums/.. and another one for the functions;

- Notes should use the ReST tag, as kernel-doc doesn't
  recognizes it anymore;

- Identation needs to be fixed, as ReST uses it to identify
  when a format "tag" ends.

- Fix the cross-references at the media controller description.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] doc-rst: Convert media API to rst</title>
<updated>2016-07-17T17:02:41+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@s-opensource.com</email>
</author>
<published>2016-07-17T10:20:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d26a5d4350fd234c1f35d8b262527c8cb97c630d'/>
<id>d26a5d4350fd234c1f35d8b262527c8cb97c630d</id>
<content type='text'>
Move the contents of the media section at
DocBooks/DocBook/device-drivers.tmpl to a new ReST book.

For now, the contents is kept as-is. Next patches will fix
the warnings and add cross-references that were removed due to
the conversion.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the contents of the media section at
DocBooks/DocBook/device-drivers.tmpl to a new ReST book.

For now, the contents is kept as-is. Next patches will fix
the warnings and add cross-references that were removed due to
the conversion.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] dvb-core/en50221: use kref to manage struct dvb_ca_private</title>
<updated>2016-07-13T18:45:29+00:00</updated>
<author>
<name>Max Kellermann</name>
<email>max@duempel.org</email>
</author>
<published>2016-07-04T12:08:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da677fe14364f7ac1f5f7085c58bbc2f7bb12da0'/>
<id>da677fe14364f7ac1f5f7085c58bbc2f7bb12da0</id>
<content type='text'>
Don't free the object until the file handle has been closed.  Fixes
use-after-free bug which occurs when I disconnect my DVB-S received
while VDR is running.

This is a crash dump of such a use-after-free:

    general protection fault: 0000 [#1] SMP
    CPU: 0 PID: 2541 Comm: CI adapter on d Not tainted 4.7.0-rc1-hosting+ #49
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    task: ffff880027d7ce00 ti: ffff88003d8f8000 task.ti: ffff88003d8f8000
    RIP: 0010:[&lt;ffffffff812f3d1f&gt;]  [&lt;ffffffff812f3d1f&gt;] dvb_ca_en50221_io_read_condition.isra.7+0x6f/0x150
    RSP: 0018:ffff88003d8fba98  EFLAGS: 00010206
    RAX: 0000000059534255 RBX: 000000753d470f90 RCX: ffff88003c74d181
    RDX: 00000001bea04ba9 RSI: ffff88003d8fbaf4 RDI: 3a3030a56d763fc0
    RBP: ffff88003d8fbae0 R08: ffff88003c74d180 R09: 0000000000000000
    R10: 0000000000000001 R11: 0000000000000000 R12: ffff88003c480e00
    R13: 00000000ffffffff R14: 0000000059534255 R15: 0000000000000000
    FS:  00007fb4209b4700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f06445f4078 CR3: 000000003c55b000 CR4: 00000000000006b0
    Stack:
     ffff88003d8fbaf4 000000003c2170c0 0000000000004000 0000000000000000
     ffff88003c480e00 ffff88003d8fbc80 ffff88003c74d180 ffff88003d8fbb8c
     0000000000000000 ffff88003d8fbb10 ffffffff812f3e37 ffff88003d8fbb00
    Call Trace:
     [&lt;ffffffff812f3e37&gt;] dvb_ca_en50221_io_poll+0x37/0xa0
     [&lt;ffffffff8113109b&gt;] do_sys_poll+0x2db/0x520

This is a backtrace of the kernel attempting to lock a freed mutex:

    #0  0xffffffff81083d40 in rep_nop () at ./arch/x86/include/asm/processor.h:569
    #1  cpu_relax () at ./arch/x86/include/asm/processor.h:574
    #2  virt_spin_lock (lock=&lt;optimized out&gt;) at ./arch/x86/include/asm/qspinlock.h:57
    #3  native_queued_spin_lock_slowpath (lock=0xffff88003c480e90, val=761492029) at kernel/locking/qspinlock.c:304
    #4  0xffffffff810d1a06 in pv_queued_spin_lock_slowpath (val=&lt;optimized out&gt;, lock=&lt;optimized out&gt;) at ./arch/x86/include/asm/paravirt.h:669
    #5  queued_spin_lock_slowpath (val=&lt;optimized out&gt;, lock=&lt;optimized out&gt;) at ./arch/x86/include/asm/qspinlock.h:28
    #6  queued_spin_lock (lock=&lt;optimized out&gt;) at include/asm-generic/qspinlock.h:107
    #7  __mutex_lock_common (use_ww_ctx=&lt;optimized out&gt;, ww_ctx=&lt;optimized out&gt;, ip=&lt;optimized out&gt;, nest_lock=&lt;optimized out&gt;, subclass=&lt;optimized out&gt;,
        state=&lt;optimized out&gt;, lock=&lt;optimized out&gt;) at kernel/locking/mutex.c:526
    #8  mutex_lock_interruptible_nested (lock=0xffff88003c480e88, subclass=&lt;optimized out&gt;) at kernel/locking/mutex.c:647
    #9  0xffffffff812f49fe in dvb_ca_en50221_io_do_ioctl (file=&lt;optimized out&gt;, cmd=761492029, parg=0x1 &lt;irq_stack_union+1&gt;)
        at drivers/media/dvb-core/dvb_ca_en50221.c:1210
    #10 0xffffffff812ee660 in dvb_usercopy (file=&lt;optimized out&gt;, cmd=761492029, arg=&lt;optimized out&gt;, func=&lt;optimized out&gt;) at drivers/media/dvb-core/dvbdev.c:883
    #11 0xffffffff812f3410 in dvb_ca_en50221_io_ioctl (file=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, arg=&lt;optimized out&gt;) at drivers/media/dvb-core/dvb_ca_en50221.c:1284
    #12 0xffffffff8112eddd in vfs_ioctl (arg=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, filp=&lt;optimized out&gt;) at fs/ioctl.c:43
    #13 do_vfs_ioctl (filp=0xffff88003c480e90, fd=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, arg=&lt;optimized out&gt;) at fs/ioctl.c:674
    #14 0xffffffff8112f30c in SYSC_ioctl (arg=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, fd=&lt;optimized out&gt;) at fs/ioctl.c:689
    #15 SyS_ioctl (fd=6, cmd=2148298626, arg=140734533693696) at fs/ioctl.c:680
    #16 0xffffffff8103feb2 in entry_SYSCALL_64 () at arch/x86/entry/entry_64.S:207

Signed-off-by: Max Kellermann &lt;max@duempel.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't free the object until the file handle has been closed.  Fixes
use-after-free bug which occurs when I disconnect my DVB-S received
while VDR is running.

This is a crash dump of such a use-after-free:

    general protection fault: 0000 [#1] SMP
    CPU: 0 PID: 2541 Comm: CI adapter on d Not tainted 4.7.0-rc1-hosting+ #49
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    task: ffff880027d7ce00 ti: ffff88003d8f8000 task.ti: ffff88003d8f8000
    RIP: 0010:[&lt;ffffffff812f3d1f&gt;]  [&lt;ffffffff812f3d1f&gt;] dvb_ca_en50221_io_read_condition.isra.7+0x6f/0x150
    RSP: 0018:ffff88003d8fba98  EFLAGS: 00010206
    RAX: 0000000059534255 RBX: 000000753d470f90 RCX: ffff88003c74d181
    RDX: 00000001bea04ba9 RSI: ffff88003d8fbaf4 RDI: 3a3030a56d763fc0
    RBP: ffff88003d8fbae0 R08: ffff88003c74d180 R09: 0000000000000000
    R10: 0000000000000001 R11: 0000000000000000 R12: ffff88003c480e00
    R13: 00000000ffffffff R14: 0000000059534255 R15: 0000000000000000
    FS:  00007fb4209b4700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f06445f4078 CR3: 000000003c55b000 CR4: 00000000000006b0
    Stack:
     ffff88003d8fbaf4 000000003c2170c0 0000000000004000 0000000000000000
     ffff88003c480e00 ffff88003d8fbc80 ffff88003c74d180 ffff88003d8fbb8c
     0000000000000000 ffff88003d8fbb10 ffffffff812f3e37 ffff88003d8fbb00
    Call Trace:
     [&lt;ffffffff812f3e37&gt;] dvb_ca_en50221_io_poll+0x37/0xa0
     [&lt;ffffffff8113109b&gt;] do_sys_poll+0x2db/0x520

This is a backtrace of the kernel attempting to lock a freed mutex:

    #0  0xffffffff81083d40 in rep_nop () at ./arch/x86/include/asm/processor.h:569
    #1  cpu_relax () at ./arch/x86/include/asm/processor.h:574
    #2  virt_spin_lock (lock=&lt;optimized out&gt;) at ./arch/x86/include/asm/qspinlock.h:57
    #3  native_queued_spin_lock_slowpath (lock=0xffff88003c480e90, val=761492029) at kernel/locking/qspinlock.c:304
    #4  0xffffffff810d1a06 in pv_queued_spin_lock_slowpath (val=&lt;optimized out&gt;, lock=&lt;optimized out&gt;) at ./arch/x86/include/asm/paravirt.h:669
    #5  queued_spin_lock_slowpath (val=&lt;optimized out&gt;, lock=&lt;optimized out&gt;) at ./arch/x86/include/asm/qspinlock.h:28
    #6  queued_spin_lock (lock=&lt;optimized out&gt;) at include/asm-generic/qspinlock.h:107
    #7  __mutex_lock_common (use_ww_ctx=&lt;optimized out&gt;, ww_ctx=&lt;optimized out&gt;, ip=&lt;optimized out&gt;, nest_lock=&lt;optimized out&gt;, subclass=&lt;optimized out&gt;,
        state=&lt;optimized out&gt;, lock=&lt;optimized out&gt;) at kernel/locking/mutex.c:526
    #8  mutex_lock_interruptible_nested (lock=0xffff88003c480e88, subclass=&lt;optimized out&gt;) at kernel/locking/mutex.c:647
    #9  0xffffffff812f49fe in dvb_ca_en50221_io_do_ioctl (file=&lt;optimized out&gt;, cmd=761492029, parg=0x1 &lt;irq_stack_union+1&gt;)
        at drivers/media/dvb-core/dvb_ca_en50221.c:1210
    #10 0xffffffff812ee660 in dvb_usercopy (file=&lt;optimized out&gt;, cmd=761492029, arg=&lt;optimized out&gt;, func=&lt;optimized out&gt;) at drivers/media/dvb-core/dvbdev.c:883
    #11 0xffffffff812f3410 in dvb_ca_en50221_io_ioctl (file=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, arg=&lt;optimized out&gt;) at drivers/media/dvb-core/dvb_ca_en50221.c:1284
    #12 0xffffffff8112eddd in vfs_ioctl (arg=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, filp=&lt;optimized out&gt;) at fs/ioctl.c:43
    #13 do_vfs_ioctl (filp=0xffff88003c480e90, fd=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, arg=&lt;optimized out&gt;) at fs/ioctl.c:674
    #14 0xffffffff8112f30c in SYSC_ioctl (arg=&lt;optimized out&gt;, cmd=&lt;optimized out&gt;, fd=&lt;optimized out&gt;) at fs/ioctl.c:689
    #15 SyS_ioctl (fd=6, cmd=2148298626, arg=140734533693696) at fs/ioctl.c:680
    #16 0xffffffff8103feb2 in entry_SYSCALL_64 () at arch/x86/entry/entry_64.S:207

Signed-off-by: Max Kellermann &lt;max@duempel.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] dvb_frontend: eliminate blocking wait in dvb_unregister_frontend()</title>
<updated>2016-07-13T18:43:31+00:00</updated>
<author>
<name>Max Kellermann</name>
<email>max@duempel.org</email>
</author>
<published>2016-07-04T12:08:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe35637b0a9f8837a63ec4ffc52831de2af98fe4'/>
<id>fe35637b0a9f8837a63ec4ffc52831de2af98fe4</id>
<content type='text'>
The wait_event() call in dvb_unregister_frontend() waits synchronously
for other tasks to free a file descriptor, but it does that while
holding several mutexes.  That alone is a bad idea, but if one user
process happens to keep a (defunct) file descriptor open indefinitely,
the kernel will correctly detect a hung task:

    INFO: task kworker/0:1:314 blocked for more than 30 seconds.
          Not tainted 4.7.0-rc1-hosting+ #50
    "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    kworker/0:1     D ffff88003daf7a50     0   314      2 0x00000000
    Workqueue: usb_hub_wq hub_event
     ffff88003daf7a50 0000000000000296 ffff88003daf7a30 ffff88003fc13f98
     ffff88003dadce00 ffff88003daf8000 ffff88003e3fc010 ffff88003d48d4f8
     ffff88003e3b5030 ffff88003e3f8898 ffff88003daf7a68 ffffffff810cf860
    Call Trace:
     [&lt;ffffffff810cf860&gt;] schedule+0x30/0x80
     [&lt;ffffffff812f88d3&gt;] dvb_unregister_frontend+0x93/0xc0
     [&lt;ffffffff8107a000&gt;] ? __wake_up_common+0x80/0x80
     [&lt;ffffffff813019c7&gt;] dvb_usb_adapter_frontend_exit+0x37/0x70
     [&lt;ffffffff81300614&gt;] dvb_usb_exit+0x34/0xb0
     [&lt;ffffffff81300d4a&gt;] dvb_usb_device_exit+0x3a/0x50
     [&lt;ffffffff81302dc2&gt;] pctv452e_usb_disconnect+0x52/0x60
     [&lt;ffffffff81295a07&gt;] usb_unbind_interface+0x67/0x1e0
     [&lt;ffffffff810609f3&gt;] ? __blocking_notifier_call_chain+0x53/0x70
     [&lt;ffffffff8127ba67&gt;] __device_release_driver+0x77/0x110
     [&lt;ffffffff8127c2d3&gt;] device_release_driver+0x23/0x30
     [&lt;ffffffff8127ab5d&gt;] bus_remove_device+0x10d/0x150
     [&lt;ffffffff8127879b&gt;] device_del+0x13b/0x260
     [&lt;ffffffff81299dea&gt;] ? usb_remove_ep_devs+0x1a/0x30
     [&lt;ffffffff8129468e&gt;] usb_disable_device+0x9e/0x1e0
     [&lt;ffffffff8128bb09&gt;] usb_disconnect+0x89/0x260
     [&lt;ffffffff8128db8d&gt;] hub_event+0x30d/0xfc0
     [&lt;ffffffff81059475&gt;] process_one_work+0x1c5/0x4a0
     [&lt;ffffffff8105940c&gt;] ? process_one_work+0x15c/0x4a0
     [&lt;ffffffff81059799&gt;] worker_thread+0x49/0x480
     [&lt;ffffffff81059750&gt;] ? process_one_work+0x4a0/0x4a0
     [&lt;ffffffff81059750&gt;] ? process_one_work+0x4a0/0x4a0
     [&lt;ffffffff8105f65e&gt;] kthread+0xee/0x110
     [&lt;ffffffff810400bf&gt;] ret_from_fork+0x1f/0x40
     [&lt;ffffffff8105f570&gt;] ? __kthread_unpark+0x70/0x70
    5 locks held by kworker/0:1/314:
     #0:  ("usb_hub_wq"){......}, at: [&lt;ffffffff8105940c&gt;] process_one_work+0x15c/0x4a0
     #1:  ((&amp;hub-&gt;events)){......}, at: [&lt;ffffffff8105940c&gt;] process_one_work+0x15c/0x4a0
     #2:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff8128d8cb&gt;] hub_event+0x4b/0xfc0
     #3:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff8128bad2&gt;] usb_disconnect+0x52/0x260
     #4:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff8127c2cb&gt;] device_release_driver+0x1b/0x30

This patch removes the blocking wait, and postpones the kfree() call
until all file handles have been closed by using struct kref.

Signed-off-by: Max Kellermann &lt;max@duempel.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The wait_event() call in dvb_unregister_frontend() waits synchronously
for other tasks to free a file descriptor, but it does that while
holding several mutexes.  That alone is a bad idea, but if one user
process happens to keep a (defunct) file descriptor open indefinitely,
the kernel will correctly detect a hung task:

    INFO: task kworker/0:1:314 blocked for more than 30 seconds.
          Not tainted 4.7.0-rc1-hosting+ #50
    "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    kworker/0:1     D ffff88003daf7a50     0   314      2 0x00000000
    Workqueue: usb_hub_wq hub_event
     ffff88003daf7a50 0000000000000296 ffff88003daf7a30 ffff88003fc13f98
     ffff88003dadce00 ffff88003daf8000 ffff88003e3fc010 ffff88003d48d4f8
     ffff88003e3b5030 ffff88003e3f8898 ffff88003daf7a68 ffffffff810cf860
    Call Trace:
     [&lt;ffffffff810cf860&gt;] schedule+0x30/0x80
     [&lt;ffffffff812f88d3&gt;] dvb_unregister_frontend+0x93/0xc0
     [&lt;ffffffff8107a000&gt;] ? __wake_up_common+0x80/0x80
     [&lt;ffffffff813019c7&gt;] dvb_usb_adapter_frontend_exit+0x37/0x70
     [&lt;ffffffff81300614&gt;] dvb_usb_exit+0x34/0xb0
     [&lt;ffffffff81300d4a&gt;] dvb_usb_device_exit+0x3a/0x50
     [&lt;ffffffff81302dc2&gt;] pctv452e_usb_disconnect+0x52/0x60
     [&lt;ffffffff81295a07&gt;] usb_unbind_interface+0x67/0x1e0
     [&lt;ffffffff810609f3&gt;] ? __blocking_notifier_call_chain+0x53/0x70
     [&lt;ffffffff8127ba67&gt;] __device_release_driver+0x77/0x110
     [&lt;ffffffff8127c2d3&gt;] device_release_driver+0x23/0x30
     [&lt;ffffffff8127ab5d&gt;] bus_remove_device+0x10d/0x150
     [&lt;ffffffff8127879b&gt;] device_del+0x13b/0x260
     [&lt;ffffffff81299dea&gt;] ? usb_remove_ep_devs+0x1a/0x30
     [&lt;ffffffff8129468e&gt;] usb_disable_device+0x9e/0x1e0
     [&lt;ffffffff8128bb09&gt;] usb_disconnect+0x89/0x260
     [&lt;ffffffff8128db8d&gt;] hub_event+0x30d/0xfc0
     [&lt;ffffffff81059475&gt;] process_one_work+0x1c5/0x4a0
     [&lt;ffffffff8105940c&gt;] ? process_one_work+0x15c/0x4a0
     [&lt;ffffffff81059799&gt;] worker_thread+0x49/0x480
     [&lt;ffffffff81059750&gt;] ? process_one_work+0x4a0/0x4a0
     [&lt;ffffffff81059750&gt;] ? process_one_work+0x4a0/0x4a0
     [&lt;ffffffff8105f65e&gt;] kthread+0xee/0x110
     [&lt;ffffffff810400bf&gt;] ret_from_fork+0x1f/0x40
     [&lt;ffffffff8105f570&gt;] ? __kthread_unpark+0x70/0x70
    5 locks held by kworker/0:1/314:
     #0:  ("usb_hub_wq"){......}, at: [&lt;ffffffff8105940c&gt;] process_one_work+0x15c/0x4a0
     #1:  ((&amp;hub-&gt;events)){......}, at: [&lt;ffffffff8105940c&gt;] process_one_work+0x15c/0x4a0
     #2:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff8128d8cb&gt;] hub_event+0x4b/0xfc0
     #3:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff8128bad2&gt;] usb_disconnect+0x52/0x260
     #4:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff8127c2cb&gt;] device_release_driver+0x1b/0x30

This patch removes the blocking wait, and postpones the kfree() call
until all file handles have been closed by using struct kref.

Signed-off-by: Max Kellermann &lt;max@duempel.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media: dvb_ringbuffer: Add memory barriers</title>
<updated>2016-07-09T10:57:47+00:00</updated>
<author>
<name>Soeren Moch</name>
<email>smoch@web.de</email>
</author>
<published>2016-05-11T16:49:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ca6e6126db5494f18c6c6615060d4d803b528bff'/>
<id>ca6e6126db5494f18c6c6615060d4d803b528bff</id>
<content type='text'>
Implement memory barriers according to Documentation/circular-buffers.txt:
- use smp_store_release() to update ringbuffer read/write pointers
- use smp_load_acquire() to load write pointer on reader side
- use ACCESS_ONCE() to load read pointer on writer side

This fixes data stream corruptions observed e.g. on an ARM Cortex-A9
quad core system with different types (PCI, USB) of DVB tuners.

Signed-off-by: Soeren Moch &lt;smoch@web.de&gt;
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement memory barriers according to Documentation/circular-buffers.txt:
- use smp_store_release() to update ringbuffer read/write pointers
- use smp_load_acquire() to load write pointer on reader side
- use ACCESS_ONCE() to load read pointer on writer side

This fixes data stream corruptions observed e.g. on an ARM Cortex-A9
quad core system with different types (PCI, USB) of DVB tuners.

Signed-off-by: Soeren Moch &lt;smoch@web.de&gt;
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] dvb: use ktime_t for internal timeout</title>
<updated>2016-07-08T19:36:00+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-06-17T20:46:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e95be15886ac9a931f540073c1c0db299e806f3c'/>
<id>e95be15886ac9a931f540073c1c0db299e806f3c</id>
<content type='text'>
The dvb demuxer code uses a 'struct timespec' to pass a timeout
as absolute time. This will cause problems on 32-bit architectures
in 2038 when time_t overflows, and it is racy with a concurrent
settimeofday() call.

This patch changes the code to use ktime_get() instead, using
the monotonic time base to avoid both the race and the overflow.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The dvb demuxer code uses a 'struct timespec' to pass a timeout
as absolute time. This will cause problems on 32-bit architectures
in 2038 when time_t overflows, and it is racy with a concurrent
settimeofday() call.

This patch changes the code to use ktime_get() instead, using
the monotonic time base to avoid both the race and the overflow.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
