<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/media/dvb-frontends/rtl2832.c, branch v4.2.2</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] dvb: Get rid of typedev usage for enums</title>
<updated>2015-06-09T20:47:35+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@osg.samsung.com</email>
</author>
<published>2015-06-07T17:53:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0df289a209e02f0926042ab07d7d2595ea2d2e9b'/>
<id>0df289a209e02f0926042ab07d7d2595ea2d2e9b</id>
<content type='text'>
The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.

So, let's do it.

This patch was generated by this shell script:

	for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," &lt;$i &gt;a &amp;&amp; mv a $i; done; done

While here, make CodingStyle fixes on the affected lines.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
Acked-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt; # for drivers/media/firewire/*
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.

So, let's do it.

This patch was generated by this shell script:

	for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," &lt;$i &gt;a &amp;&amp; mv a $i; done; done

While here, make CodingStyle fixes on the affected lines.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
Acked-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt; # for drivers/media/firewire/*
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: add inittab for FC2580 tuner</title>
<updated>2015-05-18T18:55:52+00:00</updated>
<author>
<name>Antti Palosaari</name>
<email>crope@iki.fi</email>
</author>
<published>2015-04-24T01:52:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f88aae9d07ab1612c37cf52fee3a98e1e1eeea69'/>
<id>f88aae9d07ab1612c37cf52fee3a98e1e1eeea69</id>
<content type='text'>
Add reg/val inittab for FC2580 tuner.

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add reg/val inittab for FC2580 tuner.

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: add support for GoTView MasterHD 3 USB tuner</title>
<updated>2015-05-12T16:25:35+00:00</updated>
<author>
<name>Olli Salonen</name>
<email>olli.salonen@iki.fi</email>
</author>
<published>2015-05-05T16:54:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=699dcffc5244388a38f6323afc15ed3833c1ad96'/>
<id>699dcffc5244388a38f6323afc15ed3833c1ad96</id>
<content type='text'>
GoTView MasterHD 3 is a DVB-T2/C USB 2.0 tuner.

It's based on the following components:
- USB bridge: RTL2832P (contains also DVB-T demodulator)
- Demodulator: Si2168-A30
- Tuner: Si2148-A20

The demodulator and the tuner will need firmwares. The Si2148 uses Si2158
firmware. Antti has the firmwares available for download:
http://palosaari.fi/linux/v4l-dvb/firmware/

Do note that for DVB-T either of the demodulators can be used. DVB-C and
DVB-T2 are only supported by the Si2168 demodulator. The driver will
register 2 frontends for the same adapter. Frontend 0 will be the RTL2832
demodulator and frontend 1 will be the Si2168 demodulator. The same
tuner is used for both.

As a consequence of the above, it's recommended to use application that
does implement proper DVBv5 support.

For some reason, the old I2C write method sporadically fails. Thus the
need for an option to only use the new I2C write method supported by the
RTL2832.

Signed-off-by: Olli Salonen &lt;olli.salonen@iki.fi&gt;
Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GoTView MasterHD 3 is a DVB-T2/C USB 2.0 tuner.

It's based on the following components:
- USB bridge: RTL2832P (contains also DVB-T demodulator)
- Demodulator: Si2168-A30
- Tuner: Si2148-A20

The demodulator and the tuner will need firmwares. The Si2148 uses Si2158
firmware. Antti has the firmwares available for download:
http://palosaari.fi/linux/v4l-dvb/firmware/

Do note that for DVB-T either of the demodulators can be used. DVB-C and
DVB-T2 are only supported by the Si2168 demodulator. The driver will
register 2 frontends for the same adapter. Frontend 0 will be the RTL2832
demodulator and frontend 1 will be the Si2168 demodulator. The same
tuner is used for both.

As a consequence of the above, it's recommended to use application that
does implement proper DVBv5 support.

For some reason, the old I2C write method sporadically fails. Thus the
need for an option to only use the new I2C write method supported by the
RTL2832.

