]> Pileus Git - ~andy/linux/log
~andy/linux
10 years agostaging:iio:ade7758: Remove redundant call to iio_sw_buffer_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
staging:iio:ade7758: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad5933: Remove redundant call to iio_sw_buffer_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
staging:iio:ad5933: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:simple-dummy: Remove redundant call to iio_sw_buffer_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
staging:iio:simple-dummy: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:mxs-lradc: Remove redundant call to iio_sw_buffer_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
staging:iio:mxs-lradc: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:lis3l02dq: Remove redundant call to iio_sw_buffer_preenable().
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
staging:iio:lis3l02dq: Remove redundant call to iio_sw_buffer_preenable().

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:gp2ap020a00f: Remove redundant call to iio_sw_buffer_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:gp2ap020a00f: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:st_pressure: Remove redundant call to iio_sw_buffer_preenable().
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:st_pressure: Remove redundant call to iio_sw_buffer_preenable().

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:st_magn: Remove redundant call to iio_sw_buffer_preenable().
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:st_magn: Remove redundant call to iio_sw_buffer_preenable().

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:triggered-buffer: Remove redundant call to iio_sw_buffer_preenable().
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:triggered-buffer: Remove redundant call to iio_sw_buffer_preenable().

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:st_gyro: Remove redundant call to iio_sw_buffer_preenable().
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:st_gyro: Remove redundant call to iio_sw_buffer_preenable().

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:ti_am335x: Remove redundant call to iio_sw_buffer_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:ti_am335x: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer
core, so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:ad_sigma_delta: Remove redundant call to iio_sw_buffer_preenable().
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:ad_sigma_delta: Remove redundant call to iio_sw_buffer_preenable().

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:ad7887: Remove redundant call to iio_sw_buffer_preenable().
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:ad7887: Remove redundant call to iio_sw_buffer_preenable().

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:ad7266: Remove redundant call to iio_sw_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:ad7266: Remove redundant call to iio_sw_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:st_accel: Drop redundant call to iio_sw_buffer_preenable()
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio:st_accel: Drop redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core,
so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Update buffer's bytes per datum after updating the scan mask
Lars-Peter Clausen [Mon, 14 Oct 2013 16:49:00 +0000 (17:49 +0100)]
iio: Update buffer's bytes per datum after updating the scan mask

Currently a IIO device driver needs to make sure to update the buffer's bytes
per datum after the scan mask has changed. This is usually done in the preenable
callback by invoking iio_sw_buffer_preenable(). This is something that needs to
be done and is done for virtually all devices which support buffers (we
currently have only one exception). Also this a bit of a layering violation
since we have to call the buffer setup ops from the device setup ops. This
requires the device driver to know about the internal requirements of the buffer
(e.g. whether we need to call the set_bytes_per_datum) callback. And especially
with in-kernel buffer consumers, which allows to attach arbitrary buffers to a
device, this is something that the driver can't know.

Moving this to the core allows us to drop the individual calls to
iio_sw_buffer_preenable() from drivers.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Denis Ciocca <denis.ciocca@st.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:kfifo: Set update_needed to false after allocating a new buffer
Lars-Peter Clausen [Tue, 15 Oct 2013 08:30:00 +0000 (09:30 +0100)]
iio:kfifo: Set update_needed to false after allocating a new buffer

update_needed is used to decide whether the kfifo buffer needs to be
re-allocated. It is set to true whenever the size of the buffer is changed. It
is never set to false though, causing the buffer to always be re-allocated.
Setting update_needed to false after the new buffer has been allocated fixes the
problem.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:kfifo: Empty buffer on update
Lars-Peter Clausen [Tue, 15 Oct 2013 08:30:00 +0000 (09:30 +0100)]
iio:kfifo: Empty buffer on update

The kfifo's request_update callback will free the current buffer and allocate a
new one if the size has changed. This will remove any samples that might still
be left in the buffer. If the size has not changed the buffer content is
left untouched though. This is a bit inconsistent and might cause an application
to see data from a previous capture. This patch inserts a call to
kfifo_reset_out() when the size did not change. This makes sure that any pending
samples are removed from the buffer.

Note, due to a different bug the buffer is currently always re-allocated, even
if the size did not change. So this patch will not change the behavior. In the
next patch the bug will be fixed and this patch makes sure that the current
behavior is kept.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:kfifo: Protect against concurrent access from userspace
Lars-Peter Clausen [Tue, 15 Oct 2013 08:30:00 +0000 (09:30 +0100)]
iio:kfifo: Protect against concurrent access from userspace

It is possible for userspace to concurrently access the buffer from multiple
threads or processes. To avoid corruption of the internal state of the buffer we
need to add proper locking. It is possible for multiple processes to try to read
from the buffer concurrently and it is also possible that one process causes a
buffer re-allocation while a different process still access the buffer. Both can
be fixed by protecting the calls to kfifo_to_user() and kfifo_alloc() by the
same mutex. In iio_read_first_n_kfifo() we also use kfifo_recsize() instead of
the buffers bytes_per_datum to avoid a race that can happen if bytes_per_datum
has been changed, but the buffer has not been reallocated yet.

