]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
8 years agoiio:adc:at91-sama5d2: add support for differential conversions
Ludovic Desroches [Tue, 22 Mar 2016 16:08:46 +0000 (17:08 +0100)]
iio:adc:at91-sama5d2: add support for differential conversions

Add signed differential channels and update the voltage scale for
differential conversions.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:adc:at91-sama5d2: cleanup mode register use
Ludovic Desroches [Tue, 22 Mar 2016 16:08:45 +0000 (17:08 +0100)]
iio:adc:at91-sama5d2: cleanup mode register use

Do not erase previous configuration of the mode register when setting
the sampling frequency.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X...
Slawomir Stepien [Wed, 23 Mar 2016 08:57:20 +0000 (09:57 +0100)]
iio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

The following functionalities are supported:
 - write, read from volatile memory

Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf

Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Reviewed-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoStaging: iio: ad7606: Fix sparse endian warning
Ksenija Stanojevic [Wed, 23 Mar 2016 11:06:34 +0000 (12:06 +0100)]
Staging: iio: ad7606: Fix sparse endian warning

Fix following sparse warning:
warning: cast to restricted __be16

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: buffer: add missing descriptions in iio_buffer_access_funcs
Luis de Bethencourt [Wed, 23 Mar 2016 12:34:41 +0000 (12:34 +0000)]
iio: buffer: add missing descriptions in iio_buffer_access_funcs

The members buffer_group and attrs of iio_buffer_access_funcs have no
descriptions for the documentation. Adding them.

Fixes: 08e7e0adaa17 ("iio: buffer: Allocate standard attributes in the core")
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: tools: make generic_buffer look for "-trigger"
Linus Walleij [Thu, 24 Mar 2016 08:39:14 +0000 (09:39 +0100)]
iio: tools: make generic_buffer look for "-trigger"

All the ST Sensors use the old "<foo>-trigger" rather than the
standard "<foo>-devN" new standard suffix for triggers. Now much
to do about it since it is ABI, but make the testing tools
recognize it too.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: remove gpio interrupt probing from drivers that use a single interrupt
Irina Tirdea [Thu, 24 Mar 2016 09:05:09 +0000 (11:05 +0200)]
iio: remove gpio interrupt probing from drivers that use a single interrupt

