platform/kernel/linux-starfive.git
3 years agoiio: Fix: Do not poll the driver again if try_reenable() callback returns non 0.
Jonathan Cameron [Sun, 20 Sep 2020 13:25:47 +0000 (14:25 +0100)]
iio: Fix: Do not poll the driver again if try_reenable() callback returns non 0.

The original reason for this behaviour is long gone and no current
drivers are making use of this function correctly. Note however, that
you would be very unlucky to actually hit the problem as it would
require a bus comms failure in the callback.

This dates back a long way.  The original board on which I did a lot
of early IIO development only supported edge interrupts, but some of the
sensors were level interrupt based.  As such, the lis3l02dq driver did
a dance with checking a GPIO to identify if it should retrigger.
That was an unsustainable hack so we later just stopped supporting interrupts
for that particular combination.

There are a number of drivers where a fault on a bus read in the
try_reenable() callback will result in them returning non 0 and
incorrectly then causing iio_trigger_poll() to be called.

Anyhow, this handling is unused and causing issues so let us rip it out.
Link: https://lore.kernel.org/linux-iio/20200813075358.13310-1-lars@metafoo.de/
After this the try_reenable() naming makes no sense, so as a follow up
patch I'll rename it to simply reenable().  I haven't done that here
as it will add noise to the fix for backporting.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Christian Eggers <ceggers@arri.de>
Link: https://lore.kernel.org/r/20200920132548.196452-2-jic23@kernel.org
3 years agoio:core: In iio_map_array_register() cleanup in case of error
Lino Sanfilippo [Sat, 28 Nov 2020 13:44:19 +0000 (14:44 +0100)]
io:core: In iio_map_array_register() cleanup in case of error

In function iio_map_array_register() properly rewind in case of error.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1606571059-13974-2-git-send-email-LinoSanfilippo@gmx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:core: Introduce unlocked version of iio_map_array_unregister()
Lino Sanfilippo [Sat, 28 Nov 2020 13:44:18 +0000 (14:44 +0100)]
iio:core: Introduce unlocked version of iio_map_array_unregister()

Introduce an unlocked version of iio_map_array_unregister(). This function
can help to unwind in case of error while the iio_map_list_lock mutex is
held.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1606571059-13974-1-git-send-email-LinoSanfilippo@gmx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: imu: st_lsm6dsx: add lsm6dsop device bindings
Lorenzo Bianconi [Sun, 29 Nov 2020 09:43:07 +0000 (10:43 +0100)]
dt-bindings: iio: imu: st_lsm6dsx: add lsm6dsop device bindings

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/501ff8187d2df584ec978c7e7ec5c445c3d0741c.1606642528.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: imu: st_lsm6dsx: add support to LSM6DSOP
Lorenzo Bianconi [Sun, 29 Nov 2020 09:43:06 +0000 (10:43 +0100)]
iio: imu: st_lsm6dsx: add support to LSM6DSOP

Add support to STM LSM6DSOP (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dsop.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/d3c459ad945ccd1a256f4a217128be214b0c024e.1606642528.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: imu: st_lsmdsx: compact st_lsm6dsx_sensor_settings table
Lorenzo Bianconi [Sat, 28 Nov 2020 10:08:01 +0000 (11:08 +0100)]
iio: imu: st_lsmdsx: compact st_lsm6dsx_sensor_settings table

Shrink st_lsm6dsx_sensor_settings table size moving wai address info in
id array and remove duplicated code

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/c43286938b2fe03ab3abdb5fc095ea6b950abcb1.1606557946.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: merge at91_adc_probe_dt back in at91_adc_probe
Alexandre Belloni [Sat, 28 Nov 2020 22:28:15 +0000 (23:28 +0100)]
iio: adc: at91_adc: merge at91_adc_probe_dt back in at91_adc_probe

at91_adc_probe_dt is now small enough to be merged back in at91_adc_probe.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/20201128222818.1910764-8-alexandre.belloni@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:remove triggers
Alexandre Belloni [Sat, 28 Nov 2020 22:28:14 +0000 (23:28 +0100)]
dt-bindings:iio:adc:remove triggers

The trigger child nodes are not necessary anymore as they are defined
directly by the driver, depending on the compatible string.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Rob Herring <robh+dt@kernel.org>
Link: https://lore.kernel.org/r/20201128222818.1910764-7-alexandre.belloni@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: rework trigger definition
Alexandre Belloni [Sat, 28 Nov 2020 22:28:13 +0000 (23:28 +0100)]
iio: adc: at91_adc: rework trigger definition

Move the available trigger definition back in the driver to stop cluttering
the device tree. There is no functional change except that it actually
fixes the available triggers for at91sam9rl as it inherited the list from
at91sam9260 but actually has the triggers from at91sam9x5.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/20201128222818.1910764-6-alexandre.belloni@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:atmel, sama9260-adc: conversion to yaml from at91_adc.txt
Jonathan Cameron [Sat, 28 Nov 2020 22:28:12 +0000 (23:28 +0100)]
dt-bindings:iio:adc:atmel, sama9260-adc: conversion to yaml from at91_adc.txt

There are a few things we would do differently in an ADC binding if we
were starting from scratch but we are stuck with what we have (which
made sense back when this was written!)

We may be able to tighten up some elements of this binding in the future
by careful checking of what values properties can actually take.

Note the unusual sign off chain is representative of the path this patch
took.

Jonathan wrote the patch, which was then included in a series by
Alexandre and ultimately applied by Jonathan.

[Alexandre Belloni: add sama5d3, remove atmel,adc-res and atmel,adc-res-names]

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20201128222818.1910764-5-alexandre.belloni@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:remove atmel, adc-res and atmel, adc-res-names
Alexandre Belloni [Sat, 28 Nov 2020 22:28:11 +0000 (23:28 +0100)]
dt-bindings:iio:adc:remove atmel, adc-res and atmel, adc-res-names

Remove atmel,adc-res and atmel,adc-res-names as they are not necessary and
are handled by the driver. Also add sama5d3 to the list of possible chips.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Rob Herring <robh+dt@kernel.org>
Link: https://lore.kernel.org/r/20201128222818.1910764-4-alexandre.belloni@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: rework resolution selection
Alexandre Belloni [Sat, 28 Nov 2020 22:28:10 +0000 (23:28 +0100)]
iio: adc: at91_adc: rework resolution selection

Move the possible resolution values back to the driver. This removes the
atmel,adc-res and atmel,adc-res-names properties, leaving only
atmel,adc-use-res. As atmel,adc-res-names had to contain "lowres" and
"highres", those where already the only allowed values for
atmel,adc-use-res.

Also introduce a new compatible string for the sama5d3 as this is the only
one with a different resolution. Also it doesn't even have the LOWRES
bit.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/20201128222818.1910764-3-alexandre.belloni@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: remove at91_adc_ids
Alexandre Belloni [Sat, 28 Nov 2020 22:28:09 +0000 (23:28 +0100)]
iio: adc: at91_adc: remove at91_adc_ids

The driver is DT only since commit ead1c9f376db ("iio: adc: at91_adc:
remove platform data and move defs in driver file"). Remove the leftover
platform_device_id array.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201128222818.1910764-2-alexandre.belloni@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:potentiostat:ti,lmp91000: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:12:42 +0000 (18:12 +0000)]
dt-bindings:iio:potentiostat:ti,lmp91000: txt to yaml conversion.

There were a few parts of the example that did not conform to the
binding description and would not have worked with the Linux driver
as a result.  Fixed them whilst doing this conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031181242.742301-11-jic23@kernel.org
3 years agodt-bindings:iio:light:capella,cm3605: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:12:41 +0000 (18:12 +0000)]
dt-bindings:iio:light:capella,cm3605: txt to yaml conversion.

Simple conversion using the new iio-consumers.yaml binding in the
dt-schema.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201031181242.742301-10-jic23@kernel.org
3 years agodt-bindings:iio:afe:voltage-divider: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:12:40 +0000 (18:12 +0000)]
dt-bindings:iio:afe:voltage-divider: txt to yaml conversion

Simple binding so straight forward conversion, though did require
adding a separate binding document for the max1027 to reflect
its abilities to provide channels to consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20201031181242.742301-9-jic23@kernel.org
3 years agodt-bindings:iio:adc:maxim,max1027: Pull out to separate binding doc.
Jonathan Cameron [Sat, 31 Oct 2020 18:12:39 +0000 (18:12 +0000)]
dt-bindings:iio:adc:maxim,max1027: Pull out to separate binding doc.

The afe/voltage-divider.yaml example uses this device with 2 properties
not provided by trivial-devices.yaml (spi-max-frequency and #io-channel-cells)

Solve that by creating a more specific binding doc.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Philippe Reynes <tremyfr@yahoo.fr>
Link: https://lore.kernel.org/r/20201031181242.742301-8-jic23@kernel.org
3 years agodt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:12:38 +0000 (18:12 +0000)]
dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.

