platform/kernel/linux-rpi.git
4 years agoiio: accel: kxcjk1013: Support orientation matrix
Dmitry Osipenko [Sun, 12 Jan 2020 20:33:00 +0000 (23:33 +0300)]
iio: accel: kxcjk1013: Support orientation matrix

Hardware could be physically mounted in any possible direction and
userpspace needs to be aware of the mounting orientation in order to
process sensor's data correctly. In particular this helps iio-sensor-proxy
to report display's orientation properly on a phone/tablet devices.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add mount matrix support
Martin Kepplinger [Mon, 13 Jan 2020 10:11:40 +0000 (11:11 +0100)]
iio: imu: st_lsm6dsx: add mount matrix support

Allow to read the mount-matrix device tree property and provide the
mount_matrix file for userspace to read.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: stm32-adc: don't print an error on probe deferral
Etienne Carriere [Mon, 13 Jan 2020 13:18:59 +0000 (14:18 +0100)]
iio: adc: stm32-adc: don't print an error on probe deferral

Do not print an error trace when deferring probe for some resource.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adis16480: add compatible entry for ADIS16490
Alexandru Ardelean [Thu, 16 Jan 2020 13:11:48 +0000 (15:11 +0200)]
dt-bindings: iio: adis16480: add compatible entry for ADIS16490

This change adds an entry for ADIS16490 in the list of compatible devices
defined in the dt-bindings of the adis16480 driver.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: adis16480: Add support for ADIS16490
Stefan Popa [Thu, 16 Jan 2020 13:11:47 +0000 (15:11 +0200)]
iio: imu: adis16480: Add support for ADIS16490

The ADIS16490 is part of the same family with ADIS16495 and ADIS16497,
the main difference is the temperature, accelerometer and gyroscope
scales.

Datasheet:
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/adis16490.pdf
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: bma400: prevent setting accel scale too low
Dan Carpenter [Thu, 16 Jan 2020 10:08:29 +0000 (13:08 +0300)]
iio: accel: bma400: prevent setting accel scale too low

This puts an upper bound on "val2" but it also needs to have a lower
bound (BMA400_SCALE_MIN).

Fixes: 465c811f1f20 ("iio: accel: Add driver for the BMA400")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu/mpu6050: support dual-edge IRQ
Michał Mirosław [Sat, 11 Jan 2020 15:19:11 +0000 (16:19 +0100)]
iio: imu/mpu6050: support dual-edge IRQ

Make mpu6050 usable on platforms which provide only any-edge interrupts.
One example of this kind of platform is AT91SAM9G45

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: inv_mpu6050: add fifo temperature data support
Jean-Baptiste Maneyrol [Thu, 16 Jan 2020 17:56:45 +0000 (18:56 +0100)]
iio: imu: inv_mpu6050: add fifo temperature data support

Add support of temperature data in fifo for all chips.
Enable unification of scan elements for icm20602.
Add macros for generating scan elements.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: magnetometer: ak8975: Convert to use device_get_match_data()
Andy Shevchenko [Wed, 15 Jan 2020 17:44:25 +0000 (19:44 +0200)]
iio: magnetometer: ak8975: Convert to use device_get_match_data()

Convert to use device_get_match_data() instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: magnetometer: ak8975: Get rid of platform data
Andy Shevchenko [Wed, 15 Jan 2020 17:44:24 +0000 (19:44 +0200)]
iio: magnetometer: ak8975: Get rid of platform data

Since IIO framework supports device property API and driver has been moved
already to the use of GPIO descriptors the logical continuation is to
get rid of platform data completely. We are on the safe side here since
there are no users of it in the kernel.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad7124: Set IRQ type to falling
Alexandru Tachici [Mon, 13 Jan 2020 10:26:53 +0000 (12:26 +0200)]
iio: adc: ad7124: Set IRQ type to falling

Ad7124 data-sheet specifies that the falling edge
of the DOUT line should be used for an interrupt.
The current irq flag (IRQF_TRIGGER_LOW) used will
cause unwanted behaviour. When enabling the interrupt
it will fire once because the DOUT line is already low.
This will make the driver to read an unfinished conversion
from the chip.

This patch sets the irq type to the one specified in
the data-sheet.

Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad-sigma-delta: Allow custom IRQ flags
Alexandru Tachici [Mon, 13 Jan 2020 10:26:52 +0000 (12:26 +0200)]
iio: adc: ad-sigma-delta: Allow custom IRQ flags

Before this patch the ad_sigma_delta implementation hardcoded
the irq trigger type to low, assuming that all Sigma-Delta ADCs
have the same interrupt-type.

This patch allows all drivers using the ad_sigma_delta layer to set the
irq trigger type to the one specified in the datasheet.

Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: adis: use new `delay` structure for SPI transfer delays
Alexandru Ardelean [Tue, 10 Dec 2019 14:07:55 +0000 (16:07 +0200)]
iio: imu: adis: use new `delay` structure for SPI transfer delays

In a recent change to the SPI subsystem [1], a new `delay` struct was added
to replace the `delay_usecs`. This change replaces the current `delay_usecs`
with `delay` for this driver.

The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure
that both `delay_usecs` & `delay` are used (in this order to preserve
backwards compatibility).

