rodrigosiqueira [Fri, 16 Feb 2018 19:44:41 +0000 (17:44 -0200)]
iio:pressure:ms5611: Fix coding style in probe function
This patch fixes the checkpatch.pl warning and error:
iio/pressure/ms5611.h:66: ERROR: code indent should use tabs where possible
iio/pressure/ms5611.h:66: WARNING: please, no spaces at the start of a line
iio/pressure/ms5611.h:66: ERROR: "foo* bar" should be "foo *bar"
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Matt Ranostay [Sat, 17 Feb 2018 02:36:21 +0000 (18:36 -0800)]
iio: sysfs-bus-iio-*: update email contact
Change email contact for ABI documention to author's current employer
on the following files:
* sysfs-bus-iio-chemical-vz89x
* sysfs-bus-iio-proximity-as3935
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Harald Geyer [Sun, 11 Feb 2018 11:09:40 +0000 (11:09 +0000)]
iio: dht11: Improve detection of sensor type
The old code was based on a DHT11 datasheet which specifies a measurement
range of 20%-90% RH. Turns out the sensor actually reports values outside
this range, so we should support it as far as possible.
Reported-by: Edward Attfield <edward@attfield.ca>
Signed-off-by: Harald Geyer <harald@ccbib.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
rodrigosiqueira [Sat, 10 Feb 2018 20:23:15 +0000 (18:23 -0200)]
staging:
ade7759: Fix open parenthesis alignment
This patch fixes the CHECKs reported by checkpatch.pl for "alignment
should match open parenthesis"
Signed-off-by: rodrigosiqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Phil Reid [Fri, 9 Feb 2018 00:57:27 +0000 (08:57 +0800)]
iio: ad5272: Add support for Analog Devices digital potentiometers
Add implementation for Analog Devices AD5272 and AD5274 digital
potentiometer devices.
Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Phil Reid [Fri, 9 Feb 2018 00:57:26 +0000 (08:57 +0800)]
dt-bindings: ad5272: Add bindings for Analog Devices digital potentiometers
Add binding documentation for Analog Devices AD5272 and AD5274 digital
potentiometer devices.
Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Shreeya Patel [Tue, 6 Feb 2018 17:01:57 +0000 (22:31 +0530)]
Staging: iio:
ade7758: Expand buf_lock to cover both buffer and state protection
iio_dev->mlock is to be used only by the IIO core for protecting
device mode changes between INDIO_DIRECT and INDIO_BUFFER.
This patch replaces the use of mlock with the already established
buf_lock mutex.
Introducing 'unlocked' forms of read and write registers. The
read/write frequency functions now require buf_lock to be held.
That's not obvious so avoid this but moving the locking inside
the functions where it is then clear that they are taking the
unlocked forms of the register read/write.
It isn't readily apparent that write frequency function requires
the locks to be taken, so move it inside the function to where it
is required to protect.
Also, the read raw does not require iio_dev->mlock for
reads. It can run concurrently as resource protection is handled
by buf_lock in read register.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Crt Mori [Thu, 11 Jan 2018 10:20:23 +0000 (11:20 +0100)]
iio: temperature: Adding support for MLX90632
Melexis has just released Infra Red temperature sensor MLX90632 used
for contact-less temperature measurement. Driver provides basic
functionality for reporting object (and ambient) temperature with
support for object emissivity.
Signed-off-by: Crt Mori <cmo@melexis.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Crt Mori [Thu, 11 Jan 2018 10:20:10 +0000 (11:20 +0100)]
dt-bindings: iio: temperature: add MLX90632 device bindings
Add device tree bindings for MLX90632 IR temperature sensor.
Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Crt Mori [Thu, 11 Jan 2018 10:19:57 +0000 (11:19 +0100)]
lib: Add strongly typed 64bit int_sqrt
There is no option to perform 64bit integer sqrt on 32bit platform.
Added stronger typed int_sqrt64 enables the 64bit calculations to
be performed on 32bit platforms. Using same algorithm as int_sqrt()
with strong typing provides enough precision also on 32bit platforms,
but it sacrifices some performance. In case values are smaller than
ULONG_MAX the standard int_sqrt is used for calculation to maximize the
performance due to more native calculations.
Signed-off-by: Crt Mori <cmo@melexis.com>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Sat, 13 Jan 2018 17:57:56 +0000 (18:57 +0100)]
iio: imu: st_lsm6dsx: add hw timestamp support
Introduce hw timestamp support instead of compute sample timestamps
according to interrupt rate and configured watermark. LSM6DSx based
devices are able to queue in hw FIFO the time reference of data
sampling
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Milan Stevanovic [Sun, 14 Jan 2018 20:32:40 +0000 (21:32 +0100)]
iio: adc: change license description
Using an SPDX tag. Remove a license notice to keep
the whole purpose of using an SPDx id.
Signed-off-by: Milan Stevanovic <milan.o.stevanovic@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Milan Stevanovic [Sun, 14 Jan 2018 20:32:39 +0000 (21:32 +0100)]
iio: adc: driver for ti adc081s/adc101s/adc121s
Add Linux device driver for TI single-channel CMOS
8/10/12-bit analog-to-digital converter with a
high-speed serial interface.
Signed-off-by: Milan Stevanovic <milan.o.stevanovic@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Randy Dunlap [Mon, 15 Jan 2018 05:11:05 +0000 (21:11 -0800)]
iio/adc: depend on SYSFS instead of selecting it
Drivers should not 'select' a subsystem. Instead they should depend
on it. If the subsystem is disabled, the user probably did that for
a purpose and one driver shouldn't be changing that.
This also makes all IIO drivers consistent w.r.t depending on SYSFS
instead of selecting it.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Quentin Schulz [Mon, 15 Jan 2018 10:33:41 +0000 (11:33 +0100)]
iio: adc: axp20x_adc: add support for AXP813 ADC
The X-Powers AXP813 PMIC is really close to what is already done for
AXP20X/AXP22X.
There are two pairs of bits to set the rate (one for Voltage and Current
measurements and one for TS/GPIO0 voltage measurements) instead of one.
The register to set the ADC rates is different from the one for
AXP20X/AXP22X.
GPIO0 can be used as an ADC (measuring Volts) unlike for AXP22X.
The scales to apply to the different inputs are unlike the ones from
AXP20X and AXP22X.
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Quentin Schulz [Mon, 15 Jan 2018 10:33:37 +0000 (11:33 +0100)]
iio: adc: axp20x_adc: make it possible to probe from DT
To prepare for a future patch that will add a DT node for the ADC, make
axp20x_adc able to probe from DT and get the per-variant data from
of_device_id.data since platform_device_id.driver_data won't be set when
probing by DT.
Leave the ability to probe via platform for driver compatibility with
old DTs.
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Quentin Schulz [Mon, 15 Jan 2018 10:33:36 +0000 (11:33 +0100)]
dt-bindings: iio: adc: add binding for X-Powers AXP PMICs ADC
X-Powers PMICs have several ADC channels that can be used for different
purposes, e.g. PMIC internal temperature, battery voltage or AC current.
This is the documentation for AXP209, AXP221/223 and AXP813 ADC
bindings.
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Quentin Schulz [Mon, 15 Jan 2018 10:33:35 +0000 (11:33 +0100)]
iio: adc: axp20x_adc: put ADC rate setting in a per-variant function
To prepare for a new comer that set a different register with different
values, move rate setting in a function that is specific to each AXP
variant.
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Alexandru Ardelean [Thu, 18 Jan 2018 14:57:40 +0000 (16:57 +0200)]
staging: iio: adc: ad7192: disable burnout currents on misconfig
The burnout currents can be enabled only if buffer is enabled
and CHOP is disabled.
So, if neither of these conditions are met, then
we should disable the burnout currents in the driver as well,
and warn the user.
This change doesn't fix anything.
The burnout currents simply won't work if CHOP is enabled
or buffer is disabled.
The intent is to provide the user with some feedback
instead of silently not working inside the chip.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Wei Yongjun [Wed, 17 Jan 2018 11:30:00 +0000 (11:30 +0000)]
iio: ep93xx: remove redundant return value check of platform_get_resource()
Remove unneeded error handling on the result of a call
to platform_get_resource() when the value is passed to
devm_ioremap_resource().
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 8 Jan 2018 22:12:31 +0000 (23:12 +0100)]
iio: humidity: hts221: remove unnecessary get_unaligned_le16()
Remove unnecessary unaligned access routine in hts221_read_oneshot() and
the related include
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 8 Jan 2018 22:12:30 +0000 (23:12 +0100)]
iio: humidity: hts221: add regmap API support
Introduce regmap API support to access to i2c/spi bus instead of
using a custom support.
Remove lock mutex since concurrency is already managed by regmap API
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 8 Jan 2018 22:12:29 +0000 (23:12 +0100)]
iio: humidity: hts221: remove trailing whitespace from a comment
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 8 Jan 2018 22:12:28 +0000 (23:12 +0100)]
iio: humidity: hts221: remove warnings in hts221_parse_{temp,rh}_caldata()
Remove following sparse warnings in hts221_parse_temp_caldata() and in
hts221_parse_rh_caldata():
drivers/iio/humidity/hts221_core.c:302:19: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:314:18: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:320:18: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:355:18: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:361:18: warning: cast to
restricted __le16
Fixes: e4a70e3e7d84 ("iio: humidity: add support to hts221 rh/temp combo device")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Xiongfeng Wang [Fri, 12 Jan 2018 07:45:38 +0000 (15:45 +0800)]
iio: accel: use strlcpy() instead of strncpy()
gcc-8 reports
drivers/iio/accel/st_accel_i2c.c: In function 'st_accel_i2c_probe':
./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified
bound 20 equals destination size [-Wstringop-truncation]
The compiler require that the length of the dest string is greater than
the length we want to copy to make sure the dest string is
nul-terminated. We can just use strlcpy() to avoid this warning.
Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Michael Panzlaff [Tue, 9 Jan 2018 16:20:58 +0000 (17:20 +0100)]
staging: pi433: Cleanup codestyle, indent statements after case labels
This patch changes the indentation of the statements after case labels.
The linux coding guidelines do not explicitly mentiond this but pretty
much all existing code doesn't put any statements into the same line of
their belonging case labels. Therefore this adapts to the more usual style.
Please note that there is still a lot of > 80 character lines which will
cause checkpatch warnings. This patch does not intent to fix this
already existing issue.
Signed-off-by: Michael Panzlaff <michael.panzlaff@fau.de>
Signed-off-by: Tillmann Zipperer <tillmann.zipperer@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Luis de Bethencourt [Wed, 10 Jan 2018 16:51:29 +0000 (16:51 +0000)]
staging: rtl8723bs: Fix trailing semicolon
The trailing semicolon is an empty statement that does nothing.
Removing it since it has no purpose.
Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Luis de Bethencourt [Wed, 10 Jan 2018 16:51:28 +0000 (16:51 +0000)]
staging: rtl8723bs: Fix trailing semicolon
The trailing semicolon is an empty statement that does no operation.
Removing it since it doesn't do anything.
Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Luis Gerhorst [Wed, 10 Jan 2018 17:30:35 +0000 (18:30 +0100)]
staging: fbtft: Fix indentation
This fixes the checkpatch message:
CHECK: Alignment should match open parenthesis
#1380: FILE: drivers/staging/fbtft/fbtft-core.c:1380:
+ dev_warn(dev,
+ "no default functions for regwidth=%d and buswidth=%d\n",
Signed-off-by: Luis Gerhorst <linux-kernel@luisgerhorst.de>
Signed-off-by: Jonny Schaefer <schaefer.jonny@gmail.com>
Acked-by: Alexander Wuerstlein <arw@cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sumit Pundir [Wed, 10 Jan 2018 10:16:10 +0000 (15:46 +0530)]
staging: rts5208: sd: fix misspelled constant
Fixes the misspelled constant to 'SWITCH_NO_ERR'.
Issue reported by checkpatch.pl
Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joe Perches [Tue, 9 Jan 2018 19:33:56 +0000 (11:33 -0800)]
MAINTAINERS: Mark some staging directories as "Obsolete"
Several staging directories have TODO files that indicate a
subsystem will be removed in the future.
Using a status entry of "S: Obsolete" helps indicate the
subsystem files should not be modified unnecessarily.
checkpatch also tests this setting and emits a warning that
the matching subsystem files should not be modified.
This might help avoid receiving patches that will be dropped.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Luis de Bethencourt [Tue, 9 Jan 2018 16:51:03 +0000 (16:51 +0000)]
staging: rtl8723bs: Fix trailing semicolon
The trailing semicolon is an empty statement that does no operation.
Removing it since it doesn't do anything.
Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Colin Ian King [Tue, 9 Jan 2018 17:06:40 +0000 (17:06 +0000)]
ncpfs: remove redundant cast of struct ncp_inode_info
Casting a value returned by memory an allocation function is
not required and can be removed. Also add in a newline after before
the first statement. Code clean up as suggested by coccinelle.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Valentin Vidic [Tue, 9 Jan 2018 14:39:17 +0000 (15:39 +0100)]
staging: pi433: align function parameters with open parenthesis
Fixes checkpatch warnings:
CHECK: Alignment should match open parenthesis
Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Tue, 9 Jan 2018 10:24:33 +0000 (10:24 +0000)]
staging: ccree: dma mask is type u64
The dma mask var was defined as dma_addr_t but should be
u64. This showed as a sparse warning when building for 32 bit.
Fix it by changing type to u64 and drop the cast.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Tue, 9 Jan 2018 10:24:32 +0000 (10:24 +0000)]
staging: ccree: make stub function static inline
The debugfs interface defines stub function if debugfs is not
enabled, which were missing the 'static inline' qualifiers causing
sparse warnings.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Tue, 9 Jan 2018 10:24:31 +0000 (10:24 +0000)]
staging: ccree: add missing include
Add the missing include of include file with function declarations.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Tue, 9 Jan 2018 10:24:30 +0000 (10:24 +0000)]
staging: ccree: remove unneeded includes
Remove include files not needed for compilation.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Tue, 9 Jan 2018 10:24:29 +0000 (10:24 +0000)]
staging: ccree: use a consistent file naming convention
The ccree driver source files were using an inconsistent
naming convention stemming from what the company was called
when they were added.
Move to a single consistent naming convention for better
code readability.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: remove LIBCFS_ALLOC, LIBCFS_FREE and related macros.
LIBCFS_ALLOC
LIBCFS_ALLOC_ATOMIC
LIBCFS_ALLOC_POST
LIBCFS_CPT_ALLOC
LIBCFS_FREE
are no longer used, and so are removed.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: replace LIBCFS_CPT_ALLOC()
LIBCFS_APT_ALLOC() calls kvmalloc_node() with GFP_NOFS
which is not permitted.
Mostly, a kmalloc_node(GFP_NOFS) is appropriate, though occasionally
the allocation is large and GFP_KERNEL is acceptable, so
kvmalloc_node() can be used.
This patch introduces 4 alternatives to LIBCFS_CPT_ALLOC():
kmalloc_cpt()
kzalloc_cpt()
kvmalloc_cpt()
kvzalloc_cpt().
Each takes a size, gfp flags, and cpt number.
Almost every call to LIBCFS_CPT_ALLOC() passes lnet_cpt_table()
as the table. This patch embeds that choice in the k*alloc_cpt()
macros, and opencode kzalloc_node(..., cfs_cpt_spread_node(..))
in the one case that lnet_cpt_table() isn't used.
When LIBCFS_CPT_ALLOC() is replaced, the matching LIBCFS_FREE()
is also replaced, with with kfree() or kvfree() as appropriate.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: opencode LIBCFS_ALLOC_ATOMIC calls.
Just call kzalloc(GFP_ATOMIC) directly.
We don't need the warning on failure.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: cfs_percpt_alloc: use kvmalloc(GFP_KERNEL)
this allocation is called from several places, but all are
during initialization, so GFP_NOFS is not needed.
So use kvmalloc and GFP_KERNEL.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: use kmalloc for allocating ksock_tx
The size of the data structure is primarily controlled
by the iovec size, which is limited to 256.
Entries in this vector are 12 bytes, so the whole
will always fit in a page.
So it is safe to use kmalloc (kvmalloc not needed).
So replace LIBCFS_ALLOC with kmalloc.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: lnet-route: use kmalloc for small allocation
This allocation is reasonably small.
As the function is called "*_locked", it might not be safe
to perform a GFP_KERNEL allocation, so be safe and
use GFP_NOFS.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: more conversions to GFP_KERNEL allocations.
These are not called from filesystem context, so use
GFP_KERNEL, not LIBCFS_ALLOC().
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: more LIBCFS_ALLOC conversions to GFP_KERNEL allocations.
None of these need GFP_NOFS so allocate directly.
Change matching LIBCFS_FREE() to kfree() or kvfree().
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: Convert more LIBCFS_ALLOC allocation to direct GFP_KERNEL
None of these need to be GFP_NOFS, so use GFP_KERNEL explicitly
with kmalloc(), kvmalloc(), or kvmalloc_array().
Change matching LIBCFS_FREE() to kfree() or kvfree()
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: change some LIBCFS_ALLOC calls to k?alloc(GFP_KERNEL)
When an allocation happens from process context rather than
filesystem context, it is best to use GFP_KERNEL rather than
LIBCFS_ALLOC() which always uses GFP_NOFS.
This include initialization during, or prior to, mount,
and code run from separate worker threads.
So for some of these cases, switch to kmalloc, kvmalloc, or
kvmalloc_array() as appropriate.
In some cases we preserve __GFP_ZERO (via kzalloc/kvzalloc), but in
others it is clear that allocated memory is immediately initialized.
In each case, the matching LIBCFS_FREE() is converted to
kfree() or kvfree()
This is just a subset of locations that need changing.
As there are quite a lot, I've broken them up into several
ad-hoc sets to avoid review-fatigue.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: lnet: use kmalloc/kvmalloc in router_proc
The buffers allocated in router_proc are to temporarily
hold strings created for procfs files.
So they do not need to be zeroed and are safe to use
GFP_KERNEL.
So use kmalloc() directly except in two cases where it
isn't trivial to confirm that the size is always small.
In those cases, use kvmalloc().
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: lnet: selftest: don't allocate small strings.
All of the "name" buffers here are at most LST_NAME_SIZE+1
bytes, so 33 bytes at most.
They are only used temporarily during the life of the function
that allocates them.
So it is much simpler to just allocate on the stack.
Worst case is lst_tet_add_ioct(), which allocates
3 for these which 99 bytes on the stack, instead of the 24 that would
have been allocated for 64-bit pointers.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: lnet: switch to cpumask_var_t
So that we can use the common cpumask allocation functions,
switch to cpumask_var_t.
We need to be careful not to free a cpumask_var_t until the
variable has been initialized, and it cannot be initialized
directly.
So we must be sure either that it is filled with zeros, or
that zalloc_cpumask_var() has been called on it.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Tue, 9 Jan 2018 01:19:38 +0000 (12:19 +1100)]
staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.
All usages of the form
LIBCFS_ALLOC(variable, sizeof(variable))
or
LIBCFS_ALLOC(variable, sizeof(variable's-type))
are changed to
variable = kzalloc(sizeof(...), GFP_NOFS);
Similarly, all
LIBCFS_FREE(variable, sizeof(variable))
become
kfree(variable);
None of these need the vmalloc option, or any of the other minor
benefits of LIBCFS_ALLOC().
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Valentin Vidic [Mon, 8 Jan 2018 17:38:31 +0000 (18:38 +0100)]
staging: pi433: replace shifting with BIT macro
Fixes checkpatch warnings:
CHECK: Prefer using the BIT macro
Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sumit Pundir [Mon, 8 Jan 2018 16:50:15 +0000 (22:20 +0530)]
Staging: greybus: camera: cleanup multiple checks for null pointers
Fixed coding style issue regarding null comparison at multiple lines.
Issue reported by checkpatch.pl
Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Laura Abbott [Fri, 5 Jan 2018 19:14:09 +0000 (11:14 -0800)]
staging: android: ion: Switch from WARN to pr_warn
Syzbot reported a warning with Ion:
WARNING: CPU: 0 PID: 3502 at drivers/staging/android/ion/ion-ioctl.c:73 ion_ioctl+0x2db/0x380 drivers/staging/android/ion/ion-ioctl.c:73
Kernel panic - not syncing: panic_on_warn set ...
This is a warning that validation of the ioctl fields failed. This was
deliberately added as a warning to make it very obvious to developers that
something needed to be fixed. In reality, this is overkill and disturbs
fuzzing. Switch to pr_warn for a message instead.
Reported-by: syzbot+fa2d5f63ee5904a0115a@syzkaller.appspotmail.com
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Laura Abbott [Fri, 5 Jan 2018 19:14:08 +0000 (11:14 -0800)]
staging: android: ion: Add __GFP_NOWARN for system contig heap
syzbot reported a warning from Ion:
WARNING: CPU: 1 PID: 3485 at mm/page_alloc.c:3926
...
__alloc_pages_nodemask+0x9fb/0xd80 mm/page_alloc.c:4252
alloc_pages_current+0xb6/0x1e0 mm/mempolicy.c:2036
alloc_pages include/linux/gfp.h:492 [inline]
ion_system_contig_heap_allocate+0x40/0x2c0
drivers/staging/android/ion/ion_system_heap.c:374
ion_buffer_create drivers/staging/android/ion/ion.c:93 [inline]
ion_alloc+0x2c1/0x9e0 drivers/staging/android/ion/ion.c:420
ion_ioctl+0x26d/0x380 drivers/staging/android/ion/ion-ioctl.c:84
vfs_ioctl fs/ioctl.c:46 [inline]
do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
This is a warning about attempting to allocate order > MAX_ORDER. This
is coming from a userspace Ion allocation request. Since userspace is
free to request however much memory it wants (and the kernel is free to
deny its allocation), silence the allocation attempt with __GFP_NOWARN
in case it fails.
Reported-by: syzbot+76e7efc4748495855a4d@syzkaller.appspotmail.com
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shubham Kumaram [Sun, 7 Jan 2018 21:11:33 +0000 (02:41 +0530)]
Staging: gs_fpgaboot: remove FSF's mailing address from io.h
This patch removes FSF's mailing address issue from io.h found by
checkpatch.pl tool.
Signed-off-by: Shubham Kumaram <shubhamkumaram@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marcelo Guzmán Lamperti [Mon, 8 Jan 2018 01:03:32 +0000 (22:03 -0300)]
staging: sm750fb: Remove multiple blank lines
Remove multiple blank lines. Issue found by checkpatch.
Signed-off-by: Marcelo Guzmán Lamperti <marcelo.guzman.lamperti@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ioana Radulescu [Fri, 5 Jan 2018 11:04:32 +0000 (05:04 -0600)]
staging: fsl-dpaa2/eth: Use affine DPIO services
Use the newly added DPIO service API to map cpu-affine DPIO services
to channels.
The DPAA2 Ethernet driver already had mappings of frame queues and
channels to cpus, but had no control over the DPIOs used. We can
now ensure full affinity of hotpath hardware resources to cores,
which improves performance and almost eliminates some resource
contentions (e.g. enqueue/dequeue busy counters should be close to
zero from now on).
Making the pull channel operation core affine brings the most
significant benefits. This ensures the same DPIO service will be
used for all dequeue commands issued for a certain frame queue,
which is in line with the way hardware is optimized.
Additionally, we also use affine DPIOs for the frame enqueue and
buffer release operations in order to avoid resource contention.
dpaa2_io_service_register() and dpaa2_io_service_rearm()
functions receive an affine DPIO as argument mostly for uniformity,
but this doesn't change the previous functionality.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ioana Radulescu [Fri, 5 Jan 2018 11:04:31 +0000 (05:04 -0600)]
staging: fsl-mc/dpio: Add dpaa2_io_service_select() API
All DPIO service API functions receive a dpaa2_io service pointer
as parameter (NULL meaning any service will do) which indicates
the hardware resource to be used to execute the specified command.
There isn't however any available API for obtaining such a service
reference that could be used further, effectively forcing the users
to always request a random service for DPIO operations.
(The DPIO driver holds internally an array mapping services to cpus,
and affine services can be indirectly requested by a couple of API
functions: dpaa2_io_service_register and dpaa2_io_service_rearm
use the cpu id provided by the user to select the corresponding
service)
This patch adds a function for selecting a DPIO service based on
the specified cpu id. If the user provides a "don't care" value
for the cpu, we revert to the default behavior and return the next
DPIO, taken in a round-robin fashion from a list of available
services.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Acked-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sumit Pundir [Mon, 25 Dec 2017 05:31:14 +0000 (11:01 +0530)]
Staging: vt6656: Fix unnecessary 'out of memory' message
This patch fixes one of the warnings as noted by checkpatch.pl related
to unnecessary 'out of memory' message.
This patch fixes the following checkpatch.pl error:
WARNING: Possible unnecessary 'out of memory' message
Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
Jia-Ju Bai [Sun, 24 Dec 2017 10:16:55 +0000 (18:16 +0800)]
staging: rtl8192u: Replace mdelay with msleep in rtl8192_usb_probe
rtl8192_usb_probe is not called in an interrupt handler
nor holding a spinlock.
The function mdelay in it can be replaced with msleep,
to avoid busy wait.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Richard Sudaryono [Sun, 24 Dec 2017 08:47:45 +0000 (16:47 +0800)]
staging: comedi: adv_pci1760: fix typo in comments
Changed 'firware' to 'firmware'
Signed-off-by: Richard Sudaryono <richardsudaryono@gmail.com>
Shreeya Patel [Thu, 21 Dec 2017 22:28:21 +0000 (03:58 +0530)]
Staging: rtlwifi: Remove unused variable and the code
Remove unused variable and also remove unused code
associated with initializing the unused variable.
Unused variable was detected using the following
semantic patch by coccinelle.
@@
type T;
identifier i;
constant C;
@@
(
extern T i;
|
- T i;
<+... when != i
- i = C;
...+>
)
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Sidong Yang [Mon, 25 Dec 2017 16:37:45 +0000 (16:37 +0000)]
staging: vc05_services: fix checkpatch.pl errors
Fix some errors for wrong brace position reported by checkpatch.
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kishore KP [Sun, 24 Dec 2017 14:03:54 +0000 (19:33 +0530)]
staging: vc04_services: Prefer WARN_ON_ONCE instead of if condition followed by BUG.
Coccinelle suggested to use BUG_ON instead of if condition followed by BUG
but BUG_ON should be used in situations where integrity of the system is no
longer guaranteed. In this case, as suggested by Stefan Wahren, vchiq isn't
critical.
Since it is not critical, BUG_ON should be avoided.
Replaced if condition followed by BUG with WARN_ON_ONCE.
Signed-off-by: Kishore KP <kishore.p@techveda.org>
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kishore KP [Sat, 23 Dec 2017 14:46:59 +0000 (20:16 +0530)]
staging: vc04_services: Fix platform_no_drv_owner.cocci warnings.
Removed .owner field initialization, platform core does it automatically.
Pointed out by Coccinelle.
Signed-off-by: Kishore KP <kishore.p@techveda.org>
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Andy Pusch [Sat, 23 Dec 2017 15:37:56 +0000 (16:37 +0100)]
Staging: wlan-ng: hfa384x_usb: fixed two line limit coding style issues
Fixed two coding style issues.
Signed-off-by: Andy Pusch <drag@black-pixel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philippe Loctaux [Thu, 28 Dec 2017 21:51:24 +0000 (22:51 +0100)]
Staging: vme: vme_user: fixed an alignment coding style issue
Fixed a coding style issue.
Signed-off-by: Philippe Loctaux <loctauxphilippe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xiongwei Song [Thu, 4 Jan 2018 23:34:36 +0000 (07:34 +0800)]
staging: android: check the return value of register_shrinker
register_shrinker call is made in ashmem_init, it may return error code,
so we need to check it.
Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xiongwei Song [Fri, 29 Dec 2017 12:37:03 +0000 (20:37 +0800)]
staging: android: check for error from register_shrinker in ion_heap_init_shrinker
The function register_shrinker in ion_heap_init_shrinker may return an
error, check it out. Meanwhile, ion_heap_init_shrinker has to a return
value.
Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Zhai Zhaoxuan [Thu, 28 Dec 2017 13:56:06 +0000 (21:56 +0800)]
staging: android: ashmem: add procfs fdinfo helper
This print the inode number of backing file and the name in
/proc/pid/fdinfo/fd.
These information helps users to know which processes are sharing the same
ashmem.
Signed-off-by: Zhai Zhaoxuan <kxuanobj@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
George Edward Bulmer [Fri, 29 Dec 2017 21:26:20 +0000 (21:26 +0000)]
staging: most: convert macro to static function
This fixes checkpatch warning:
CHECK: Macro argument reuse 'buf' - possible side effects?
Signed-off-by: George Edward Bulmer <gebulmer@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ravi Eluri [Fri, 22 Dec 2017 10:09:02 +0000 (15:39 +0530)]
staging: most: Fix identifiers to function parameters
fixed "function definition argument should have an identifier name",
with appropriate identifier names. Pointed out by checkpatch.
Signed-off-by: Ravi Eluri <venkataravi.e@techveda.org>
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ravi Eluri [Fri, 22 Dec 2017 08:25:44 +0000 (13:55 +0530)]
staging: most: Avoid trailing semicolon for macros
Fixes checkpatch warning:
macros should not use a trailing semicolon.
Signed-off-by: Ravi Eluri <venkataravi.e@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Sat, 30 Dec 2017 01:16:58 +0000 (14:16 +1300)]
Staging: pi433 - fix ccheckpatch issue, updated include line.
Updated the include of compat.h to fix checkpatch error
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Valentin Vidic [Mon, 25 Dec 2017 18:20:56 +0000 (19:20 +0100)]
staging: pi433: fix CamelCase for payload identifiers
Fixes checkpatch warnings:
CHECK: Avoid CamelCase: <payloadLength>
CHECK: Avoid CamelCase: <payloadReady>
Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Valentin Vidic [Fri, 22 Dec 2017 08:36:59 +0000 (09:36 +0100)]
staging: pi433: fix CamelCase for maxMinus variables
Fixes checkpatch warnings:
CHECK: Avoid CamelCase: <maxMinus12>
CHECK: Avoid CamelCase: <maxMinus24>
CHECK: Avoid CamelCase: <maxMinus36>
CHECK: Avoid CamelCase: <maxMinus48>
CHECK: Avoid CamelCase: <maxMinus6>
Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marcin Ciupak [Thu, 21 Dec 2017 21:39:41 +0000 (21:39 +0000)]
staging: pi433: remove unused rf69_reset_flag function
Function rf69_reset_flag is unused and should be removed.
Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marcin Ciupak [Thu, 21 Dec 2017 21:39:12 +0000 (21:39 +0000)]
staging: pi433: remove unused rf69_set_sync_tolerance function
Function rf69_set_sync_tolerance is unused and should be removed.
Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:37 +0000 (12:14 +0000)]
staging: ccree: update TODO
Update TODO to reflect work done
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:34 +0000 (12:14 +0000)]
stating: ccree: fix allocation of void sized buf
We were allocating buffers using sizeof(*struct->field) where field was
type void. Fix it by having a local variable with the real type.
Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:33 +0000 (12:14 +0000)]
staging: ccree: put pointer next to var name
Put pointer next to var name as per coding style.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:32 +0000 (12:14 +0000)]
staging: ccree: fold common code into service func
Fold common code in hash call into service functions.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:31 +0000 (12:14 +0000)]
staging: ccree: fix indentation of func params
Fix indentation of some function params in hash code for
better readability.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:30 +0000 (12:14 +0000)]
staging: ccree: do not map bufs in ahash_init
hash_init was mapping DMA memory that were then being unmap in
hash_digest/final/finup callbacks, which is against the Crypto API
usage rules (see discussion at
https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30077.html)
Fix it by moving all buffer mapping/unmapping or each Crypto API op.
This also properly deals with hash_import() not knowing if
hash_init was called or not as it now no longer matters.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:29 +0000 (12:14 +0000)]
staging: ccree: allocate hash bufs inside req ctx
Move to allocating the buffers needed for requests as part of
the request structure instead of malloc'ing each one on it's
own, making for simpler (and more efficient) code.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:28 +0000 (12:14 +0000)]
staging: ccree: use array for double buffer
The ccree hash code is using a double buffer to hold data
for processing but manages the buffers and their associated
data count in two separate fields and uses a predicate to
chose which to use.
Move to using a proper 2 members array for a much cleaner code.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:27 +0000 (12:14 +0000)]
staging: ccree: remove unused field
Remove unused struct field.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:26 +0000 (12:14 +0000)]
staging: ccree: use Makefile to include PM code
Replace ugly ifdefs with some inline macros and Makefile magic
for optionally including power management related code for
better readability.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:25 +0000 (12:14 +0000)]
staging: ccree: handle end of sg list gracefully
If we are asked for number of entries of an offset bigger than the
sg list we should not crash.
Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:24 +0000 (12:14 +0000)]
staging: ccree: check DMA pool buf !NULL before free
If we ran out of DMA pool buffers, we get into the unmap
code path with a NULL before. Deal with this by checking
the virtual mapping is not NULL.
Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:23 +0000 (12:14 +0000)]
staging: ccree: failing the suspend is not an error
PM suspend returning a none zero value is not an error. It simply
indicates a suspend is not advised right now so don't treat it as
an error.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:22 +0000 (12:14 +0000)]
stating: ccree: revert "staging: ccree: fix leak of import() after init()"
This reverts commit
c5f39d07860c ("staging: ccree: fix leak of import()
after init()") and commit
aece09024414 ("staging: ccree: Uninitialized
return in ssi_ahash_import()").
This is the wrong solution and ends up relying on uninitialized memory,
although it was not obvious to me at the time.
Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:21 +0000 (12:14 +0000)]
staging: ccree: add backlog processing
Crypto API tfm providers are required to provide a backlog
service, if so indicated, that queues up requests in the case
of the provider being busy and processing them later.
The ccree driver did not provide this facility. Add it now.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:20 +0000 (12:14 +0000)]
staging: ccree: break send_request and fix ret val
The send_request() function was handling both synchronous
and asynchronous invocations, but were not handling
the asynchronous case, which may be called in an atomic
context, properly as it was sleeping.
Start to fix the problem by breaking up the two use
cases to separate functions calling a common internal
service function and return error instead of sleeping
for the asynchronous case.
The next patch will complete the fix by implementing
proper backlog handling.
Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver").
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:19 +0000 (12:14 +0000)]
staging: ccree: remove unused leftover field
Remove the unused monitor_desc field.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:18 +0000 (12:14 +0000)]
staging: ccree: tag debugfs init/exit func properly
The debugfs global init and exit functions were missing
__init and __exit tags, potentially wasting memory.
Fix it by properly tagging them.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Sun, 7 Jan 2018 12:14:17 +0000 (12:14 +0000)]
staging: ccree: copy larval digest from RAM
The ccree driver was using a DMA operation to copy larval digest
from the ccree SRAM to RAM. Replace it with a simple memcpy.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>