Note that all access to the buffer from within the kernel is already properly
synchronized, so there is no need for extra locking in iio_store_to_kfifo().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:kfifo: Fix memory leak
Lars-Peter Clausen [Tue, 15 Oct 2013 08:30:00 +0000 (09:30 +0100)]
iio:kfifo: Fix memory leak

We need to free the kfifo when we release the buffer, otherwise the fifos memory
will be leaked.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
Lars-Peter Clausen [Sat, 12 Oct 2013 13:55:00 +0000 (14:55 +0100)]
staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set

None of the SPEAr, LPC32XX or MXS ADC drivers have a compile time dependency on
their respective platform. So make it possible to build the drivers when
CONFIG_COMPILE_TEST is set. This makes it easier to compile test changes.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Roland Stigge <stigge@antcom.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:mxs-lradc: Select STMP_DEVICE
Lars-Peter Clausen [Sat, 12 Oct 2013 13:55:00 +0000 (14:55 +0100)]
staging:iio:mxs-lradc: Select STMP_DEVICE

The MXS ADC driver uses the stmp_reset_block() which is only provided when the
STMP_DEVICE Kconfig symbol is selected. Hence the driver should select this
symbol. So far this has not been a problem since the driver depends on ARCH_MXS,
which already selects STMP_DEVICE, but will become necessary once we allow the
driver to be built when COMPILE_TEST is selected.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:spear_adc: Fix sparse warning
Lars-Peter Clausen [Sat, 12 Oct 2013 13:55:00 +0000 (14:55 +0100)]
staging:iio:spear_adc: Fix sparse warning

The driver is casting from one __iomem pointer to another. Make sure to include
__iomem in the cast, otherwise sparse will complain with the following warning:

drivers/staging/iio/adc/spear_adc.c:321:18: warning: cast removes address space of expression
drivers/staging/iio/adc/spear_adc.c:320:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/iio/adc/spear_adc.c:320:33:    expected struct adc_regs_spear3xx [noderef] <asn:2>*adc_base_spear3xx
drivers/staging/iio/adc/spear_adc.c:320:33:    got struct adc_regs_spear3xx *<noident>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:spear_adc: Remove unused variable
Lars-Peter Clausen [Mon, 7 Oct 2013 13:26:00 +0000 (14:26 +0100)]
staging:iio:spear_adc: Remove unused variable

Remove the scale_mv variable from the read_raw() callback. Fixes the following
warning:
drivers/staging/iio/adc/spear_adc.c: In function 'spear_read_raw':
drivers/staging/iio/adc/spear_adc.c:149:6: warning: unused variable 'scale_mv'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:buffer: Ignore noop requests for iio_update_buffers()
Lars-Peter Clausen [Fri, 4 Oct 2013 11:07:00 +0000 (12:07 +0100)]
iio:buffer: Ignore noop requests for iio_update_buffers()

Since the kernel now disables all buffers when a device is unregistered it might
happen that a in-kernel consumer tries to disable that buffer again. So ignore
requests where the buffer already is in the desired state.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad7291: Use event spec for threshold hysteresis
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:ad7291: Use event spec for threshold hysteresis

Register the event threshold hysteresis attributes by using the new
IIO_EV_INFO_HYSTERESIS event spec type. This allows us to throw away a good
portion of boiler-plate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad799x: Use event spec for threshold hysteresis
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:ad799x: Use event spec for threshold hysteresis

Register the event threshold hysteresis attributes by using the new
IIO_EV_INFO_HYSTERESIS event spec type. This allows us to throw away a good
portion of boiler-plate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad799x: Simplify threshold register look-up
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:ad799x: Simplify threshold register look-up

Given a channel number the corresponding threshold and hysteresis registers can
easily be calculated. No need to use a look-up table.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Add a hysteresis event info attribute
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio: Add a hysteresis event info attribute

For some devices it is possible to configure a hysteresis for threshold (or
similar) events. This patch adds a new hysteresis event info type which allows
for easy creation and read/write handling of the sysfs attribute.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:tsl2x7x: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:tsl2x7x: Switch to new event config interface

Switch the tsl2x7x driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:simple_dummy: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:simple_dummy: Switch to new event config interface

Switch the simple_dummy driver to the new IIO event config interface as the old
one is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad7150: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:ad7150: Switch to new event config interface

Switch the ad7150 driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad799x: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:ad799x: Switch to new event config interface

Switch the ad799x driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad7291: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:ad7291: Switch to new event config interface

Switch the ad7291 driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:sca3000: Switch to new config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:sca3000: Switch to new config interface

Switch the sca3000 driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:lis2l02dq: Share threshold value between axis
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:lis2l02dq: Share threshold value between axis

The threshold event can be enabled/disabled separately, but the threshold value
is shared between all three axis.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:lis3l02dq: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
staging:iio:lis3l02dq: Switch to new event config interface