[1] commit bebcfd272df6485 ("spi: introduce `delay` field for
`spi_transfer` + spi_transfer_delay_exec()")

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: stm32-dfsdm: adapt sampling rate to oversampling ratio
Olivier Moysan [Wed, 27 Nov 2019 13:10:08 +0000 (14:10 +0100)]
iio: adc: stm32-dfsdm: adapt sampling rate to oversampling ratio

Update sampling rate when oversampling ratio is changed
through the IIO ABI.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: stm32-dfsdm: fix single conversion
Olivier Moysan [Wed, 27 Nov 2019 13:07:29 +0000 (14:07 +0100)]
iio: adc: stm32-dfsdm: fix single conversion

Apply data formatting to single conversion,
as this is already done in continuous and trigger modes.

Fixes: 102afde62937 ("iio: adc: stm32-dfsdm: manage data resolution in trigger mode")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Cc: <Stable@vger.kernel.org>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_sensors: Make use of device properties
Andy Shevchenko [Mon, 16 Dec 2019 17:38:53 +0000 (19:38 +0200)]
iio: st_sensors: Make use of device properties

Device property API allows to gather device resources from different sources,
such as ACPI. Convert the drivers to unleash the power of device property API.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_sensors: Drop redundant parameter from st_sensors_of_name_probe()
Andy Shevchenko [Mon, 16 Dec 2019 17:38:52 +0000 (19:38 +0200)]
iio: st_sensors: Drop redundant parameter from st_sensors_of_name_probe()

Since we have access to the struct device_driver and thus to the ID table,
there is no need to supply special parameters to st_sensors_of_name_probe().

Besides that we have a common API to get driver match data, there is
no need to do matching separately for OF and ACPI.

Taking into consideration above, simplify the ST sensors code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_gyro: Correct data for LSM9DS0 gyro
Andy Shevchenko [Tue, 17 Dec 2019 17:10:38 +0000 (19:10 +0200)]
iio: st_gyro: Correct data for LSM9DS0 gyro

The commit 41c128cb25ce ("iio: st_gyro: Add lsm9ds0-gyro support")
assumes that gyro in LSM9DS0 is the same as others with 0xd4 WAI ID,
but datasheet tells slight different story, i.e. the first scale factor
for the chip is 245 dps, and not 250 dps.

Correct this by introducing a separate settings for LSM9DS0.

Fixes: 41c128cb25ce ("iio: st_gyro: Add lsm9ds0-gyro support")
Depends-on: 45a4e4220bf4 ("iio: gyro: st_gyro: fix L3GD20H support")
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: check return value from st_lsm6dsx_sensor_set_enable
Lorenzo Bianconi [Thu, 2 Jan 2020 08:36:29 +0000 (09:36 +0100)]
iio: imu: st_lsm6dsx: check return value from st_lsm6dsx_sensor_set_enable

Add missing return value check in st_lsm6dsx_read_oneshot disabling the
sensor. The issue is reported by coverity with the following error:

Unchecked return value:
If the function returns an error value, the error value may be mistaken
for a normal value.

Addresses-Coverity-ID: 1446733 ("Unchecked return value")
Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events")
Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: chemical: atlas-sensor: add helper function atlas_buffer_num_channels()
Matt Ranostay [Sat, 4 Jan 2020 01:29:08 +0000 (17:29 -0800)]
iio: chemical: atlas-sensor: add helper function atlas_buffer_num_channels()

Add helper function to detect the number of channels to output
in trigger handler. This is based on IIO_TIMESTAMP channel being the
delimiter between input and output channels.

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: humidity: dht11 remove TODO since it doesn't make sense
Kent Gustavsson [Sat, 4 Jan 2020 18:19:29 +0000 (19:19 +0100)]
iio: humidity: dht11 remove TODO since it doesn't make sense

DHT11 isn't addressable and will trigger temperature measurement on any
data sent on the bus.

Signed-off-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis: Remove startup_delay
Nuno Sá [Tue, 7 Jan 2020 11:17:05 +0000 (13:17 +0200)]
iio: adis: Remove startup_delay

All timeouts are now handled by a dedicated timeout struct. This
variable is no longer needed.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis: Introduce timeouts structure
Nuno Sá [Tue, 7 Jan 2020 11:17:04 +0000 (13:17 +0200)]
iio: adis: Introduce timeouts structure

The adis library only allows to define a `startup_delay` which for some
devices is enough. However, other devices define different timeouts with
significantly different timings which could lead to devices to not wait
enough time or to wait a lot more than necessary (which is not
efficient). This patch introduces a new timeout struct that must be
passed into `adis_init()`. There are mainly, for now, three timeouts
used. This is also an introductory patch with the goal of refactoring
`adis_initial_startup()`. New driver's (eg: adis16480, adis16460) are
replicating code for the device initial setup. With some changes (being
this the first one) we can pass this to `adis_initial_startup()`.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: at91-sama5d2_adc: Use dma_request_chan() instead dma_request_slave_channel()
Peter Ujfalusi [Tue, 7 Jan 2020 11:37:29 +0000 (13:37 +0200)]
iio: adc: at91-sama5d2_adc: Use dma_request_chan() instead dma_request_slave_channel()

dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

The dma_request_chan() is the standard API to request slave channel,
clients should be moved away from the legacy API to allow us to retire
them.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: stm32-adc: Use dma_request_chan() instead dma_request_slave_channel()
Peter Ujfalusi [Wed, 8 Jan 2020 08:08:01 +0000 (10:08 +0200)]
iio: adc: stm32-adc: Use dma_request_chan() instead dma_request_slave_channel()

dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

By using dma_request_chan() directly the driver can support deferred
probing against DMA.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: stm32-dfsdm: Use dma_request_chan() instead dma_request_slave_channel()
Peter Ujfalusi [Tue, 7 Jan 2020 11:45:32 +0000 (13:45 +0200)]
iio: adc: stm32-dfsdm: Use dma_request_chan() instead dma_request_slave_channel()

dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

By using dma_request_chan() directly the driver can support deferred
probing against DMA.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Olivier Moysan <olivier.moysan@st.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: vc04_services: remove header include path to vc04_services
Masahiro Yamada [Fri, 10 Jan 2020 13:56:15 +0000 (22:56 +0900)]
staging: vc04_services: remove header include path to vc04_services

Fix up some relative paths in #include "..." directives, and remove
the include path to drivers/staging/vc04_services.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200110135615.11617-1-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vt6656: Move ieee80211_rx_status off stack.
Malcolm Priestley [Wed, 8 Jan 2020 21:41:56 +0000 (21:41 +0000)]
staging: vt6656: Move ieee80211_rx_status off stack.

ieee80211_rx_status off stack to IEEE80211_SKB_RXCB (skb->cb)
removing the need to copy on to it.

skb->cb is always present as a clean buffer so simply fill
it in.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/a66caba4-0c17-41af-a58f-3cdbb3243fb0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vt6656: Fix false Tx excessive retries reporting.
Malcolm Priestley [Wed, 8 Jan 2020 21:41:36 +0000 (21:41 +0000)]
staging: vt6656: Fix false Tx excessive retries reporting.

The driver reporting  IEEE80211_TX_STAT_ACK is not being handled
correctly. The driver should only report on TSR_TMO flag is not
set indicating no transmission errors and when not IEEE80211_TX_CTL_NO_ACK
is being requested.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/340f1f7f-c310-dca5-476f-abc059b9cd97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vt6656: use NULLFUCTION stack on mac80211
Malcolm Priestley [Wed, 8 Jan 2020 21:41:20 +0000 (21:41 +0000)]
staging: vt6656: use NULLFUCTION stack on mac80211

It appears that the drivers does not go into power save correctly the
NULL data packets are not being transmitted because it not enabled
in mac80211.

The driver needs to capture ieee80211_is_nullfunc headers and
copy the duration_id to it's own duration data header.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/610971ae-555b-a6c3-61b3-444a0c1e35b4@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vt6656: correct packet types for CTS protect, mode.
Malcolm Priestley [Wed, 8 Jan 2020 21:40:58 +0000 (21:40 +0000)]
staging: vt6656: correct packet types for CTS protect, mode.

It appears that the driver still transmits in CTS protect mode even
though it is not enabled in mac80211.

That is both packet types PK_TYPE_11GA and PK_TYPE_11GB both use CTS protect.
The only difference between them GA does not use B rates.

Find if only B rate in GB or GA in protect mode otherwise transmit packets
as PK_TYPE_11A.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/9c1323ff-dbb3-0eaa-43e1-9453f7390dc0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mt7621-dts: fix register range of memc node in mt7621.dtsi
Chuanhong Guo [Thu, 9 Jan 2020 08:00:03 +0000 (16:00 +0800)]
staging: mt7621-dts: fix register range of memc node in mt7621.dtsi

The memc node from mt7621.dtsi has incorrect register resource.
Fix it according to the programming guide.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Link: https://lore.kernel.org/r/20200109080120.362110-1-gch981213@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: remove unneeded compiler flags
Masahiro Yamada [Sat, 4 Jan 2020 16:21:36 +0000 (01:21 +0900)]
staging: rtl8192u: remove unneeded compiler flags

-std=gnu89 is specified by the top Makefile. Adding it in a driver
Makefile is redundant.

A driver should avoid specifying the optimization flag.
-O2, -O3, or -Os is passed by the top Makefile based on the
CONFIG_CC_OPTIMIZE_FOR_* option.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200104162136.19170-3-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: remove header include path to ieee80211/
Masahiro Yamada [Sat, 4 Jan 2020 16:21:35 +0000 (01:21 +0900)]
staging: rtl8192u: remove header include path to ieee80211/

There is no need to add "ccflags-y += -I $(srctree)/$(src)/ieee80211"
just for including "dot11d.h".

Use the correct relative path for the #include "..." directive.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200104162136.19170-2-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: remove unused Makefile
Masahiro Yamada [Sat, 4 Jan 2020 16:21:34 +0000 (01:21 +0900)]
staging: rtl8192u: remove unused Makefile

drivers/staging/rtl8192u/ieee80211/Makefile is not used at all.
All the build rules are described in drivers/staging/rtl8192u/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200104162136.19170-1-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188eu: refactor rtl88eu_dm_update_rx_idle_ant()
Michael Straube [Sun, 5 Jan 2020 19:49:36 +0000 (20:49 +0100)]
staging: rtl8188eu: refactor rtl88eu_dm_update_rx_idle_ant()

Refactor rtl88eu_dm_update_rx_idle_ant() to reduce indentation level
and clear line over 80 characters checkpatch warnings.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200105194936.5477-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188eu: remove else after return
Michael Straube [Sun, 5 Jan 2020 19:49:35 +0000 (20:49 +0100)]
staging: rtl8188eu: remove else after return

Remove else after return in rtl88eu_dm_antenna_diversity() to improve
readability and clear a checkpatch warning.

WARNING: else is not generally useful after a break or return

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200105194936.5477-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188: avoid excessive stack usage
Arnd Bergmann [Sat, 4 Jan 2020 21:48:21 +0000 (22:48 +0100)]
staging: rtl8188: avoid excessive stack usage

The rtl8188 copy of the os_dep support code causes a
warning about a very significant stack usage in the translate_scan()
function:

drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'translate_scan':
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:306:1: error: the frame size of 1560 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]

