platform/kernel/linux-rpi.git
3 years agopower: reset: ltc2952: make trigger delay configurable
Marek Czerski [Wed, 3 Feb 2021 21:49:00 +0000 (22:49 +0100)]
power: reset: ltc2952: make trigger delay configurable

Make trigger delay configurable through device tree with
trigger-delay-ms property.

Trigger delay is the time to wait before starting shutdown
sequence after trigger line assertion.
Trigger delay must take into account the OFFT time configured
with the capacitor connected to OFFT pin of the LTC2952 chip.
Basically, the higher the capacitance connected to OFFT pin,
the larger trigger delay must be.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: cpcap-charger: Simplify bool conversion
Yang Li [Fri, 29 Jan 2021 08:10:12 +0000 (16:10 +0800)]
power: supply: cpcap-charger: Simplify bool conversion

Fix the following coccicheck warning:
./drivers/power/supply/cpcap-charger.c:416:31-36: WARNING: conversion to
bool not needed here

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: cpcap-charger: Add usleep to cpcap charger to avoid usb plug bounce
Carl Philipp Klemm [Sun, 17 Jan 2021 21:48:53 +0000 (22:48 +0100)]
power: supply: cpcap-charger: Add usleep to cpcap charger to avoid usb plug bounce

Adds 80000 us sleep when the usb cable is plugged in to hopefully avoid
bouncing contacts.

Upon pluging in the usb cable vbus will bounce for some time, causing cpcap to
dissconnect charging due to detecting an undervoltage condition. This is a
scope of vbus on xt894 while quickly inserting the usb cable with firm force,
probed at the far side of the usb socket and vbus loaded with approx 1k:
http://uvos.xyz/maserati/usbplug.jpg.

As can clearly be seen, vbus is all over the place for the first 15 ms or so
with a small blip at ~40 ms this causes the cpcap to trip up and disable
charging again.

The delay helps cpcap_usb_detect avoid the worst of this. It is, however, still
not ideal as strong vibrations can cause the issue to reapear any time during
charging. I have however not been able to cause the device to stop charging due
to this in practice as it is hard to vibrate the device such that the vbus pins
start bouncing again but cpcap_usb_detect is not called again due to a detected
disconnect/reconnect event.

Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: cpcap-charger: fix small mistake in current to register conversion
Carl Philipp Klemm [Sun, 17 Jan 2021 21:47:45 +0000 (22:47 +0100)]
power: supply: cpcap-charger: fix small mistake in current to register conversion

Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: core: reduce loglevel for probe defer info
Sebastian Reichel [Tue, 9 Mar 2021 18:04:07 +0000 (19:04 +0100)]
power: supply: core: reduce loglevel for probe defer info

Avoid logging probe defer information for default loglevel
configurations. This is only required for debugging probe
defer issues, which requires enabling debug messages for
other subsystems.

This dev_info() message predates having deferred devices
information available in /sys/kernel/debug/devices_deferred,
which is generally more useful.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: sbs-manager: update gpio include
Sebastian Reichel [Tue, 9 Mar 2021 18:04:06 +0000 (19:04 +0100)]
power: supply: sbs-manager: update gpio include

sbs-manager implements a GPIO chip, so include the proper
gpio driver include instead of the legacy gpio.h.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: sbs-manager: use dev_err_probe
Sebastian Reichel [Tue, 9 Mar 2021 18:04:05 +0000 (19:04 +0100)]
power: supply: sbs-manager: use dev_err_probe

Introduce usage of dev_err_probe in probe routine, which
makes the code slightly more readable and removes some
lines of code. It also removes PROBE_DEFER errors being
logged by default.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: sbs-manager: use managed i2c_mux_adapter
Sebastian Reichel [Tue, 9 Mar 2021 18:04:04 +0000 (19:04 +0100)]
power: supply: sbs-manager: use managed i2c_mux_adapter

Simplify code by using devm_add_action_or_reset to unregister
the i2c_mux_adapter.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: sbs-charger: drop unused gpio includes
Sebastian Reichel [Tue, 9 Mar 2021 18:04:03 +0000 (19:04 +0100)]
power: supply: sbs-charger: drop unused gpio includes

sbs-charger does not use any GPIOs, so no need to include
gpio.h and of_gpio.h.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: sbs-charger: use dev_err_probe
Sebastian Reichel [Tue, 9 Mar 2021 18:04:02 +0000 (19:04 +0100)]
power: supply: sbs-charger: use dev_err_probe

Introduce usage of dev_err_probe in probe routine, which
makes the code slightly more readable and removes some
lines of code. It also removes PROBE_DEFER errors being
logged by default.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: sbs-battery: use dev_err_probe
Sebastian Reichel [Tue, 9 Mar 2021 18:04:01 +0000 (19:04 +0100)]
power: supply: sbs-battery: use dev_err_probe

Introduce usage of dev_err_probe in probe routine, which
makes the code slightly more readable and removes some
lines of code. It also removes PROBE_DEFER errors being
logged by default, which are common when the battery is
waiting for the charger driver to be registered.

This also cleans up a useless goto and instead returns
directly.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: 88pm860x_battery: Remove unnecessary int for long long
Milan Djurovic [Sat, 27 Mar 2021 07:36:05 +0000 (00:36 -0700)]
power: supply: 88pm860x_battery: Remove unnecessary int for long long

Change 'long long int' to 'long long' because the int is unnecessary,
as suggested by checkpatch.pl.

Signed-off-by: Milan Djurovic <mdjurovic@zohomail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: max8997_charger: Switch to new binding
Timon Baetz [Mon, 29 Mar 2021 14:38:02 +0000 (14:38 +0000)]
power: supply: max8997_charger: Switch to new binding

Get regulator from parent device's node and extcon by name.