Commit 845c877009cf014b ("i2c / ACPI: Assign IRQ for devices that have
GpioInt automatically") automatically assigns the first ACPI GPIO
interrupt in client->irq, so we can remove the probing code from
drivers that use only one interrupt.

Commit 0f0796509c07c1c7 ("iio: remove gpio interrupt probing from drivers
that use a single interrupt") removes gpio interrupt probing from most
drivers. This patch cleans the remaining ones.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: remove unused gpio consumer.h include
Irina Tirdea [Thu, 24 Mar 2016 09:08:38 +0000 (11:08 +0200)]
iio: remove unused gpio consumer.h include

GPIO handling code has been removed from the drivers (since
this is now handled by the ACPI core) in commit 0f0796509c07 ("iio:
remove gpio interrupt probing from drivers that use a single interrupt").

Remove the include for linux/gpio/consumer.h since it is no longer
used.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: kxcjk-1013: optimize i2c transfers in trigger handler
Adriana Reus [Thu, 24 Mar 2016 09:29:31 +0000 (11:29 +0200)]
iio: accel: kxcjk-1013: optimize i2c transfers in trigger handler

Some i2c busses (e.g.: Synopsys DesignWare I2C adapter) need to
enable/disable the bus at each i2c transfer and must wait for
the enable/disable to happen before sending the data.

When reading data in the trigger handler, the kxcjk-1013 accel driver
does one i2c transfer for each axis. This has an impact on the
frequency of the accelerometer at high sample rates due to additional
delays introduced by the i2c bus at each transfer.

Reading all axis values in one i2c transfer reduces the delays
introduced by the i2c bus. Uses i2c_smbus_read_i2c_block_data_or_emulated
that will fallback to reading each axis as a separate word in case i2c
block read is not supported.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: kxcjk-1013: use available_scan_masks
Adriana Reus [Thu, 24 Mar 2016 09:29:30 +0000 (11:29 +0200)]
iio: accel: kxcjk-1013: use available_scan_masks

Use available_scan_masks to allow the iio core to select
the data to send to userspace depending on which axes are
enabled, instead of doing this in the driver's interrupt
handler.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: bmg160: optimize transfers in trigger handler
Irina Tirdea [Thu, 24 Mar 2016 09:29:29 +0000 (11:29 +0200)]
iio: accel: bmg160: optimize transfers in trigger handler

Some i2c busses (e.g.: Synopsys DesignWare I2C adapter) need to
enable/disable the bus at each i2c transfer and must wait for
the enable/disable to happen before sending the data.

When reading data in the trigger handler, the bmg160 gyro driver does
one bus transfer for each axis. This has an impact on the frequency
of the accelerometer at high sample rates due to additional delays
introduced by the bus at each transfer.

Reading all axis values in one bus transfer reduces the delays
introduced by the bus.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: gyro: bmg160: use available_scan_masks
Irina Tirdea [Thu, 24 Mar 2016 09:29:28 +0000 (11:29 +0200)]
iio: gyro: bmg160: use available_scan_masks

Use available_scan_masks to allow the iio core to select
the data to send to userspace depending on which axes are
enabled, instead of doing this in the driver's interrupt
handler.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: bmc150: optimize transfers in trigger handler
Irina Tirdea [Thu, 24 Mar 2016 09:29:27 +0000 (11:29 +0200)]
iio: accel: bmc150: optimize transfers in trigger handler

Some i2c busses (e.g.: Synopsys DesignWare I2C adapter) need to
enable/disable the bus at each i2c transfer and must wait for
the enable/disable to happen before sending the data.

When reading data in the trigger handler, the bmc150 accel driver does
one bus transfer for each axis. This has an impact on the frequency
of the accelerometer at high sample rates due to additional delays
introduced by the bus at each transfer.

Reading all axis values in one bus transfer reduces the delays
introduced by the bus.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: bmc150: use available_scan_masks
Irina Tirdea [Thu, 24 Mar 2016 09:29:26 +0000 (11:29 +0200)]
iio: accel: bmc150: use available_scan_masks

Use available_scan_masks to allow the iio core to select
the data to send to userspace depending on which axes are
enabled, instead of doing this in the driver's interrupt
handler.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: potentiometer: mcp4531: use pointer to access model parameters
Slawomir Stepien [Thu, 24 Mar 2016 16:06:01 +0000 (17:06 +0100)]
iio: potentiometer: mcp4531: use pointer to access model parameters

Use const pointer to element from model configuration array rather then array
index, as it will not change anyway.

Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: convert bare unsigned usage to unsigned int
Alison Schofield [Sat, 26 Mar 2016 19:50:24 +0000 (12:50 -0700)]
staging: iio: convert bare unsigned usage to unsigned int

Use kernel preferred unsigned int declaration style.

Patch created using:
git ls-files drivers/staging/iio | \
xargs ./scripts/checkpatch.pl -f --fix-inplace --types=unspecified_int

Hand edits restored columns in structure definitions.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: st_sensors: simplify buffer address handling
Linus Walleij [Thu, 24 Mar 2016 13:18:03 +0000 (14:18 +0100)]
iio: st_sensors: simplify buffer address handling

The driver goes to some length to dynamically allocate an array
to hold the channel addresses. However no ST sensor has more than
three channels (x, y, z at most). Instead of kmalloc():ing and
kfree():in the address array, just use a fixed array of three
elements.

Cc: Giuseppe Barba <giuseppe.barba@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: ina2xx-adc: update the CALIB. register when RShunt changes
Marc Titinger [Mon, 14 Mar 2016 10:20:44 +0000 (11:20 +0100)]
iio: ina2xx-adc: update the CALIB. register when RShunt changes

The user (or an init script) may setup RShunt via sysfs after the
driver was initialized, for instance based on the EEPROM contents
of a modular probe. The calibration register must be set accordingly.

Signed-off-by: Marc Titinger <marc.titinger@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:magnetometer:ak8975: fix missing regulator_disable
Gregor Boirie [Thu, 17 Mar 2016 16:43:26 +0000 (17:43 +0100)]
iio:magnetometer:ak8975: fix missing regulator_disable

Ensure optional regulator is properly disabled when present.

Fixes: 63d5d525cbbc ("iio:magnetometer:ak8975: power regulator support")
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: light: tsl2563: Remove flush_scheduled_work
Amitoj Kaur Chawla [Thu, 17 Mar 2016 13:55:11 +0000 (19:25 +0530)]
iio: light: tsl2563: Remove flush_scheduled_work

flush_scheduled_work is scheduled for deprecation.
Replace cancel_delayed_work and flush_scheduled_work with
cancel_delayed_work_sync instead to ensure there is no pending or
running work item.

Since there is only one work item, chip->poweroff_work, there are
no further dependencies of flush_scheduled_work().

Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:pressure:ms5611: fix missing regulator_disable
Gregor Boirie [Thu, 17 Mar 2016 11:55:03 +0000 (12:55 +0100)]
iio:pressure:ms5611: fix missing regulator_disable

Ensure optional regulator is properly disabled when present.

Fixes: 3145229f9191 ("iio:pressure:ms5611: power regulator support")
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: imu: mpu6050: Fix name/chip_id when using ACPI
Daniel Baluta [Thu, 17 Mar 2016 16:32:44 +0000 (18:32 +0200)]
iio: imu: mpu6050: Fix name/chip_id when using ACPI

When using ACPI, id is NULL and the current code automatically
defaults name to NULL and chip id to 0. We should instead use
the data provided in the ACPI device table.

Fixes: c816d9e7a57b ("iio: imu: mpu6050: fix possible NULL dereferences")
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-By: Matt Ranostay <matt.ranostay@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: adc: rockchip_saradc: add saradc support for rk3399
David Wu [Tue, 15 Mar 2016 17:44:15 +0000 (01:44 +0800)]
iio: adc: rockchip_saradc: add saradc support for rk3399

The ADC is a 6-channel signal-ended 10-bit Successive
Approximation Register (SAR) A/D Converter.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29028: use regmap to retrieve struct device
Alison Schofield [Tue, 15 Mar 2016 18:49:12 +0000 (11:49 -0700)]
staging: iio: isl29028: use regmap to retrieve struct device

Driver includes struct regmap and struct device in its global data.
Remove the struct device and use regmap API to retrieve device info.

Simplified version of Coccinelle semantic patch used:

@ a @
identifier drvdata, r;
position p;
@@
  struct drvdata@p {
  ...
  struct regmap *r;
  ...
  };

@ b @
identifier a.drvdata, d;
position a.p;
@@
  struct drvdata@p {
  ...
- struct device *d;
  ...
  };

@ passed depends on b @
identifier a.drvdata, a.r, b.d, i, f;
@@
  f (..., struct drvdata *i ,...) {
+ struct device *dev = regmap_get_device(i->r);
   <+...
-    i->d
+    dev
   ...+>
  }

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agotools: iio: Update iio_event_monitor names
Peter Meerwald-Stadler [Tue, 15 Mar 2016 21:54:51 +0000 (22:54 +0100)]
tools: iio: Update iio_event_monitor names

add recently added channel types and modifiers

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: mma8452: use runtime pm instead of device specific autosleep
Martin Kepplinger [Mon, 14 Mar 2016 11:26:29 +0000 (12:26 +0100)]
iio: mma8452: use runtime pm instead of device specific autosleep

What is this autosleep?
-----------------------
It slows down the device after x seconds of inactivity. The thing is, we have
really achieved almost the same by runtime pm.

differnces are:

autosleep
 * uses more power during inactivity
 * the first read after inactivity slightly faster
 * complicated to understand for the user
 * no documented sysfs interface (afaik)
 * complicated to read and maintain

runtime pm
 * already merged in mma8452
 * uses less power during inactivity
 * first read after inactivity slower
 * easy to use. well documented.
 * easy to maintain and understand

The two approaches solve the same problem. runtime pm has more advantages
than autosleep and comes quite close to it's behaviour anyways. As I see it,
autosleep, even if somehow supported, would never be used anyways.

So resolve this issue by "ignoring" autosleep.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Reviewed-by: Martina Kepplinger <martina.novakovic@zoho.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: mma8452: add i2c_device_id for mma8451
Martin Kepplinger [Mon, 14 Mar 2016 11:33:14 +0000 (12:33 +0100)]
iio: mma8452: add i2c_device_id for mma8451

This was forgotten about and is added for consistency now

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: ABI: Fix typo in in_proximity_raw description
Peter Meerwald [Sun, 13 Mar 2016 15:02:22 +0000 (16:02 +0100)]
iio: ABI: Fix typo in in_proximity_raw description

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoMAINTAINERS: update pmeerw's name
Peter Meerwald-Stadler [Sun, 13 Mar 2016 15:22:33 +0000 (16:22 +0100)]
MAINTAINERS: update pmeerw's name

happily married for 4 month :)

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agodt: document NXP LPC1850 DAC driver bindings
Joachim Eastwood [Sat, 12 Mar 2016 12:30:17 +0000 (13:30 +0100)]
dt: document NXP LPC1850 DAC driver bindings

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: dac: add NXP LPC18xx DAC driver
Joachim Eastwood [Sat, 12 Mar 2016 12:30:16 +0000 (13:30 +0100)]
iio: dac: add NXP LPC18xx DAC driver

Add base support for the 10-bit DAC peripheral found
on NXP LPC18xx/43xx SoCs.

This is a minimal driver that does not support DMA or
interrupts.

User manual with register description can be found on:
LPC18xx: www.nxp.com/documents/user_manual/UM10430.pdf
LPC43xx: www.nxp.com/documents/user_manual/UM10503.pdf

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agodt: document NXP LPC1850 ADC driver bindings
Joachim Eastwood [Sat, 12 Mar 2016 12:30:15 +0000 (13:30 +0100)]
dt: document NXP LPC1850 ADC driver bindings

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: adc: add NXP LPC18xx ADC driver
Joachim Eastwood [Sat, 12 Mar 2016 12:30:14 +0000 (13:30 +0100)]
iio: adc: add NXP LPC18xx ADC driver

Add base support for the 10-bit SAR ADC peripheral found
on NXP LPC18xx/43xx SoCs.

This is a minimal driver that does not support burst mode,
interrupts, DMA or hardware triggers.

User manual with register description can be found on:
LPC18xx: www.nxp.com/documents/user_manual/UM10430.pdf
LPC43xx: www.nxp.com/documents/user_manual/UM10503.pdf

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: ad7192: use iio_device_{claim|release}_direct_mode()
Alison Schofield [Wed, 9 Mar 2016 19:30:43 +0000 (11:30 -0800)]
staging: iio: ad7192: use iio_device_{claim|release}_direct_mode()

Replace the code that guarantees the device stays in direct mode with
iio_device_{claim|release}_direct_mode() which does same.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: core: implement iio_device_{claim|release}_direct_mode()
Alison Schofield [Wed, 9 Mar 2016 19:30:12 +0000 (11:30 -0800)]
iio: core: implement iio_device_{claim|release}_direct_mode()

It is often the case that the driver wants to be sure a device stays
in direct mode while it is executing a task or series of tasks.  To
accomplish this today, the driver performs this sequence: 1) take the
device state lock, 2) verify it is not in a buffered mode, 3) execute
some tasks, and 4) release that lock.