Use the same trick as in the rtl8723bs copy of the same function, and
allocate it dynamically.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200104214832.558198-1-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rts5208: remove unneeded header include path
Masahiro Yamada [Sat, 4 Jan 2020 16:37:10 +0000 (01:37 +0900)]
staging: rts5208: remove unneeded header include path

A header include path without $(srctree)/ is suspicous because it does
not work with O= builds.

I can build drivers/staging/rts5208/ without this include path.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200104163710.21582-1-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoMerge tag 'iio-for-5.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio...
Greg Kroah-Hartman [Fri, 10 Jan 2020 09:44:00 +0000 (10:44 +0100)]
Merge tag 'iio-for-5.6a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of new device support, features and cleanups for IIO in the 5.6 cycle

New device support

* ad7091r5 ADC
  - New driver with follow up patch adding scale and vref support.
  - DT bindings
* ad7923
  - Support for ad7908, ad7918 and ad7928 added to driver.
* bma180
  - Support the BMA254 accelerometer. Required fairly substantial rework
    to allow for small differences between this an existing parts.
* bma400 accelerometer
  - New driver with follow up patch for regulator support.
  - DT bindings.
* asc dlhl60d
  - New driver support this range of pressure and temperature sensors.
  - DT bindings.
* ltc2496 ADC
  - New driver to support this ADC.
  - Split the existing LTC2497 driver generic component out and reuse.
  - DT bindings.
* parallax ping
  - New driver supporting ultrasonic and laser tof distance sensors.
  - Bindings for these sensors.

New features

* core
  - New char type for read_raw returns, used for thermocouple types.
  - Rename read_first_n callback to read.   The reasons behind the original
    naming are lost to the mists of time.
* ad799x
  - Allow pm_ops to disable device completely allowing regulator power down.
* bma180
  - Enable basic regulator support.
* dmaengine buffer
  - Report platform data alignment requirements via new ABI.
* max31856
  - Add option to set mains filter rejection frequency and document
    new in_temp_filter_notch_center_frequency ABI.
  - Add support for configuring HW averaging (oversampling ratio)
  - Add runtime configuration of thermocouple type and document new ABI.
* maxim-thermocouple
  - Add read only access to thermocouple type using new ABI, includes
    adding more specific compatibles to reflect which variant of the
    chip is being used.
* mpu6050
  - Provide option to support the PMU9150 in package magnetometer directly
    rather than via auxiliary bus.
* stm32_adc
  - Add overrun interrupt checks to detect if this happens.
* st_lsm6dsx
  - Enable the sensor-hub support for lsm6dsm. Includes various reworks to
    allow this.

Cleanups and minor fixes

* Subsystem wide
  - Tidy up indentation in Kconfig and fix alphabetical order of AD7091R5.
  - Drop linux/gpio.h and linux/of_gpio.h from drivers that don't use them.
* ad7266
  - Convert to GPIO descriptors.
* ad7303
  - Avoid a dance with checking if the regulator is supplied by just
    using the optional request interface.
* ad7887
  - Simplify channel specification assignment to enable adding more devices.
* ad7923
  - Drop some unused and largely pointless defines of BOB_N==N variety.
  - Tidy up checkpatch warnings.
  - Add missing of_device_id table.
* adf4350
  - Convert to GPIO descriptors.
* ak8975
  - Convert to GPIO descriptors.
* ADIS library and drivers
  - Expand scope of txrx_lock to cover all state and rename as state_lock
  - Add unlocked read / write to allow grouping of consecutive calls under
    single lock / unlock.
  - Add unlocked check_status, reset to allow grouping under single
    lock / unlock.
  - Remove remaining uses of core mlock for local state protection.
    mlock should never be used directly as it protects tightly defined
    core IIO device management state.
* adis16240
  - Enforce only supported SPI mode on driver load + add DT binding doc.
* atlas-ph-sensor
  - Rename to atlas-sensor given it now covers things beyond ph sensors.
* bma180
  - Use local dev variable to tidy up code.
  - Use c99 style explicity .member assignment to make driver more readable.
* bmp280
  - Drop ACPI support. No evidence this was used and appropriate ID is not
    registered.
  - Allow ACPI to bind device via PRP0001
* dmaengine buffer
  - Use dma_request_chan instead of dma_request_slave_channel_reason as that
    ABI is going away.
  - Add module info to avoid tainting the kernel.
* hts221
  - Avoid magic number defines when only used to fill structure elements
    that are self describing.
* lm3533
  - Drop a stray semicolon.
* max9611
  - Cleanup enum handling to be more resilient to future changes.
* mpu6050
  - Delete MPU9150 from supported SPI devices as doesn't provide SPI.
  - Select I2C_MUX again after kbuild issue fixed elsewhere.
* stm32-timer
  - Drop an unnecessary register update.
* ssp_sensors
  - Convert to GPIO descriptors.
* st_sensors
  - drop !CONFIG_ACPI defines as ACPI_PTR() will stop them being used
    anyway.
  - Make default platform data structures __maybe_unsued.
  - Fill in some missing kernel-doc function parameters.
* st_lsm6dsx
  - white space fixes.
  - Mark some constants that aren't always used as __maybe_unused.
  - Drop of ID table guards as they just pervent use under ACPI.
  - Switch to device properties to allow ACPI usage.