Signed-off-by: Olli Salonen &lt;olli.salonen@iki.fi&gt;
Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'patchwork' into v4l_for_linus</title>
<updated>2015-04-21T09:12:35+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@osg.samsung.com</email>
</author>
<published>2015-04-21T09:12:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=676ee36be04985062522804c2de04f0764212be6'/>
<id>676ee36be04985062522804c2de04f0764212be6</id>
<content type='text'>
* patchwork: (404 commits)
  [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL
  [media] uvcvideo: fix cropcap v4l2-compliance failure
  [media] media: omap3isp: remove unused clkdev
  [media] coda: Add tracing support
  [media] coda: drop dma_sync_single_for_device in coda_bitstream_queue
  [media] coda: fix fill bitstream errors in nonstreaming case
  [media] coda: call SEQ_END when the first queue is stopped
  [media] coda: fail to start streaming if userspace set invalid formats
  [media] coda: remove duplicate error messages for buffer allocations
  [media] coda: move parameter buffer in together with context buffer allocation
  [media] coda: allocate bitstream buffer from REQBUFS, size depends on the format
  [media] coda: allocate per-context buffers from REQBUFS
  [media] coda: use strlcpy instead of snprintf
  [media] coda: bitstream payload is unsigned
  [media] coda: fix double call to debugfs_remove
  [media] coda: check kasprintf return value in coda_open
  [media] coda: bitrate can only be set in kbps steps
  [media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove
  [media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init
  [media] coda: set allow_zero_bytesused flag for vb2_queue_init
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* patchwork: (404 commits)
  [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL
  [media] uvcvideo: fix cropcap v4l2-compliance failure
  [media] media: omap3isp: remove unused clkdev
  [media] coda: Add tracing support
  [media] coda: drop dma_sync_single_for_device in coda_bitstream_queue
  [media] coda: fix fill bitstream errors in nonstreaming case
  [media] coda: call SEQ_END when the first queue is stopped
  [media] coda: fail to start streaming if userspace set invalid formats
  [media] coda: remove duplicate error messages for buffer allocations
  [media] coda: move parameter buffer in together with context buffer allocation
  [media] coda: allocate bitstream buffer from REQBUFS, size depends on the format
  [media] coda: allocate per-context buffers from REQBUFS
  [media] coda: use strlcpy instead of snprintf
  [media] coda: bitstream payload is unsigned
  [media] coda: fix double call to debugfs_remove
  [media] coda: check kasprintf return value in coda_open
  [media] coda: bitrate can only be set in kbps steps
  [media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove
  [media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init
  [media] coda: set allow_zero_bytesused flag for vb2_queue_init
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: remove compiler warning</title>
<updated>2015-04-08T16:13:36+00:00</updated>
<author>
<name>Luis de Bethencourt</name>
<email>luis@debethencourt.com</email>
</author>
<published>2015-02-11T11:08:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=203577562449c1889caa3a321be572ed2b972ac9'/>
<id>203577562449c1889caa3a321be572ed2b972ac9</id>
<content type='text'>
Cleaning up the following compiler warning:
rtl2832.c:703:12: warning: 'tmp' may be used uninitialized in this function

Even though it could never happen since if rtl2832_rd_demod_reg () doesn't set
tmp, this line would never run because we go to err. It is still nice to avoid
compiler warnings.

[mchehab@osg.samsung.com: fix a merge conflict with another patch meant
 to fix the same bug, but doing it at the wrong way]
Signed-off-by: Luis de Bethencourt &lt;luis.bg@samsung.com&gt;
Reviewed-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cleaning up the following compiler warning:
rtl2832.c:703:12: warning: 'tmp' may be used uninitialized in this function

Even though it could never happen since if rtl2832_rd_demod_reg () doesn't set
tmp, this line would never run because we go to err. It is still nice to avoid
compiler warnings.

[mchehab@osg.samsung.com: fix a merge conflict with another patch meant
 to fix the same bug, but doing it at the wrong way]
Signed-off-by: Luis de Bethencourt &lt;luis.bg@samsung.com&gt;
Reviewed-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: disable regmap register cache</title>
<updated>2015-04-02T21:26:45+00:00</updated>
<author>
<name>Antti Palosaari</name>
<email>crope@iki.fi</email>
</author>
<published>2015-03-14T14:13:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b3b2bf820e82d7581462dea28a9c3af1bd8cc747'/>
<id>b3b2bf820e82d7581462dea28a9c3af1bd8cc747</id>
<content type='text'>
Caching register reads causes some random I/O errors on channel
change. Disable caching now in order to avoid those errors.

Reverts partly commit dcadb82

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Caching register reads causes some random I/O errors on channel
change. Disable caching now in order to avoid those errors.

Reverts partly commit dcadb82

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: fix compiler warning</title>
<updated>2015-04-02T21:22:54+00:00</updated>
<author>
<name>Hans Verkuil</name>
<email>hverkuil@xs4all.nl</email>
</author>
<published>2015-03-12T07:27:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f2e37b9b733c720de917aa7616cce3a1c52225eb'/>
<id>f2e37b9b733c720de917aa7616cce3a1c52225eb</id>
<content type='text'>
&gt;From the daily build:

rtl2832.c: In function 'rtl2832_read_status':
rtl2832.c:703:12: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized]
  } else if (tmp == 10) {
            ^

The code is OK, it's just the compiler that cannot figure out what's
going on. So just init 'tmp' to 0.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
&gt;From the daily build:

rtl2832.c: In function 'rtl2832_read_status':
rtl2832.c:703:12: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized]
  } else if (tmp == 10) {
            ^

The code is OK, it's just the compiler that cannot figure out what's
going on. So just init 'tmp' to 0.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: declare functions as static</title>
<updated>2015-02-03T18:38:43+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@osg.samsung.com</email>
</author>
<published>2015-02-03T18:34:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bda977b7318a4ec10648fe5f80b6ecb42edea7bb'/>
<id>bda977b7318a4ec10648fe5f80b6ecb42edea7bb</id>
<content type='text'>
drivers/media/dvb-frontends/rtl2832.c:157:5: warning: no previous prototype for ‘rtl2832_bulk_write’ [-Wmissing-prototypes]
 int rtl2832_bulk_write(struct i2c_client *client, unsigned int reg,
     ^
drivers/media/dvb-frontends/rtl2832.c:169:5: warning: no previous prototype for ‘rtl2832_update_bits’ [-Wmissing-prototypes]
 int rtl2832_update_bits(struct i2c_client *client, unsigned int reg,
     ^
drivers/media/dvb-frontends/rtl2832.c:181:5: warning: no previous prototype for ‘rtl2832_bulk_read’ [-Wmissing-prototypes]
 int rtl2832_bulk_read(struct i2c_client *client, unsigned int reg, void *val,

Cc: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
drivers/media/dvb-frontends/rtl2832.c:157:5: warning: no previous prototype for ‘rtl2832_bulk_write’ [-Wmissing-prototypes]
 int rtl2832_bulk_write(struct i2c_client *client, unsigned int reg,
     ^
drivers/media/dvb-frontends/rtl2832.c:169:5: warning: no previous prototype for ‘rtl2832_update_bits’ [-Wmissing-prototypes]
 int rtl2832_update_bits(struct i2c_client *client, unsigned int reg,
     ^
drivers/media/dvb-frontends/rtl2832.c:181:5: warning: no previous prototype for ‘rtl2832_bulk_read’ [-Wmissing-prototypes]
 int rtl2832_bulk_read(struct i2c_client *client, unsigned int reg, void *val,

Cc: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: implement own lock for regmap</title>
<updated>2015-02-03T18:28:12+00:00</updated>
<author>
<name>Antti Palosaari</name>
<email>crope@iki.fi</email>
</author>
<published>2014-12-18T10:22:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b410dae43cd0dc9aa07f9ada54a7b78d0fd75566'/>
<id>b410dae43cd0dc9aa07f9ada54a7b78d0fd75566</id>
<content type='text'>
Introduce own lock to silence lockdep warning. lockdep validator
makes wrong decision when two similar (&amp;map-&gt;mutex) locks were taken
recursively, even those are different mutexes in a two different
drivers. After that patch, functionality remains same, but mutex names
are different. That is a temporary hack, proper solution is make
regmap aware of locked nested locking rules.

=============================================
[ INFO: possible recursive locking detected ]
3.18.0-rc4+ #4 Tainted: G           O
---------------------------------------------
kdvb-ad-0-fe-0/2814 is trying to acquire lock:
 (&amp;map-&gt;mutex){+.+.+.}, at: [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40

but task is already holding lock:
 (&amp;map-&gt;mutex){+.+.+.}, at: [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40

other info that might help us debug this:
 Possible unsafe locking scenario:
       CPU0
       ----
  lock(&amp;map-&gt;mutex);
  lock(&amp;map-&gt;mutex);

 *** DEADLOCK ***
 May be due to missing lock nesting notation
1 lock held by kdvb-ad-0-fe-0/2814:
 #0:  (&amp;map-&gt;mutex){+.+.+.}, at: [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40

stack backtrace:
CPU: 3 PID: 2814 Comm: kdvb-ad-0-fe-0 Tainted: G           O 3.18.0-rc4+ #4
Hardware name: System manufacturer System Product Name/M5A78L-M/USB3, BIOS 2001    09/11/2014
 0000000000000000 00000000410c8772 ffff880293af3868 ffffffff817a6f82
 0000000000000000 ffff8800b3462be0 ffff880293af3968 ffffffff810e7f94
 ffff880293af3888 00000000410c8772 ffffffff82dfee60 ffffffff81ab8f89
Call Trace:
 [&lt;ffffffff817a6f82&gt;] dump_stack+0x4e/0x68
 [&lt;ffffffff810e7f94&gt;] __lock_acquire+0x1ea4/0x1f50
 [&lt;ffffffff810e2a7d&gt;] ? trace_hardirqs_off+0xd/0x10
 [&lt;ffffffff817b01f3&gt;] ? _raw_spin_lock_irqsave+0x83/0xa0
 [&lt;ffffffff810e13e6&gt;] ? up+0x16/0x50
 [&lt;ffffffff810e2a7d&gt;] ? trace_hardirqs_off+0xd/0x10
 [&lt;ffffffff817af8bf&gt;] ? _raw_spin_unlock_irqrestore+0x5f/0x70
 [&lt;ffffffff810e9069&gt;] lock_acquire+0xc9/0x170
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff817ab50e&gt;] mutex_lock_nested+0x7e/0x430
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff817a530b&gt;] ? printk+0x70/0x86
 [&lt;ffffffff8110d9e8&gt;] ? mod_timer+0x168/0x240
 [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff814f08d9&gt;] regmap_update_bits+0x29/0x60
 [&lt;ffffffffa03e9778&gt;] rtl2832_select+0x38/0x70 [rtl2832]
 [&lt;ffffffffa039b03d&gt;] i2c_mux_master_xfer+0x3d/0x90 [i2c_mux]
 [&lt;ffffffff815da493&gt;] __i2c_transfer+0x73/0x2e0
 [&lt;ffffffff815dbaba&gt;] i2c_transfer+0x5a/0xc0
 [&lt;ffffffff815dbb6e&gt;] i2c_master_send+0x4e/0x70
 [&lt;ffffffffa03ff25a&gt;] regmap_i2c_write+0x1a/0x50 [regmap_i2c]
 [&lt;ffffffff817ab713&gt;] ? mutex_lock_nested+0x283/0x430
 [&lt;ffffffff814f06b2&gt;] _regmap_raw_write+0x862/0x880
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff814f0744&gt;] _regmap_bus_raw_write+0x74/0xa0
 [&lt;ffffffff814ef3d2&gt;] _regmap_write+0x92/0x140
 [&lt;ffffffff814f0b7b&gt;] regmap_write+0x4b/0x70
 [&lt;ffffffffa032b090&gt;] ? dvb_frontend_release+0x110/0x110 [dvb_core]
 [&lt;ffffffffa05141d4&gt;] e4000_init+0x34/0x210 [e4000]
 [&lt;ffffffffa032a029&gt;] dvb_frontend_init+0x59/0xc0 [dvb_core]
 [&lt;ffffffff810bde30&gt;] ? finish_task_switch+0x80/0x180
 [&lt;ffffffff810bddf2&gt;] ? finish_task_switch+0x42/0x180
 [&lt;ffffffffa032b116&gt;] dvb_frontend_thread+0x86/0x7b0 [dvb_core]
 [&lt;ffffffff817a9203&gt;] ? __schedule+0x343/0x930
 [&lt;ffffffffa032b090&gt;] ? dvb_frontend_release+0x110/0x110 [dvb_core]
 [&lt;ffffffff810b826b&gt;] kthread+0x10b/0x130
 [&lt;ffffffff81020099&gt;] ? sched_clock+0x9/0x10
 [&lt;ffffffff810b8160&gt;] ? kthread_create_on_node+0x250/0x250
 [&lt;ffffffff817b063c&gt;] ret_from_fork+0x7c/0xb0
 [&lt;ffffffff810b8160&gt;] ? kthread_create_on_node+0x250/0x250

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce own lock to silence lockdep warning. lockdep validator
makes wrong decision when two similar (&amp;map-&gt;mutex) locks were taken
recursively, even those are different mutexes in a two different
drivers. After that patch, functionality remains same, but mutex names
are different. That is a temporary hack, proper solution is make
regmap aware of locked nested locking rules.

=============================================
[ INFO: possible recursive locking detected ]
3.18.0-rc4+ #4 Tainted: G           O
---------------------------------------------
kdvb-ad-0-fe-0/2814 is trying to acquire lock:
 (&amp;map-&gt;mutex){+.+.+.}, at: [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40

but task is already holding lock:
 (&amp;map-&gt;mutex){+.+.+.}, at: [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40

other info that might help us debug this:
 Possible unsafe locking scenario:
       CPU0
       ----
  lock(&amp;map-&gt;mutex);
  lock(&amp;map-&gt;mutex);

 *** DEADLOCK ***
 May be due to missing lock nesting notation
1 lock held by kdvb-ad-0-fe-0/2814:
 #0:  (&amp;map-&gt;mutex){+.+.+.}, at: [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40

stack backtrace:
CPU: 3 PID: 2814 Comm: kdvb-ad-0-fe-0 Tainted: G           O 3.18.0-rc4+ #4
Hardware name: System manufacturer System Product Name/M5A78L-M/USB3, BIOS 2001    09/11/2014
 0000000000000000 00000000410c8772 ffff880293af3868 ffffffff817a6f82
 0000000000000000 ffff8800b3462be0 ffff880293af3968 ffffffff810e7f94
 ffff880293af3888 00000000410c8772 ffffffff82dfee60 ffffffff81ab8f89
Call Trace:
 [&lt;ffffffff817a6f82&gt;] dump_stack+0x4e/0x68
 [&lt;ffffffff810e7f94&gt;] __lock_acquire+0x1ea4/0x1f50
 [&lt;ffffffff810e2a7d&gt;] ? trace_hardirqs_off+0xd/0x10
 [&lt;ffffffff817b01f3&gt;] ? _raw_spin_lock_irqsave+0x83/0xa0
 [&lt;ffffffff810e13e6&gt;] ? up+0x16/0x50
 [&lt;ffffffff810e2a7d&gt;] ? trace_hardirqs_off+0xd/0x10
 [&lt;ffffffff817af8bf&gt;] ? _raw_spin_unlock_irqrestore+0x5f/0x70
 [&lt;ffffffff810e9069&gt;] lock_acquire+0xc9/0x170
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff817ab50e&gt;] mutex_lock_nested+0x7e/0x430
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff817a530b&gt;] ? printk+0x70/0x86
 [&lt;ffffffff8110d9e8&gt;] ? mod_timer+0x168/0x240
 [&lt;ffffffff814ec90f&gt;] regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff814f08d9&gt;] regmap_update_bits+0x29/0x60
 [&lt;ffffffffa03e9778&gt;] rtl2832_select+0x38/0x70 [rtl2832]
 [&lt;ffffffffa039b03d&gt;] i2c_mux_master_xfer+0x3d/0x90 [i2c_mux]
 [&lt;ffffffff815da493&gt;] __i2c_transfer+0x73/0x2e0
 [&lt;ffffffff815dbaba&gt;] i2c_transfer+0x5a/0xc0
 [&lt;ffffffff815dbb6e&gt;] i2c_master_send+0x4e/0x70
 [&lt;ffffffffa03ff25a&gt;] regmap_i2c_write+0x1a/0x50 [regmap_i2c]
 [&lt;ffffffff817ab713&gt;] ? mutex_lock_nested+0x283/0x430
 [&lt;ffffffff814f06b2&gt;] _regmap_raw_write+0x862/0x880
 [&lt;ffffffff814ec90f&gt;] ? regmap_lock_mutex+0x2f/0x40
 [&lt;ffffffff814f0744&gt;] _regmap_bus_raw_write+0x74/0xa0
 [&lt;ffffffff814ef3d2&gt;] _regmap_write+0x92/0x140
 [&lt;ffffffff814f0b7b&gt;] regmap_write+0x4b/0x70
 [&lt;ffffffffa032b090&gt;] ? dvb_frontend_release+0x110/0x110 [dvb_core]
 [&lt;ffffffffa05141d4&gt;] e4000_init+0x34/0x210 [e4000]
 [&lt;ffffffffa032a029&gt;] dvb_frontend_init+0x59/0xc0 [dvb_core]
 [&lt;ffffffff810bde30&gt;] ? finish_task_switch+0x80/0x180
 [&lt;ffffffff810bddf2&gt;] ? finish_task_switch+0x42/0x180
 [&lt;ffffffffa032b116&gt;] dvb_frontend_thread+0x86/0x7b0 [dvb_core]
 [&lt;ffffffff817a9203&gt;] ? __schedule+0x343/0x930
 [&lt;ffffffffa032b090&gt;] ? dvb_frontend_release+0x110/0x110 [dvb_core]
 [&lt;ffffffff810b826b&gt;] kthread+0x10b/0x130
 [&lt;ffffffff81020099&gt;] ? sched_clock+0x9/0x10
 [&lt;ffffffff810b8160&gt;] ? kthread_create_on_node+0x250/0x250
 [&lt;ffffffff817b063c&gt;] ret_from_fork+0x7c/0xb0
 [&lt;ffffffff810b8160&gt;] ? kthread_create_on_node+0x250/0x250

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] rtl2832: remove internal mux I2C adapter</title>
<updated>2015-02-03T18:23:09+00:00</updated>
<author>
<name>Antti Palosaari</name>
<email>crope@iki.fi</email>
</author>
<published>2014-12-18T09:30:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0d117901b6ecb67f863345d283dcc09a479232ab'/>
<id>0d117901b6ecb67f863345d283dcc09a479232ab</id>
<content type='text'>
There was 2 muxed I2C adapters, one for demod tuner bus and one for
internal use. Idea of internal I2C adapter was to force I2C repeater
close when demod access its registers. Driver has also delayed work
queue based method to close I2C repeater.

After regmap conversion internal I2C adapter based repeater close
left unused - only work queue method was in use. We could not use
internal mux adapter method with regmap as it makes recursive regmap
call, which causes deadlock as regmap has own locking. Due to that
remove whole method totally.

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was 2 muxed I2C adapters, one for demod tuner bus and one for
internal use. Idea of internal I2C adapter was to force I2C repeater
close when demod access its registers. Driver has also delayed work
queue based method to close I2C repeater.

After regmap conversion internal I2C adapter based repeater close
left unused - only work queue method was in use. We could not use
internal mux adapter method with regmap as it makes recursive regmap
call, which causes deadlock as regmap has own locking. Due to that
remove whole method totally.

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