Signed-off-by: Timon Baetz <timon.baetz@protonmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: reset: hisi-reboot: use the correct HiSilicon copyright
Hao Fang [Tue, 30 Mar 2021 06:38:05 +0000 (14:38 +0800)]
power: reset: hisi-reboot: use the correct HiSilicon copyright

s/Hisilicon/HiSilicon/g.
It should use capital S, according to
https://www.hisilicon.com/en/terms-of-use.

Signed-off-by: Hao Fang <fanghao11@huawei.com>
Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: reset: at91-reset: use devm_of_iomap
Claudiu Beznea [Fri, 2 Apr 2021 10:50:18 +0000 (13:50 +0300)]
power: reset: at91-reset: use devm_of_iomap

Use devm_of_iomap() to map resources. This will avoid the necessity to
track the mapped resources and free them on failure path or on remove.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agodt-bindings: power: update battery.yaml reference
Mauro Carvalho Chehab [Thu, 1 Apr 2021 12:17:48 +0000 (14:17 +0200)]
dt-bindings: power: update battery.yaml reference

Changesets: 70c23e62d20c ("dt-bindings: power: supply: Fix remaining battery.txt links")
and: 471dec8023d1 ("dt-bindings: power: Convert battery.txt to battery.yaml")
renamed: Documentation/devicetree/bindings/power/supply/battery.txt
to: Documentation/devicetree/bindings/power/supply/battery.yaml.

Update its cross-reference accordingly.

Fixes: 70c23e62d20c ("dt-bindings: power: supply: Fix remaining battery.txt links")
Fixes: 471dec8023d1 ("dt-bindings: power: Convert battery.txt to battery.yaml")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agoMAINTAINERS: update lego,ev3-battery.yaml reference
Mauro Carvalho Chehab [Thu, 1 Apr 2021 12:17:32 +0000 (14:17 +0200)]
MAINTAINERS: update lego,ev3-battery.yaml reference

Changeset 3004e581d92a ("dt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format")
renamed: Documentation/devicetree/bindings/power/supply/lego_ev3_battery.txt
to: Documentation/devicetree/bindings/power/supply/lego,ev3-battery.yaml.

Update its cross-reference accordingly.

Fixes: 3004e581d92a ("dt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: David Lechner <david@lechnology.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: reset: replace curly brackets in Makefile
Daniel Golle [Thu, 18 Feb 2021 18:18:36 +0000 (18:18 +0000)]
power: reset: replace curly brackets in Makefile

Normal parentheses should be used when referring to config variables
in Makefile. Replace the accidentally introduced curly brackets by
regular parentheses.

Fixes: a7f79f99541ef ("power: reset: add driver for LinkStation power off")
Acked-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: max17042: Trivial spelling fixes
Bhaskar Chowdhury [Tue, 23 Mar 2021 12:42:06 +0000 (18:12 +0530)]
power: supply: max17042: Trivial spelling fixes

Few trivial spelling fixes.

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agodt-bindings: power: supply: Drop power_supply.txt
Sebastian Reichel [Wed, 17 Mar 2021 13:49:04 +0000 (14:49 +0100)]
dt-bindings: power: supply: Drop power_supply.txt

The file has been replaced by power-supply.yaml and all links
have been updated to the new file.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: Fix remaining battery.txt links
Sebastian Reichel [Wed, 17 Mar 2021 13:49:03 +0000 (14:49 +0100)]
dt-bindings: power: supply: Fix remaining battery.txt links

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: sbs-battery: Fix dtbs_check
Sebastian Reichel [Wed, 17 Mar 2021 13:49:02 +0000 (14:49 +0100)]
dt-bindings: power: supply: sbs-battery: Fix dtbs_check

Existing in-tree users make use of '"ti,bq20z45", "sbs,sbs-battery"', so
add it to the list of known compatible strings.

Also add missing support for the generic 'power-supplies' property by
importing power-supply.yaml and setting unevaluatedProperties instead
of additionalProperties.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: ab8500: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:49:01 +0000 (14:49 +0100)]
dt-bindings: power: supply: ab8500: Convert to DT schema format

Convert the binding to DT schema format.

Note: The battery node does not have a compatible value and needs
to be described from the binding file for the PMIC. That has not
yet been converted, so I kept the information in plaintext for now.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: olpc-battery: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:49:00 +0000 (14:49 +0100)]
dt-bindings: power: supply: olpc-battery: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: rt9455: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:59 +0000 (14:48 +0100)]
dt-bindings: power: supply: rt9455: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: ltc294x: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:58 +0000 (14:48 +0100)]
dt-bindings: power: supply: ltc294x: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: lt3651: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:57 +0000 (14:48 +0100)]
dt-bindings: power: supply: lt3651: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: lp8727: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:56 +0000 (14:48 +0100)]
dt-bindings: power: supply: lp8727: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: da9150: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:55 +0000 (14:48 +0100)]
dt-bindings: power: supply: da9150: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: axp20x: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:54 +0000 (14:48 +0100)]
dt-bindings: power: supply: axp20x: Convert to DT schema format

Convert the binding to DT schema format.

Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: act8945a: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:53 +0000 (14:48 +0100)]
dt-bindings: power: supply: act8945a: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: pm8941-coincell: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:52 +0000 (14:48 +0100)]
dt-bindings: power: supply: pm8941-coincell: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: pm8941-charger: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:51 +0000 (14:48 +0100)]
dt-bindings: power: supply: pm8941-charger: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: ucs1002: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:50 +0000 (14:48 +0100)]
dt-bindings: power: supply: ucs1002: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: max8903: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:49 +0000 (14:48 +0100)]
dt-bindings: power: supply: max8903: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: max17042: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:48 +0000 (14:48 +0100)]
dt-bindings: power: supply: max17042: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: max14656: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:47 +0000 (14:48 +0100)]
dt-bindings: power: supply: max14656: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: max17040: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:46 +0000 (14:48 +0100)]
dt-bindings: power: supply: max17040: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:45 +0000 (14:48 +0100)]
dt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format