* st_uvis25
  - Drop acpi.h include as no ACPI APIs used.
* ti-ads1015
  - Drop legacy platform data as no one seems to be using it.
  - Use the device property API instead of OF specific.
* ti-ads7950
  - typo fix in error message.

* tag 'iio-for-5.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (99 commits)
  iio: accel: bma180: BMA254 support
  iio: pressure: bmp280: Allow device to be enumerated from ACPI
  iio: pressure: bmp280: Drop ACPI support
  dt-bindings: iio: adc: convert sd modulator to json-schema
  iio: buffer: rename 'read_first_n' callback to 'read'
  iio: buffer-dmaengine: Report buffer length requirements
  bindings: iio: pressure: Add documentation for dlh driver
  dt-bindings: Add asc vendor
  iio: pressure: Add driver for DLH pressure sensors
  iio: buffer-dmaengine: Add module information
  iio: accel: bma180: Use explicit member assignment
  iio: accel: bma180: Basic regulator support
  iio: accel: bma180: Add dev helper variable
  iio: imu: st_lsm6dsx: enable sensor-hub support for lsm6dsm
  iio: imu: st_lsm6dsx: rename st_lsm6dsx_shub_read_reg in st_lsm6dsx_shub_read_output
  iio: imu: st_lsm6dsx: check if shub_output reg is located in primary page
  iio: imu: st_lsm6dsx: check if pull_up is located in primary page
  iio: imu: st_lsm6dsx: check if master_enable is located in primary page
  iio: imu: st_lsm6dsx: export max num of slave devices in st_lsm6dsx_shub_settings
  iio: light: remove unneeded semicolon
  ...

4 years agostaging: wfx: check for memory allocation failures from wfx_alloc_hif
Colin Ian King [Sat, 21 Dec 2019 00:15:43 +0000 (00:15 +0000)]
staging: wfx: check for memory allocation failures from wfx_alloc_hif

Currently calls to wfx_alloc_hif are not checking for a null return
when a memory allocation fails and this leads to null pointer
dereferencing issues.  Fix this by adding null pointer checks and
returning passing down -ENOMEM errors where necessary. The error
checking in the current driver is a bit sparse, so this may need
some extra attention later if required.

Fixes: f95a29d40782 ("staging: wfx: add HIF commands helpers")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191221001543.15255-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: add STAGING prefix to config names
Namjae Jeon [Fri, 3 Jan 2020 01:13:45 +0000 (09:13 +0800)]
staging: exfat: add STAGING prefix to config names

Add STAGING prefix to config names to avoid collsion with fs/exfat config.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Link: https://lore.kernel.org/r/20200103011345.25245-1-namjae.jeon@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vt6656: remove unnecessary parenthesis
Amir Mahdi Ghorbanian [Mon, 30 Dec 2019 15:55:20 +0000 (10:55 -0500)]
staging: vt6656: remove unnecessary parenthesis

Remove unnecessary parenthesis to abide by kernel
coding-style.

Signed-off-by: Amir Mahdi Ghorbanian <indigoomega021@gmail.com>
Link: https://lore.kernel.org/r/20191230155520.GA27072@user-ThinkPad-X230
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188eu: use break to exit while loop
Michael Straube [Fri, 20 Dec 2019 17:44:13 +0000 (18:44 +0100)]
staging: rtl8188eu: use break to exit while loop

The variable bContinual in Efuse_PgPacketRead() is only used to break
out of a while loop. Remove the variable and use break instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191220174413.13913-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: kpc2000: remove unnecessary assertions in kpc_dma_transfer
Aditya Pakki [Thu, 19 Dec 2019 17:21:11 +0000 (11:21 -0600)]
staging: kpc2000: remove unnecessary assertions in kpc_dma_transfer

In kpc_dma_transfer(), the assertion that priv is NULL and priv->ldev
is NULL, are never satisfied. The two callers of the function,
dereference the fields before the function is called. This patch
removes the two BUG_ON calls.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Link: https://lore.kernel.org/r/20191219172118.17456-1-pakki001@umn.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: accel: bma180: BMA254 support
Linus Walleij [Wed, 11 Dec 2019 21:38:19 +0000 (22:38 +0100)]
iio: accel: bma180: BMA254 support

This adds support for the BMA254 variant of this
accelerometer. The only difference for the simple IIO
driver is that values are 12 bit and the temperature
offset differs by 1 degree.

Whilst wildcards in naming are normally frowned upon:

The cases where I have labeled variables "25x" is where the
models are identical, so as to make things easier for people
that want to add support for BMA253 and BMA255.

Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: bmp280: Allow device to be enumerated from ACPI
Andy Shevchenko [Mon, 9 Dec 2019 18:28:05 +0000 (20:28 +0200)]
iio: pressure: bmp280: Allow device to be enumerated from ACPI

There is no need to limit the driver use by OF/platform code.
In this case we simple remove redundant OF parts from the code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: bmp280: Drop ACPI support
Andy Shevchenko [Mon, 9 Dec 2019 18:28:04 +0000 (20:28 +0200)]
iio: pressure: bmp280: Drop ACPI support

There is no evidence of officially registered ACPI IDs for these devices.
Thus, revert ACPI support from the driver. All authors of the respective
changes are being informed here:

  d5c94568cc1d ("iio: add bmp280 pressure and temperature driver")
  6dba72eca7fb ("iio: pressure: bmp280: add support for BMP180")
  14beaa8f5ab1 ("iio: pressure: bmp280: add humidity support")

Above seems a cargo cult without paying attention to how ACPI IDs
are being allocated.

Cc: Vlad Dogaru <ddvlad@gmail.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adc: convert sd modulator to json-schema
Olivier Moysan [Fri, 6 Dec 2019 10:00:58 +0000 (11:00 +0100)]
dt-bindings: iio: adc: convert sd modulator to json-schema

Convert the sigma delta modulator bindings
to DT schema format using json-schema.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: buffer: rename 'read_first_n' callback to 'read'
Lars-Peter Clausen [Wed, 11 Dec 2019 10:43:00 +0000 (12:43 +0200)]
iio: buffer: rename 'read_first_n' callback to 'read'

It is implied that 'read' will read the first n bytes and not e.g. bytes
only from offsets within the buffer that are a prime number.

This change is non-functional, mostly just a rename.
A secondary intent with this patch is to make room later to add a write
callback.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: buffer-dmaengine: Report buffer length requirements
Lars-Peter Clausen [Wed, 11 Dec 2019 11:56:15 +0000 (13:56 +0200)]
iio: buffer-dmaengine: Report buffer length requirements

The dmaengine buffer has some length alignment requirements that can differ
from platform to platform. If the length alignment requirements are not met
unexpected behavior like dropping of samples can occur.

Currently these requirements are not reported and applications need to know
the requirements of the platform by some out-of-band means.

Add a new buffer attribute that reports the length alignment requirements
called `length_align_bytes`. The reported length alignment is in bytes that
means the buffer length alignment in sample sets depends on the number of
enabled channels and the bytes per channel. Applications using this
attribute to determine the buffer size requirements need to consider this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agobindings: iio: pressure: Add documentation for dlh driver
Tomislav Denis [Wed, 11 Dec 2019 09:59:46 +0000 (10:59 +0100)]
bindings: iio: pressure: Add documentation for dlh driver