This patch introduces a pair of helper functions that simplify these
steps and make it more semantically expressive.

iio_device_claim_direct_mode()
        If the device is not in any buffered mode it is guaranteed
        to stay that way until iio_release_direct_mode() is called.

iio_device_release_direct_mode()
        Release the claim. Device is no longer guaranteed to stay
        in direct mode.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: mma8452: add support for FXLS8471Q
Martin Kepplinger [Wed, 9 Mar 2016 11:01:29 +0000 (12:01 +0100)]
iio: mma8452: add support for FXLS8471Q

This adds support for Freescale's (now NXP's) FXLS8471Q accelerometer.

We use MMA8451Q's configuration because for what the driver supports,
FXLS8471Q is the same.

Support for FXLS8471Q's features (fast SPI interface and a larger FIFO,
among others) can be added to this driver anytime.

See it's datasheet for the details:
http://cache.nxp.com/files/sensors/doc/data_sheet/FXLS8471Q.pdf

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: Add support for the h3lis331dl accelerometer
Tiberiu Breana [Wed, 9 Mar 2016 12:06:14 +0000 (14:06 +0200)]
iio: accel: Add support for the h3lis331dl accelerometer

This commit adds support for STMicroelectronics h3lis331dl high-g
accelerometer. The datasheet for this device can be found here:

http://www.st.com/web/en/resource/technical/document/
datasheet/DM00053090.pdf

Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com>
Reviewed-by: Denis Ciocca <denis.ciocca@st.com>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging:iio:adis16220: Remove adis16220 driver
Lars-Peter Clausen [Mon, 7 Mar 2016 14:22:32 +0000 (15:22 +0100)]
staging:iio:adis16220: Remove adis16220 driver