Very simple binding. As such straight forward conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20201031181242.742301-7-jic23@kernel.org
3 years agodt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:12:37 +0000 (18:12 +0000)]
dt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion.

Note this includes a fix in the example where we had *-mul instead of
*-mult.  The binding doc and driver agree that it should be *-mult

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20201031181242.742301-6-jic23@kernel.org
3 years agodt-bindings:iio:adc:envelope-detector: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:12:36 +0000 (18:12 +0000)]
dt-bindings:iio:adc:envelope-detector: txt to yaml conversion.

Straight forward format conversion.  The example in here is fun in
that it has 2 separate provider / consumer pairs.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20201031181242.742301-5-jic23@kernel.org
3 years agodt-bindings:iio:potentiometer: give microchip,mcp4531 its own binding
Jonathan Cameron [Sat, 31 Oct 2020 18:12:35 +0000 (18:12 +0000)]
dt-bindings:iio:potentiometer: give microchip,mcp4531 its own binding

We use this part in an example for the envelope detector. That showed
that we need to allow for the #io-channel-cells property which
trivial-devices.yaml does not.

It doesn't make sense to add that property to trivial-devices as
it only applies for those devices that can provide some sort of
DAC or ADC service to another device driver.  Hence solution will
be to pull some IIO devices out to have their own file on a case
by case basis.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20201031181242.742301-4-jic23@kernel.org
3 years agodt-bindings:iio:dac:dpot-dac: yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:12:34 +0000 (18:12 +0000)]
dt-bindings:iio:dac:dpot-dac: yaml conversion.

Txt to yaml format conversion.  I dropped the example section
describing the measurement ADC, as that isn't strictly part
of this binding.

Uses the new dt-schema/schema/iio/iio-consumer.yaml schema.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20201031181242.742301-3-jic23@kernel.org
3 years agodt-bindings:iio:iio-binding.txt Drop file as content now in dt-schema
Jonathan Cameron [Sat, 31 Oct 2020 18:12:33 +0000 (18:12 +0000)]
dt-bindings:iio:iio-binding.txt Drop file as content now in dt-schema

File contained generic IIO wide bindings.
Now part of the external dt-schema repository.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031181242.742301-2-jic23@kernel.org
3 years agodt-bindings:iio:adc:adi,ad7292: Use new adc.yaml binding for channels.
Jonathan Cameron [Sat, 31 Oct 2020 18:24:23 +0000 (18:24 +0000)]
dt-bindings:iio:adc:adi,ad7292: Use new adc.yaml binding for channels.

Also add additionalProperties: false for the child nodes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20201031182423.742798-4-jic23@kernel.org
3 years agodt-bindings:iio:adc:adi,ad7124: Use the new adc.yaml channel binding
Jonathan Cameron [Sat, 31 Oct 2020 18:24:22 +0000 (18:24 +0000)]
dt-bindings:iio:adc:adi,ad7124: Use the new adc.yaml channel binding

This both ensures this binding is compliant with the generic properties
and reduces the amount we need to specify in this separate binding.

Whilst here mark the child node as additionalProperties: false

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Link: https://lore.kernel.org/r/20201031182423.742798-3-jic23@kernel.org
3 years agodt-bindings:iio:adc: convert adc.txt to yaml
Jonathan Cameron [Sat, 31 Oct 2020 18:24:21 +0000 (18:24 +0000)]
dt-bindings:iio:adc: convert adc.txt to yaml

Each driver that uses this will need to use a $ref
We can't always enable it like most of the generic bindings due to
channel@X matching far more widely than IIO.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031182423.742798-2-jic23@kernel.org
3 years agodt-bindings:iio:health:ti,afe4404: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:16 +0000 (18:48 +0000)]
dt-bindings:iio:health:ti,afe4404: txt to yaml conversion

This basically has same questions as for the afe4403.  We could combine
the two bindings, but as the drivers are separate and it would be a little
fiddly due to different buses let's keep the separating.
To repeat questions from the ti,afe4403 binding.

A few questions came up whilst converting this one.
1) What is actually required?
   - Checking Linux driver, interrupt is not, and the tx-supply could
     be supplied by a stub regulator as long as it's always on.
     As such I have reduced the required list to just compatible and reg.
2) What is the regulator called?
   - It's tx-supply in the binding doc, but the driver request tx_sup
     I will shortly send out a fix for the driver to match the binding
     doc which is the better choice of naming.

As Andrew's email is bouncing, I've put myself as temporary maintainer
for this binding until someone else steps up.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-9-jic23@kernel.org
3 years agodt-bindings:iio:health:ti,afe4403: txt to yaml binding
Jonathan Cameron [Sat, 31 Oct 2020 18:48:15 +0000 (18:48 +0000)]
dt-bindings:iio:health:ti,afe4403: txt to yaml binding

A few questions came up whilst converting this one.
1) What is actually required?
  - Checking Linux driver, interrupt is not, and the tx-supply could
    be supplied by a stub regulator as long as it's always on.
    As such I have reduced the required list to just compatible and reg.
2) What is the regulator called?
  - It's tx-supply in the binding doc, but the driver requests tx_sup.
    I'll post a fix patch to change the driver to fix this as it makes
    little sense.

Andrew's email is bouncing so until someone else steps up I have
listed myself as maintainer for this binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-8-jic23@kernel.org
3 years agoiio: buffer: Fix demux update
Nuno Sá [Thu, 12 Nov 2020 14:43:22 +0000 (15:43 +0100)]
iio: buffer: Fix demux update

When updating the buffer demux, we will skip a scan element from the
device in the case `in_ind != out_ind` and we enter the while loop.
in_ind should only be refreshed with `find_next_bit()` in the end of the
loop.

Note, to cause problems we need a situation where we are skippig over
an element (channel not enabled) that happens to not have the same size
as the next element.   Whilst this is a possible situation we haven't
actually identified any cases in mainline where it happens as most drivers
have consistent channel storage sizes with the exception of the timestamp
which is the last element and hence never skipped over.

Fixes: 5ada4ea9be16 ("staging:iio: add demux optionally to path from device to buffer")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20201112144323.28887-1-nuno.sa@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: Simplify iio_format_list()
Lars-Peter Clausen [Sat, 14 Nov 2020 12:00:00 +0000 (13:00 +0100)]
iio: core: Simplify iio_format_list()

iio_format_list() has two branches in a switch statement that are almost
identical. They only differ in the stride that is used to iterate through
the item list.

Consolidate this into a common code path to simplify the code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201114120000.6533-2-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: Consolidate iio_format_avail_{list,range}()
Lars-Peter Clausen [Sat, 14 Nov 2020 11:59:59 +0000 (12:59 +0100)]
iio: core: Consolidate iio_format_avail_{list,range}()

The iio_format_avail_list() and iio_format_avail_range() functions are
almost identical. The only differences are that iio_format_avail_range()
expects a fixed amount of items and adds brackets "[ ]" around the output.

Refactor them into a common helper function. This improves the
maintainability of the code as it makes it easier to modify the
implementation of these functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201114120000.6533-1-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:samsung, exynos-adc: drop missuse of io-channel-ranges
Jonathan Cameron [Sun, 15 Nov 2020 19:29:44 +0000 (19:29 +0000)]
dt-bindings:iio:samsung, exynos-adc: drop missuse of io-channel-ranges

io-channel-ranges is a property for consumers of io-channels, not
providers.  Hence it is not relevant in this binding or the examples
given.

Recent changes to dt-schema result in this being reported as an error
as a dependency is enforced between this property and io-channels.

Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201115192951.1073632-3-jic23@kernel.org
3 years agodt-bindings:iio:qcom-spmi-vadc drop incorrect io-channel-ranges from example
Jonathan Cameron [Sun, 15 Nov 2020 19:29:43 +0000 (19:29 +0000)]
dt-bindings:iio:qcom-spmi-vadc drop incorrect io-channel-ranges from example

io-channel-ranges is a property for io-channel consumers. Here
it is in an example of a provider of channels so doesn't do anything
useful.

Recent additions to dt-schema check this property is only provided
alongside io-channels which is not true here and hence an error is
reported.

Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Andy Gross <agross@kernel.org>
Cc: Jishnu Prakash <jprakash@codeaurora.org>
Link: https://lore.kernel.org/r/20201115192951.1073632-2-jic23@kernel.org
3 years agoiio: potentiometer: ad5272: Correct polarity of reset
Phil Reid [Tue, 24 Nov 2020 05:00:14 +0000 (13:00 +0800)]
iio: potentiometer: ad5272: Correct polarity of reset