Add a device tree binding documentation for DLH series pressure
sensors.

Signed-off-by: Tomislav Denis <tomislav.denis@avl.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: Add asc vendor
Tomislav Denis [Wed, 11 Dec 2019 09:59:45 +0000 (10:59 +0100)]
dt-bindings: Add asc vendor

All Sensors Corporation is a manufacturer of MEMS piezoresitive
ultra low pressure sensors and pressure transducers.

Signed-off-by: Tomislav Denis <tomislav.denis@avl.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: Add driver for DLH pressure sensors
Tomislav Denis [Wed, 11 Dec 2019 09:59:44 +0000 (10:59 +0100)]
iio: pressure: Add driver for DLH pressure sensors

All Sensors DLH is series of low voltage digital pressure sensors.
Additionally to pressure value sensors deliver a temperature value.
Sensors can be accessed over I2C and SPI, this driver supports
only I2C access.

Signed-off-by: Tomislav Denis <tomislav.denis@avl.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: buffer-dmaengine: Add module information
Lars-Peter Clausen [Wed, 11 Dec 2019 10:41:47 +0000 (12:41 +0200)]
iio: buffer-dmaengine: Add module information

Make sure that the industrialio-buffer-dmaengine has proper license
information so it can be build as a module and loaded without tainting the
kernel.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: bma180: Use explicit member assignment
Linus Walleij [Wed, 11 Dec 2019 21:38:18 +0000 (22:38 +0100)]
iio: accel: bma180: Use explicit member assignment

This uses the C99 explicit .member assignment for the
variant data in struct bma180_part_info. This makes it
easier to understand and add new variants.

Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: bma180: Basic regulator support
Linus Walleij [Wed, 11 Dec 2019 21:38:17 +0000 (22:38 +0100)]
iio: accel: bma180: Basic regulator support

This brings up the VDD and VDDIO regulators using the
regulator framework. Platforms that do not use regulators
will provide stubs or dummy regulators.

Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: bma180: Add dev helper variable
Linus Walleij [Wed, 11 Dec 2019 21:38:16 +0000 (22:38 +0100)]
iio: accel: bma180: Add dev helper variable

Having a shorthand "dev" instead of &client->dev everywhere
makes the code easier to read (more compact).

Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: enable sensor-hub support for lsm6dsm
Lorenzo Bianconi [Sat, 14 Dec 2019 16:52:59 +0000 (17:52 +0100)]
iio: imu: st_lsm6dsx: enable sensor-hub support for lsm6dsm

Enabled i2c master controller support for LSM6DSM sensor. Enable
ext_sensor0 for lsm6dsm. This series has been tested using LIS2MDL as
slave device connected to the i2c controller of the LSM6DSM

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: rename st_lsm6dsx_shub_read_reg in st_lsm6dsx_shub_read_output
Lorenzo Bianconi [Sat, 14 Dec 2019 16:52:58 +0000 (17:52 +0100)]
iio: imu: st_lsm6dsx: rename st_lsm6dsx_shub_read_reg in st_lsm6dsx_shub_read_output

Rename st_lsm6dsx_shub_read_reg routine in st_lsm6dsx_shub_read_output
since it is used to read from sensorhub channel0 output register

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: check if shub_output reg is located in primary page
Lorenzo Bianconi [Sat, 14 Dec 2019 16:52:57 +0000 (17:52 +0100)]
iio: imu: st_lsm6dsx: check if shub_output reg is located in primary page

Check if the sensor hub output register is located in the primary or in the
secondary memory page. This is a preliminary patch to support i2c master
controller on lsm6dsm devices

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: check if pull_up is located in primary page
Lorenzo Bianconi [Sat, 14 Dec 2019 16:52:56 +0000 (17:52 +0100)]
iio: imu: st_lsm6dsx: check if pull_up is located in primary page

Check if the pull up register is located in the primary or in the
secondary memory page. This is a preliminary patch to support i2c master
controller on lsm6dsm devices

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: check if master_enable is located in primary page
Lorenzo Bianconi [Sat, 14 Dec 2019 16:52:55 +0000 (17:52 +0100)]
iio: imu: st_lsm6dsx: check if master_enable is located in primary page

Check if the master enable register is located in the primary or in the
secondary memory page. This is a preliminary patch to support i2c master
controller on lsm6dsm devices

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: export max num of slave devices in st_lsm6dsx_shub_settings
Lorenzo Bianconi [Sat, 14 Dec 2019 16:52:54 +0000 (17:52 +0100)]
iio: imu: st_lsm6dsx: export max num of slave devices in st_lsm6dsx_shub_settings

Export max number of slave devices supported by the i2c master
controller in st_lsm6dsx_shub_settings data structure.
This is a preliminary patch to support i2c master controller
on lsm6dsm sensors

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: light: remove unneeded semicolon
Chen Zhou [Mon, 16 Dec 2019 10:51:01 +0000 (18:51 +0800)]
iio: light: remove unneeded semicolon

Fixes coccicheck warning:

./drivers/iio/light/lm3533-als.c:745:2-3: Unneeded semicolon

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: chemical: atlas-ph-sensor: rename atlas-ph-sensor to atlas-sensor
Matt Ranostay [Mon, 16 Dec 2019 00:00:45 +0000 (16:00 -0800)]
iio: chemical: atlas-ph-sensor: rename atlas-ph-sensor to atlas-sensor

Since the orginal scope of the driver was to only support
the pH product from Atlas it has evolved to other sensors.

Rename the file, driver name, and regmap to atlas-sensor which
reflects this, although keep CONFIG_ATLAS_PH_SENSOR to not cause
regressions with current configurations.

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_sensors: Describe function parameters in kernel-doc
Andy Shevchenko [Mon, 16 Dec 2019 17:38:51 +0000 (19:38 +0200)]
iio: st_sensors: Describe function parameters in kernel-doc

Kernel documentation script complains that some of the function parameters
are not described:

.../common/st_sensors/st_sensors_trigger.c:29: warning: Function parameter or member 'indio_dev' not described in 'st_sensors_new_samples_available'
.../common/st_sensors/st_sensors_trigger.c:29: warning: Function parameter or member 'sdata' not described in 'st_sensors_new_samples_available'

Describe function parameters where it's appropriate.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: st_press: Mark default_press_pdata with __maybe_unused
Andy Shevchenko [Mon, 16 Dec 2019 17:38:50 +0000 (19:38 +0200)]
iio: pressure: st_press: Mark default_press_pdata with __maybe_unused

Since we put static variable to a header file it's copied to each module
that includes the header. But not all of them are actually used it.

Mark default_press_pdata with __maybe_unused to calm a compiler down:

In file included from drivers/iio/pressure/st_pressure_spi.c:18:
drivers/iio/pressure/st_pressure.h:40:46: warning: ‘default_press_pdata’ defined but not used [-Wunused-const-variable=]
   40 | static const struct st_sensors_platform_data default_press_pdata = {
      |                                              ^~~~~~~~~~~~~~~~~~~
...

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: st_accel: Mark default_accel_pdata with __maybe_unused
Andy Shevchenko [Mon, 16 Dec 2019 17:38:49 +0000 (19:38 +0200)]
iio: accel: st_accel: Mark default_accel_pdata with __maybe_unused

Since we put static variable to a header file it's copied to each module
that includes the header. But not all of them are actually used it.

Mark default_accel_pdata with __maybe_unused to calm a compiler down:

In file included from drivers/iio/accel/st_accel_i2c.c:19:
drivers/iio/accel/st_accel.h:67:46: warning: ‘default_accel_pdata’ defined but not used [-Wunused-const-variable=]
   67 | static const struct st_sensors_platform_data default_accel_pdata = {
      |                                              ^~~~~~~~~~~~~~~~~~~
...

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: gyro: st_gyro: Mark gyro_pdata with __maybe_unused
Andy Shevchenko [Mon, 16 Dec 2019 17:38:48 +0000 (19:38 +0200)]
iio: gyro: st_gyro: Mark gyro_pdata with __maybe_unused

Since we put static variable to a header file it's copied to each module
that includes the header. But not all of them are actually used it.

Mark gyro_pdata with __maybe_unused to calm a compiler down:

In file included from drivers/iio/gyro/st_gyro_i2c.c:18:
drivers/iio/gyro/st_gyro.h:31:46: warning: ‘gyro_pdata’ defined but not used [-Wunused-const-variable=]
   31 | static const struct st_sensors_platform_data gyro_pdata = {
      |                                              ^~~~~~~~~~
...

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: st_press: Drop unnecessary #else branch for ACPI
Andy Shevchenko [Mon, 16 Dec 2019 17:38:47 +0000 (19:38 +0200)]
iio: pressure: st_press: Drop unnecessary #else branch for ACPI

ACPI_PTR() takes care of the argument in case of !CONFIG_ACPI.
Remove unnecessary #else branch.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: st_accel: Drop unnecessary #else branch for ACPI
Andy Shevchenko [Mon, 16 Dec 2019 17:38:46 +0000 (19:38 +0200)]
iio: accel: st_accel: Drop unnecessary #else branch for ACPI

ACPI_PTR() takes care of the argument in case of !CONFIG_ACPI.
Remove unnecessary #else branch.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: light: st_uvis25: Drop unneeded header inclusion
Andy Shevchenko [Mon, 16 Dec 2019 17:38:45 +0000 (19:38 +0200)]
iio: light: st_uvis25: Drop unneeded header inclusion

There is no evidence that the driver supports or needs ACPI APIs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_lsm6dsx: Make use of device properties
Andy Shevchenko [Mon, 16 Dec 2019 18:19:25 +0000 (20:19 +0200)]
iio: st_lsm6dsx: Make use of device properties

Device property API allows to gather device resources from different sources,
such as ACPI. Convert the drivers to unleash the power of device property API.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_lsm6dsx: Drop unneeded OF code
Andy Shevchenko [Mon, 16 Dec 2019 18:19:24 +0000 (20:19 +0200)]
iio: st_lsm6dsx: Drop unneeded OF code

There is no need to have OF guard against ID table.
Drop it for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_lsm6dsx: Mark predefined constants with __maybe_unused
Andy Shevchenko [Mon, 16 Dec 2019 18:19:23 +0000 (20:19 +0200)]
iio: st_lsm6dsx: Mark predefined constants with __maybe_unused

Since we put static variable to a header file it's copied to each module
that includes the header. But not all of them are actually used it.

Mark predefined constants with __maybe_unused to calm a compiler down:

In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c:17:
.../st_lsm6dsx/st_lsm6dsx.h:399:28: warning: ‘st_lsm6dsx_available_scan_masks’ defined but not used [-Wunused-const-variable=]
  399 | static const unsigned long st_lsm6dsx_available_scan_masks[] = {0x7, 0x0};
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../st_lsm6dsx/st_lsm6dsx.h:392:36: warning: ‘st_lsm6dsx_event’ defined but not used [-Wunused-const-variable=]
  392 | static const struct iio_event_spec st_lsm6dsx_event = {
      |                                    ^~~~~~~~~~~~~~~~
...

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad7923: Add support for the ad7908/ad7918/ad7928
Daniel Junho [Tue, 17 Dec 2019 11:11:58 +0000 (08:11 -0300)]
iio: adc: ad7923: Add support for the ad7908/ad7918/ad7928

The ad7928 is software compatible with the ad7923.
The ad7908 and ad7918 are the 8 and 10-bit versions of the ad7928.

Signed-off-by: Daniel Junho <djunho@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad7923: Add of_device_id table
Daniel Junho [Tue, 17 Dec 2019 11:11:57 +0000 (08:11 -0300)]
iio: adc: ad7923: Add of_device_id table

Accomplish device tree compatibility to driver AD7923
by adding of_device_id table and making a subsequent call to
MODULE_DEVICE_TABLE.

Signed-off-by: Daniel Junho <djunho@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad7923: Fix checkpatch warning
Daniel Junho [Tue, 17 Dec 2019 11:11:56 +0000 (08:11 -0300)]
iio: adc: ad7923: Fix checkpatch warning

Fix checkpatch warning:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
+static int ad7923_scan_direct(struct ad7923_state *st, unsigned ch)

Signed-off-by: Daniel Junho <djunho@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad7923: Remove the unused defines
Daniel Junho [Tue, 17 Dec 2019 11:11:55 +0000 (08:11 -0300)]
iio: adc: ad7923: Remove the unused defines

Removes the unused define AD7923_CHANNEL_x from the code.

Signed-off-by: Daniel Junho <djunho@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: bma400: basic regulator support
Dan Robertson [Fri, 20 Dec 2019 16:00:51 +0000 (16:00 +0000)]
iio: accel: bma400: basic regulator support

Add support for the VDD and VDDIO regulators using the regulator
framework.

Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: Add driver for the BMA400
Dan Robertson [Fri, 20 Dec 2019 16:00:50 +0000 (16:00 +0000)]
iio: accel: Add driver for the BMA400

Add a IIO driver for the Bosch BMA400 3-axes ultra-low power accelerometer.
The driver supports reading from the acceleration and temperature
registers. The driver also supports reading and configuring the output data
rate, oversampling ratio, and scale.

Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: accel: bma400: add bindings
Dan Robertson [Fri, 20 Dec 2019 16:00:49 +0000 (16:00 +0000)]
dt-bindings: iio: accel: bma400: add bindings

Add devicetree binding for the Bosch BMA400 3-axes ultra-low power
accelerometer sensor.

Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoMerge 5.5-rc3 into staging-next
Greg Kroah-Hartman [Mon, 23 Dec 2019 12:00:09 +0000 (07:00 -0500)]
Merge 5.5-rc3 into staging-next

We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoLinux 5.5-rc3
Linus Torvalds [Mon, 23 Dec 2019 01:02:23 +0000 (17:02 -0800)]
Linux 5.5-rc3

4 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Mon, 23 Dec 2019 01:00:04 +0000 (17:00 -0800)]
Merge branch 'fixes' of git://git./linux/kernel/git/viro/vfs

Pull vfs fixes from Al Viro:
 "Eric's s_inodes softlockup fixes + Jan's fix for recent regression
  from pipe rework"

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  fs: call fsnotify_sb_delete after evict_inodes
  fs: avoid softlockups in s_inodes iterators
  pipe: Fix bogus dereference in iov_iter_alignment()

4 years agoMerge tag 'xfs-5.5-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Linus Torvalds [Sun, 22 Dec 2019 18:59:06 +0000 (10:59 -0800)]
Merge tag 'xfs-5.5-fixes-2' of git://git./fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:
 "Fix a few bugs that could lead to corrupt files, fsck complaints, and
  filesystem crashes:

   - Minor documentation fixes

   - Fix a file corruption due to read racing with an insert range
     operation.

   - Fix log reservation overflows when allocating large rt extents

   - Fix a buffer log item flags check

   - Don't allow administrators to mount with sunit= options that will
     cause later xfs_repair complaints about the root directory being
     suspicious because the fs geometry appeared inconsistent

   - Fix a non-static helper that should have been static"

* tag 'xfs-5.5-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: Make the symbol 'xfs_rtalloc_log_count' static
  xfs: don't commit sunit/swidth updates to disk if that would cause repair failures
  xfs: split the sunit parameter update into two parts
  xfs: refactor agfl length computation function
  libxfs: resync with the userspace libxfs
  xfs: use bitops interface for buf log item AIL flag check
  xfs: fix log reservation overflows when allocating large rt extents
  xfs: stabilize insert range start boundary to avoid COW writeback race
  xfs: fix Sphinx documentation warning

4 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 22 Dec 2019 18:41:48 +0000 (10:41 -0800)]
Merge tag 'ext4_for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 bug fixes from Ted Ts'o:
 "Ext4 bug fixes, including a regression fix"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: clarify impact of 'commit' mount option
  ext4: fix unused-but-set-variable warning in ext4_add_entry()
  jbd2: fix kernel-doc notation warning
  ext4: use RCU API in debug_print_tree
  ext4: validate the debug_want_extra_isize mount option at parse time
  ext4: reserve revoke credits in __ext4_new_inode
  ext4: unlock on error in ext4_expand_extra_isize()
  ext4: optimize __ext4_check_dir_entry()
  ext4: check for directory entries too close to block end
  ext4: fix ext4_empty_dir() for directories with holes

4 years agoMerge tag 'block-5.5-20191221' of git://git.kernel.dk/linux-block
Linus Torvalds [Sun, 22 Dec 2019 18:36:55 +0000 (10:36 -0800)]
Merge tag 'block-5.5-20191221' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "Let's try this one again, this time without the compat_ioctl changes.
  We've got those fixed up, but that can go out next week.

  This contains:

   - block queue flush lockdep annotation (Bart)

   - Type fix for bsg_queue_rq() (Bart)

   - Three dasd fixes (Stefan, Jan)

   - nbd deadlock fix (Mike)

   - Error handling bio user map fix (Yang)

   - iocost fix (Tejun)

   - sbitmap waitqueue addition fix that affects the kyber IO scheduler
     (David)"

* tag 'block-5.5-20191221' of git://git.kernel.dk/linux-block:
  sbitmap: only queue kyber's wait callback if not already active
  block: fix memleak when __blk_rq_map_user_iov() is failed
  s390/dasd: fix typo in copyright statement
  s390/dasd: fix memleak in path handling error case
  s390/dasd/cio: Interpret ccw_device_get_mdc return value correctly
  block: Fix a lockdep complaint triggered by request queue flushing
  block: Fix the type of 'sts' in bsg_queue_rq()
  block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT
  nbd: fix shutdown and recv work deadlock v2
  iocost: over-budget forced IOs should schedule async delay

4 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Sun, 22 Dec 2019 18:26:59 +0000 (10:26 -0800)]
Merge tag 'for-linus' of git://git./virt/kvm/kvm

Pull KVM fixes from Paolo Bonzini:
 "PPC:
   - Fix a bug where we try to do an ultracall on a system without an
     ultravisor

  KVM:
   - Fix uninitialised sysreg accessor
   - Fix handling of demand-paged device mappings
   - Stop spamming the console on IMPDEF sysregs
   - Relax mappings of writable memslots
   - Assorted cleanups

  MIPS:
   - Now orphan, James Hogan is stepping down

  x86:
   - MAINTAINERS change, so long Radim and thanks for all the fish
   - supported CPUID fixes for AMD machines without SPEC_CTRL"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  MAINTAINERS: remove Radim from KVM maintainers
  MAINTAINERS: Orphan KVM for MIPS
  kvm: x86: Host feature SSBD doesn't imply guest feature AMD_SSBD
  kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD
  KVM: PPC: Book3S HV: Don't do ultravisor calls on systems without ultravisor
  KVM: arm/arm64: Properly handle faulting of device mappings
  KVM: arm64: Ensure 'params' is initialised when looking up sys register
  KVM: arm/arm64: Remove excessive permission check in kvm_arch_prepare_memory_region
  KVM: arm64: Don't log IMP DEF sysreg traps
  KVM: arm64: Sanely ratelimit sysreg messages
  KVM: arm/arm64: vgic: Use wrapper function to lock/unlock all vcpus in kvm_vgic_create()
  KVM: arm/arm64: vgic: Fix potential double free dist->spis in __kvm_vgic_destroy()
  KVM: arm/arm64: Get rid of unused arg in cpu_init_hyp_mode()

4 years agoMerge tag 'riscv/for-v5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv...
Linus Torvalds [Sun, 22 Dec 2019 18:22:47 +0000 (10:22 -0800)]
Merge tag 'riscv/for-v5.5-rc3' of git://git./linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley:
 "Several fixes, and one cleanup, for RISC-V.

  Fixes:

   - Fix an error in a Kconfig file that resulted in an undefined
     Kconfig option "CONFIG_CONFIG_MMU"

   - Fix undefined Kconfig option "CONFIG_CONFIG_MMU"

   - Fix scratch register clearing in M-mode (affects nommu users)

   - Fix a mismerge on my part that broke the build for
     CONFIG_SPARSEMEM_VMEMMAP users

  Cleanup:

   - Move SiFive L2 cache-related code to drivers/soc, per request"

* tag 'riscv/for-v5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: move sifive_l2_cache.c to drivers/soc
  riscv: define vmemmap before pfn_to_page calls
  riscv: fix scratch register clearing in M-mode.
  riscv: Fix use of undefined config option CONFIG_CONFIG_MMU

4 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Linus Torvalds [Sun, 22 Dec 2019 17:54:33 +0000 (09:54 -0800)]
Merge git://git./linux/kernel/git/netdev/net

Pull networking fixes from David Miller:

 1) Several nf_flow_table_offload fixes from Pablo Neira Ayuso,
    including adding a missing ipv6 match description.

 2) Several heap overflow fixes in mwifiex from qize wang and Ganapathi
    Bhat.

 3) Fix uninit value in bond_neigh_init(), from Eric Dumazet.

 4) Fix non-ACPI probing of nxp-nci, from Stephan Gerhold.

 5) Fix use after free in tipc_disc_rcv(), from Tuong Lien.

 6) Enforce limit of 33 tail calls in mips and riscv JIT, from Paul
    Chaignon.

 7) Multicast MAC limit test is off by one in qede, from Manish Chopra.

 8) Fix established socket lookup race when socket goes from
    TCP_ESTABLISHED to TCP_LISTEN, because there lacks an intervening
    RCU grace period. From Eric Dumazet.

 9) Don't send empty SKBs from tcp_write_xmit(), also from Eric Dumazet.

