<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/staging/comedi, branch v3.15.2</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.15.2</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.15.2'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2014-05-23T16:31:35+00:00</updated>
<entry>
<title>staging: comedi: ni_daq_700: add mux settling delay</title>
<updated>2014-05-23T16:31:35+00:00</updated>
<author>
<name>Ian Abbott</name>
<email>abbotti@mev.co.uk</email>
</author>
<published>2014-05-19T10:29:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ffed54dced86723f352323f15789d9ad6bee25e1'/>
<id>urn:sha1:ffed54dced86723f352323f15789d9ad6bee25e1</id>
<content type='text'>
I got a patch from the original author, Fred Brooks, to add a small
settling delay after setting the AI channel multiplexor.  The lack of
delay resulted in unstable or scrambled data on faster processors.

Signed-off-by: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Reported-by: Fred Brooks &lt;nsaspook@nsaspook.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.7.x - 3.15.x
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data</title>
<updated>2014-04-23T23:20:15+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hsweeten@visionengravers.com</email>
</author>
<published>2014-03-28T16:20:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2704f807f9498054b8153002bafa3e818079e9a5'/>
<id>urn:sha1:2704f807f9498054b8153002bafa3e818079e9a5</id>
<content type='text'>
In usbdux_ao_cmd(), the channels for the command are transfered from the
cmd-&gt;chanlist and stored in the private data 'ao_chanlist'. The channel
numbers are bit-shifted when stored so that they become the "command"
that is transfered to the device. The channel to command conversion
results in the 'ao_chanlist' having these values for the channels:

  channel 0 -&gt; ao_chanlist = 0x00
  channel 1 -&gt; ao_chanlist = 0x40
  channel 2 -&gt; ao_chanlist = 0x80
  channel 3 -&gt; ao_chanlist = 0xc0

The problem is, the usbduxsub_ao_isoc_irq() function uses the 'chan' value
from 'ao_chanlist' to access the 'ao_readback' array in the private data.
So instead of accessing the array as 0, 1, 2, 3, it accesses it as 0x00,
0x40, 0x80, 0xc0.

Fix this by storing the raw channel number in 'ao_chanlist' and doing the
bit-shift when creating the command.

Fixes: a998a3db530bff80 "staging: comedi: usbdux: cleanup the private data 'outBuffer'"
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.12
Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Reviewed-by: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Acked-by: Bernd Porr &lt;mail@berndporr.me.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: comedi: fix circular locking dependency in comedi_mmap()</title>
<updated>2014-04-16T18:41:45+00:00</updated>
<author>
<name>Ian Abbott</name>
<email>abbotti@mev.co.uk</email>
</author>
<published>2014-04-10T18:41:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b34aa86f12e8848ba453215602c8c50fa63c4cb3'/>
<id>urn:sha1:b34aa86f12e8848ba453215602c8c50fa63c4cb3</id>
<content type='text'>
Mmapping a comedi data buffer with lockdep checking enabled produced the
following kernel debug messages:

======================================================
[ INFO: possible circular locking dependency detected ]
3.5.0-rc3-ija1+ #9 Tainted: G         C
-------------------------------------------------------
comedi_test/4160 is trying to acquire lock:
 (&amp;dev-&gt;mutex#2){+.+.+.}, at: [&lt;ffffffffa00313f4&gt;] comedi_mmap+0x57/0x1d9 [comedi]

but task is already holding lock:
 (&amp;mm-&gt;mmap_sem){++++++}, at: [&lt;ffffffff810c96fe&gt;] vm_mmap_pgoff+0x41/0x76

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #1 (&amp;mm-&gt;mmap_sem){++++++}:
       [&lt;ffffffff8106d0e8&gt;] lock_acquire+0x97/0x105
       [&lt;ffffffff810ce3bc&gt;] might_fault+0x6d/0x90
       [&lt;ffffffffa0031ffb&gt;] do_devinfo_ioctl.isra.7+0x11e/0x14c [comedi]
       [&lt;ffffffffa003227f&gt;] comedi_unlocked_ioctl+0x256/0xe48 [comedi]
       [&lt;ffffffff810f7fcd&gt;] vfs_ioctl+0x18/0x34
       [&lt;ffffffff810f87fd&gt;] do_vfs_ioctl+0x382/0x43c
       [&lt;ffffffff810f88f9&gt;] sys_ioctl+0x42/0x65
       [&lt;ffffffff81415c62&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (&amp;dev-&gt;mutex#2){+.+.+.}:
       [&lt;ffffffff8106c528&gt;] __lock_acquire+0x101d/0x1591
       [&lt;ffffffff8106d0e8&gt;] lock_acquire+0x97/0x105
       [&lt;ffffffff8140c894&gt;] mutex_lock_nested+0x46/0x2a4
       [&lt;ffffffffa00313f4&gt;] comedi_mmap+0x57/0x1d9 [comedi]
       [&lt;ffffffff810d5816&gt;] mmap_region+0x281/0x492
       [&lt;ffffffff810d5c92&gt;] do_mmap_pgoff+0x26b/0x2a7
       [&lt;ffffffff810c971a&gt;] vm_mmap_pgoff+0x5d/0x76
       [&lt;ffffffff810d493f&gt;] sys_mmap_pgoff+0xc7/0x10d
       [&lt;ffffffff81004d36&gt;] sys_mmap+0x16/0x20
       [&lt;ffffffff81415c62&gt;] system_call_fastpath+0x16/0x1b

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;mm-&gt;mmap_sem);
                               lock(&amp;dev-&gt;mutex#2);
                               lock(&amp;mm-&gt;mmap_sem);
  lock(&amp;dev-&gt;mutex#2);

 *** DEADLOCK ***

To avoid the circular dependency, just try to get the lock in
`comedi_mmap()` instead of blocking.  Since the comedi device's main mutex
is heavily used, do a down-read of its `attach_lock` rwsemaphore
instead.  Trying to down-read `attach_lock` should only fail if
some task has down-write locked it, and that is only done while the
comedi device is being attached to or detached from a low-level hardware
device.

Unfortunately, acquiring the `attach_lock` doesn't prevent another
task replacing the comedi data buffer we are trying to mmap.  The
details of the buffer are held in a `struct comedi_buf_map` and pointed
to by `s-&gt;async-&gt;buf_map` where `s` is the comedi subdevice whose buffer
we are trying to map.  The `struct comedi_buf_map` is already reference
counted with a `struct kref`, so we can stop it being freed prematurely.

Modify `comedi_mmap()` to call new function
`comedi_buf_map_from_subdev_get()` to read the subdevice's current
buffer map pointer and increment its reference instead of accessing
`async-&gt;buf_map` directly.  Call `comedi_buf_map_put()` to decrement the
reference once the buffer map structure has been dealt with.  (Note that
`comedi_buf_map_put()` does nothing if passed a NULL pointer.)

`comedi_buf_map_from_subdev_get()` checks the subdevice's buffer map
pointer has been set and the buffer map has been initialized enough for
`comedi_mmap()` to deal with it (specifically, check the `n_pages`
member has been set to a non-zero value).  If all is well, the buffer
map's reference is incremented and a pointer to it is returned.  The
comedi subdevice's spin-lock is used to protect the checks.  Also use
the spin-lock in `__comedi_buf_alloc()` and `__comedi_buf_free()` to
protect changes to the subdevice's buffer map structure pointer and the
buffer map structure's `n_pages` member.  (This checking of `n_pages` is
a bit clunky and I [Ian Abbott] plan to deal with it in the future.)

Signed-off-by: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x, 3.15.x
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: comedi: poc: remove obsolete driver</title>
<updated>2014-03-20T01:57:01+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hsweeten@visionengravers.com</email>
</author>
<published>2014-03-19T23:23:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b6512cfcd279d121cf3fbead627b5724b446aedc'/>
<id>urn:sha1:b6512cfcd279d121cf3fbead627b5724b446aedc</id>
<content type='text'>
The DAC02 board, which is the only board supported by this driver, now
has its own comedi driver (dac02).

Remove this obsolete driver.

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Cc: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Staging: comedi: Fix line over 80 characters in s626.c</title>
<updated>2014-03-19T16:14:22+00:00</updated>
<author>
<name>Ebru Akagunduz</name>
<email>ebru.akagunduz@gmail.com</email>
</author>
<published>2014-03-18T22:13:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3df1d9bddf64031e3196b912f3f37828f045565b'/>
<id>urn:sha1:3df1d9bddf64031e3196b912f3f37828f045565b</id>
<content type='text'>
Fix checkpatch.pl issues line over 80 characters
in s626.c

Signed-off-by: Ebru Akagunduz &lt;ebru.akagunduz@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Staging: comedi: Fix missing space after return type in s626.c</title>
<updated>2014-03-19T16:14:22+00:00</updated>
<author>
<name>Ebru Akagunduz</name>
<email>ebru.akagunduz@gmail.com</email>
</author>
<published>2014-03-18T22:13:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fbdc4001e3dc9e5bec86828654c9c8fe653abf0a'/>
<id>urn:sha1:fbdc4001e3dc9e5bec86828654c9c8fe653abf0a</id>
<content type='text'>
Fix checkpatch.pl issues with missing space after
return type in s626.c

Signed-off-by: Ebru Akagunduz &lt;ebru.akagunduz@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Staging: comedi: proc: title block update</title>
<updated>2014-03-19T04:41:04+00:00</updated>
<author>
<name>Michael Welling</name>
<email>mwelling@ieee.org</email>
</author>
<published>2014-03-19T04:24:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=89509814dce2b8289b4aa3dd9e2e0060f00b71da'/>
<id>urn:sha1:89509814dce2b8289b4aa3dd9e2e0060f00b71da</id>
<content type='text'>
Follow up patch for "STAGING: comedi: style and checkpatch fixes".
Removes the file name in the comment block per suggestions.

Signed-off-by: Michael Welling &lt;mwelling@ieee.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>STAGING: comedi: style and checkpatch fixes</title>
<updated>2014-03-18T20:04:19+00:00</updated>
<author>
<name>Michael Welling</name>
<email>mwelling@ieee.org</email>
</author>
<published>2014-03-18T07:14:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6f2c9efa66d0455e2a5a3de600deaed433e1f3a4'/>
<id>urn:sha1:6f2c9efa66d0455e2a5a3de600deaed433e1f3a4</id>
<content type='text'>
Updates block comment per Documentation/CodingStyle.
Also updated due to checkpatch warnings about qouted string
after Lindent modified the spacing slightly.

Signed-off-by: Michael Welling &lt;mwelling@ieee.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: comedi: das6402: rewrite broken driver</title>
<updated>2014-03-17T21:20:10+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hsweeten@visionengravers.com</email>
</author>
<published>2014-03-14T19:24:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=79e5e6addbb18bf56075f0ff552094a28636dd03'/>
<id>urn:sha1:79e5e6addbb18bf56075f0ff552094a28636dd03</id>
<content type='text'>
This driver is _really_ broken.

It initializes an analog input subdevice that only has a (*cancel)
function. It also does a request_irq() to hookup an interrupt handler
using it-&gt;options[0] as the IRQ. This option is actually the base
address of the I/O region used by the board. If the interrupt handler
actually did get hooked up, the rest of the code assumes that IRQ 10
is being used.

Rewrite the driver to properly support the hardware.

The DAS6402-12/16 boards have 64 single-ended / 32 differential analog
inputs, 2 analog outputs, 8 digital inputs, and 8 digital outputs. Add
proper support for these subdevices.

Stub in the analog input async command support.

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Reviewed-by: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: comedi: rti802: update the MODULE_DESCRIPTION</title>
<updated>2014-03-17T21:20:10+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hartleys@visionengravers.com</email>
</author>
<published>2014-03-13T22:48:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2925cc8637f47efe0ecba3ca4519983fb249ddde'/>
<id>urn:sha1:2925cc8637f47efe0ecba3ca4519983fb249ddde</id>
<content type='text'>
Change the generic MODULE_DESCRIPTION text to something more
specific for this driver.

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Reviewed-by: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