Switch the lis3l02dq driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:apds9300: Use new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio:apds9300: Use new event config interface

Switch the apds9300 driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:tsl2563: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio:tsl2563: Switch to new event config interface

Switch the tsl2563 driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:gp2ap020a00f: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio:gp2ap020a00f: Switch to new event config interface

Switch the gp2ap020a00f driver to the new IIO event config interface as the old
one is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:ad5421: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio:ad5421: Switch to new event config interface

Switch the ad5421 driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:max1363: Switch to new event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio:max1363: Switch to new event config interface

Switch the max1363 driver to the new IIO event config interface as the old one
is going to be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Extend the event config interface
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio: Extend the event config interface

The event configuration interface of the IIO framework has not been getting the
same attention as other parts. As a result it has not seen the same improvements
as e.g. the channel interface has seen with the introduction of the channel spec
struct. Currently all the event config callbacks take a u64 (the so called event
code) to pass all the different information about for which event the callback
is invoked. The callback function then has to extract the information it is
interested in using some macros with rather long names. Most information encoded
in the event code comes straight from the iio_chan_spec struct the event was
registered for. Since we always have a handle to the channel spec when we call
the event callbacks the first step is to add the channel spec as a parameter to
the event callbacks. The two remaining things encoded in the event code are the
type and direction of the event. Instead of passing them in one parameter, add
one parameter for each of them and remove the eventcode from the event
callbacks. The patch also adds a new iio_event_info parameter to the
{read,write}_event_value callbacks. This makes it possible, similar to the
iio_chan_info_enum for channels, to specify additional properties other than
just the value for an event. Furthermore the new interface will allow to
register shared events. This is e.g. useful if a device allows configuring a
threshold event, but the threshold setting is the same for all channels.

To implement this the patch adds a new iio_event_spec struct which is similar to
the iio_chan_spec struct. It as two field to specify the type and the direction
of the event. Furthermore it has a mask field for each one of the different
iio_shared_by types. These mask fields holds which kind of attributes should be
registered for the event. Creation of the attributes follows the same rules as
the for the channel attributes. E.g. for the separate_mask there will be a
attribute for each channel with this event, for the shared_by_type there will
only be one attribute per channel type. The iio_chan_spec struct gets two new
fields, 'event_spec' and 'num_event_specs', which is used to specify which the
events for this channel. These two fields are going to replace the channel's
event_mask field.

For now both the old and the new event config interface coexist, but over the
few patches all drivers will be converted from the old to the new interface.
Once that is done all code for supporting the old interface will be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Factor IIO value formating into its own function
Lars-Peter Clausen [Mon, 7 Oct 2013 14:11:00 +0000 (15:11 +0100)]
iio: Factor IIO value formating into its own function

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging: iio: generic_buffer: initialize ret
Sebastian Andrzej Siewior [Mon, 7 Oct 2013 12:42:00 +0000 (13:42 +0100)]
staging: iio: generic_buffer: initialize ret