10) Fix active backup transition after link failure in bonding, from
    Mahesh Bandewar.

11) Avoid zero sized hash table in gtp driver, from Taehee Yoo.

12) Fix wrong interface passed to ->mac_link_up(), from Russell King.

13) Fix DSA egress flooding settings in b53, from Florian Fainelli.

14) Memory leak in gmac_setup_txqs(), from Navid Emamdoost.

15) Fix double free in dpaa2-ptp code, from Ioana Ciornei.

16) Reject invalid MTU values in stmmac, from Jose Abreu.

17) Fix refcount leak in error path of u32 classifier, from Davide
    Caratti.

18) Fix regression causing iwlwifi firmware crashes on boot, from Anders
    Kaseorg.

19) Fix inverted return value logic in llc2 code, from Chan Shu Tak.

20) Disable hardware GRO when XDP is attached to qede, frm Manish
    Chopra.

21) Since we encode state in the low pointer bits, dst metrics must be
    at least 4 byte aligned, which is not necessarily true on m68k. Add
    annotations to fix this, from Geert Uytterhoeven.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (160 commits)
  sfc: Include XDP packet headroom in buffer step size.
  sfc: fix channel allocation with brute force
  net: dst: Force 4-byte alignment of dst_metrics
  selftests: pmtu: fix init mtu value in description
  hv_netvsc: Fix unwanted rx_table reset
  net: phy: ensure that phy IDs are correctly typed
  mod_devicetable: fix PHY module format
  qede: Disable hardware gro when xdp prog is installed
  net: ena: fix issues in setting interrupt moderation params in ethtool
  net: ena: fix default tx interrupt moderation interval
  net/smc: unregister ib devices in reboot_event
  net: stmmac: platform: Fix MDIO init for platforms without PHY
  llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)
  net: hisilicon: Fix a BUG trigered by wrong bytes_compl
  net: dsa: ksz: use common define for tag len
  s390/qeth: don't return -ENOTSUPP to userspace
  s390/qeth: fix promiscuous mode after reset
  s390/qeth: handle error due to unsupported transport mode
  cxgb4: fix refcount init for TC-MQPRIO offload
  tc-testing: initial tdc selftests for cls_u32
  ...