The ADIS16220 part has been obsoleted, which makes it hard to get the
hardware to even test the driver. Considering this there is no expectation
that the driver will be cleaned up and be able to move out of staging, so
remove the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging:iio:adis16204: Remove adis16204 driver
Lars-Peter Clausen [Mon, 7 Mar 2016 14:22:31 +0000 (15:22 +0100)]
staging:iio:adis16204: Remove adis16204 driver

The ADIS16204 part has been obsoleted, which makes it hard to get the
hardware to even test the driver. Considering this there is no expectation
that the driver will be cleaned up and be able to move out of staging, so
remove the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: adc: Fix build error of missing devm_ioremap_resource on UM
Krzysztof Kozlowski [Fri, 4 Mar 2016 01:05:26 +0000 (10:05 +0900)]
iio: adc: Fix build error of missing devm_ioremap_resource on UM

The devres.o gets linked if HAS_IOMEM is present so on ARCH=um
allyesconfig (COMPILE_TEST) failed with:

drivers/built-in.o: In function `at91_adc_probe':
at91-sama5d2_adc.c:(.text+0x48f548): undefined reference to `devm_ioremap_resource'

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: imu: mpu6050: fix possible NULL dereferences
Matt Ranostay [Thu, 3 Mar 2016 03:18:12 +0000 (19:18 -0800)]
iio: imu: mpu6050: fix possible NULL dereferences

Fix possible null dereferencing of i2c and spi driver data.

Signed-off-by: Matt Ranostay <matt.ranostay@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: mma8452: add support for runtime power management
Martin Kepplinger [Thu, 3 Mar 2016 08:24:03 +0000 (09:24 +0100)]
iio: mma8452: add support for runtime power management

This adds support for runtime power management and, if configured, activates
automatic standby after 2 seconds of inactivity.

Inactivity means no read of acceleration values and no events triggered or
activated.

If CONFIG_PM is not set, this doesn't change anything for existing users.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: mma8452: avoid switching to active because of config change
Martin Kepplinger [Thu, 3 Mar 2016 08:24:02 +0000 (09:24 +0100)]
iio: mma8452: avoid switching to active because of config change

The devices' config registers can only be changed in standby mode.
Up until now the driver just held the device *always* active, so for
changing a config it was *always* necessary to switch to standby.

For upcoming support for runtime pm, the device can as well be in standby
mode. Instead of putting runtime pm functions in there, just keep the
device in standby if it already is. This section is protected by a lock
after all.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: mma8452: coding style fixes
Martin Kepplinger [Thu, 3 Mar 2016 08:24:01 +0000 (09:24 +0100)]
iio: mma8452: coding style fixes

fix checkpatch issues like "space before tabs", too long lines or alignment.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:magnetometer:ak8975: power regulator support
Gregor Boirie [Thu, 3 Mar 2016 10:44:05 +0000 (11:44 +0100)]
iio:magnetometer:ak8975: power regulator support

Add support for an optional regulator which, if found into device-tree,
will power on device at probing time.
The regulator is declared into ak8975 DTS entry as a "vdd-supply" property.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:magnetometer:ak8975: remove unused field
Gregor Boirie [Thu, 3 Mar 2016 10:44:04 +0000 (11:44 +0100)]
iio:magnetometer:ak8975: remove unused field

Remove unused struct ak8975_data attrs field.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:magnetometer:ak8975: fix uninitialized chipset
Gregor Boirie [Thu, 3 Mar 2016 10:44:03 +0000 (11:44 +0100)]
iio:magnetometer:ak8975: fix uninitialized chipset

ak_def_array bounds are not properly checked in case of ACPI matching
failure. GCC warns with the following message at line 799:
‘chipset’ may be used uninitialized in this function.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:adc:at91-sama5d2: fix identation
Ludovic Desroches [Thu, 3 Mar 2016 16:09:14 +0000 (17:09 +0100)]
iio:adc:at91-sama5d2: fix identation

Remove some extra tabs.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:adc:at91-sama5d2: fix typo
Ludovic Desroches [Thu, 3 Mar 2016 16:09:13 +0000 (17:09 +0100)]
iio:adc:at91-sama5d2: fix typo

Fix typo in the name of a macro.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:pressure:ms5611: oversampling rate support
Gregor Boirie [Tue, 1 Mar 2016 10:31:38 +0000 (11:31 +0100)]
iio:pressure:ms5611: oversampling rate support

Add support for setting and retrieving OverSampling Rate independently for
each of the temperature and pressure channels. This allows userspace to
fine tune hardware sampling process according to the following tradeoffs :
* the higher the OSR, the finer the resolution ;
* the higher the OSR, the lower the noise ;
BUT:
* the higher the OSR, the larger the drift ;
* the higher the OSR, the longer the response time, i.e. less samples per
  unit of time.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:pressure:ms5611: complete DT support
Grégor Boirie [Tue, 1 Mar 2016 10:31:37 +0000 (11:31 +0100)]
iio:pressure:ms5611: complete DT support

Add device-tree ID tables and document bindings.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: potentiometer: tpl0102: change i2c functionality return code
Matt Ranostay [Sat, 5 Mar 2016 06:55:25 +0000 (22:55 -0800)]
iio: potentiometer: tpl0102: change i2c functionality return code

Change i2c_check_functionality condition check return from ENOTSUPP to
EOPNOTSUPP which is now the standard return code.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: wilc1000: use switch statement instead of multiple if statement
Chaehyun Lim [Thu, 3 Mar 2016 12:05:22 +0000 (21:05 +0900)]
staging: wilc1000: use switch statement instead of multiple if statement