The driver should assert reset by setting the gpio high, and
then release it by setting it the gpio low. This allows the
device tree (or other hardware definition) to specify how the
gpio is configured.

For example as open drain or push-pull depending on the
connected hardware.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Link: https://lore.kernel.org/r/20201124050014.4453-1-preid@electromag.com.au
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bmc150-accel: Add rudimentary regulator support
Linus Walleij [Sun, 15 Nov 2020 20:57:45 +0000 (21:57 +0100)]
iio: accel: bmc150-accel: Add rudimentary regulator support

These Bosch accelerometers have two supplies, VDD and VDDIO.
Add some rudimentary support to obtain and enable these
regulators during probe() and disable them during remove()
or on the errorpath.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201115205745.618455-3-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bmc150-accel: Add support for BMA222
Linus Walleij [Sun, 15 Nov 2020 20:57:44 +0000 (21:57 +0100)]
iio: accel: bmc150-accel: Add support for BMA222

This adds support for the BMA222 version of this sensor,
found in for example the Samsung GT-I9070 mobile phone.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201115205745.618455-2-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bmc150-accel: Add DT bindings
Linus Walleij [Sun, 15 Nov 2020 20:57:43 +0000 (21:57 +0100)]
iio: accel: bmc150-accel: Add DT bindings

These accelerometers have bindings used in the kernel and
several device trees but no proper bindings documentation.
Add it.

Also add a compatible for the BMA222 that I am right now
adding support for in the driver.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20201115205745.618455-1-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: ad_sigma_delta: Don't put SPI transfer buffer on the stack
Lars-Peter Clausen [Tue, 24 Nov 2020 12:38:07 +0000 (14:38 +0200)]
iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

Use a heap allocated memory for the SPI transfer buffer. Using stack memory
can corrupt stack memory when using DMA on some systems.

This change moves the buffer from the stack of the trigger handler call to
the heap of the buffer of the state struct. The size increases takes into
account the alignment for the timestamp, which is 8 bytes.

The 'data' buffer is split into 'tx_buf' and 'rx_buf', to make a clearer
separation of which part of the buffer should be used for TX & RX.

Fixes: af3008485ea03 ("iio:adc: Add common code for ADI Sigma Delta devices")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201124123807.19717-1-alexandru.ardelean@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: buffer: Return error if no callback is given
Nuno Sá [Sat, 21 Nov 2020 16:14:57 +0000 (17:14 +0100)]
iio: buffer: Return error if no callback is given

Return error in case no callback is provided to
`iio_channel_get_all_cb()`. There's no point in setting up a buffer-cb
if no callback is provided.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20201121161457.957-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoASoC: stm32: dfsdm: add stm32_adfsdm_dummy_cb() callback
Olivier Moysan [Sat, 21 Nov 2020 16:14:56 +0000 (17:14 +0100)]
ASoC: stm32: dfsdm: add stm32_adfsdm_dummy_cb() callback

Adapt STM32 DFSDM driver to a change in iio_channel_get_all_cb() API.
The callback pointer becomes a requested parameter of this API,
so add a dummy callback to be given as parameter of this function.
However, the stm32_dfsdm_get_buff_cb() API is still used instead,
to optimize DMA transfers.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20201121161457.957-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: humidity: hts221: introduce vdd regulator bindings
Lorenzo Bianconi [Sun, 22 Nov 2020 11:56:49 +0000 (12:56 +0100)]
dt-bindings: iio: humidity: hts221: introduce vdd regulator bindings

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/9579804f52ccab74a5ca5c7a55b5072b7304bea9.1606045688.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: humidity: hts221: add vdd voltage regulator
Lorenzo Bianconi [Sun, 22 Nov 2020 11:56:48 +0000 (12:56 +0100)]
iio: humidity: hts221: add vdd voltage regulator

Like all other ST sensors, hts221 devices have VDD power line.
Introduce VDD voltage regulator to control it.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/6b3347e78f4f920c48eb6a66936d3b69cb9ff53a.1606045688.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoMAINTAINERS: Add Kamel Bouhara as TCB counter driver maintainer
William Breathitt Gray [Sat, 21 Nov 2020 18:58:24 +0000 (13:58 -0500)]
MAINTAINERS: Add Kamel Bouhara as TCB counter driver maintainer

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20201121185824.451477-1-vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7298: check regulator for null in ad7298_get_ref_voltage()
Alexandru Ardelean [Fri, 27 Nov 2020 09:40:38 +0000 (11:40 +0200)]
iio: adc: ad7298: check regulator for null in ad7298_get_ref_voltage()

'st->ext_ref' & 'st->reg' are both non-zero/non-null at the same time, so
logically the code isn't broken.
But it is more correct to check that 'st->reg' is non-null, since we make
sure that the regulator is NULL (in probe) in case one isn't defined.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201127094038.91714-2-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7298: convert probe to device-managed functions
Alexandru Ardelean [Fri, 27 Nov 2020 09:40:37 +0000 (11:40 +0200)]
iio: adc: ad7298: convert probe to device-managed functions

This change converts the probe of this driver to use device-managed
register functions, and a devm_add_action_or_reset() for the regulator
disable.

With this, the exit & error paths can be removed.
Another side-effect is that this should avoid some static-analyzer's check
with respect to a potential null dereference of the regulator. The null
dereference isn't likely to happen (under normal operation), so there isn't
a requirement to have this fixed/backported in other releases.

As a note: this is removing spi_set_drvdata() since there is no other
spi_get_drvdata() (or dev_get_drvdata()) call that need it.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201127094038.91714-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: imu: st_lsm6dsx: introduce vdd-vddio regulators bindings
Lorenzo Bianconi [Tue, 17 Nov 2020 16:47:26 +0000 (17:47 +0100)]
dt-bindings: iio: imu: st_lsm6dsx: introduce vdd-vddio regulators bindings

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/ae812b48528c48555a753c081acf1c9bb6376cc6.1605631305.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: imu: st_lsm6dsx: add vdd-vddio voltage regulator
Lorenzo Bianconi [Tue, 17 Nov 2020 16:47:25 +0000 (17:47 +0100)]
iio: imu: st_lsm6dsx: add vdd-vddio voltage regulator

Like all other ST sensors, st_lsm6dsx devices have VDD and VDDIO power
lines. Introduce voltage regulators to control them.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/a0427a66360bdec73c3b1fb536a46240f96b2ae7.1605631305.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:temperature: Drop generic binding file.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:54 +0000 (18:48 +0000)]
dt-bindings:iio:temperature: Drop generic binding file.

So far, the thermocouple-type property described in here is only
used in a single driver.  Whilst I would like it to be more generally
used that hasn't happened yet and I don't see a reason to maintain
this small file in the hope that it happens.

I pushed for this generic binding in the first place.  Hopefully
we can bring it back at somepoint.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Patrick Havelange <patrick.havelange@essensium.com>
Link: https://lore.kernel.org/r/20201031184854.745828-47-jic23@kernel.org
3 years agodt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:53 +0000 (18:48 +0000)]
dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.

This is a large but fairly simple binding.
It may well be possible to constrain some of the properties more than
currently done, but that would involve diving into datasheets for the
supported parts.  Hence for this initial conversion just use the
information that was in the txt file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20201031184854.745828-46-jic23@kernel.org
3 years agodt-bindings:iio:st,st-sensors: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:52 +0000 (18:48 +0000)]
dt-bindings:iio:st,st-sensors: txt to yaml conversion.

This binding document covers a very large number of different sensors.
As such the existing documentation is less specific than it could
be (such as which devices have 2 interrupt pin options).
That can be improved later.

Denis, are you happy to be listed as maintainer for this one?
If not feel free to suggestion someone else.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Link: https://lore.kernel.org/r/20201031184854.745828-45-jic23@kernel.org
3 years agodt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:51 +0000 (18:48 +0000)]
dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion.

Very simple direct conversion of existing txt file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/r/20201031184854.745828-44-jic23@kernel.org
3 years agodt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:50 +0000 (18:48 +0000)]
dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion.

Simple binding so mostly straight forward to convert.
Original binding was unclear on how many interrupts there are.
The device has two such lines, whilst I believe the driver currently
only uses one at a time.  The binding should allow both to be specified.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
Link: https://lore.kernel.org/r/20201031184854.745828-43-jic23@kernel.org
3 years agodt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:49 +0000 (18:48 +0000)]
dt-bindings:iio:accel:kionix,kxcjk1013: txt to yaml format conversion.

Very simple binding hence a straight forward conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: Robert Yang <decatf@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-42-jic23@kernel.org
3 years agodt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:48 +0000 (18:48 +0000)]
dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.

