Commit Graph

576715 Commits

Author SHA1 Message Date
Amitoj Kaur Chawla 9e61d90115 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>
2016-03-20 11:04:49 +00:00
Gregor Boirie 334ecdd0ba iio:pressure:ms5611: fix missing regulator_disable
Ensure optional regulator is properly disabled when present.

Fixes: 3145229f91 ("iio:pressure:ms5611: power regulator support")
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-20 11:02:40 +00:00
Daniel Baluta 718ba46e5f 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: c816d9e7a5 ("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>
2016-03-20 10:39:49 +00:00
David Wu ae549a7221 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>
2016-03-20 10:27:25 +00:00
Alison Schofield 722fc31663 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>
2016-03-20 10:27:25 +00:00
Peter Meerwald-Stadler 6ad515c6d6 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>
2016-03-20 10:27:24 +00:00
Martin Kepplinger bce59b602d 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>
2016-03-20 10:27:23 +00:00
Martin Kepplinger ddb851affb 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>
2016-03-20 10:27:22 +00:00
Peter Meerwald 4fbcfa09f9 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>
2016-03-20 10:27:21 +00:00
Peter Meerwald-Stadler 6fca5aa865 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>
2016-03-20 10:27:21 +00:00
Joachim Eastwood d03b65967c 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>
2016-03-20 10:26:57 +00:00
Joachim Eastwood 9bbccbe11a 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>
2016-03-12 18:12:37 +00:00
Joachim Eastwood edcb2d26c1 dt: document NXP LPC1850 ADC driver bindings
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-12 18:11:52 +00:00
Joachim Eastwood a583c24dee 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>
2016-03-12 18:11:48 +00:00
Alison Schofield 1c118b7230 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>
2016-03-12 18:09:54 +00:00
Alison Schofield 08a3380551 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>
2016-03-12 11:17:19 +00:00
Martin Kepplinger e8731180fb 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>
2016-03-12 10:49:52 +00:00
Tiberiu Breana 1e52fefc9b 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>
2016-03-12 10:19:07 +00:00
Lars-Peter Clausen 2bcdb3f2e0 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>
2016-03-09 21:08:50 +00:00
Lars-Peter Clausen 88ae3aedb8 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>
2016-03-09 21:06:02 +00:00
Krzysztof Kozlowski e84a41d5db 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>
2016-03-05 18:48:14 +00:00
Matt Ranostay c816d9e7a5 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>
2016-03-05 17:51:10 +00:00
Martin Kepplinger 96c0cb2bbf 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>
2016-03-05 17:27:56 +00:00
Martin Kepplinger e866853d67 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>
2016-03-05 17:22:16 +00:00
Martin Kepplinger 8b8ff3a6a6 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>
2016-03-05 17:18:14 +00:00
Gregor Boirie 63d5d525cb 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>
2016-03-05 15:25:58 +00:00
Gregor Boirie d3546af67f 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>
2016-03-05 15:25:10 +00:00
Gregor Boirie 55c0c530f7 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>
2016-03-05 15:18:05 +00:00
Ludovic Desroches f0fa15cce1 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>
2016-03-05 15:02:59 +00:00
Ludovic Desroches 43d33f7458 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>
2016-03-05 15:01:46 +00:00
Gregor Boirie 033691a9a1 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>
2016-03-05 14:45:14 +00:00
Grégor Boirie 7a948c5e05 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>
2016-03-05 14:41:00 +00:00
Matt Ranostay 844a656367 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>
2016-03-05 14:00:57 +00:00
Chaehyun Lim 9bad1d0a5a 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>
2016-03-03 17:58:46 -08:00
Chaehyun Lim 9e58c36c77 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>
2016-03-03 17:58:46 -08:00
Chaehyun Lim 7cc386e9de 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>
2016-03-03 17:58:46 -08:00
Chaehyun Lim 76e6121c90 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>
2016-03-03 17:58:46 -08:00
Chaehyun Lim e9d24b9e88 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>
2016-03-03 17:58:46 -08:00
Chaehyun Lim 7902451cb9 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>
2016-03-03 17:58:46 -08:00
Anchal Jain 63f803518c 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>
2016-03-03 17:58:46 -08:00
Chaehyun Lim b1d296b3fd 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>
2016-03-03 17:52:13 -08:00
Chaehyun Lim 09db529cb5 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>
2016-03-03 17:52:13 -08:00
Chaehyun Lim fc17eaa1ed 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>
2016-03-03 17:52:13 -08:00
Chaehyun Lim c44e80bc6a 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>
2016-03-03 17:52:13 -08:00
Chaehyun Lim a91632fac9 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>
2016-03-03 17:52:13 -08:00
Liang Zhen ea363b419f 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>
2016-03-02 16:01:38 -08:00
Liang Zhen 4d99b2581e 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>
2016-03-02 16:01:38 -08:00
Liang Zhen 82fffff4af 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>
2016-03-02 16:01:38 -08:00
Doug Oucharek a70d69ae88 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>
2016-03-02 16:01:38 -08:00
Liang Zhen 992f0b226e 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>
2016-03-02 16:01:38 -08:00