It is more readable than multiple if-else statement.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unnecessary comments
Chaehyun Lim [Thu, 3 Mar 2016 12:05:21 +0000 (21:05 +0900)]
staging: wilc1000: remove unnecessary comments

This patch removes unnecessary comments because enum cfg_cmd_type
shows each command type without it.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: add enum cfg_type_cmd
Chaehyun Lim [Thu, 3 Mar 2016 12:05:20 +0000 (21:05 +0900)]
staging: wilc1000: add enum cfg_type_cmd

This patch adds a new enum cfg_type_cmd to change hard-coded command
type.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename hardwareProductVersion in struct wilc_mac_cfg
Chaehyun Lim [Thu, 3 Mar 2016 12:05:19 +0000 (21:05 +0900)]
staging: wilc1000: rename hardwareProductVersion in struct wilc_mac_cfg

This patch renames hardwareProductVersion to hw_product_version to avoid
camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove commented codes
Chaehyun Lim [Thu, 3 Mar 2016 12:05:18 +0000 (21:05 +0900)]
staging: wilc1000: remove commented codes

This patch removes commented codes in struct wilc_cfg_str.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use TAG_PARAM_OFFSET define
Chaehyun Lim [Thu, 3 Mar 2016 12:05:17 +0000 (21:05 +0900)]
staging: wilc1000: use TAG_PARAM_OFFSET define

TAG_PARAM_OFFSET is defined at top of this file so that it is used
to simplify codes.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Remove a whitespace before parenthesis
Anchal Jain [Wed, 2 Mar 2016 15:42:19 +0000 (21:12 +0530)]
staging: wilc1000: Remove a whitespace before parenthesis

Remove a whitespace before parenthesis "("

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove typedef from enum tenuConnectSts
Chaehyun Lim [Thu, 3 Mar 2016 05:28:24 +0000 (14:28 +0900)]
staging: wilc1000: remove typedef from enum tenuConnectSts

This patch removes typedef from enum tenuConnectSts and renames it to
connect_status to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unused define
Chaehyun Lim [Thu, 3 Mar 2016 05:28:23 +0000 (14:28 +0900)]
staging: wilc1000: remove unused define

This patch removes INFINITE_SLEEP_TIME that is not used in the driver,
so just remove it.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove typedef from sdio_cmd53_t
Chaehyun Lim [Thu, 3 Mar 2016 05:28:22 +0000 (14:28 +0900)]
staging: wilc1000: remove typedef from sdio_cmd53_t

This patch removes typedef from struct sdio_cmd53_t and renames it to
sdio_cmd53.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unnecessary comment codes
Chaehyun Lim [Thu, 3 Mar 2016 05:28:21 +0000 (14:28 +0900)]
staging: wilc1000: remove unnecessary comment codes

This patch removes unnecessary comment code in struct sdio_cmd53_t.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove typedef from struct sdio_cmd52_t
Chaehyun Lim [Thu, 3 Mar 2016 05:28:20 +0000 (14:28 +0900)]
staging: wilc1000: remove typedef from struct sdio_cmd52_t

This patch removes typedef from struct sdio_cmd52_t and renames it to
sdio_cmd52.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: do less intense allocating retry for ko2iblnd
Liang Zhen [Wed, 2 Mar 2016 23:53:30 +0000 (18:53 -0500)]
staging: lustre: do less intense allocating retry for ko2iblnd

ko2iblnd may retry too frequent for growing pools, all schedulers
are spinning if another thread is in progress of allocating a new
pool and can't finish right away because of high system load.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7054
Reviewed-on: http://review.whamcloud.com/16470
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: avoid intensive reconnecting for ko2iblnd
Liang Zhen [Wed, 2 Mar 2016 23:53:29 +0000 (18:53 -0500)]
staging: lustre: avoid intensive reconnecting for ko2iblnd

When there is a connection race between two nodes and one side
of the connection is rejected by the other side. o2iblnd will
reconnect immediately, this is going to generate a lot of
trashes if:

 - race winner is slow and can't send out connecting request
   in short time.
 - remote side leaves a cmid in TIMEWAIT state, which will reject
   future connection requests

To resolve this problem, this patch changed the reconnection
behave: reconnection is submitted by connd only if a zombie
connection is being destroyed and there is a pending
reconnection request for the corresponding peer.

Also, after a few rejections, reconnection will have a time
interval between each attempt.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7569
Reviewed-on: http://review.whamcloud.com/17892
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: check wr_id returned by ib_poll_cq
Liang Zhen [Wed, 2 Mar 2016 23:53:28 +0000 (18:53 -0500)]
staging: lustre: check wr_id returned by ib_poll_cq

If ib_poll_cq returned +ve without initialising ib_wc::wr_id (bug
in driver), then o2iblnd will run into unpredictable situation
because ib_wc::wr_id may refer to stale tx/rx pointer in stack.

It indicates bug in HCA driver if this happened, ko2iblnd should
output console error then close current connection.

This patch could also be helpful for LU-5271

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-519
Reviewed-on: http://review.whamcloud.com/12747
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Change connect peer failed cleanup order
Doug Oucharek [Wed, 2 Mar 2016 23:53:27 +0000 (18:53 -0500)]
staging: lustre: Change connect peer failed cleanup order

A race condition has been found where connd is cleaning up failed
connections, the peer ref counter goes to zero, but we stil have
a connecting counter > 0.

One possible race is when we are retrying a connection by
calling kiblnd_connect_peer() which itself fails and decrements
the peer ref counter and gets swapped out before it can decrement
the connecting counter.  connd swaps in and cleans up the
connection where it sees a peer ref counter of 1 and a connecting
counter of 1.  This will trigger the assert seen in LU-7210 when
it decrements the peer counter.