One question in here is whether we want to constrain the number of
interrupts.  Some parts definitely only have 1 such pin, and others
2 pins but I can not find information on the bma254.

Oleksandr's email address is bouncing so I've listed myself as
maintainer for this binding until someone else steps up.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-41-jic23@kernel.org
3 years agodt-bindings:iio:dac:ad5592r: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:46 +0000 (18:48 +0000)]
dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.

This is a more complex binding. Whilst conversion is straight forward
I am unsure if the full nature of required properties has been captured.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20201031184854.745828-39-jic23@kernel.org
3 years agodt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:45 +0000 (18:48 +0000)]
dt-binding:iio:adc:ti,ads124s08: txt to yaml format conversion.

Simple binding so straight forward format conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20201031184854.745828-38-jic23@kernel.org
3 years agodt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:44 +0000 (18:48 +0000)]
dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion.

Straight forward conversion.  Not heard from Ivan in a while so if the
email bounces, I'll change the maintainer to myself for this binding unless
anyone else comes forwards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-37-jic23@kernel.org
3 years agodt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:43 +0000 (18:48 +0000)]
dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.

Renamed to match a listed compatible rather than relying on wildcards
with all their usual problems.

Dropped the reference supply as a requirement as at least one dtsi doesn't
include it and the example never did.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201031184854.745828-36-jic23@kernel.org
3 years agodt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:42 +0000 (18:48 +0000)]
dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion.

Simple conversion of the binding doc for this subnode of the palmas
PMIC.
Given age of driver and lack interaction with original authors,
I've guessed at Tony for a maintainer on this one.  Tony, if you
are happy with that great, otherwise I can default back to myself.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20201031184854.745828-35-jic23@kernel.org
3 years agodt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:41 +0000 (18:48 +0000)]
dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and yaml conversion.

The current driver and indeed binding are named after a part that they
do not list in the compatible.  Hence renamed the binding to reflect
one that does.

>From the driver it looks like there is a lot more backwards compatibility
than the binding currently reflects. We could consider expressing that
more explicitly in the yaml for the compatible property. I have
added one explicit pair that was present in the upstream dtsi files.

I added Matthias alongside Zhiyong Tao because I don't think
Zhiyong Tao has reviewed recent patches.  Please let me know if this
isn't the right thing to do.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Zhiyong Tao <zhiyong.tao@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-34-jic23@kernel.org
3 years agodt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:40 +0000 (18:48 +0000)]
dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion

A few questions came up in this one.
1) Why does the txt file document io-channel-ranges as a required property.
   That property is for iio-channel consumers, and this is a provider.
   I have dropped it.
2) The example had an @180a6000 for the ADC but given it uses syscon for
   all access, it doesn't have its own reg etc.  I've dropped that from
   the binding example.

Note this example was lifted directly from bcm-cygnus.dtsi so both
issues are present there as well.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Link: https://lore.kernel.org/r/20201031184854.745828-33-jic23@kernel.org
3 years agoMerge tag 'iio-for-5.11a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Tue, 24 Nov 2020 07:30:08 +0000 (08:30 +0100)]
Merge tag 'iio-for-5.11a' of https://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.11 cycle

Usual mixed bag of new drivers / device support + cleanups etc with the
addition of a fairly big set of yaml conversions.

Txt to yaml format conversions.
In some cases dropped separate binding and moved to trivial devices (drop).

Listed by manufacturer
  - dht11 temperature(drop)
  - adi,ad2s90 adi,ad5272 adi,ad5592r adi,ad5758 adi,ad5933 adi,ad7303
    adi,adis16480 adi,adf4350
  - ams,as3935
  - asahi-kasei,ak8974
  - atmel,sama5d2-adc
  - avago,apds9300 avago,apds9960
  - bosch,bma180 bosch,bmc150_magn bosch,bme680 bosch,bmg180
  - brcm,iproc-static-adc
  - capella,cm36651
  - domintech,dmard06(drop)
  - fsl,mag3110 fsl,mma8452 fsl,vf610-dac
  - hoperf,hp03
  - honeywell,hmc5843
  - kionix,kxcjk1013
  - maxim,ds1803(drop) maxim,ds4424 maxim,max30100 maxim,max30102
    maxim,max31856 maxim,max31855k maxim,max44009
    maxim,max5481 maxim,max5821
  - meas,htu21(drop) meas,ms5367(drop) meas,ms5611 meas,tsys01(drop)
  - mediatek,mt2701-auxadc
  - melexis,mlx90614 melexis,mlx90632
  - memsic,mmc35240(drop)
  - microchip,mcp41010 microchip,mcp4131 microchip,mcp4725
  - murata,zap2326
  - nxp,fxas21002c nxp,lpc1850-dac
  - pni,rm3100
  - qcom,pm8018-adc qcom,spmi-iadc
  - renesas,isl29501 renesas,rcar-gyroadc
  - samsung,sensorhub-rinato
  - sensiron,sgp30
  - sentech,sx9500
  - sharp,gp2ap020a00f
  - st,hts221 st,lsm6dsx st,st-sensors(many!) st,uvis25 st,vcl53l0x st,vl6180
  - ti,adc084s021 ti,ads124s08
    ti,dac5571 ti,dac7311 ti,dac7512 ti,dac7612
    ti,hdc1000(drop) ti,palmas-gpadc ti,opt3001 ti,tmp07
  - upisemi,us51882
  - vishay,vcnl4035
  - x-powers,axp209

New device support
* adi,ad5685
  - Add support for AD5338R dual output 10-bit DAC
  - Add DT-binding doc.
* mediatek,mt6360
  - New driver for this SoC ADC with bindings and using new channel label
    support in the IIO core.
* st,lsm6dsx
  - Add support for LSM6DST

Core:
* Add "label" to device channels, provided via a new core callback. Including
  DT docs for when that is the source, and ABI docs.
* Add devm_iio_triggered_buffer_setup_ext to take extra attributes.
* dmaengine, unwrap use of iio_buffer_set_attrs()
* Drop iio_buffer_set_attrs()
* Centralize ioctl call handling. Later fix to ensure -EINVAL returned if
  no handler has run.
* Fix an issue with IIO_VAL_FRACTIONAL and negative values - doesn't affect
  any known existing drivers, but will impact a future one.
* kernel-doc fix in trigger.h
* file-ops ordering cleanup

Features
* semtech,sx9310
  - Add control of hardware gain, proximity thresholds, hysteresis and
    debounce.
  - Increase what information on hardware configuration can be provided
    via DT.

Cleanup and minor features
* adi,ad5685
  - Add of_match_table
* adi,ad7292
  - Drop pointless spi_set_drvdata() call
* adi,ad7298
  - Drop platform data and tidy up external reference config.
* adi,ad7303
  - Drop platform data handling as unused.
* adi,ad7768
  - Add new label attribute for channels provided from dt.
* adi,ad7887
  - devm_ usage in probe simplifying remove and error handling.
* adi,adis16201
  - Drop pointless spi_set_drvdata() call
* adi,adis16209
  - Drop pointless spi_set_drvdata() call
* adi,adis16240
  - White space fixup
* adi,adxl372
  - use new devm_iio_triggered-buffer_setup_ext()
* amlogic,meson-saradc
  - Drop pointless semicolon.
* amstaos,tsl2563
  - Put back i2c_device_id table as needed for greybus probing.
* atmel,at91_adc
  - Use of_device_get_match_data() instead of open coding it.
  - Constify some driver data
  - Add KCONFIG dep on CONFIG_OF and drop of_match_ptr()
  - Drop platform data as mostly dead code.
  - Tidy up reference voltage logic
* atmel-sama5d2
  - Drop a pointless semicolon
  - Merge buffer and trigger init into a separate function
  - Use new devm_iio_triggered_buff_setup_ext()
* avago,apds9960
  - Drop a pointless semicolon
* bosch,bmc150
  - Drop a pointless semicolon
  - Use new iio_triggered_buffer_setup_ext()
* bosch,bmp280
  - Drop a pointless semicolon
* fsl,mma8452
  - Constification
* (google),cros_ec
  - Use new devm_iio_triggered_buffer_setup_ext()
* hid-sensors
  - Use new iio_triggered_buffer_setup_ext()
* ingenic,adc
  - Drop a pointless semicolon
* invensense,icm426xx
  - Fix MAINTAINERS entry missing :
* mediatek,mt6577_audxac
  - Add binding doc for mt8516 compatible with mt8173
* motorola,cpcap-adc
  - Fix an implicit fallthrough marking that clang needs to avoid warning.
* samsung,exynos-adc
  - Stop relying on users counter form input device in ISR.
* st,lsm6dsx
  - add vdd and vddio regulator control (including binding update)
* st,stm32-adc
  - Tidy up code for dma transfers.
  - Adapt clock duty cycle for proper functioning. Note no known problems
    with existing boards.
