Merge tag 'iio-for-5.4b-take3' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second set of new device support, cleanups and features for IIO in the 5.4 cycle
Revised pull request to fix up a missing Signed-off-by and roll in
a fix in the lsm9ds1 support after I broke it when applying.
Revised again because the fix changed a hash meaning a fix
that previously followed it now had the wrong fixes tag.
A few fixes in here that could have gone a faster path but aren't quite
worth the rush for 5.3.
New device support
* ad7606
- Support the ad7606b which adds a software controlled mode alongside
the pin controlled only approach of the ad7606. Including dt-bindings.
* lsm6dsx
- Add support for the gyro and accelerometer part of the lsm9ds1 which is
a compound device also including a magnetometer (st_sensors driver).
Includes bindings and precursor rework of the driver.
Features
* ad7192
- Add support for low pass filter control.
- DT binding docs.
Cleanups and minor fixes
* MAINTAINERS
- Fix a typo in a path.
- Add entry for ad7606
* ad5380
- Fix a failure to dereference a pointer before atempting to assign the
value.
* ad7192
- Drop platform data as not used in mainline and we now have full DT bindings.
* ad7606
- YAML conversion for dt-bindings.
* adis16240
- Rework write_raw to make it more readable using GENMASK.
* adis16460
- Fix and issue with an unsigned variable holding potential negatives.
* cros_ec
- Fix missing default of calibration vector so that we get 'something'
before calibration is complete on a given axis.
* hid-sensors
- Use int_pow instead of opencoding.
* isl29501
- rename dt-binding docs to include renesas inline with other renesas parts
and general current convention.
* kxcjk1013
- Improve comments on the 'unusual' ACPI ids used to identify which sensor
is which in certain laptops.
* lsm6dsx
- Add one bit to the fifo status masks for a number of parts.
- Drop a reserved entry from the sensitivity values to tidy up interface.
- Use core conversion macro from G to m/s^2 for lsm9ds1 to make it easier
to relate to the datasheet and consistent with other parts supported.
* max1027
- Use device managed APIs to avoid manual error handling and cleanup.
* rfd77402
- Typo in Kconfig help.
* sc27xx
- Switch to polling mode from interrupts as interrupt handling typically
to slow for very short sleeps.
* st-sensors
- Fix some missing selects for regmap.
* tools
- Add a .gitignore containing the binary outputs.
* tag 'iio-for-5.4b-take3' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (27 commits)
iio: imu: st_lsm6dsx: rely on IIO_G_TO_M_S_2 for gain definition for LSM9DS1
iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1
iio: cros_ec: set calibscale for 3d MEMS to unit vector
iio: dac: ad5380: fix incorrect assignment to val
iio: imu: st_lsm6dsx: Fix FIFO diff mask for tagged fifo
dt-bindings: iio: imu: st_lsm6dsx: add lsm9ds1 device bindings
iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1
iio: imu: st_lsm6dsx: move register definitions to sensor_settings struct
iio: imu: st_lsm6dsx: introduce update_fifo function pointer
dt-bindings: iio: light: isl29501: Rename bindings documentation file
Kconfig: Fix the reference to the RFD77402 ToF sensor in the 'help' section
iio: st_sensors: Fix build error
dt-bindings: iio: adc: Add AD7606B ADC documentation
dt-bindings: iio: adc: Migrate AD7606 documentation to yaml
MAINTAINERS: Add Beniamin Bia for AD7606 driver
iio: adc: ad7606: Add support for AD7606B ADC
tools: iio: add .gitignore
iio: adc: sc27xx: Change to polling mode to read data
iio: hid-sensor-attributes: Convert to use int_pow()
iio: adc: max1027: Use device-managed APIs
...
Lorenzo Bianconi [Tue, 27 Aug 2019 08:26:35 +0000 (10:26 +0200)]
iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1
Get rid of invalid sensitivity value for LSM9DS1 gyro sensor
Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Gwendal Grignou [Mon, 26 Aug 2019 23:02:58 +0000 (16:02 -0700)]
iio: cros_ec: set calibscale for 3d MEMS to unit vector
By default, set the calibscale vector to unit vector.
When calibrating one axis, the other axis calibrations are sent as well.
If left to 0, sensor data from uncalibrated axis are zero'ed out until
all axis are calibrated.
Fixes: ed1f2e85da79 ("iio: cros_ec: Add calibscale for 3d MEMS ") Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Colin Ian King [Thu, 15 Aug 2019 11:58:46 +0000 (12:58 +0100)]
iio: dac: ad5380: fix incorrect assignment to val
Currently the pointer val is being incorrectly incremented
instead of the value pointed to by val. Fix this by adding
in the missing * indirection operator.
Addresses-Coverity: ("Unused value") Fixes: c03f2c536818 ("staging:iio:dac: Add AD5380 driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: mario tesi <mario.tesi@st.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Note the binding is st,lsm9ds1-imu. This device is effectively
two separate devices in the same package. (separate addreses,
chip selects etc) The magnetometer is already supported
as lsm9ds1-mag. imu may not be the best name but it's the best
that anyone has yet come up with for a gyro and accel part.
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1
The LSM9DS1's accelerometer / gyroscope unit and it's magnetometer (separately
supported in iio/magnetometer/st_magn*) are located on a separate i2c addresses
on the bus.
For the datasheet, see https://www.st.com/resource/en/datasheet/lsm9ds1.pdf
Treat it just like the LSM6* devices and, despite it's name, hook it up
to the st_lsm6dsx driver, using it's basic functionality.
accelerometer and gyroscope are not independently clocked. It runs at the gyro
frequencies if both are enabled, see chapter 7.12 of the datasheet.
We could have handled this as a single IIO device but we have split
it up to be more consistent with the other more flexible devices.
Despite supporting and testing the LSM9DS1, we call the gyro channels
iio_chan_spec struct "st_lsm6ds0_gyro_channels" because the register
description is equal. This suggests that supporting LSM6DS0 should be
trivial to do.
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Colin Ian King [Fri, 30 Aug 2019 17:50:50 +0000 (18:50 +0100)]
staging: exfat: check for null return from call to FAT_getblk
A call to FAT_getblk is missing a null return check which can
lead to a null pointer dereference. Fix this by adding a null
check to match all the other FAT_getblk return sanity checks.
Addresses-Coverity: ("Dereference null return") Fixes: c48c9f7ff32b ("staging: exfat: add exfat filesystem code to staging") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20190830175050.12706-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Thu, 29 Aug 2019 12:28:39 +0000 (15:28 +0300)]
staging: greybus: light: fix a couple double frees
The problem is in gb_lights_request_handler(). If we get a request to
change the config then we release the light with gb_lights_light_release()
and re-allocated it. However, if the allocation fails part way through
then we call gb_lights_light_release() again. This can lead to a couple
different double frees where we haven't cleared out the original values:
I also made a small change to how we set "light->channels_count = 0;".
The original code handled this part fine and did not cause a use after
free but it was sort of complicated to read.
There are two hunks of code that check if sd30_mode is true however
an earlier check in an outer code block on sd30_mode being false means
that sd30_mode can never be true at these points so these checks are
redundant. Remove the dead code.
Colin Ian King [Mon, 2 Sep 2019 09:40:52 +0000 (10:40 +0100)]
staging: exfat: remove return and error return via a goto
The return statement is incorrect, the error exit should be by
assigning ret with the error code and exiting via label out.
Thanks to Valdis Klētnieks for correcting my original fix.
Colin Ian King [Fri, 30 Aug 2019 18:46:44 +0000 (19:46 +0100)]
staging: exfat: fix uninitialized variable ret
Currently there are error return paths in ffsReadFile that
exit via lable err_out that return and uninitialized error
return in variable ret. Fix this by initializing ret to zero.
Addresses-Coverity: ("Uninitialized scalar variable") Fixes: c48c9f7ff32b ("staging: exfat: add exfat filesystem code to staging") Signed-off-by: Colin Ian King <colin.king@canonical.com> Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>, Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Link: https://lore.kernel.org/r/20190830184644.15590-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CHECK: Please don't use multiple blank lines
CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Please use a blank line after function/struct/union/enum
declarations
This should fix a build error in some configurations when CONFIG_BLOCK
is not selected. Also properly set the dependancy for no FAT support at
the same time.
Reported-by: Randy Dunlap <rdunlap@infradead.org> Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu> Link: https://lore.kernel.org/r/20190902174631.GB31445@kroah.com Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: exfat: add exfat filesystem code to staging
The exfat code needs a lot of work to get it into "real" shape for
the fs/ part of the kernel, so put it into drivers/staging/ for now so
that it can be worked on by everyone in the community.
The full specification of the filesystem can be found at:
https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification
iio: imu: st_lsm6dsx: move register definitions to sensor_settings struct
Move some register definitions to the per-device array of struct
st_lsm6dsx_sensor_settings in order to simplify adding new sensor
devices to the driver.
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Rui Miguel Silva [Tue, 27 Aug 2019 15:53:02 +0000 (16:53 +0100)]
staging: greybus: add missing includes
Before moving greybus core out of staging and moving header files to
include/linux some greybus header files were missing the necessary
includes. This would trigger compilation faillures with some example
errors logged bellow for with CONFIG_KERNEL_HEADER_TEST=y.
So, add the necessary headers to compile clean before relocating the
header files.
./include/linux/greybus/hd.h:23:50: error: unknown type name 'u16'
int (*cport_disable)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/greybus_protocols.h:1314:2: error: unknown type name '__u8'
__u8 data[0];
^~~~
./include/linux/greybus/hd.h:24:52: error: unknown type name 'u16'
int (*cport_connected)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:25:48: error: unknown type name 'u16'
int (*cport_flush)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:26:51: error: unknown type name 'u16'
int (*cport_shutdown)(struct gb_host_device *hd, u16 cport_id, ^~~
./include/linux/greybus/hd.h:27:5: error: unknown type name 'u8'
u8 phase, unsigned int timeout);
^~
./include/linux/greybus/hd.h:28:50: error: unknown type name 'u16'
int (*cport_quiesce)(struct gb_host_device *hd, u16 cport_id, ^~~
./include/linux/greybus/hd.h:29:5: error: unknown type name 'size_t'
size_t peer_space, unsigned int timeout);
^~~~~~
./include/linux/greybus/hd.h:29:5: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
./include/linux/greybus/hd.h:1:1:
+#include <stddef.h>
/* SPDX-License-Identifier: GPL-2.0 */
./include/linux/greybus/hd.h:29:5:
size_t peer_space, unsigned int timeout);
^~~~~~
./include/linux/greybus/hd.h:30:48: error: unknown type name 'u16'
int (*cport_clear)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:32:49: error: unknown type name 'u16'
int (*message_send)(struct gb_host_device *hd, u16 dest_cport_id, ^~~
./include/linux/greybus/hd.h:33:32: error: unknown type name 'gfp_t'
struct gb_message *message, gfp_t gfp_mask); ^~~~~
./include/linux/greybus/hd.h:35:55: error: unknown type name 'u16'
int (*latency_tag_enable)(struct gb_host_device *hd, u16 cport_id);
Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Gao Xiang <hsiangkao@aol.com> Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Link: https://lore.kernel.org/r/20190827155302.25704-1-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: greybus: move the greybus core to drivers/greybus
The Greybus core code has been stable for a long time, and has been
shipping for many years in millions of phones. With the advent of a
recent Google Summer of Code project, and a number of new devices in the
works from various companies, it is time to get the core greybus code
out of staging as it really is going to be with us for a while.
staging: greybus: move core include files to include/linux/greybus/
With the goal of moving the core of the greybus code out of staging, the
include files need to be moved to include/linux/greybus.h and
include/linux/greybus/
Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com> Cc: Johan Hovold <johan@kernel.org> Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com> Cc: Rui Miguel Silva <rmfrfs@gmail.com> Cc: David Lin <dtwlin@gmail.com> Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie> Cc: greybus-dev@lists.linaro.org Cc: devel@driverdev.osuosl.org Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Alex Elder <elder@kernel.org> Link: https://lore.kernel.org/r/20190825055429.18547-8-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When the greybus drivers were converted to SPDX identifiers for the
license text, some license boilerplate was not removed. Clean this up
by removing this unneeded text now.
Gao Xiang [Mon, 26 Aug 2019 13:26:53 +0000 (21:26 +0800)]
erofs: fix compile warnings when moving out include/trace/events/erofs.h
As Stephon reported [1], many compile warnings are raised when
moving out include/trace/events/erofs.h:
In file included from include/trace/events/erofs.h:8,
from <command-line>:
include/trace/events/erofs.h:28:37: warning: 'struct dentry' declared inside parameter list will not be visible outside of this definition or declaration
TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
^~~~~~
include/linux/tracepoint.h:233:34: note: in definition of macro '__DECLARE_TRACE'
static inline void trace_##name(proto) \
^~~~~
include/linux/tracepoint.h:396:24: note: in expansion of macro 'PARAMS'
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
^~~~~~
include/linux/tracepoint.h:532:2: note: in expansion of macro 'DECLARE_TRACE'
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
^~~~~~~~~~~~~
include/linux/tracepoint.h:532:22: note: in expansion of macro 'PARAMS'
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
^~~~~~
include/trace/events/erofs.h:26:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(erofs_lookup,
^~~~~~~~~~~
include/trace/events/erofs.h:28:2: note: in expansion of macro 'TP_PROTO'
TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
^~~~~~~~
That makes me very confused since most original EROFS tracepoint code
was taken from f2fs, and finally I found
commit 43c78d88036e ("kbuild: compile-test kernel headers to ensure they are self-contained")
It seems these warnings are generated from KERNEL_HEADER_TEST feature and
ext4/f2fs tracepoint files were in blacklist.
Anyway, let's fix these issues for KERNEL_HEADER_TEST feature instead
of adding to blacklist...
staging: rtl8192u: Add or remove blank lines as required
This patch fixes the file r8190_rtl8256.c to avoid the following
checkpatch.pl warnings:
CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please use a blank line after function/struct/union/enum declarations
CHECK: Please don't use multiple blank line
staging: rtl8192u: Add or remove spaces to fix style issues
This patch fixes the file r8190_rtl8256.c to avoid the following
checkpatch.pl warnings:
CHECK: spaces preferred around that '<<' (ctx:VxV)
CHECK: spaces preferred around that '-' (ctx:VxV)
CHECK: No space is necessary after a cast
Lorenzo Bianconi [Wed, 21 Aug 2019 13:25:17 +0000 (15:25 +0200)]
iio: imu: st_lsm6dsx: introduce update_fifo function pointer
Introduce update_fifo routine pointer in st_lsm6dsx_fifo_ops data
structure since we will need a different update FIFO configuration
callback adding support for lsm6ds0/lsm9ds1 imu device
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Rename the bindings documentation file for Renesas ISL29501 Time-of-flight
sensor from isl29501.txt to renesas,isl29501.txt.
This is part of an ongoing effort to name bindings documentation files for
Renesas IP blocks consistently, in line with the compat strings they
document.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
YueHaibing [Fri, 23 Aug 2019 12:18:52 +0000 (20:18 +0800)]
iio: st_sensors: Fix build error
IIO_ST_SENSORS_CORE select IIO_ST_SENSORS_I2C
unconditionally, if REGMAP_I2C is not set, build fails
drivers/iio/common/st_sensors/st_sensors_i2c.o: In function `st_sensors_i2c_configure':
st_sensors_i2c.c:(.text+0x58): undefined reference to `__devm_regmap_init_i2c'
This patch selects REGMAP_I2C to fix it.
IIO_ST_SENSORS_SPI is similar to SPI issue.
Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 062809ef7733 ("iio: make st_sensors drivers use regmap") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The AD7606B is a 16-bit ADC that supports simultaneous sampling of 8
channels. It is pin compatible to AD7606, but adds extra modes by
writing to the register map.
The AD7606B can be configured to work in software mode by setting all
oversampling pins to high. This mode is selected by default.
The oversampling ratio is configured from the OS_MODE register (address
0x08) with the addition of OS=128 and OS=256 that were not available in
hardware mode.
The device is configured to output data on a single spi channel, but this
configuration must be done right after restart. That is why the delay was
removed for devices which doesn't require it.
Moreover, in software mode, the range gpio has no longer its function.
Instead, the scale can be configured individually for each channel from
the RANGE_CH registers (address 0x03 to 0x06). Besides the already
supported ±10 V and ±5 V ranges, software mode can also accommodate the
±2.5 V range.
Signed-off-by: Stefan Popa <stefan.popa@analog.com> Co-developed-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Stephen Brennan [Fri, 23 Aug 2019 16:24:10 +0000 (09:24 -0700)]
staging: rtl8192u: remove code under TO_DO_LIST
Several blocks of code are guarded by #ifdef TO_DO_LIST. If this is
defined, compilation fails. No machinery exists to define this, and no
documenation on the in-progress feature exists. Since this code is dead,
let's delete it.
Colin Ian King [Thu, 22 Aug 2019 08:46:09 +0000 (09:46 +0100)]
staging: rtl8192u: remove redundant assignment to pointer crypt
The pointer crypt is being set with a value that is never read,
the assignment is redundant and hence can be removed.
Thanks to Dan Carpenter for sanity checking that this was indeed
redundant.
Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20190822084609.8971-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gao Xiang [Thu, 22 Aug 2019 21:36:59 +0000 (05:36 +0800)]
erofs: move erofs out of staging
EROFS filesystem has been merged into linux-staging for a year.
EROFS is designed to be a better solution of saving extra storage
space with guaranteed end-to-end performance for read-only files
with the help of reduced metadata, fixed-sized output compression
and decompression inplace technologies.
In the past year, EROFS was greatly improved by many people as
a staging driver, self-tested, betaed by a large number of our
internal users, successfully applied to almost all in-service
HUAWEI smartphones as the part of EMUI 9.1 and proven to be stable
enough to be moved out of staging.
EROFS is a self-contained filesystem driver. Although there are
still some TODOs to be more generic, we have a dedicated team
actively keeping on working on EROFS in order to make it better
with the evolution of Linux kernel as the other in-kernel filesystems.
As Pavel suggested, it's better to do as one commit since git
can do moves and all histories will be saved in this way.
Let's promote it from staging and enhance it more actively as
a "real" part of kernel for more wider scenarios!
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Theodore Ts'o <tytso@mit.edu> Cc: Pavel Machek <pavel@denx.de> Cc: David Sterba <dsterba@suse.cz> Cc: Amir Goldstein <amir73il@gmail.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Darrick J . Wong <darrick.wong@oracle.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Jaegeuk Kim <jaegeuk@kernel.org> Cc: Jan Kara <jack@suse.cz> Cc: Richard Weinberger <richard@nod.at> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Chao Yu <yuchao0@huawei.com> Cc: Miao Xie <miaoxie@huawei.com> Cc: Li Guifu <bluce.liguifu@huawei.com> Cc: Fang Wei <fangwei1@huawei.com> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Link: https://lore.kernel.org/r/20190822213659.5501-1-hsiangkao@aol.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stephen Brennan [Wed, 21 Aug 2019 14:35:38 +0000 (07:35 -0700)]
staging: rtl8192u: fix OPEN_BRACE errors in ieee80211
Checkpatch emits several errors regarding braces being on the incorrect
line. These can be fixed by moving the brace, do this. In a few cases,
some comments were moved to facilitate this.
YueHaibing [Wed, 21 Aug 2019 12:28:02 +0000 (20:28 +0800)]
staging: rtl8192e: remove set but not used variable 'data_len'
Fixes gcc '-Wunused-but-set-variable' warning:
In function ieee80211_ccmp_encrypt:
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c:162:6:
warning: variable data_len set but not used [-Wunused-but-set-variable]
It is not used since commit 5ee5265674ce ("staging:
rtl8192e: rtllib_crypt_ccmp.c: Use crypto API ccm(aes)")
YueHaibing [Wed, 21 Aug 2019 12:25:56 +0000 (20:25 +0800)]
staging: rtl8192e: remove two set but not used variables
Fixes gcc '-Wunused-but-set-variable' warning:
In function '_rtl92e_dm_tx_power_tracking_callback_tssi':
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c:621:7:
warning: variable 'bHighpowerstate' set but not used [-Wunused-but-set-variable]
In function '_rtl92e_dm_rx_path_sel_byrssi':
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c:1904:32:
warning: variable 'cck_rx_ver2_min_index' set but not used [-Wunused-but-set-variable]
YueHaibing [Wed, 21 Aug 2019 12:22:50 +0000 (20:22 +0800)]
staging: rtl8192u: ieee80211: remove set but not used variable 'data_len'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c:
In function ieee80211_ccmp_encrypt:
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c:162:6:
warning: variable data_len set but not used [-Wunused-but-set-variable]
It is not used since commit eb0e7bf3ca94 ("staging:
rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: Use crypto API ccm(aes)")
Donald Yandt [Sun, 18 Aug 2019 15:20:23 +0000 (11:20 -0400)]
staging: android: Remove ion device tree bindings from the TODO
Commit 23a4388f24f5 ("staging: android: ion: Remove file ion_chunk_heap.c")
and eadbf7a34e44 ("staging: android: ion: Remove file ion_carveout_heap.c")
removed the chunk and carveout heaps from ion but left behind the device
tree bindings for them in the TODO, this patch removes it.
staging: rtl8712: Improve naming of include hearder guards
Choose a better name for the include hearder guard used in rtl871x_io.h.
'_IO_H_' is to generic and does not match the comment after the #endif.
Use '_RTL871X_IO_H_' instead.
Also make the comments in the #endif /* XXX */ match the name used in
#ifndef.
Gao Xiang [Wed, 21 Aug 2019 03:09:08 +0000 (11:09 +0800)]
staging: erofs: avoid loop in submit chains
As reported by erofs-utils fuzzer, 2 conditions
can happen in corrupted images, which can cause
unexpected behaviors.
- access the same pcluster one more time;
- access the tail end pcluster again, e.g.
_ access again (will trigger tail merging)
|
1 2 3 1 2 -> 1 2 3 1
|_ tail end of the chain \___/ (unexpected behavior)
Let's detect and avoid them now.
Gao Xiang [Mon, 19 Aug 2019 10:34:22 +0000 (18:34 +0800)]
staging: erofs: cannot set EROFS_V_Z_INITED_BIT if fill_inode_lazy fails
As reported by erofs-utils fuzzer, unsupported compressed
clustersize will make fill_inode_lazy fail, for such case
we cannot set EROFS_V_Z_INITED_BIT since we need return
failure for each z_erofs_map_blocks_iter().
Gao Xiang [Mon, 19 Aug 2019 10:34:21 +0000 (18:34 +0800)]
staging: erofs: some compressed cluster should be submitted for corrupted images
As reported by erofs_utils fuzzer, a logical page can belong
to at most 2 compressed clusters, if one compressed cluster
is corrupted, but the other has been ready in submitting chain.
The chain needs to submit anyway in order to keep the page
working properly (page unlocked with PG_error set, PG_uptodate
not set).
Gao Xiang [Sun, 18 Aug 2019 12:54:57 +0000 (20:54 +0800)]
staging: erofs: fix an error handling in erofs_readdir()
Richard observed a forever loop of erofs_read_raw_page() [1]
which can be generated by forcely setting ->u.i_blkaddr
to 0xdeadbeef (as my understanding block layer can
handle access beyond end of device correctly).
After digging into that, it seems the problem is highly
related with directories and then I found the root cause
is an improper error handling in erofs_readdir().
Freeman Liu [Thu, 25 Jul 2019 06:33:50 +0000 (14:33 +0800)]
iio: adc: sc27xx: Change to polling mode to read data
On Spreadtrum platform, the headphone will read one ADC channel multiple
times to identify the headphone type, and the headphone identification is
sensitive of the ADC reading time. And we found it will take longer time
to reading ADC data by using interrupt mode comparing with the polling
mode, thus we should change to polling mode to improve the efficiency
of reading data, which can identify the headphone type successfully.
Signed-off-by: Freeman Liu <freeman.liu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>