The `ret´ variable is only initialized in the error case. For some reason
it was always != 0 while I played with generic_buffer so here is a patch.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Add a helper to free a list of IIO device attributes
Lars-Peter Clausen [Mon, 7 Oct 2013 11:50:00 +0000 (12:50 +0100)]
iio: Add a helper to free a list of IIO device attributes

We have the same code to free a IIO device attribute list in multiple place.
This patch adds a new helper function to take care of this and replaces the
custom instances with a call to the helper function. Note that we do not need to
call list_del() for each of the list items since we will never look at any of
the list items nor the list itself again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio:buffer: Add proper locking for iio_update_buffers()
Lars-Peter Clausen [Fri, 4 Oct 2013 11:07:00 +0000 (12:07 +0100)]
iio:buffer: Add proper locking for iio_update_buffers()

We need to make sure that in-kernel users of iio_update_buffers() do not race
against each other or against unregistration of the device. So we need to take
both the mlock and the info_exist_lock when calling iio_update_buffers() from a
in-kernel consumer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Wakeup poll and blocking reads when the device is unregistered
Lars-Peter Clausen [Fri, 4 Oct 2013 11:07:00 +0000 (12:07 +0100)]
iio: Wakeup poll and blocking reads when the device is unregistered

Once the device has been unregistered there won't be any new data no matter how
long a userspace application waits, so we might as well wake them up and let
them know.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Return -ENODEV for file operations if the device has been unregistered
Lars-Peter Clausen [Fri, 4 Oct 2013 11:06:00 +0000 (12:06 +0100)]
iio: Return -ENODEV for file operations if the device has been unregistered

If the IIO device has been unregistered return -ENODEV for any further file
operations like read() and ioctl(). This avoids userspace being able to grab new
references to the device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: Add reference counting for buffers
Lars-Peter Clausen [Fri, 4 Oct 2013 11:06:00 +0000 (12:06 +0100)]
iio: Add reference counting for buffers

Since the buffer is accessed by userspace we can not just free the buffers
memory once we are done with it in kernel space. There might still be open file
descriptors and userspace still might be accessing the buffer. This patch adds
support for reference counting to the IIO buffers. When a buffer is created and
initialized its initial reference count is set to 1. Instead of freeing the
memory of the buffer the buffer's _free() function will drop that reference
again. But only after the last reference to the buffer has been dropped the
buffer the buffer's memory will be freed. The IIO device will take a reference
to its primary buffer. The patch adds a small helper function for this called
iio_device_attach_buffer() which will get a reference to the buffer and assign
the buffer to the IIO device. This function must be used instead of assigning
the buffer to the device by hand. The reference is only dropped once the IIO
device is freed and we can be sure that there are no more open file handles. A
reference to a buffer will also be taken whenever the buffer is active to avoid
the buffer being freed while data is still being send to it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: at91: move the num_channels from DT to driver itself
Josh Wu [Tue, 8 Oct 2013 03:48:00 +0000 (04:48 +0100)]
iio: at91: move the num_channels from DT to driver itself

CC: devicetree@vger.kernel.org
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoiio: at91: ADC start-up time calculation changed since at91sam9x5
Josh Wu [Tue, 8 Oct 2013 03:48:00 +0000 (04:48 +0100)]
iio: at91: ADC start-up time calculation changed since at91sam9x5

Since in at91sam9x5, sama5d3x chip. the start up time calucation is changed.
This patch can choose different start up time calculation formula for different
chips.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agoStaging: iio: adt7316-i2c: quoted string split across lines
Ebru Akagunduz [Sun, 6 Oct 2013 12:46:15 +0000 (15:46 +0300)]
Staging: iio: adt7316-i2c: quoted string split across lines

Fix checkpatch.pl issues with quoted string split across lines in adt7316-i2c.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: iio: adt7316-spi: fix quoted string split across lines
Ebru Akagunduz [Sun, 6 Oct 2013 12:49:57 +0000 (15:49 +0300)]
Staging: iio: adt7316-spi: fix quoted string split across lines

Fix checkpatch.pl issues with quoted string split across lines in adt7316-spi.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: iio: printk(KERN_INFO ...
Ebru Akagunduz [Sun, 6 Oct 2013 12:15:38 +0000 (15:15 +0300)]
Staging: iio: printk(KERN_INFO ...

Fix checkpatch.pl issues with prefer netdev_info(netdev, .. then dev_info(dev, ..
then pr_info(...  to printk(KERN_INFO .. in lis3l02dq_ring.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: iio: space prohibited before semicolon
Ebru Akagunduz [Sun, 6 Oct 2013 12:15:37 +0000 (15:15 +0300)]
Staging: iio: space prohibited before semicolon

Fix checkpatch.pl issues with space prohibited before semicolon in
lis3l02dq_ring.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: iio: iio_simple_dummy: fix line over 80 characters
Ebru Akagunduz [Sun, 6 Oct 2013 11:46:47 +0000 (14:46 +0300)]
Staging: iio: iio_simple_dummy: fix line over 80 characters

Fix checkpatch.pl issues with line over 80 characters in
iio_simple_dummy.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: xillybus: quoted strings split across lines
Ebru Akagunduz [Sat, 5 Oct 2013 15:08:49 +0000 (18:08 +0300)]
Staging: xillybus: quoted strings split across lines

Fix checkpatch.pl issues with quoted strings split across lines in xillybus_core.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: keucr: fix quoted string split across lines
Ebru Akagunduz [Sat, 5 Oct 2013 14:11:39 +0000 (17:11 +0300)]
Staging: keucr: fix quoted string split across lines

Fix checkpatch.pl issues quoted string split across lines in usb.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: tidspbridge: fix no space before tabs
Ebru Akagunduz [Sat, 5 Oct 2013 14:09:45 +0000 (17:09 +0300)]
Staging: tidspbridge: fix no space before tabs

Fix checkpatch.pl issues please, no space before tabs in
drivers/staging/tidspbridge/rmgr/dspdrv.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/media/go7007:Replace kern_debug with pr_debug
Dulshani Gunawardhana [Fri, 4 Oct 2013 21:19:18 +0000 (02:49 +0530)]
staging/media/go7007:Replace kern_debug with pr_debug

Replace kern_debug with pr_debug in go7007-usb.c

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/cxt1e1:Fixes suspect code indent warning
Dulshani Gunawardhana [Thu, 3 Oct 2013 19:35:23 +0000 (01:05 +0530)]
staging/cxt1e1:Fixes suspect code indent warning

Fixes checkpatch.pl warning "suspect code indent for conditional
statements" for comet.c.

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-ethernet: allow to use only 1 CPU for packet processing
Aaro Koskinen [Sun, 6 Oct 2013 20:35:16 +0000 (23:35 +0300)]
staging: octeon-ethernet: allow to use only 1 CPU for packet processing

Module parameter max_rx_cpus has off-by-one error. Fix that.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-ethernet: allow to set IRQ smp_affinity freely
Aaro Koskinen [Sun, 6 Oct 2013 20:35:15 +0000 (23:35 +0300)]
staging: octeon-ethernet: allow to set IRQ smp_affinity freely

Currently the driver assumes that CPU 0 is handling all the hard IRQs.
This is wrong in Linux SMP systems where user is allowed to assign to
hardware IRQs to any CPU. The driver will stop working if user sets
smp_affinity so that interrupts end up being handled by other than CPU
0. The patch fixes that.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: refactor __cvmx_usb_pipe_needs_split
Aaro Koskinen [Sun, 6 Oct 2013 19:22:37 +0000 (22:22 +0300)]
staging: octeon-usb: refactor __cvmx_usb_pipe_needs_split

Split a long line and remove redundant parenthesis.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: eliminate submit_handle
Aaro Koskinen [Sun, 6 Oct 2013 19:22:36 +0000 (22:22 +0300)]
staging: octeon-usb: eliminate submit_handle

Eliminate submit_handle, use a direct reference instead.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: eliminate pipe_handle
Aaro Koskinen [Sun, 6 Oct 2013 19:22:35 +0000 (22:22 +0300)]
staging: octeon-usb: eliminate pipe_handle

Eliminate pipe_handle, use a direct reference instead.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: clean up hcpriv usage
Aaro Koskinen [Sun, 6 Oct 2013 19:22:34 +0000 (22:22 +0300)]
staging: octeon-usb: clean up hcpriv usage

Use ep->hcpriv for pipe handle and urb->hcpriv for submit handle,
instead of packing both into the same field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: cvmx_usb_submit_control: get params from urb
Aaro Koskinen [Sun, 6 Oct 2013 19:22:33 +0000 (22:22 +0300)]
staging: octeon-usb: cvmx_usb_submit_control: get params from urb

Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: cvmx_usb_submit_interrupt: get params from urb
Aaro Koskinen [Sun, 6 Oct 2013 19:22:32 +0000 (22:22 +0300)]
staging: octeon-usb: cvmx_usb_submit_interrupt: get params from urb

Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: cvmx_usb_submit_control: get params from urb
Aaro Koskinen [Sun, 6 Oct 2013 19:22:31 +0000 (22:22 +0300)]
staging: octeon-usb: cvmx_usb_submit_control: get params from urb

Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: cvmx_usb_submit_bulk: get params from urb
Aaro Koskinen [Sun, 6 Oct 2013 19:22:30 +0000 (22:22 +0300)]
staging: octeon-usb: cvmx_usb_submit_bulk: get params from urb

Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: replace generic transfer callback data with urb
Aaro Koskinen [Sun, 6 Oct 2013 19:22:29 +0000 (22:22 +0300)]
staging: octeon-usb: replace generic transfer callback data with urb

URB is always passed, so we can use strong typing here.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: call transfer completion callback directly
Aaro Koskinen [Sun, 6 Oct 2013 19:22:28 +0000 (22:22 +0300)]
staging: octeon-usb: call transfer completion callback directly

The callback is always the same, we can just call it directly.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: call port change callback directly
Aaro Koskinen [Sun, 6 Oct 2013 19:22:27 +0000 (22:22 +0300)]
staging: octeon-usb: call port change callback directly

Call port change callback directly.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: inline cvmx_usb_set_status
Aaro Koskinen [Sun, 6 Oct 2013 19:22:26 +0000 (22:22 +0300)]
staging: octeon-usb: inline cvmx_usb_set_status

Inline a trivial function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: eliminate cvmx_usb_internal_state
Aaro Koskinen [Sun, 6 Oct 2013 19:22:25 +0000 (22:22 +0300)]
staging: octeon-usb: eliminate cvmx_usb_internal_state

Eliminate cvmx_usb_internal_state, just use cvmx_usb_state everywhere.
This also enables to allocate only the needed amount of data for the
USB internal state, instead of always allocating 64 KB.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-usb: merge cvmx-usb into octeon-hcd
Aaro Koskinen [Sun, 6 Oct 2013 19:22:24 +0000 (22:22 +0300)]
staging: octeon-usb: merge cvmx-usb into octeon-hcd

cvmx-usb module provided Cavium "OS abstraction layer" for USB
functionality. To make this driver a proper Linux driver, we need to
refactor this layer out. By making all the code internal to the HCD
driver makes this task easier.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge 3.12-rc4 into staging-next
Greg Kroah-Hartman [Mon, 7 Oct 2013 00:22:43 +0000 (17:22 -0700)]
Merge 3.12-rc4 into staging-next

We want the staging fixes in this branch as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoLinux 3.12-rc4 v3.12-rc4
Linus Torvalds [Sun, 6 Oct 2013 21:00:20 +0000 (14:00 -0700)]
Linux 3.12-rc4

10 years agonet: Update the sysctl permissions handler to test effective uid/gid
Eric W. Biederman [Sat, 5 Oct 2013 20:15:30 +0000 (13:15 -0700)]
net: Update the sysctl permissions handler to test effective uid/gid

Modify the code to use current_euid(), and in_egroup_p, as in done
in fs/proc/proc_sysctl.c:test_perm()

Cc: stable@vger.kernel.org
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Linus Torvalds [Sun, 6 Oct 2013 20:38:31 +0000 (13:38 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull SCSI target fixes from Nicholas Bellinger:
 "Here are the outstanding target fixes queued up for v3.12-rc4 code.

  The highlights include:

   - Make vhost/scsi tag percpu_ida_alloc() use GFP_ATOMIC
   - Allow sess_cmd_map allocation failure fallback to use vzalloc
   - Fix COMPARE_AND_WRITE se_cmd->data_length bug with FILEIO backends
   - Fixes for COMPARE_AND_WRITE callback recursive failure OOPs + non
     zero scsi_status bug
   - Make iscsi-target do acknowledgement tag release from RX context
   - Setup iscsi-target with extra (cmdsn_depth / 2) percpu_ida tags

  Also included is a iscsi-target patch CC'ed for v3.10+ that avoids
  legacy wait_for_task=true release during fast-past StatSN
  acknowledgement, and two other SRP target related patches that address
  long-standing issues that are CC'ed for v3.3+.

  Extra thanks to Thomas Glanzmann for his testing feedback with
  COMPARE_AND_WRITE + EXTENDED_COPY VAAI logic"

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  iscsi-target; Allow an extra tag_num / 2 number of percpu_ida tags
  iscsi-target: Perform release of acknowledged tags from RX context
  iscsi-target: Only perform wait_for_tasks when performing shutdown
  target: Fail on non zero scsi_status in compare_and_write_callback
  target: Fix recursive COMPARE_AND_WRITE callback failure
  target: Reset data_length for COMPARE_AND_WRITE to NoLB * block_size
  ib_srpt: always set response for task management
  target: Fall back to vzalloc upon ->sess_cmd_map kzalloc failure
  vhost/scsi: Use GFP_ATOMIC with percpu_ida_alloc for obtaining tag
  ib_srpt: Destroy cm_id before destroying QP.
  target: Fix xop->dbl assignment in target_xcopy_parse_segdesc_02

10 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Sun, 6 Oct 2013 20:35:15 +0000 (13:35 -0700)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine fixes from Vinod Koul:
 "Here is the slave dmanegine fixes.  We have the fix for deadlock issue
  on imx-dma by Michael and Josh's edma config fix along with author
  change"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: imx-dma: fix callback path in tasklet
  dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet
  dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic
  dma/Kconfig: Make TI_EDMA select TI_PRIV_EDMA
  edma: Update author email address

10 years agoMerge tag 'iio-for-3.13c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Sun, 6 Oct 2013 19:39:52 +0000 (12:39 -0700)]
Merge tag 'iio-for-3.13c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of new functionality and cleanups for IIO in the 3.13 cycle.

Driver New Functionality
* MXS - new interrupt driven touch screen support for i.MX23/28. Old
  polled implementation dropped.

Driver Cleanups
* Some spi_sync boilerplate dropped by using spi_sync_transfer
* Some switching of drivers to the fractional type for scale reading.
  Moves the ugly calculation into one place.
* Fix the documentation for *_voltage_scale which is never been correct
  or as implemented in any driver.
* HID sensor hub and children : Open the sensor hub only when someone cares.
* hmc5843 - various minor

10 years agosep: Convert sep_lock_user_pages() to get_user_pages_fast()
Jan Kara [Wed, 2 Oct 2013 14:27:52 +0000 (16:27 +0200)]
sep: Convert sep_lock_user_pages() to get_user_pages_fast()

CC: Mark Allyn <mark.a.allyn@intel.com>
CC: Jayant Mangalampalli <jayant.mangalampalli@intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoced1401: Convert driver to use get_user_pages_fast()
Jan Kara [Wed, 2 Oct 2013 14:27:49 +0000 (16:27 +0200)]
ced1401: Convert driver to use get_user_pages_fast()

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agolustre: Convert ll_get_user_pages() to use get_user_pages_fast()
Jan Kara [Wed, 2 Oct 2013 14:27:51 +0000 (16:27 +0200)]
lustre: Convert ll_get_user_pages() to use get_user_pages_fast()

CC: Peng Tao <tao.peng@emc.com>
Acked-by: Andreas Dilger <andreas.dilger@intel.com>
CC: hpdd-discuss@lists.01.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: xillybus: remove redundant Kconfig dependency
Baruch Siach [Fri, 4 Oct 2013 07:52:41 +0000 (10:52 +0300)]
staging: xillybus: remove redundant Kconfig dependency

XILLYBUS_PCIE and XILLYBUS_OF are inside 'if XILLYBUS' already, so there is not
need to depend on XILLYBUS.

Cc: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgnc: changes arguments in sizeof
Lidza Louina [Fri, 4 Oct 2013 16:18:30 +0000 (12:18 -0400)]
staging: dgnc: changes arguments in sizeof

The arguments that were passed into sizeof were
generic. This patch changes this by putting
the actual item that we need a size of instead.

For example:
-   kzalloc(sizeof(struct dgnc_board), GFP_KERNEL);
+   kzalloc(sizeof(*brd), GFP_KERNEL);

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
Linus Torvalds [Sat, 5 Oct 2013 19:17:24 +0000 (12:17 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "This is a small collection of fixes, including a regression fix from
  Liu Bo that solves rare crashes with compression on.

  I've merged my for-linus up to 3.12-rc3 because the top commit is only
  meant for 3.12.  The rest of the fixes are also available in my master
  branch on top of my last 3.11 based pull"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: Fix crash due to not allocating integrity data for a bioset
  Btrfs: fix a use-after-free bug in btrfs_dev_replace_finishing
  Btrfs: eliminate races in worker stopping code
  Btrfs: fix crash of compressed writes
  Btrfs: fix transid verify errors when recovering log tree

10 years agoMerge tag 'gpio-v3.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Sat, 5 Oct 2013 19:11:40 +0000 (12:11 -0700)]
Merge tag 'gpio-v3.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "Two patches for the OMAP driver, dealing with setting up IRQs properly
  on the device tree boot path"

* tag 'gpio-v3.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio/omap: auto-setup a GPIO when used as an IRQ
  gpio/omap: maintain GPIO and IRQ usage separately

10 years agoMerge tag 'usb-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sat, 5 Oct 2013 18:54:10 +0000 (11:54 -0700)]
Merge tag 'usb-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are none fixes for various USB driver problems.  The majority are
  gadget/musb fixes, but there are some new device ids in here as well"

* tag 'usb-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: chipidea: add Intel Clovertrail pci id
  usb: gadget: s3c-hsotg: fix can_write limit for non-periodic endpoints
  usb: gadget: f_fs: fix error handling
  usb: musb: dsps: do not bind to "musb-hdrc"
  USB: serial: option: Ignore card reader interface on Huawei E1750
  usb: musb: gadget: fix otg active status flag
  usb: phy: gpio-vbus: fix deferred probe from __init
  usb: gadget: pxa25x_udc: fix deferred probe from __init
  usb: musb: fix otg default state

10 years agoMerge tag 'tty-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sat, 5 Oct 2013 18:26:19 +0000 (11:26 -0700)]
Merge tag 'tty-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty fixes from Greg KH:
 "Here are two tty driver fixes for 3.12-rc4.

  One fixes the reported regression in the n_tty code that a number of
  people found recently, and the other one fixes an issue with xen
  consoles that broke in 3.10"

* tag 'tty-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  xen/hvc: allow xenboot console to be used again
  tty: Fix pty master read() after slave closes

10 years agoMerge tag 'staging-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sat, 5 Oct 2013 18:25:38 +0000 (11:25 -0700)]
Merge tag 'staging-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging fixes from Greg KH:
 "Here are 4 tiny staging and iio driver fixes for 3.12-rc4.  Nothing
  major, just some small fixes for reported issues"

* tag 'staging-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice
  iio:magnetometer: Bugfix magnetometer default output registers
  iio: Remove debugfs entries in iio_device_unregister()
  iio: amplifiers: ad8366: Remove regulator_put

10 years agobtrfs: Fix crash due to not allocating integrity data for a bioset
Darrick J. Wong [Fri, 20 Sep 2013 03:37:07 +0000 (20:37 -0700)]
btrfs: Fix crash due to not allocating integrity data for a bioset

When btrfs creates a bioset, we must also allocate the integrity data pool.
Otherwise btrfs will crash when it tries to submit a bio to a checksumming
disk:

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
 IP: [<ffffffff8111e28a>] mempool_alloc+0x4a/0x150
 PGD 2305e4067 PUD 23063d067 PMD 0
 Oops: 0000 [#1] PREEMPT SMP
 Modules linked in: btrfs scsi_debug xfs ext4 jbd2 ext3 jbd mbcache
sch_fq_codel eeprom lpc_ich mfd_core nfsd exportfs auth_rpcgss af_packet
raid6_pq xor zlib_deflate libcrc32c [last unloaded: scsi_debug]
 CPU: 1 PID: 4486 Comm: mount Not tainted 3.12.0-rc1-mcsum #2
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
 task: ffff8802451c9720 ti: ffff880230698000 task.ti: ffff880230698000
 RIP: 0010:[<ffffffff8111e28a>]  [<ffffffff8111e28a>] mempool_alloc+0x4a/0x150
 RSP: 0018:ffff880230699688  EFLAGS: 00010286
 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 00000000005f8445
 RDX: 0000000000000001 RSI: 0000000000000010 RDI: 0000000000000000
 RBP: ffff8802306996f8 R08: 0000000000011200 R09: 0000000000000008
 R10: 0000000000000020 R11: ffff88009d6e8000 R12: 0000000000011210
 R13: 0000000000000030 R14: ffff8802306996b8 R15: ffff8802451c9720
 FS:  00007f25b8a16800(0000) GS:ffff88024fc80000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000018 CR3: 0000000230576000 CR4: 00000000000007e0
 Stack:
  ffff8802451c9720 0000000000000002 ffffffff81a97100 0000000000281250
  ffffffff81a96480 ffff88024fc99150 ffff880228d18200 0000000000000000
  0000000000000000 0000000000000040 ffff880230e8c2e8 ffff8802459dc900
 Call Trace:
  [<ffffffff811b2208>] bio_integrity_alloc+0x48/0x1b0
  [<ffffffff811b26fc>] bio_integrity_prep+0xac/0x360
  [<ffffffff8111e298>] ? mempool_alloc+0x58/0x150
  [<ffffffffa03e8041>] ? alloc_extent_state+0x31/0x110 [btrfs]
  [<ffffffff81241579>] blk_queue_bio+0x1c9/0x460
  [<ffffffff8123e58a>] generic_make_request+0xca/0x100
  [<ffffffff8123e639>] submit_bio+0x79/0x160
  [<ffffffffa03f865e>] btrfs_map_bio+0x48e/0x5b0 [btrfs]
  [<ffffffffa03c821a>] btree_submit_bio_hook+0xda/0x110 [btrfs]
  [<ffffffffa03e7eba>] submit_one_bio+0x6a/0xa0 [btrfs]
  [<ffffffffa03ef450>] read_extent_buffer_pages+0x250/0x310 [btrfs]
  [<ffffffff8125eef6>] ? __radix_tree_preload+0x66/0xf0
  [<ffffffff8125f1c5>] ? radix_tree_insert+0x95/0x260
  [<ffffffffa03c66f6>] btree_read_extent_buffer_pages.constprop.128+0xb6/0x120
[btrfs]
  [<ffffffffa03c8c1a>] read_tree_block+0x3a/0x60 [btrfs]
  [<ffffffffa03caefd>] open_ctree+0x139d/0x2030 [btrfs]
  [<ffffffffa03a282a>] btrfs_mount+0x53a/0x7d0 [btrfs]
  [<ffffffff8113ab0b>] ? pcpu_alloc+0x8eb/0x9f0
  [<ffffffff81167305>] ? __kmalloc_track_caller+0x35/0x1e0
  [<ffffffff81176ba0>] mount_fs+0x20/0xd0
  [<ffffffff81191096>] vfs_kern_mount+0x76/0x120
  [<ffffffff81193320>] do_mount+0x200/0xa40
  [<ffffffff81135cdb>] ? strndup_user+0x5b/0x80
  [<ffffffff81193bf0>] SyS_mount+0x90/0xe0
  [<ffffffff8156d31d>] system_call_fastpath+0x1a/0x1f
 Code: 4c 8d 75 a8 4c 89 6d e8 45 89 e0 4c 8d 6f 30 48 89 5d d8 41 83 e0 af 48
89 fb 49 83 c6 18 4c 89 7d f8 65 4c 8b 3c 25 c0 b8 00 00 <48> 8b 73 18 44 89 c7
44 89 45 98 ff 53 20 48 85 c0 48 89 c2 74
 RIP  [<ffffffff8111e28a>] mempool_alloc+0x4a/0x150
  RSP <ffff880230699688>
 CR2: 0000000000000018
 ---[ end trace 7a96042017ed21e2 ]---

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
10 years agoMerge branch 'for-linus' into for-linus-3.12
Chris Mason [Sat, 5 Oct 2013 14:51:32 +0000 (10:51 -0400)]
Merge branch 'for-linus' into for-linus-3.12

10 years agostaging:iio:ad9951: Use spi_sync_transfer()
Lars-Peter Clausen [Sat, 5 Oct 2013 07:45:00 +0000 (08:45 +0100)]
staging:iio:ad9951: Use spi_sync_transfer()

Use the spi_sync_transfer() helper function instead of open-coding it. Makes the
code a bit shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad9910: Use spi_sync_transfer()
Lars-Peter Clausen [Sat, 5 Oct 2013 07:45:00 +0000 (08:45 +0100)]
staging:iio:ad9910: Use spi_sync_transfer()

Use the spi_sync_transfer() helper function instead of open-coding it. Makes
the code a bit shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:ad9852: Use spi_sync_transfer()
Lars-Peter Clausen [Sat, 5 Oct 2013 07:45:00 +0000 (08:45 +0100)]
staging:iio:ad9852: Use spi_sync_transfer()

Use the spi_sync_transfer() helper function instead of open-coding it. Makes
the code a bit shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
10 years agostaging:iio:adis16220: Use spi_sync_transfer()
Lars-Peter Clausen [Sat, 5 Oct 2013 07:45:00 +0000 (08:45 +0100)]
staging:iio:adis16220: Use spi_sync_transfer()

Use the spi_sync_transfer() helper function instead of open-coding it. Makes
the code a bit shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>