* st,vl53l0x-i2c
  - Put back i2c_device_id table as needed for greybus probing.
* vishay,vcnl4035
  - Put back i2c_device_id table as needed for greybus probing.

* tag 'iio-for-5.11a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (126 commits)
  dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
  dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
  dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
  dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
  dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion
  dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion.
  dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion
  dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
  dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
  dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
  dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor
  dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
  dt-bindings:iio:light:ti,opt3001: txt to yaml conversion
  dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
  dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
  dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
  dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
  dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
  dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
  dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
  ...

3 years agodt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:39 +0000 (18:48 +0000)]
dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion

This is a very small binding.  It might make sense at some stage
to just roll it into the parent mfd.  For now, converted as is.
The main advantage of this document is the identification of the
channel index values when this is used as a provider of ADC channels
to consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-32-jic23@kernel.org
3 years agostaging: dpaa2-switch: pack the firmware command structures
Ioana Ciornei [Thu, 19 Nov 2020 16:50:17 +0000 (18:50 +0200)]
staging: dpaa2-switch: pack the firmware command structures

The structures defined in the dpsw-cmd.h header file describe exactly
the layout of commands accepted by the MC firmware. Make sure that all
these structures are packed.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20201119165017.806696-4-ciorneiioana@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: dpaa2-switch: make sure that the VLAN is not already configured
Ioana Ciornei [Thu, 19 Nov 2020 16:50:16 +0000 (18:50 +0200)]
staging: dpaa2-switch: make sure that the VLAN is not already configured

When in the PREPARE state of a switchdev transaction, check if the
requested VLAN is not already configured on the switch port. This keeps
us from getting into a WARNING as below.

[ 1389.683296] dpaa2_ethsw dpsw.0 eth0: VLAN 2 already configured
[ 1389.689125] ------------[ cut here ]------------
[ 1389.694084] eth0: Commit of object (id=1) failed.
[ 1389.698863] WARNING: CPU: 0 PID: 613 at net/switchdev/switchdev.c:277 switchdev_port_obj_add_now+0xcc/0x110
[ 1389.708589] Modules linked in:
[ 1389.711634] CPU: 0 PID: 613 Comm: bridge Not tainted 5.9.0-rc2-next-20200828-00112-g7172078477c5 #59
[ 1389.720753] Hardware name: NXP Layerscape LX2160ARDB (DT)
[ 1389.726139] pstate: 40000005 (nZcv daif -PAN -UAO BTYPE=--)
[ 1389.731698] pc : switchdev_port_obj_add_now+0xcc/0x110
[ 1389.736824] lr : switchdev_port_obj_add_now+0xcc/0x110

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20201119165017.806696-3-ciorneiioana@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: dpaa2-switch: export the 'no buffer' counter in ethtool
Ionut-robert Aron [Thu, 19 Nov 2020 16:50:15 +0000 (18:50 +0200)]
staging: dpaa2-switch: export the 'no buffer' counter in ethtool

Export the DPSW_CNT_ING_NO_BUFFER_DISCARD counter in ethtool for each
switch interface. This is useful for debugging purposes.

Signed-off-by: Ionut-robert Aron <ionut-robert.aron@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20201119165017.806696-2-ciorneiioana@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove redundant statements
Kaixu Xia [Sat, 21 Nov 2020 12:17:21 +0000 (20:17 +0800)]
staging: rtl8723bs: remove redundant statements

The bool variable is2T is true, so the if statement is redundant.
we can directly set the variable bound to 8 and remove the if
statement.

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Link: https://lore.kernel.org/r/1605961041-12875-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: clean up the useless code
Kaixu Xia [Sun, 15 Nov 2020 12:13:20 +0000 (20:13 +0800)]
staging: rtl8188eu: clean up the useless code

The two bool variables singletone and carrier_sup are always false
and the following if statement can't be true, these code are useless,
so remove them.

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Link: https://lore.kernel.org/r/1605442400-16108-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fieldbus: use kobj_to_dev() to get device
Ding Xiang [Tue, 17 Nov 2020 02:59:33 +0000 (10:59 +0800)]
staging: fieldbus: use kobj_to_dev() to get device

Use kobj_to_dev() instead of container_of()

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20201117025933.668938-1-dingxiang@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: fix error return code in hi6421_spmi_pmic_probe()
Wang Hai [Wed, 18 Nov 2020 10:37:24 +0000 (18:37 +0800)]
staging: mfd: hi6421-spmi-pmic: fix error return code in hi6421_spmi_pmic_probe()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 4524ac56cdca ("staging: mfd: add a PMIC driver for HiSilicon 6421 SPMI version")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Link: https://lore.kernel.org/r/20201118103724.57451-1-wanghai38@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hikey9xx: Specify HAS_IOMEM dependency for MFD_HI6421_SPMI
David Gow [Thu, 19 Nov 2020 08:29:03 +0000 (00:29 -0800)]
staging: hikey9xx: Specify HAS_IOMEM dependency for MFD_HI6421_SPMI

MFD_CORE is selected by MFD_HI6421_SPMI, and MFD_CORE depends on
HAS_IOMEM. If HAS_IOMEM is not set, this can cause a conflict in Kconfig
resolution, yielding the following error:

WARNING: unmet direct dependencies detected for MFD_CORE
  Depends on [n]: HAS_IOMEM [=n]
  Selected by [y]:
  - MFD_HI6421_SPMI [=y] && STAGING [=y] && OF [=y] && SPMI [=y]

By specifying HAS_IOMEM as a dependency for MFD_HI6421_SPMI (as
SPMI_HISI3670 already dows), this issue is resolved, and no such warning
appears when building on architectures without HAS_IOMEM.

Signed-off-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/r/20201119082903.3601758-1-davidgow@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: trivial: hikey9xx: fix be32<->u32 casting warnings
Juan Antonio Aldea-Armenteros [Thu, 19 Nov 2020 12:27:38 +0000 (13:27 +0100)]
staging: trivial: hikey9xx: fix be32<->u32 casting warnings

This patch fixes the following warnings reported by sparse, by adding
missing __force annotations.

drivers/staging/hikey9xx/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32
drivers/staging/hikey9xx/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32
drivers/staging/hikey9xx/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32
drivers/staging/hikey9xx/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32
drivers/staging/hikey9xx/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32
drivers/staging/hikey9xx/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32

drivers/staging/hikey9xx/hisi-spmi-controller.c:239:25: warning: cast from restricted __be32

Rationale for #164:
data is declared as u32, and it is read and then converted by means of
be32_to_cpu(). Said function expects a __be32 but data is u32, therefore
there's a type missmatch here.

Rationale for #239:
Is the dual of #164. This time data going to be  written so it
needs to be converted from cpu to __be32, but writel() expects u32 and the
output of cpu_to_be32 returns a __be32.

Signed-off-by: Juan Antonio Aldea-Armenteros <juant.aldea@gmail.com>
Link: https://lore.kernel.org/r/20201119122737.189675-1-juant.aldea@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6656: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 20 Nov 2020 18:39:57 +0000 (12:39 -0600)]
staging: vt6656: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of letting the code fall
through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/5a5a8f2489fbf61f65f0241c349737f7c9ad59ca.1605896060.git.gustavoars@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: qlge: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 20 Nov 2020 18:39:51 +0000 (12:39 -0600)]
staging: qlge: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of letting the code fall
through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/673bd9f27bcc2df8c9d12be94f54001d8066d4ab.1605896060.git.gustavoars@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6655: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 20 Nov 2020 18:27:44 +0000 (12:27 -0600)]
staging: vt6655: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break statements instead of just
letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/863fda60074850bc976974af48fa769c64725e64.1605896059.git.gustavoars@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: core: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 20 Nov 2020 18:27:37 +0000 (12:27 -0600)]
staging: rtl8723bs: core: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break statements instead of just
letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/cd07e3ebc11b44a3fe016341438e24cf950994a3.1605896059.git.gustavoars@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMerge 5.10-rc5 into staging-testing
Greg Kroah-Hartman [Mon, 23 Nov 2020 07:21:37 +0000 (08:21 +0100)]
Merge 5.10-rc5 into staging-testing

We want the staging/IIO fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoLinux 5.10-rc5
Linus Torvalds [Sun, 22 Nov 2020 23:36:08 +0000 (15:36 -0800)]
Linux 5.10-rc5