Convert the binding to DT schema format.

Cc: David Lechner <david@lechnology.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: n900-battery: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:44 +0000 (14:48 +0100)]
dt-bindings: power: supply: n900-battery: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Rejected-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: twl4030: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:43 +0000 (14:48 +0100)]
dt-bindings: power: supply: twl4030: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: tps65217: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:42 +0000 (14:48 +0100)]
dt-bindings: power: supply: tps65217: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: tps65090: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:41 +0000 (14:48 +0100)]
dt-bindings: power: supply: tps65090: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: sc2731-charger: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:40 +0000 (14:48 +0100)]
dt-bindings: power: supply: sc2731-charger: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: sc27xx-fg: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:39 +0000 (14:48 +0100)]
dt-bindings: power: supply: sc27xx-fg: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: ds2760: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:38 +0000 (14:48 +0100)]
dt-bindings: power: supply: ds2760: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: sbs-manager: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:37 +0000 (14:48 +0100)]
dt-bindings: power: supply: sbs-manager: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: sbs-charger: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:36 +0000 (14:48 +0100)]
dt-bindings: power: supply: sbs-charger: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: isp1704: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:35 +0000 (14:48 +0100)]
dt-bindings: power: supply: isp1704: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: bq24735: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:34 +0000 (14:48 +0100)]
dt-bindings: power: supply: bq24735: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: bq2415x: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:33 +0000 (14:48 +0100)]
dt-bindings: power: supply: bq2415x: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: bq24190: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:32 +0000 (14:48 +0100)]
dt-bindings: power: supply: bq24190: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: bq24257: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:31 +0000 (14:48 +0100)]
dt-bindings: power: supply: bq24257: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: bq25890: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:30 +0000 (14:48 +0100)]
dt-bindings: power: supply: bq25890: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: cpcap-charger: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:29 +0000 (14:48 +0100)]
dt-bindings: power: supply: cpcap-charger: Convert to DT schema format

Convert the binding to DT schema format. I also added the missing bits
used by the only in-tree user and implemented in the driver.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: power: supply: cpcap-battery: Convert to DT schema format
Sebastian Reichel [Wed, 17 Mar 2021 13:48:28 +0000 (14:48 +0100)]
dt-bindings: power: supply: cpcap-battery: Convert to DT schema format

Convert the binding to DT schema format. I also added the missing bits
used by the only in-tree user and implemented in the driver.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agopower: supply: max1721x: Correct spelling
Xiaofeng Cao [Thu, 11 Mar 2021 11:57:35 +0000 (19:57 +0800)]
power: supply: max1721x: Correct spelling

Change  'stanalone'      to  'standalone'
Change  'mesaurement'    to  'measurement'
Change  'nonvilatile'    to  'nonvolatile'
Change  'unical'         to  'unique'
Change  'unaccesable'    to  'unaccessible'
Change  'correcpondent'  to  'correspond'

Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: ds2781: use kobj_to_dev()
dongjian [Tue, 16 Mar 2021 06:54:12 +0000 (14:54 +0800)]
power: supply: ds2781: use kobj_to_dev()

Use kobj_to_dev() instead of open-coding it

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: charger-manager: Fix a typo
Bhaskar Chowdhury [Fri, 19 Mar 2021 05:52:30 +0000 (11:22 +0530)]
power: supply: charger-manager: Fix a typo

s/systme/system/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: reset: remove unneeded semicolon
dongjian [Mon, 22 Mar 2021 11:42:27 +0000 (19:42 +0800)]
power: reset: remove unneeded semicolon

Fixes coccicheck warning:
drivers/power/reset/vexpress-poweroff.c:136:2-3: Unneeded semicolon

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: Use IRQF_ONESHOT
dongjian [Mon, 22 Mar 2021 11:21:33 +0000 (19:21 +0800)]
power: supply: Use IRQF_ONESHOT

Fixes coccicheck error:

drivers/power/supply/pm2301_charger.c:1089:7-27: ERROR:
drivers/power/supply/lp8788-charger.c:502:8-28: ERROR:
drivers/power/supply/tps65217_charger.c:239:8-33: ERROR:
drivers/power/supply/tps65090-charger.c:303:8-33: ERROR:

Threaded IRQ with no primary handler requested without IRQF_ONESHOT

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: bq27xxx: Add support for BQ78Z100
LI Qingwu [Fri, 19 Mar 2021 11:02:36 +0000 (11:02 +0000)]
power: supply: bq27xxx: Add support for BQ78Z100

Add support for TI BQ78Z100, I2C interface gas gauge.
It provides a fully integrated safety protection
and authentication for 1 to 2-series cell Li-Ion and
Li-Polymer battery packs.

The patch was tested with BQ78Z100 equipment.

CASE I:  Discharging:
POWER_SUPPLY_NAME=bq78z100-0
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_VOLTAGE_NOW=3386000
POWER_SUPPLY_CURRENT_NOW=-5000
POWER_SUPPLY_CAPACITY=27
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_TEMP=269
POWER_SUPPLY_TIME_TO_EMPTY_NOW=1249920
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CHARGE_FULL=6494000
POWER_SUPPLY_CHARGE_NOW=1736000
POWER_SUPPLY_CHARGE_FULL_DESIGN=6000000
POWER_SUPPLY_CYCLE_COUNT=1
POWER_SUPPLY_POWER_AVG=-20000
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_MANUFACTURER=Texas Instruments