4 years agopipe: fix empty pipe check in pipe_write()
Jan Stancek [Sun, 22 Dec 2019 12:33:24 +0000 (13:33 +0100)]
pipe: fix empty pipe check in pipe_write()

LTP pipeio_1 test is hanging with v5.5-rc2-385-gb8e382a185eb,
with read side observing empty pipe and sleeping and write
side running out of space and then sleeping as well. In this
scenario there are 5 writers and 1 reader.

Problem is that after pipe_write() reacquires pipe lock, it
re-checks for empty pipe with potentially stale 'head' and
doesn't wake up read side anymore. pipe->tail can advance
beyond 'head', because there are multiple writers.

Use pipe->head for empty pipe check after reacquiring lock
to observe current state.

Testing: With patch, LTP pipeio_1 ran successfully in loop for 1 hour.
         Without patch it hanged within a minute.

Fixes: 1b6b26ae7053 ("pipe: fix and clarify pipe write wakeup logic")
Reported-by: Rachel Sibley <rasibley@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
4 years agoMerge tag 'kvm-ppc-fixes-5.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Paolo Bonzini [Sun, 22 Dec 2019 12:18:15 +0000 (13:18 +0100)]
Merge tag 'kvm-ppc-fixes-5.5-1' of git://git./linux/kernel/git/paulus/powerpc into kvm-master

PPC KVM fix for 5.5

- Fix a bug where we try to do an ultracall on a system without an
  ultravisor.

4 years agoMAINTAINERS: remove Radim from KVM maintainers
Paolo Bonzini [Wed, 4 Dec 2019 14:33:35 +0000 (15:33 +0100)]
MAINTAINERS: remove Radim from KVM maintainers

Radim's kernel.org email is bouncing, which I take as a signal that
he is not really able to deal with KVM at this time.  Make MAINTAINERS
match the effective value of KVM's bus factor.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 years agoMAINTAINERS: Orphan KVM for MIPS
James Hogan [Sat, 21 Dec 2019 15:50:13 +0000 (15:50 +0000)]
MAINTAINERS: Orphan KVM for MIPS

I haven't been active for 18 months, and don't have the hardware set up
to test KVM for MIPS, so mark it as orphaned and remove myself as
maintainer. Hopefully somebody from MIPS can pick this up.

Signed-off-by: James Hogan <jhogan@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: kvm@vger.kernel.org
Cc: linux-mips@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 years agoext4: clarify impact of 'commit' mount option
Jan Kara [Wed, 18 Dec 2019 11:12:10 +0000 (12:12 +0100)]
ext4: clarify impact of 'commit' mount option

The description of 'commit' mount option dates back to ext3 times.
Update the description to match current meaning for ext4.

Reported-by: Paul Richards <paul.richards@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191218111210.14161-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext4: fix unused-but-set-variable warning in ext4_add_entry()
Yunfeng Ye [Tue, 17 Dec 2019 14:46:49 +0000 (22:46 +0800)]
ext4: fix unused-but-set-variable warning in ext4_add_entry()

Warning is found when compile with "-Wunused-but-set-variable":

fs/ext4/namei.c: In function ‘ext4_add_entry’:
fs/ext4/namei.c:2167:23: warning: variable ‘sbi’ set but not used
[-Wunused-but-set-variable]
  struct ext4_sb_info *sbi;
                       ^~~
Fix this by moving the variable @sbi under CONFIG_UNICODE.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/cb5eb904-224a-9701-c38f-cb23514b1fff@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoMerge tag 'trace-v5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Sat, 21 Dec 2019 23:16:56 +0000 (15:16 -0800)]
Merge tag 'trace-v5.5-rc2' of git://git./linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:

 - Fix memory leak on error path of process_system_preds()

 - Lock inversion fix with updating tgid recording option

 - Fix histogram compare function on big endian machines

 - Fix histogram trigger function on big endian machines

 - Make trace_printk() irq sync on init for kprobe selftest correctness

* tag 'trace-v5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix endianness bug in histogram trigger
  samples/trace_printk: Wait for IRQ work to finish
  tracing: Fix lock inversion in trace_event_enable_tgid_record()
  tracing: Have the histogram compare functions convert to u64 first
  tracing: Avoid memory leak in process_system_preds()

4 years agoMerge tag 'libnvdimm-fix-5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 21 Dec 2019 23:12:26 +0000 (15:12 -0800)]
Merge tag 'libnvdimm-fix-5.5-rc3' of git://git./linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fix from Dan Williams:
 "A minor regression fix.

  The libnvdimm unit tests were expecting to mock calls to
  ioremap_nocache() which disappeared in v5.5-rc1. This fix has appeared
  in -next and collided with some cleanups that Christoph has planned
  for v5.6, but he will fix up his branch once this goes in.

  Summary:

   - Restore the operation of the libnvdimm unit tests after the removal
     of ioremap_nocache()"

* tag 'libnvdimm-fix-5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  tools/testing/nvdimm: Fix mock support for ioremap