3 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Linus Torvalds [Sun, 22 Nov 2020 22:36:06 +0000 (14:36 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/hid/hid

Pull HID fixes from Jiri Kosina:

 - Various functionality / regression fixes for Logitech devices from
   Hans de Goede

 - Fix for (recently added) GPIO support in mcp2221 driver from Lars
   Povlsen

 - Power management handling fix/quirk in i2c-hid driver for certain
   BIOSes that have strange aproach to power-cycle from Hans de Goede

 - a few device ID additions and device-specific quirks

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
  HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver
  HID: logitech-dj: Fix an error in mse_bluetooth_descriptor
  HID: Add Logitech Dinovo Edge battery quirk
  HID: logitech-hidpp: Add HIDPP_CONSUMER_VENDOR_KEYS quirk for the Dinovo Edge
  HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad
  HID: add HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE for Gamevice devices
  HID: mcp2221: Fix GPIO output handling
  HID: hid-sensor-hub: Fix issue with devices with no report ID
  HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown
  HID: add support for Sega Saturn
  HID: cypress: Support Varmilo Keyboards' media hotkeys
  HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses
  HID: logitech-hidpp: Add PID for MX Anywhere 2
  HID: uclogic: Add ID for Trust Flex Design Tablet

3 years agoMerge tag 'sched-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 22 Nov 2020 21:26:07 +0000 (13:26 -0800)]
Merge tag 'sched-urgent-2020-11-22' of git://git./linux/kernel/git/tip/tip

Pull scheduler fixes from Thomas Gleixner:
 "A couple of scheduler fixes:

   - Make the conditional update of the overutilized state work
     correctly by caching the relevant flags state before overwriting
     them and checking them afterwards.

   - Fix a data race in the wakeup path which caused loadavg on ARM64
     platforms to become a random number generator.

   - Fix the ordering of the iowaiter accounting operations so it can't
     be decremented before it is incremented.

   - Fix a bug in the deadline scheduler vs. priority inheritance when a
     non-deadline task A has inherited the parameters of a deadline task
     B and then blocks on a non-deadline task C.

     The second inheritance step used the static deadline parameters of
     task A, which are usually 0, instead of further propagating task
     B's parameters. The zero initialized parameters trigger a bug in
     the deadline scheduler"

* tag 'sched-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/deadline: Fix priority inheritance with multiple scheduling classes
  sched: Fix rq->nr_iowait ordering
  sched: Fix data-race in wakeup
  sched/fair: Fix overutilized update in enqueue_task_fair()

3 years agoMerge tag 'perf-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 22 Nov 2020 21:23:43 +0000 (13:23 -0800)]
Merge tag 'perf-urgent-2020-11-22' of git://git./linux/kernel/git/tip/tip

Pull perf fix from Thomas Gleixner:
 "A single fix for the x86 perf sysfs interfaces which used kobject
  attributes instead of device attributes and therefore making clang's
  control flow integrity checker upset"

* tag 'perf-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/x86: fix sysfs type mismatches

3 years agoMerge tag 'locking-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 22 Nov 2020 21:19:53 +0000 (13:19 -0800)]
Merge tag 'locking-urgent-2020-11-22' of git://git./linux/kernel/git/tip/tip

Pull locking fix from Thomas Gleixner:
 "A single fix for lockdep which makes the recursion protection cover
  graph lock/unlock"

* tag 'locking-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  lockdep: Put graph lock/unlock under lock_recursion protection

3 years agoMerge tag 'efi-urgent-for-v5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 22 Nov 2020 21:05:48 +0000 (13:05 -0800)]
Merge tag 'efi-urgent-for-v5.10-rc3' of git://git./linux/kernel/git/tip/tip

Pull EFI fixes from Borislav Petkov:
 "Forwarded EFI fixes from Ard Biesheuvel:

   - fix memory leak in efivarfs driver

   - fix HYP mode issue in 32-bit ARM version of the EFI stub when built
     in Thumb2 mode

   - avoid leaking EFI pgd pages on allocation failure"

* tag 'efi-urgent-for-v5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi/x86: Free efi_pgd with free_pages()
  efivarfs: fix memory leak in efivarfs_create()
  efi/arm: set HSCTLR Thumb2 bit correctly for HVC calls from HYP

3 years agoMerge tag 'x86_urgent_for_v5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 22 Nov 2020 20:55:50 +0000 (12:55 -0800)]
Merge tag 'x86_urgent_for_v5.10-rc5' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

 - An IOMMU VT-d build fix when CONFIG_PCI_ATS=n along with a revert of
   same because the proper one is going through the IOMMU tree (Thomas
   Gleixner)

 - An Intel microcode loader fix to save the correct microcode patch to
   apply during resume (Chen Yu)

 - A fix to not access user memory of other processes when dumping
   opcode bytes (Thomas Gleixner)

* tag 'x86_urgent_for_v5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  Revert "iommu/vt-d: Take CONFIG_PCI_ATS into account"
  x86/dumpstack: Do not try to access user space code of other tasks
  x86/microcode/intel: Check patch signature before saving microcode for early loading
  iommu/vt-d: Take CONFIG_PCI_ATS into account

3 years agoMerge branch 'akpm' (patches from Andrew)
Linus Torvalds [Sun, 22 Nov 2020 20:14:46 +0000 (12:14 -0800)]
Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
 "8 patches.

  Subsystems affected by this patch series: mm (madvise, pagemap,
  readahead, memcg, userfaultfd), kbuild, and vfs"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm: fix madvise WILLNEED performance problem
  libfs: fix error cast of negative value in simple_attr_write()
  mm/userfaultfd: do not access vma->vm_mm after calling handle_userfault()
  mm: memcg/slab: fix root memcg vmstats
  mm: fix readahead_page_batch for retry entries
  mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports
  compiler-clang: remove version check for BPF Tracing
  mm/madvise: fix memory leak from process_madvise

3 years agoMerge tag 'staging-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 22 Nov 2020 19:58:49 +0000 (11:58 -0800)]
Merge tag 'staging-5.10-rc5' of git://git./linux/kernel/git/gregkh/staging

Pull staging and IIO fixes from Greg KH:
 "Here are some small Staging and IIO driver fixes for 5.10-rc5. They
  include:

   - IIO fixes for reported regressions and problems

   - new device ids for IIO drivers

   - new device id for rtl8723bs driver

   - staging ralink driver Kconfig dependency fix

   - staging mt7621-pci bus resource fix

  All of these have been in linux-next all week with no reported issues"

* tag 'staging-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  iio: accel: kxcjk1013: Add support for KIOX010A ACPI DSM for setting tablet-mode
  iio: accel: kxcjk1013: Replace is_smo8500_device with an acpi_type enum
  docs: ABI: testing: iio: stm32: remove re-introduced unsupported ABI
  iio: light: fix kconfig dependency bug for VCNL4035
  iio/adc: ingenic: Fix AUX/VBAT readings when touchscreen is used
  iio/adc: ingenic: Fix battery VREF for JZ4770 SoC
  staging: rtl8723bs: Add 024c:0627 to the list of SDIO device-ids
  staging: ralink-gdma: fix kconfig dependency bug for DMA_RALINK
  staging: mt7621-pci: avoid to request pci bus resources
  iio: imu: st_lsm6dsx: set 10ms as min shub slave timeout
  counter/ti-eqep: Fix regmap max_register
  iio: adc: stm32-adc: fix a regression when using dma and irq
  iio: adc: mediatek: fix unset field
  iio: cros_ec: Use default frequencies when EC returns invalid information

3 years agoMerge tag 'tty-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 22 Nov 2020 19:52:10 +0000 (11:52 -0800)]
Merge tag 'tty-5.10-rc5' of git://git./linux/kernel/git/gregkh/tty

Pull tty fixes from Greg KH:
 "Here are some small tty/serial fixes for 5.10-rc5 that resolve some
  reported issues:

   - speakup crash when telling the kernel to use a device that isn't
     really there

   - imx serial driver fixes for reported problems

   - ar933x_uart driver fix for probe error handling path

  All have been in linux-next for a while with no reported issues"

* tag 'tty-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: ar933x_uart: disable clk on error handling path in probe
  tty: serial: imx: keep console clocks always on
  speakup: Do not let the line discipline be used several times
  tty: serial: imx: fix potential deadlock

3 years agoMerge tag 'ext4_for_linus_fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 22 Nov 2020 19:39:32 +0000 (11:39 -0800)]
Merge tag 'ext4_for_linus_fixes2' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "A final set of miscellaneous bug fixes for ext4"

* tag 'ext4_for_linus_fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix bogus warning in ext4_update_dx_flag()
  jbd2: fix kernel-doc markups
  ext4: drop fast_commit from /proc/mounts

3 years agoafs: Fix speculative status fetch going out of order wrt to modifications
David Howells [Sun, 22 Nov 2020 13:13:45 +0000 (13:13 +0000)]
afs: Fix speculative status fetch going out of order wrt to modifications

When doing a lookup in a directory, the afs filesystem uses a bulk
status fetch to speculatively retrieve the statuses of up to 48 other
vnodes found in the same directory and it will then either update extant
inodes or create new ones - effectively doing 'lookup ahead'.

To avoid the possibility of deadlocking itself, however, the filesystem
doesn't lock all of those inodes; rather just the directory inode is
locked (by the VFS).

When the operation completes, afs_inode_init_from_status() or
afs_apply_status() is called, depending on whether the inode already
exists, to commit the new status.

A case exists, however, where the speculative status fetch operation may
straddle a modification operation on one of those vnodes.  What can then
happen is that the speculative bulk status RPC retrieves the old status,
and whilst that is happening, the modification happens - which returns
an updated status, then the modification status is committed, then we
attempt to commit the speculative status.

This results in something like the following being seen in dmesg:

kAFS: vnode modified {100058:861} 8->9 YFS.InlineBulkStatus

showing that for vnode 861 on volume 100058, we saw YFS.InlineBulkStatus
say that the vnode had data version 8 when we'd already recorded version
9 due to a local modification.  This was causing the cache to be
invalidated for that vnode when it shouldn't have been.  If it happens
on a data file, this might lead to local changes being lost.

Fix this by ignoring speculative status updates if the data version
doesn't match the expected value.

Note that it is possible to get a DV regression if a volume gets
restored from a backup - but we should get a callback break in such a
case that should trigger a recheck anyway.  It might be worth checking
the volume creation time in the volsync info and, if a change is
observed in that (as would happen on a restore), invalidate all caches
associated with the volume.

Fixes: 5cf9dd55a0ec ("afs: Prospectively look up extra files when doing a single lookup")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm: fix madvise WILLNEED performance problem
Matthew Wilcox (Oracle) [Sun, 22 Nov 2020 06:17:22 +0000 (22:17 -0800)]
mm: fix madvise WILLNEED performance problem

The calculation of the end page index was incorrect, leading to a
regression of 70% when running stress-ng.

With this fix, we instead see a performance improvement of 3%.

Fixes: e6e88712e43b ("mm: optimise madvise WILLNEED")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: William Kucharski <william.kucharski@oracle.com>
Cc: Feng Tang <feng.tang@intel.com>
Cc: "Chen, Rong A" <rong.a.chen@intel.com>
Link: https://lkml.kernel.org/r/20201109134851.29692-1-willy@infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agolibfs: fix error cast of negative value in simple_attr_write()
Yicong Yang [Sun, 22 Nov 2020 06:17:19 +0000 (22:17 -0800)]
libfs: fix error cast of negative value in simple_attr_write()

The attr->set() receive a value of u64, but simple_strtoll() is used for
doing the conversion.  It will lead to the error cast if user inputs a
negative value.

Use kstrtoull() instead of simple_strtoll() to convert a string got from
the user to an unsigned value.  The former will return '-EINVAL' if it
gets a negetive value, but the latter can't handle the situation
correctly.  Make 'val' unsigned long long as what kstrtoull() takes,
this will eliminate the compile warning on no 64-bit architectures.

Fixes: f7b88631a897 ("fs/libfs.c: fix simple_attr_write() on 32bit machines")
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lkml.kernel.org/r/1605341356-11872-1-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm/userfaultfd: do not access vma->vm_mm after calling handle_userfault()
Gerald Schaefer [Sun, 22 Nov 2020 06:17:15 +0000 (22:17 -0800)]
mm/userfaultfd: do not access vma->vm_mm after calling handle_userfault()

Alexander reported a syzkaller / KASAN finding on s390, see below for
complete output.

In do_huge_pmd_anonymous_page(), the pre-allocated pagetable will be
freed in some cases.  In the case of userfaultfd_missing(), this will
happen after calling handle_userfault(), which might have released the
mmap_lock.  Therefore, the following pte_free(vma->vm_mm, pgtable) will
access an unstable vma->vm_mm, which could have been freed or re-used
already.

For all architectures other than s390 this will go w/o any negative
impact, because pte_free() simply frees the page and ignores the
passed-in mm.  The implementation for SPARC32 would also access
mm->page_table_lock for pte_free(), but there is no THP support in
SPARC32, so the buggy code path will not be used there.

For s390, the mm->context.pgtable_list is being used to maintain the 2K
pagetable fragments, and operating on an already freed or even re-used
mm could result in various more or less subtle bugs due to list /
pagetable corruption.

Fix this by calling pte_free() before handle_userfault(), similar to how
it is already done in __do_huge_pmd_anonymous_page() for the WRITE /
non-huge_zero_page case.

Commit 6b251fc96cf2c ("userfaultfd: call handle_userfault() for
userfaultfd_missing() faults") actually introduced both, the
do_huge_pmd_anonymous_page() and also __do_huge_pmd_anonymous_page()
changes wrt to calling handle_userfault(), but only in the latter case
it put the pte_free() before calling handle_userfault().

  BUG: KASAN: use-after-free in do_huge_pmd_anonymous_page+0xcda/0xd90 mm/huge_memory.c:744
  Read of size 8 at addr 00000000962d6988 by task syz-executor.0/9334

  CPU: 1 PID: 9334 Comm: syz-executor.0 Not tainted 5.10.0-rc1-syzkaller-07083-g4c9720875573 #0
  Hardware name: IBM 3906 M04 701 (KVM/Linux)
  Call Trace:
    do_huge_pmd_anonymous_page+0xcda/0xd90 mm/huge_memory.c:744
    create_huge_pmd mm/memory.c:4256 [inline]
    __handle_mm_fault+0xe6e/0x1068 mm/memory.c:4480
    handle_mm_fault+0x288/0x748 mm/memory.c:4607
    do_exception+0x394/0xae0 arch/s390/mm/fault.c:479
    do_dat_exception+0x34/0x80 arch/s390/mm/fault.c:567
    pgm_check_handler+0x1da/0x22c arch/s390/kernel/entry.S:706
    copy_from_user_mvcos arch/s390/lib/uaccess.c:111 [inline]
    raw_copy_from_user+0x3a/0x88 arch/s390/lib/uaccess.c:174
    _copy_from_user+0x48/0xa8 lib/usercopy.c:16
    copy_from_user include/linux/uaccess.h:192 [inline]
    __do_sys_sigaltstack kernel/signal.c:4064 [inline]
    __s390x_sys_sigaltstack+0xc8/0x240 kernel/signal.c:4060
    system_call+0xe0/0x28c arch/s390/kernel/entry.S:415

  Allocated by task 9334:
    slab_alloc_node mm/slub.c:2891 [inline]
    slab_alloc mm/slub.c:2899 [inline]
    kmem_cache_alloc+0x118/0x348 mm/slub.c:2904
    vm_area_dup+0x9c/0x2b8 kernel/fork.c:356
    __split_vma+0xba/0x560 mm/mmap.c:2742
    split_vma+0xca/0x108 mm/mmap.c:2800
    mlock_fixup+0x4ae/0x600 mm/mlock.c:550
    apply_vma_lock_flags+0x2c6/0x398 mm/mlock.c:619
    do_mlock+0x1aa/0x718 mm/mlock.c:711
    __do_sys_mlock2 mm/mlock.c:738 [inline]
    __s390x_sys_mlock2+0x86/0xa8 mm/mlock.c:728
    system_call+0xe0/0x28c arch/s390/kernel/entry.S:415

  Freed by task 9333:
    slab_free mm/slub.c:3142 [inline]
    kmem_cache_free+0x7c/0x4b8 mm/slub.c:3158
    __vma_adjust+0x7b2/0x2508 mm/mmap.c:960
    vma_merge+0x87e/0xce0 mm/mmap.c:1209
    userfaultfd_release+0x412/0x6b8 fs/userfaultfd.c:868
    __fput+0x22c/0x7a8 fs/file_table.c:281
    task_work_run+0x200/0x320 kernel/task_work.c:151
    tracehook_notify_resume include/linux/tracehook.h:188 [inline]
    do_notify_resume+0x100/0x148 arch/s390/kernel/signal.c:538
    system_call+0xe6/0x28c arch/s390/kernel/entry.S:416

  The buggy address belongs to the object at 00000000962d6948 which belongs to the cache vm_area_struct of size 200
  The buggy address is located 64 bytes inside of 200-byte region [00000000962d694800000000962d6a10)
  The buggy address belongs to the page: page:00000000313a09fe refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x962d6 flags: 0x3ffff00000000200(slab)
  raw: 3ffff00000000200 000040000257e080 0000000c0000000c 000000008020ba00
  raw: 0000000000000000 000f001e00000000 ffffffff00000001 0000000096959501
  page dumped because: kasan: bad access detected
  page->mem_cgroup:0000000096959501

  Memory state around the buggy address:
   00000000962d6880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   00000000962d6900: 00 fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb
  >00000000962d6980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                        ^
   00000000962d6a00: fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00 00
   00000000962d6a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  ==================================================================

Fixes: 6b251fc96cf2c ("userfaultfd: call handle_userfault() for userfaultfd_missing() faults")
Reported-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: <stable@vger.kernel.org> [4.3+]
Link: https://lkml.kernel.org/r/20201110190329.11920-1-gerald.schaefer@linux.ibm.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm: memcg/slab: fix root memcg vmstats
Muchun Song [Sun, 22 Nov 2020 06:17:12 +0000 (22:17 -0800)]
mm: memcg/slab: fix root memcg vmstats

If we reparent the slab objects to the root memcg, when we free the slab
object, we need to update the per-memcg vmstats to keep it correct for
the root memcg.  Now this at least affects the vmstat of
NR_KERNEL_STACK_KB for !CONFIG_VMAP_STACK when the thread stack size is
smaller than the PAGE_SIZE.

David said:
 "I assume that without this fix that the root memcg's vmstat would
  always be inflated if we reparented"

Fixes: ec9f02384f60 ("mm: workingset: fix vmstat counters for shadow nodes")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Roman Gushchin <guro@fb.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Christopher Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yafang Shao <laoar.shao@gmail.com>
Cc: Chris Down <chris@chrisdown.name>
Cc: <stable@vger.kernel.org> [5.3+]
Link: https://lkml.kernel.org/r/20201110031015.15715-1-songmuchun@bytedance.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm: fix readahead_page_batch for retry entries
Matthew Wilcox (Oracle) [Sun, 22 Nov 2020 06:17:08 +0000 (22:17 -0800)]
mm: fix readahead_page_batch for retry entries

Both btrfs and fuse have reported faults caused by seeing a retry entry
instead of the page they were looking for.  This was caused by a missing
check in the iterator.

As can be seen in the below panic log, the accessing 0x402 causes a
panic.  In the xarray.h, 0x402 means RETRY_ENTRY.

  BUG: kernel NULL pointer dereference, address: 0000000000000402
  CPU: 14 PID: 306003 Comm: as Not tainted 5.9.0-1-amd64 #1 Debian 5.9.1-1
  Hardware name: Lenovo ThinkSystem SR665/7D2VCTO1WW, BIOS D8E106Q-1.01 05/30/2020
  RIP: 0010:fuse_readahead+0x152/0x470 [fuse]
  Code: 41 8b 57 18 4c 8d 54 10 ff 4c 89 d6 48 8d 7c 24 10 e8 d2 e3 28 f9 48 85 c0 0f 84 fe 00 00 00 44 89 f2 49 89 04 d4 44 8d 72 01 <48> 8b 10 41 8b 4f 1c 48 c1 ea 10 83 e2 01 80 fa 01 19 d2 81 e2 01
  RSP: 0018:ffffad99ceaebc50 EFLAGS: 00010246
  RAX: 0000000000000402 RBX: 0000000000000001 RCX: 0000000000000002
  RDX: 0000000000000000 RSI: ffff94c5af90bd98 RDI: ffffad99ceaebc60
  RBP: ffff94ddc1749a00 R08: 0000000000000402 R09: 0000000000000000
  R10: 0000000000000000 R11: 0000000000000100 R12: ffff94de6c429ce0
  R13: ffff94de6c4d3700 R14: 0000000000000001 R15: ffffad99ceaebd68
  FS:  00007f228c5c7040(0000) GS:ffff94de8ed80000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000402 CR3: 0000001dbd9b4000 CR4: 0000000000350ee0
  Call Trace:
    read_pages+0x83/0x270
    page_cache_readahead_unbounded+0x197/0x230
    generic_file_buffered_read+0x57a/0xa20
    new_sync_read+0x112/0x1a0
    vfs_read+0xf8/0x180
    ksys_read+0x5f/0xe0
    do_syscall_64+0x33/0x80
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fixes: 042124cc64c3 ("mm: add new readahead_control API")
Reported-by: David Sterba <dsterba@suse.com>
Reported-by: Wonhyuk Yang <vvghjk1234@gmail.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20201103142852.8543-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20201103124349.16722-1-vvghjk1234@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports
Dan Williams [Sun, 22 Nov 2020 06:17:05 +0000 (22:17 -0800)]
mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports

The core-mm has a default __weak implementation of phys_to_target_node()
to mirror the weak definition of memory_add_physaddr_to_nid().  That
symbol is exported for modules.  However, while the export in
mm/memory_hotplug.c exported the symbol in the configuration cases of:

CONFIG_NUMA_KEEP_MEMINFO=y
CONFIG_MEMORY_HOTPLUG=y

...and:

CONFIG_NUMA_KEEP_MEMINFO=n
CONFIG_MEMORY_HOTPLUG=y

...it failed to export the symbol in the case of:

CONFIG_NUMA_KEEP_MEMINFO=y
CONFIG_MEMORY_HOTPLUG=n

Not only is that broken, but Christoph points out that the kernel should
not be exporting any __weak symbol, which means that
memory_add_physaddr_to_nid() example that phys_to_target_node() copied
is broken too.

Rework the definition of phys_to_target_node() and
memory_add_physaddr_to_nid() to not require weak symbols.  Move to the
common arch override design-pattern of an asm header defining a symbol
to replace the default implementation.

The only common header that all memory_add_physaddr_to_nid() producing
architectures implement is asm/sparsemem.h.  In fact, powerpc already
defines its memory_add_physaddr_to_nid() helper in sparsemem.h.
Double-down on that observation and define phys_to_target_node() where
necessary in asm/sparsemem.h.  An alternate consideration that was
discarded was to put this override in asm/numa.h, but that entangles
with the definition of MAX_NUMNODES relative to the inclusion of
linux/nodemask.h, and requires powerpc to grow a new header.

The dependency on NUMA_KEEP_MEMINFO for DEV_DAX_HMEM_DEVICES is invalid
now that the symbol is properly exported / stubbed in all combinations
of CONFIG_NUMA_KEEP_MEMINFO and CONFIG_MEMORY_HOTPLUG.

[dan.j.williams@intel.com: v4]
Link: https://lkml.kernel.org/r/160461461867.1505359.5301571728749534585.stgit@dwillia2-desk3.amr.corp.intel.com
[dan.j.williams@intel.com: powerpc: fix create_section_mapping compile warning]
Link: https://lkml.kernel.org/r/160558386174.2948926.2740149041249041764.stgit@dwillia2-desk3.amr.corp.intel.com
Fixes: a035b6bf863e ("mm/memory_hotplug: introduce default phys_to_target_node() implementation")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lkml.kernel.org/r/160447639846.1133764.7044090803980177548.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agocompiler-clang: remove version check for BPF Tracing
Nick Desaulniers [Sun, 22 Nov 2020 06:17:01 +0000 (22:17 -0800)]
compiler-clang: remove version check for BPF Tracing

bpftrace parses the kernel headers and uses Clang under the hood.

Remove the version check when __BPF_TRACING__ is defined (as bpftrace
does) so that this tool can continue to parse kernel headers, even with
older clang sources.

Fixes: commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
Reported-by: Chen Yu <yu.chen.surf@gmail.com>
Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lkml.kernel.org/r/20201104191052.390657-1-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm/madvise: fix memory leak from process_madvise
Eric Dumazet [Sun, 22 Nov 2020 06:16:58 +0000 (22:16 -0800)]
mm/madvise: fix memory leak from process_madvise

The early return in process_madvise() will produce a memory leak.

Fix it.

Fixes: ecb8ac8b1f14 ("mm/madvise: introduce process_madvise() syscall: an external memory hinting API")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20201116155132.GA3805951@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agodt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:38 +0000 (18:48 +0000)]
dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.

This is a somewhat unusual device, in that it effectively does
spi offload.   That means that it doesn't act as a full SPI
master, but supports some functionality.  As such it supports
a subset of specific SPI ADCs.  There is potential for a future
clash in bindings, but as these are simple devices hopefully that
will not occur.

One addition to this from testing it against existing dts files
was to add a resets property.
This is specified in arch/arm/boot/dts/r8a7791.dtsi
If it's the dtsi that is wrong and not the binding doc, then
we can fix that instead.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-31-jic23@kernel.org
3 years agodt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:36 +0000 (18:48 +0000)]
dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion

Whilst this binding has a lot of elements they are all fairly standard.
Hence pretty much direct txt to yaml line by line conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Link: https://lore.kernel.org/r/20201031184854.745828-29-jic23@kernel.org
3 years agodt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:35 +0000 (18:48 +0000)]
dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.

Simple binding format conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Song Qiang <songqiang1304521@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-28-jic23@kernel.org