CASE II : No discharging current:
POWER_SUPPLY_NAME=bq78z100-0
POWER_SUPPLY_STATUS=Not charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_VOLTAGE_NOW=3386000
POWER_SUPPLY_CURRENT_NOW=0
POWER_SUPPLY_CAPACITY=27
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_TEMP=270
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CHARGE_FULL=6494000
POWER_SUPPLY_CHARGE_NOW=1734000
POWER_SUPPLY_CHARGE_FULL_DESIGN=6000000
POWER_SUPPLY_CYCLE_COUNT=1
POWER_SUPPLY_POWER_AVG=0
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_MANUFACTURER=Texas Instruments

Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agodt-bindings: power: bq27xxx: add bq78z100
LI Qingwu [Fri, 19 Mar 2021 11:02:35 +0000 (11:02 +0000)]
dt-bindings: power: bq27xxx: add bq78z100

Add bindings for TI BQ78Z100. An I2C interface gas gauge.
It provides a fully integrated safety protection
and authentication for 1 to 2-series cell Li-Ion and
Li-Polymer battery packs.

Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: bq27xxx: make status more robust
Matthias Schiffer [Wed, 3 Mar 2021 09:54:20 +0000 (10:54 +0100)]
power: supply: bq27xxx: make status more robust

There are multiple issues in bq27xxx_battery_status():

- On BQ28Q610 is was observed that the "full" flag may be set even while
  the battery is charging or discharging. With the current logic to make
  "full" override everything else, it look a very long time (>20min) for
  the status to change from "full" to "discharging" after unplugging the
  supply on a device with low power consumption
- The POWER_SUPPLY_STATUS_NOT_CHARGING check depends on
  power_supply_am_i_supplied(), which will not work when the supply
  doesn't exist as a separate device known to Linux

We can solve both issues by deriving the status from the current instead
of the flags field. The flags are now only used to distinguish "full"
from "not charging", and to determine the sign of the current on
BQ27XXX_O_ZERO devices.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: bq27xxx: fix power_avg for newer ICs
Matthias Schiffer [Wed, 3 Mar 2021 09:54:19 +0000 (10:54 +0100)]
power: supply: bq27xxx: fix power_avg for newer ICs

On all newer bq27xxx ICs, the AveragePower register contains a signed
value; in addition to handling the raw value as unsigned, the driver
code also didn't convert it to µW as expected.

At least for the BQ28Z610, the reference manual incorrectly states that
the value is in units of 1mW and not 10mW. I have no way of knowing
whether the manuals of other supported ICs contain the same error, or if
there are models that actually use 1mW. At least, the new code shouldn't
be *less* correct than the old version for any device.

power_avg is removed from the cache structure, se we don't have to
extend it to store both a signed value and an error code. Always getting
an up-to-date value may be desirable anyways, as it avoids inconsistent
current and power readings when switching between charging and
discharging.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: bq27xxx: fix sign of current_now for newer ICs
Matthias Schiffer [Wed, 3 Mar 2021 09:54:18 +0000 (10:54 +0100)]
power: supply: bq27xxx: fix sign of current_now for newer ICs

Commit cd060b4d0868 ("power: supply: bq27xxx: fix polarity of current_now")
changed the sign of current_now for all bq27xxx variants, but on BQ28Z610
I'm now seeing negated values *with* that patch.

The GTA04/Openmoko device that was used for testing uses a BQ27000 or
BQ27010 IC, so I assume only the BQ27XXX_O_ZERO code path was incorrect.
Revert the behaviour for newer ICs.

Fixes: cd060b4d0868 "power: supply: bq27xxx: fix polarity of current_now"
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: axp20x_usb_power: Add missing check in axp20x_usb_power_probe
Dinghao Liu [Wed, 3 Mar 2021 12:12:36 +0000 (20:12 +0800)]
power: supply: axp20x_usb_power: Add missing check in axp20x_usb_power_probe

There are two regmap_update_bits() calls but only one of them has
return value check, which is odd. Add a return value check and
terminate the execution flow on failure just like the other call.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: z2_battery: Drop unused variable
Linus Walleij [Fri, 5 Mar 2021 10:01:08 +0000 (11:01 +0100)]
power: supply: z2_battery: Drop unused variable

The kernel test robot reports an unused variable in the
Z2 battery code caused by a recent commit.

Fixes: a3b4388ea19b ("power: supply: z2_battery: Convert to GPIO descriptors")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: core: provide function stubs if CONFIG_POWER_SUPPLY=n
Ray Chi [Mon, 8 Mar 2021 13:31:46 +0000 (21:31 +0800)]
power: supply: core: provide function stubs if CONFIG_POWER_SUPPLY=n

Fix build error when CONFIG_POWER_SUPPLY is not enabled.

The build error occurs in mips (cavium_octeon_defconfig).

mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_remove':
drivers/usb/dwc3/core.c:1657: undefined reference to `power_supply_put'
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_get_properties':
drivers/usb/dwc3/core.c:1270: undefined reference to `power_supply_get_by_name'
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_probe':
drivers/usb/dwc3/core.c:1632: undefined reference to `power_supply_put'

Fixes: 59fa3def35de ("usb: dwc3: add a power supply for current control")
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Ray Chi <raychi@google.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: smb347-charger: Clean up whitespaces in the code
Dmitry Osipenko [Tue, 2 Mar 2021 10:10:27 +0000 (13:10 +0300)]
power: supply: smb347-charger: Clean up whitespaces in the code

Improve formatting of the code by removing unnecessary whitespaces.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: smb347-charger: Improve interrupt initialization
Dmitry Osipenko [Tue, 2 Mar 2021 10:10:26 +0000 (13:10 +0300)]
power: supply: smb347-charger: Improve interrupt initialization

A previous commit attempted to fix IRQ usage in a case where interrupt
is failed to initialize, but it missed couple more cases that could be
improved. The interrupt could be undefined and then everything related
to interrupt shouldn't be touched by driver. Secondly, we shouldn't ignore
errors that aren't directly related to enabling interrupt in hardware,
like enabling h/w write-access or requesting interrupt. Improve interrupt
initialization in the driver in order to handle the missing cases.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: s3c_adc_battery: remove unused pdata in suspend/resume
Krzysztof Kozlowski [Wed, 10 Feb 2021 17:21:08 +0000 (18:21 +0100)]
power: supply: s3c_adc_battery: remove unused pdata in suspend/resume

The "pdata" local variable is not used in suspend/resume handlers since
commit 7776bcd241e0 ("power: supply: s3c-adc-battery: Convert to GPIO
descriptors"):

    drivers/power/supply/s3c_adc_battery.c: In function ‘s3c_adc_bat_suspend’:
    drivers/power/supply/s3c_adc_battery.c:405:28: warning: unused variable ‘pdata’ [-Wunused-variable]

    drivers/power/supply/s3c_adc_battery.c: In function ‘s3c_adc_bat_resume’:
    drivers/power/supply/s3c_adc_battery.c:422:28: warning: unused variable ‘pdata’ [-Wunused-variable]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: s3c_adc_battery: add SPDX license identifier
Krzysztof Kozlowski [Wed, 10 Feb 2021 17:21:07 +0000 (18:21 +0100)]
power: supply: s3c_adc_battery: add SPDX license identifier

Add SPDX license identifier and replace license boilerplate.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agoMAINTAINERS: power: supply: add entry for S3C ADC battery driver
Krzysztof Kozlowski [Wed, 10 Feb 2021 17:21:06 +0000 (18:21 +0100)]
MAINTAINERS: power: supply: add entry for S3C ADC battery driver

The S3C ADC battery driver is a very old piece of code but still used by
(very old as well) S3C24xx platforms (iPAQ h1930/h1940/rx1950).
Currently the header file is not covered by maintainers file, so it
might look abandoned.  Add a new entry for entire S3C ADC battery driver
with Krzysztof Kozlowski as maintainer (as Krzysztof maintains still
Samsung S3C24xx platform) to indicate that some basic review can take
place.

However considering that the S3C24xx platform is quite old with only few
users currently and Krzysztof does not have the actual hardware, let's
mark the driver as "Odd fixes".

Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: cw2015: Add CHARGE_NOW support
Martin Ashby [Thu, 18 Feb 2021 12:42:50 +0000 (07:42 -0500)]
power: supply: cw2015: Add CHARGE_NOW support

CHARGE_NOW is expected by some user software (such as waybar)
instead of 'CAPACITY', in order to correctly calculate remaining battery
life.

Signed-off-by: Martin Ashby <martin@ashbysoft.com>
Reviewed-by: Tobias Schramm <t.schramm@manjaro.org>
Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agopower: supply: max8997-charger: remove unneeded semicolon
Jiapeng Chong [Wed, 24 Feb 2021 07:15:10 +0000 (15:15 +0800)]
power: supply: max8997-charger: remove unneeded semicolon

Fix the following coccicheck warnings:

./drivers/power/supply/max8997_charger.c:266:3-4: Unneeded semicolon.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agoLinux 5.12-rc2
Linus Torvalds [Sat, 6 Mar 2021 01:33:41 +0000 (17:33 -0800)]
Linux 5.12-rc2

3 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Linus Torvalds [Sat, 6 Mar 2021 01:27:59 +0000 (17:27 -0800)]
Merge tag 'for-linus' of git://git./linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
 "Nothing special here, though Bob's regression fixes for rxe would have
  made it before the rc cycle had there not been such strong winter
  weather!

   - Fix corner cases in the rxe reference counting cleanup that are
     causing regressions in blktests for SRP

   - Two kdoc fixes so W=1 is clean

   - Missing error return in error unwind for mlx5

   - Wrong lock type nesting in IB CM"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/rxe: Fix errant WARN_ONCE in rxe_completer()
  RDMA/rxe: Fix extra deref in rxe_rcv_mcast_pkt()
  RDMA/rxe: Fix missed IB reference counting in loopback
  RDMA/uverbs: Fix kernel-doc warning of _uverbs_alloc
  RDMA/mlx5: Set correct kernel-doc identifier
  IB/mlx5: Add missing error code
  RDMA/rxe: Fix missing kconfig dependency on CRYPTO
  RDMA/cm: Fix IRQ restore in ib_send_cm_sidr_rep

3 years agoMerge tag 'gcc-plugins-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 6 Mar 2021 01:23:03 +0000 (17:23 -0800)]
Merge tag 'gcc-plugins-v5.12-rc2' of git://git./linux/kernel/git/kees/linux

Pull gcc-plugins fixes from Kees Cook:
 "Tiny gcc-plugin fixes for v5.12-rc2. These issues are small but have
  been reported a couple times now by static analyzers, so best to get
  them fixed to reduce the noise. :)

   - Fix coding style issues (Jason Yan)"

* tag 'gcc-plugins-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  gcc-plugins: latent_entropy: remove unneeded semicolon
  gcc-plugins: structleak: remove unneeded variable 'ret'

3 years agoMerge tag 'pstore-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
Linus Torvalds [Sat, 6 Mar 2021 01:21:25 +0000 (17:21 -0800)]
Merge tag 'pstore-v5.12-rc2' of git://git./linux/kernel/git/kees/linux

Pull pstore fixes from Kees Cook:

 - Rate-limit ECC warnings (Dmitry Osipenko)

 - Fix error path check for NULL (Tetsuo Handa)

* tag 'pstore-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore/ram: Rate-limit "uncorrectable error in header" message
  pstore: Fix warning in pstore_kill_sb()

3 years agoMerge tag 'for-5.12/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
Linus Torvalds [Fri, 5 Mar 2021 21:25:23 +0000 (13:25 -0800)]
Merge tag 'for-5.12/dm-fixes' of git://git./linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mike Snitzer:
 "Fix DM verity target's optional Forward Error Correction (FEC) for
  Reed-Solomon roots that are unaligned to block size"

* tag 'for-5.12/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm verity: fix FEC for RS roots unaligned to block size
  dm bufio: subtract the number of initial sectors in dm_bufio_get_device_size

3 years agoMerge tag 'block-5.12-2021-03-05' of git://git.kernel.dk/linux-block
Linus Torvalds [Fri, 5 Mar 2021 20:59:37 +0000 (12:59 -0800)]
Merge tag 'block-5.12-2021-03-05' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

 - NVMe fixes:
      - more device quirks (Julian Einwag, Zoltán Böszörményi, Pascal
        Terjan)
      - fix a hwmon error return (Daniel Wagner)
      - fix the keep alive timeout initialization (Martin George)
      - ensure the model_number can't be changed on a used subsystem
        (Max Gurtovoy)

 - rsxx missing -EFAULT on copy_to_user() failure (Dan)

 - rsxx remove unused linux.h include (Tian)

 - kill unused RQF_SORTED (Jean)

 - updated outdated BFQ comments (Joseph)

 - revert work-around commit for bd_size_lock, since we removed the
   offending user in this merge window (Damien)

* tag 'block-5.12-2021-03-05' of git://git.kernel.dk/linux-block:
  nvmet: model_number must be immutable once set
  nvme-fabrics: fix kato initialization
  nvme-hwmon: Return error code when registration fails
  nvme-pci: add quirks for Lexar 256GB SSD
  nvme-pci: mark Kingston SKC2000 as not supporting the deepest power state
  nvme-pci: mark Seagate Nytro XM1440 as QUIRK_NO_NS_DESC_LIST.
  rsxx: Return -EFAULT if copy_to_user() fails
  block/bfq: update comments and default value in docs for fifo_expire
  rsxx: remove unused including <linux/version.h>
  block: Drop leftover references to RQF_SORTED
  block: revert "block: fix bd_size_lock use"

3 years agoMerge tag 'io_uring-5.12-2021-03-05' of git://git.kernel.dk/linux-block
Linus Torvalds [Fri, 5 Mar 2021 20:44:43 +0000 (12:44 -0800)]
Merge tag 'io_uring-5.12-2021-03-05' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
 "A bit of a mix between fallout from the worker change, cleanups and
  reductions now possible from that change, and fixes in general. In
  detail:

   - Fully serialize manager and worker creation, fixing races due to
     that.

   - Clean up some naming that had gone stale.

   - SQPOLL fixes.

   - Fix race condition around task_work rework that went into this
     merge window.

   - Implement unshare. Used for when the original task does unshare(2)
     or setuid/seteuid and friends, drops the original workers and forks
     new ones.

   - Drop the only remaining piece of state shuffling we had left, which
     was cred. Move it into issue instead, and we can drop all of that
     code too.

   - Kill f_op->flush() usage. That was such a nasty hack that we had
     out of necessity, we no longer need it.

   - Following from ->flush() removal, we can also drop various bits of
     ctx state related to SQPOLL and cancelations.

   - Fix an issue with IOPOLL retry, which originally was fallout from a
     filemap change (removing iov_iter_revert()), but uncovered an issue
     with iovec re-import too late.

   - Fix an issue with system suspend.

   - Use xchg() for fallback work, instead of cmpxchg().

   - Properly destroy io-wq on exec.

   - Add create_io_thread() core helper, and use that in io-wq and
     io_uring. This allows us to remove various silly completion events
     related to thread setup.

   - A few error handling fixes.

  This should be the grunt of fixes necessary for the new workers, next
  week should be quieter. We've got a pending series from Pavel on
  cancelations, and how tasks and rings are indexed. Outside of that,
  should just be minor fixes. Even with these fixes, we're still killing
  a net ~80 lines"

* tag 'io_uring-5.12-2021-03-05' of git://git.kernel.dk/linux-block: (41 commits)
  io_uring: don't restrict issue_flags for io_openat
  io_uring: make SQPOLL thread parking saner
  io-wq: kill hashed waitqueue before manager exits
  io_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return
  io_uring: don't keep looping for more events if we can't flush overflow
  io_uring: move to using create_io_thread()
  kernel: provide create_io_thread() helper
  io_uring: reliably cancel linked timeouts
  io_uring: cancel-match based on flags
  io-wq: ensure all pending work is canceled on exit
  io_uring: ensure that threads freeze on suspend
  io_uring: remove extra in_idle wake up
  io_uring: inline __io_queue_async_work()
  io_uring: inline io_req_clean_work()
  io_uring: choose right tctx->io_wq for try cancel
  io_uring: fix -EAGAIN retry with IOPOLL
  io-wq: fix error path leak of buffered write hash map
  io_uring: remove sqo_task
  io_uring: kill sqo_dead and sqo submission halting
  io_uring: ignore double poll add on the same waitqueue head
  ...

3 years agoMerge tag 'pm-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Linus Torvalds [Fri, 5 Mar 2021 20:36:33 +0000 (12:36 -0800)]
Merge tag 'pm-5.12-rc2' of git://git./linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix the usage of device links in the runtime PM core code and
  update the DTPM (Dynamic Thermal Power Management) feature added
  recently.

  Specifics:

   - Make the runtime PM core code avoid attempting to suspend supplier
     devices before updating the PM-runtime status of a consumer to
     'suspended' (Rafael Wysocki).

   - Fix DTPM (Dynamic Thermal Power Management) root node
     initialization and label that feature as EXPERIMENTAL in Kconfig
     (Daniel Lezcano)"

* tag 'pm-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  powercap/drivers/dtpm: Add the experimental label to the option description
  powercap/drivers/dtpm: Fix root node initialization
  PM: runtime: Update device status before letting suppliers suspend

3 years agoMerge tag 'acpi-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Fri, 5 Mar 2021 20:32:17 +0000 (12:32 -0800)]
Merge tag 'acpi-5.12-rc2' of git://git./linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Make the empty stubs of some helper functions used when CONFIG_ACPI is
  not set actually match those functions (Andy Shevchenko)"

* tag 'acpi-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: bus: Constify is_acpi_node() and friends (part 2)

3 years agoMerge tag 'iommu-fixes-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 5 Mar 2021 20:26:24 +0000 (12:26 -0800)]
Merge tag 'iommu-fixes-v5.12-rc1' of git://git./linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel:

 - Fix a sleeping-while-atomic issue in the AMD IOMMU code

 - Disable lazy IOTLB flush for untrusted devices in the Intel VT-d
   driver

 - Fix status code definitions for Intel VT-d

 - Fix IO Page Fault issue in Tegra IOMMU driver

* tag 'iommu-fixes-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/vt-d: Fix status code for Allocate/Free PASID command
  iommu: Don't use lazy flush for untrusted device
  iommu/tegra-smmu: Fix mc errors on tegra124-nyan
  iommu/amd: Fix sleeping in atomic in increase_address_space()

3 years agoMerge tag 'for-5.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
Linus Torvalds [Fri, 5 Mar 2021 20:21:14 +0000 (12:21 -0800)]
Merge tag 'for-5.12-rc1-tag' of git://git./linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
 "More regression fixes and stabilization.

  Regressions:

   - zoned mode
      - count zone sizes in wider int types
      - fix space accounting for read-only block groups

   - subpage: fix page tail zeroing

  Fixes:

   - fix spurious warning when remounting with free space tree

   - fix warning when creating a directory with smack enabled

   - ioctl checks for qgroup inheritance when creating a snapshot

   - qgroup
      - fix missing unlock on error path in zero range
      - fix amount of released reservation on error
      - fix flushing from unsafe context with open transaction,
        potentially deadlocking

   - minor build warning fixes"

* tag 'for-5.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: zoned: do not account freed region of read-only block group as zone_unusable
  btrfs: zoned: use sector_t for zone sectors
  btrfs: subpage: fix the false data csum mismatch error
  btrfs: fix warning when creating a directory with smack enabled
  btrfs: don't flush from btrfs_delayed_inode_reserve_metadata
  btrfs: export and rename qgroup_reserve_meta
  btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata
  btrfs: fix spurious free_space_tree remount warning
  btrfs: validate qgroup inherit for SNAP_CREATE_V2 ioctl
  btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors
  btrfs: ref-verify: use 'inline void' keyword ordering

3 years agoMerge tag 'devicetree-fixes-for-5.12-1' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 5 Mar 2021 20:12:28 +0000 (12:12 -0800)]
Merge tag 'devicetree-fixes-for-5.12-1' of git://git./linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:

 - Another batch of graph and video-interfaces schema conversions

 - Drop DT header symlink for dropped C6X arch

 - Fix bcm2711-hdmi schema error

* tag 'devicetree-fixes-for-5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  dt-bindings: media: Use graph and video-interfaces schemas, round 2
  dts: drop dangling c6x symlink
  dt-bindings: bcm2711-hdmi: Fix broken schema

3 years agoMerge tag 'trace-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Fri, 5 Mar 2021 20:04:59 +0000 (12:04 -0800)]
Merge tag 'trace-v5.12-rc1' of git://git./linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "Functional fixes:

   - Fix big endian conversion for arm64 in recordmcount processing

   - Fix timestamp corruption in ring buffer on discarding events

   - Fix memory leak in __create_synth_event()

   - Skip selftests if tracing is disabled as it will cause them to
     fail.

  Non-functional fixes:

   - Fix help text in Kconfig

   - Remove duplicate prototype for trace_empty()

   - Fix stale comment about the trace_event_call flags.

  Self test update:

   - Add more information to the validation output of when a corrupt
     timestamp is found in the ring buffer, and also trigger a warning
     to make sure that tests catch it"

* tag 'trace-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix comment about the trace_event_call flags
  tracing: Skip selftests if tracing is disabled
  tracing: Fix memory leak in __create_synth_event()
  ring-buffer: Add a little more information and a WARN when time stamp going backwards is detected
  ring-buffer: Force before_stamp and write_stamp to be different on discard
  tracing: Fix help text of TRACEPOINT_BENCHMARK in Kconfig
  tracing: Remove duplicate declaration from trace.h
  ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount

3 years agoRDMA/rxe: Fix errant WARN_ONCE in rxe_completer()
Bob Pearson [Thu, 4 Mar 2021 19:20:49 +0000 (13:20 -0600)]
RDMA/rxe: Fix errant WARN_ONCE in rxe_completer()

In rxe_comp.c in rxe_completer() the function free_pkt() did not clear skb
which triggered a warning at 'done:' and could possibly at 'exit:'. The
WARN_ONCE() calls are not actually needed.  The call to free_pkt() is
moved to the end to clearly show that all skbs are freed.

Fixes: 899aba891cab ("RDMA/rxe: Fix FIXME in rxe_udp_encap_recv()")
Link: https://lore.kernel.org/r/20210304192048.2958-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
3 years agoRDMA/rxe: Fix extra deref in rxe_rcv_mcast_pkt()
Bob Pearson [Thu, 4 Mar 2021 19:20:49 +0000 (13:20 -0600)]
RDMA/rxe: Fix extra deref in rxe_rcv_mcast_pkt()

rxe_rcv_mcast_pkt() dropped a reference to ib_device when no error
occurred causing an underflow on the reference counter.  This code is
cleaned up to be clearer and easier to read.

Fixes: 899aba891cab ("RDMA/rxe: Fix FIXME in rxe_udp_encap_recv()")
Link: https://lore.kernel.org/r/20210304192048.2958-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
3 years agoRDMA/rxe: Fix missed IB reference counting in loopback
Bob Pearson [Thu, 4 Mar 2021 19:20:49 +0000 (13:20 -0600)]
RDMA/rxe: Fix missed IB reference counting in loopback

When the noted patch below extending the reference taken by
rxe_get_dev_from_net() in rxe_udp_encap_recv() until each skb is freed it
was not matched by a reference in the loopback path resulting in
underflows.

Fixes: 899aba891cab ("RDMA/rxe: Fix FIXME in rxe_udp_encap_recv()")
Link: https://lore.kernel.org/r/20210304192048.2958-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
3 years agoio_uring: don't restrict issue_flags for io_openat
Pavel Begunkov [Sun, 28 Feb 2021 22:35:14 +0000 (22:35 +0000)]
io_uring: don't restrict issue_flags for io_openat

45d189c606292 ("io_uring: replace force_nonblock with flags") did
something strange for io_openat() slicing all issue_flags but
IO_URING_F_NONBLOCK. Not a bug for now, but better to just forward the
flags.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoMerge tag 'nvme-5.12-2021-03-05' of git://git.infradead.org/nvme into block-5.12
Jens Axboe [Fri, 5 Mar 2021 16:13:07 +0000 (09:13 -0700)]
Merge tag 'nvme-5.12-2021-03-05' of git://git.infradead.org/nvme into block-5.12

Pull NVMe fixes from Christoph:

"nvme fixes for 5.12:

 - more device quirks (Julian Einwag, Zoltán Böszörményi, Pascal Terjan)
 - fix a hwmon error return (Daniel Wagner)
 - fix the keep alive timeout initialization (Martin George)
 - ensure the model_number can't be changed on a used subsystem
   (Max Gurtovoy)"

* tag 'nvme-5.12-2021-03-05' of git://git.infradead.org/nvme:
  nvmet: model_number must be immutable once set
  nvme-fabrics: fix kato initialization
  nvme-hwmon: Return error code when registration fails
  nvme-pci: add quirks for Lexar 256GB SSD
  nvme-pci: mark Kingston SKC2000 as not supporting the deepest power state
  nvme-pci: mark Seagate Nytro XM1440 as QUIRK_NO_NS_DESC_LIST.

3 years agoio_uring: make SQPOLL thread parking saner
Jens Axboe [Fri, 5 Mar 2021 15:44:39 +0000 (08:44 -0700)]
io_uring: make SQPOLL thread parking saner

We have this weird true/false return from parking, and then some of the
callers decide to look at that. It can lead to unbalanced parks and
sqd locking. Have the callers check the thread status once it's parked.
We know we have the lock at that point, so it's either valid or it's NULL.

Fix race with parking on thread exit. We need to be careful here with
ordering of the sdq->lock and the IO_SQ_THREAD_SHOULD_PARK bit.

Rename sqd->completion to sqd->parked to reflect that this is the only
thing this completion event doesn.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoio-wq: kill hashed waitqueue before manager exits
Jens Axboe [Fri, 5 Mar 2021 15:14:08 +0000 (08:14 -0700)]
io-wq: kill hashed waitqueue before manager exits

If we race with shutting down the io-wq context and someone queueing
a hashed entry, then we can exit the manager with it armed. If it then
triggers after the manager has exited, we can have a use-after-free where
io_wqe_hash_wake() attempts to wake a now gone manager process.

Move the killing of the hashed write queue into the manager itself, so
that we know we've killed it before the task exits.

Fixes: e941894eae31 ("io-wq: make buffered file write hashed work map per-ctx")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoio_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return
Jens Axboe [Fri, 5 Mar 2021 04:02:58 +0000 (21:02 -0700)]
io_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return

The callback can only be armed, if we get -EIOCBQUEUED returned. It's
important that we clear the WAITQ bit for other cases, otherwise we can
queue for async retry and filemap will assume that we're armed and
return -EAGAIN instead of just blocking for the IO.

Cc: stable@vger.kernel.org # 5.9+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoio_uring: don't keep looping for more events if we can't flush overflow
Jens Axboe [Fri, 5 Mar 2021 00:15:48 +0000 (17:15 -0700)]
io_uring: don't keep looping for more events if we can't flush overflow

It doesn't make sense to wait for more events to come in, if we can't
even flush the overflow we already have to the ring. Return -EBUSY for
that condition, just like we do for attempts to submit with overflow
pending.

Cc: stable@vger.kernel.org # 5.11
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoio_uring: move to using create_io_thread()
Jens Axboe [Thu, 4 Mar 2021 19:39:36 +0000 (12:39 -0700)]
io_uring: move to using create_io_thread()

This allows us to do task creation and setup without needing to use
completions to try and synchronize with the starting thread. Get rid of
the old io_wq_fork_thread() wrapper, and the 'wq' and 'worker' startup
completion events - we can now do setup before the task is running.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoMerge branch 'powercap'
Rafael J. Wysocki [Fri, 5 Mar 2021 15:19:10 +0000 (16:19 +0100)]
Merge branch 'powercap'

* powercap:
  powercap/drivers/dtpm: Add the experimental label to the option description
  powercap/drivers/dtpm: Fix root node initialization