The solution: be sure to decrement the connecting counter
before decrementing the peer counter in the peer connect
failure path.

Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7210
Reviewed-on: http://review.whamcloud.com/17004
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: take extra refcount in kiblnd_connreq_done
Liang Zhen [Wed, 2 Mar 2016 23:53:26 +0000 (18:53 -0500)]
staging: lustre: take extra refcount in kiblnd_connreq_done

refcount taken by cmid is not reliable after kiblnd_connreq_done
released the glock because this connection is visible to other
threads, another thread can find and close this connection right
after kiblnd_connreq_done released the glock, if kiblnd_cm_callback
for RDMA_CM_EVENT_DISCONNECTED is called, it can release the
connection refcount taken by cmid. It means the connection could be
destroyed before kiblnd_connreq_done() finish operations on it.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-7210
Reviewed-on: http://review.whamcloud.com/17527
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make ko2iblnd connect parameters persistent
Amir Shehata [Wed, 2 Mar 2016 23:53:25 +0000 (18:53 -0500)]
staging: lustre: make ko2iblnd connect parameters persistent

Store map-on-demand and peertx credits in the peer, since the peer
is persistent. Also made sure that when assigning the parameters
received on the connection to the peer structure through create,
that if another peer is added before grabbing the lock we assign
these parameters to it as well.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3322
Reviewed-on: http://review.whamcloud.com/17074
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Support different ko2iblnd configs between systems
Jeremy Filizetti [Wed, 2 Mar 2016 23:53:24 +0000 (18:53 -0500)]
staging: lustre: Support different ko2iblnd configs between systems

This patch adds suppoort for ko2iblnd to have different values for
peer_credits and map_on_demand between systems.

Signed-off-by: Jeremy Filizetti <jeremy.filizetti@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3322
Reviewed-on: http://review.whamcloud.com/11794
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: lnet: Remove and rename struct typedefs
Bhumika Goyal [Wed, 2 Mar 2016 19:16:37 +0000 (00:46 +0530)]
Staging: lustre: lnet: Remove and rename struct typedefs

Remove typedefs from structures stt_timer_t and lst_ping_data_t as typedef
for a structure type is not preferred. The suffix '_t' and the typedefs
are removed using coccinelle.

Script 1:
//Drop typedefs and '_t'
@r1@
type T;
@@

typedef struct { ... } T;

@script:python c1@
T2;
T << r1.T;
@@
if T[-2:] =="_t":
  coccinelle.T2 = T[:-2];
  print T
else:
  coccinelle.T2=T;

@@
type r1.T;
identifier c1.T2;
@@
-typedef
struct
+ T2
{ ... }
-T
;

Script 2:
//Replacement
@@
typedef stt_timer_t;
typedef lst_ping_data_t;
@@
(
- stt_timer_t
+ struct stt_timer
|
- lst_ping_data_t
+ struct lst_ping_data
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: Remove unnecessary test in if condition
Amitoj Kaur Chawla [Wed, 2 Mar 2016 20:02:14 +0000 (01:32 +0530)]
staging: lustre: llite: Remove unnecessary test in if condition

Remove unnecessary test on `rc` variable since it has already been
tested previously.
Fixes following smatch warning:
drivers/staging/lustre/lustre/llite/llite_lib.c:1331 ll_setattr_raw()
warn: we tested 'rc' before and it was 'false'

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: change ibh_mrs from array to pointer
Amir Shehata [Wed, 2 Mar 2016 22:02:03 +0000 (17:02 -0500)]
staging: lustre: change ibh_mrs from array to pointer

With the removal of PMR we no longer require ibh_mrs field
to be a array so change it to a simple pointer.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6850
Reviewed-on: http://review.whamcloud.com/15788
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: corrected some typos and grammar errors
Frank Zago [Wed, 2 Mar 2016 22:02:02 +0000 (17:02 -0500)]
staging: lustre: corrected some typos and grammar errors

Cleanup various typos and grammar errors.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5710
Reviewed-on: http://review.whamcloud.com/12201
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make o2iblnd_cb.c local functions static
Frank Zago [Wed, 2 Mar 2016 22:02:01 +0000 (17:02 -0500)]
staging: lustre: make o2iblnd_cb.c local functions static

This reduces the code size by about 1KiB.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11256
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make o2iblnd local functions static
Frank Zago [Wed, 2 Mar 2016 22:02:00 +0000 (17:02 -0500)]
staging: lustre: make o2iblnd local functions static

This fixes sparse warnings such as:
 .../o2iblnd.c:424:1: warning: symbol 'kiblnd_get_peer_info' was not declared.
                      Should it be static?

This reduces the code size by 400 bytes.

The body of "the_o2iblnd" was moved at the end of the file,
to avoid having to declare some static prototypes.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11255
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: reverse LNet and infinband header order
James Simmons [Wed, 2 Mar 2016 22:01:59 +0000 (17:01 -0500)]
staging: lustre: reverse LNet and infinband header order

LNet is an abstraction built on top of network APIs such
as infiniband or TCP/IP layer. Since LNet is dependent
on these other layers we should ensure LNet headers
should always come after the infiniband header since the
infiniband headers can influence the LNet header
definitions.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5140
Reviewed-on: http://review.whamcloud.com/10571
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Shuichi Ihara <sihara@ddn.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix framework.c issues found by Klocwork Insight tool
Dmitry Eremin [Wed, 2 Mar 2016 22:01:58 +0000 (17:01 -0500)]
staging: lustre: fix framework.c issues found by Klocwork Insight tool

The functions sfw_test_buffers() and sfw_unload_test() from LNet
selftest both assume sfw_test_instance_t being passed in is never
null. This is corrected here.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-on: http://review.whamcloud.com/9386
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix conctl.c issues found by Klocwork Insight tool
Dmitry Eremin [Wed, 2 Mar 2016 22:01:57 +0000 (17:01 -0500)]
staging: lustre: fix conctl.c issues found by Klocwork Insight tool

The function lst_test_add_ioctl is always copying lstio_tes_param
from userland even if the user doesn't send this data to LNet
selftest. Only consider lstio_tes_param data if lstio_tes_param_len
is not zero.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-on: http://review.whamcloud.com/9386
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix api-ni.c issues found by Klocwork Insight tool
Dmitry Eremin [Wed, 2 Mar 2016 22:01:56 +0000 (17:01 -0500)]
staging: lustre: fix api-ni.c issues found by Klocwork Insight tool

Pointer 'ni' checked for NULL at line 1569 may be passed to
function and may be dereferenced there by passing argument 1 to
function 'lnet_ni_notify_locked' at line 1621.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-on: http://review.whamcloud.com/9386
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix socklnd issues found by Klocwork Insight tool
Dmitry Eremin [Wed, 2 Mar 2016 22:01:55 +0000 (17:01 -0500)]
staging: lustre: fix socklnd issues found by Klocwork Insight tool

Null pointer 'best_iface' that comes from line 802 may be
dereferenced at line 832.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-on: http://review.whamcloud.com/9386
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: bind socklnd peers to a specific CPT
James Simmons [Wed, 2 Mar 2016 22:01:54 +0000 (17:01 -0500)]
staging: lustre: bind socklnd peers to a specific CPT

Currently the socklnd driver doesn't support
CPT affinity for its peers. Binding peers to
a specific CPT and memory allocated to the
NUMA node belonging to the CPT should give a
performance boost.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7245
Reviewed-on: http://review.whamcloud.com/16710
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: replace direct LNet HZ access with kernel APIs
Jian Yu [Wed, 2 Mar 2016 22:01:53 +0000 (17:01 -0500)]
staging: lustre: replace direct LNet HZ access with kernel APIs

On some customers' systems, the kernel was compiled with HZ defined
to 100, instead of 1000. This improves performance for HPC applications.
However, to use these systems with Lustre, customers have to re-build
Lustre for the kernel because Lustre directly uses the defined constant
HZ.

Since kernel 2.6.21, some non-HZ dependent timing APIs become non-
inline functions, which can be used in Lustre codes to replace the
direct HZ access.

These kernel APIs include:
 jiffies_to_msecs()
 jiffies_to_usecs()
 jiffies_to_timespec()
 msecs_to_jiffies()
 usecs_to_jiffies()
 timespec_to_jiffies()

And here are some samples of the replacement:
 HZ            -> msecs_to_jiffies(MSEC_PER_SEC)
 n * HZ        -> msecs_to_jiffies(n * MSEC_PER_SEC)
 HZ / n        -> msecs_to_jiffies(MSEC_PER_SEC / n)
 n / HZ        -> jiffies_to_msecs(n) / MSEC_PER_SEC
 n / HZ * 1000 -> jiffies_to_msecs(n)

This patch replaces the direct HZ access in lnet module.

Signed-off-by: Jian Yu <jian.yu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5443
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: set task state before scheduling in lnet_sock_accept
John L. Hammond [Wed, 2 Mar 2016 22:01:52 +0000 (17:01 -0500)]
staging: lustre: set task state before scheduling in lnet_sock_accept

In the original code change when libcfs_sock_accept() was made
into lnet_sock_accept() a call to set_current_state(TASK_INTERRUPTIBLE)
got dropped which was restored. For upstream this is an
optimization of calling init_waitqueue_entry() only if
accept() return -EAGAIN. Also we can remove setting the
task to TASK_RUNNING that is not needed.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6407
Reviewed-on: http://review.whamcloud.com/14265
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix 'copy into fixed size buffer' errors
Sebastien Buisson [Wed, 2 Mar 2016 22:01:51 +0000 (17:01 -0500)]
staging: lustre: fix 'copy into fixed size buffer' errors

Fix 'copy into fixed size buffer' defects found by Coverity
version 6.0.3:
Copy into fixed size buffer (STRING_OVERFLOW)
The fixed-size string might be overrun by copying without
checking the length.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2074
Reviewed-on: http://review.whamcloud.com/4154
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: issue in the offset in lnet match hash table
Alyona Romanenko [Wed, 2 Mar 2016 22:01:50 +0000 (17:01 -0500)]
staging: lustre: issue in the offset in lnet match hash table

the offset in hash table is overflowed for no wildcard portal.
The offset for no wildcard has been corrected as for wildcard
in the LU-1622

Signed-off-by: Alyona Romanenko <alyona.romanenko@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7774
Reviewed-on: http://review.whamcloud.com/18422
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Use after free in lnet_ptl_match_delay()
Olaf Weber [Wed, 2 Mar 2016 22:01:49 +0000 (17:01 -0500)]
staging: lustre: Use after free in lnet_ptl_match_delay()

In lnet_ptl_match_delay() we check msg->msg_rx_delayed to see whether
the message has been added to the delay queue. But this check is done
after lnet_ptl_unlock() and lnet_res_unlock(), and the message can be
processed and freed before the check.

Replace the check with checking rc against LNET_MATCHMD_NONE, which
is how the callers of lnet_ptl_match_delay() know whether the message
was added to the delay queue. To make this work we reset rc in the
loop when there was no match and the message hasn't been delayed. In
addition reorganize the code and add comments to clarify the logic.

In lnet_ptl_match_md() a similar msg->msg_rx_delayed is replaced for
the same reason.

Signed-off-by: Olaf Weber <olaf@sgi.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7324
Reviewed-on: http://review.whamcloud.com/17840
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove annoying message in parse_nidrange
Li Xi [Wed, 2 Mar 2016 22:01:48 +0000 (17:01 -0500)]
staging: lustre: remove annoying message in parse_nidrange

When setting TBF rules of jobid, parse_nidrange() prints warning
messages. However, this is unnecessary and annoying since paring
a TBF rule will always try to parse the jobid like a nid.

Signed-off-by: Li Xi <lixi@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7647
Reviewed-on: http://review.whamcloud.com/17916
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: return proper error code for LNet core
James Simmons [Wed, 2 Mar 2016 22:01:47 +0000 (17:01 -0500)]
staging: lustre: return proper error code for LNet core

It is consider bad style in the linux kernel to
return -1 or a positive number for an error.
Instead return the appropriate error codes.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/17626
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Ignore hops if not explicitly set
Amir Shehata [Wed, 2 Mar 2016 22:01:46 +0000 (17:01 -0500)]
staging: lustre: Ignore hops if not explicitly set

Since the # of hops is not a mandatory parameter the LU-6060
patch will cause problems to already existing systems since it
changes the behavior by which a route is determined down.

To fix this case the # of hops now defaults to LNET_UNDEFINED_HOPS
if no hop count is specified.

LNET_UNDEFINED_HOPS is defined to ((__u32)-1). When it's printed as
%d, it displays as -1.

__u32 is used through out the call stack for hop count to explicitly
define the size of the hop count and to avoid any sizing issues when
passing data to and from the kernel.

To keep existing behavior both lnet_compare_routes() and LNetDist()
will treat undefined hop count as hop count 1.

When executing the logic in lnet_parse_rc_info() there is no
longer an assumption that the default hop count is 1. If
the hop count is 1 then it must've been explicitly set by
the user.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6851
Reviewed-on: http://review.whamcloud.com/15719
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: recv could access freed message
Liang Zhen [Wed, 2 Mar 2016 22:01:45 +0000 (17:01 -0500)]
staging: lustre: recv could access freed message

When lnet_parse_put calls lnet_ptl_match_md, this function can attach
current message on the delayed list if there is no match. It means
this message can be taken over and freed by another thread who is
posting new MD, then it is not safe for caller of lnet_parse_put to
check this message again.

This patch fixes this issue by adding a local variable "ready_delay"
to store corresponding status of lnet_msg, so lnet doesn't need to
check the message again if lnet_ptl_match_md returned MATCH_NONE for
it.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7324
Reviewed-on: http://review.whamcloud.com/17065
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: set downis to 1 if there's no NI for remote net
Liang Zhen [Wed, 2 Mar 2016 22:01:44 +0000 (17:01 -0500)]
staging: lustre: set downis to 1 if there's no NI for remote net

lnet_route_t::lr_downis is marked as zero even if there is no NI to
target network, this is wrong and breaks logic of ARF. This patch
fixes this problem.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6060
Reviewed-on: http://review.whamcloud.com/13417
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Unbreak ll_prep_inode iget result check
Oleg Drokin [Wed, 2 Mar 2016 13:25:39 +0000 (08:25 -0500)]
staging/lustre: Unbreak ll_prep_inode iget result check

commit 020ecc6f3229 ("staging: lustre: llite: Remove IS_ERR tests")
managed to break one of the converted checks by losing a dereference
causing the condition to be wrong and hence leading
to a crash later on in case of actual error.
IS_ERR_OR_NULL(*inode) got converted into !inode.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
CC: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoRevert "staging/lustre: F_SETLKW64 F_SETLK64 F_GETLK64 are always defined"
Greg Kroah-Hartman [Wed, 2 Mar 2016 20:06:42 +0000 (12:06 -0800)]
Revert "staging/lustre: F_SETLKW64 F_SETLK64 F_GETLK64 are always defined"

This reverts commit caa88c26575c9be856e5a801abd121d7ff0808f8.

Turns out that Alpha doesn't define these values :(

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wlan: Remove wrapper function
Amitoj Kaur Chawla [Mon, 29 Feb 2016 13:53:44 +0000 (19:23 +0530)]
staging: wilc1000: wilc_wlan: Remove wrapper function

Remove is_tcp_ack_filter() which only returns the value of boolean
variable `enabled` by replacing the only call site with the variable
`enabled` itself.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wlan_if.h: remove unused functions
Tony Cho [Mon, 29 Feb 2016 09:02:39 +0000 (18:02 +0900)]
staging: wilc1000: wilc_wlan_if.h: remove unused functions

This patch removes the unused functions anymore related to the configuration
of the bus interface clock speed.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Removed unused variables
Bhaktipriya Shridhar [Sun, 28 Feb 2016 11:51:06 +0000 (17:21 +0530)]
staging: wilc1000: Removed unused variables

Variables pcgroup_encrypt_val,pccipher_group,pcwpa_version,
hold different values at different stages of the execution of
connect(), however they are not being used anywhere.
Hence, the unused variables have been removed.

This was done using Coccinelle.

@@ type T; identifier i; constant c; @@
-T i;
<... when != i
-i = c;
...>

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Remove unnecessary 'else'
Rehas Sachdeva [Fri, 26 Feb 2016 12:47:45 +0000 (18:17 +0530)]
staging: wilc1000: Remove unnecessary 'else'

This patch removes the checkpatch.pl warning:
else is not generally useful after a break or return

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove code for HOST_IF_MSG_SET_MAC_ADDRESS
Alison Schofield [Fri, 26 Feb 2016 07:03:42 +0000 (23:03 -0800)]
staging: wilc1000: remove code for HOST_IF_MSG_SET_MAC_ADDRESS

The function that sent this message id was previously removed.
Finish the cleanup by removing the call to the message handler,
the message handler, and the #define.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>