linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/11] extensions and fixes
@ 2020-04-03 20:20 Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 01/11] power: charger-manager: remove duplicate assignment Michał Mirosław
                   ` (10 more replies)
  0 siblings, 11 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

This series covers three areas of power supply class:

1-5. constify property and usb_type lists as they should not be changed
     after driver registration
6-8. fix and clean up HWMON labels
9-11. extend core to support input/battery/output supply point
     measurements

I guess the first part is largely independent, so I can extract it to
a separate series if that's useful.

---
v2: splits power_supply_hwmon_read_string() fix from extensioa
    (patches 3-4)
v3: removes power_supply_hwmon_read_string() parameter checks and
    adds a prerequisite patches to two drivers to make them compile
    after property list constification patch is applied
---

Michał Mirosław (11):
  power: charger-manager: remove duplicate assignment
  power: charger-manager: don't write through desc->properties
  power: generic-adc-battery: fold psy_props[] to private data
  power: supply: core: reduce power_supply_show_usb_type() parameters
  power: supply: core: allow to constify property lists
  power: supply: core: fix HWMON temperature labels
  power: supply: core: tabularize HWMON temperature labels
  power: supply: core: hide unused HWMON labels
  power: supply: core: add input voltage/current measurements
  power: supply: core: add output voltage measurements
  power: supply: core: document measurement points

 Documentation/power/power_supply_class.rst |   6 +
 drivers/power/supply/charger-manager.c     |  17 +-
 drivers/power/supply/generic-adc-battery.c |  30 ++--
 drivers/power/supply/power_supply_hwmon.c  | 178 +++++++++++++++++++--
 drivers/power/supply/power_supply_sysfs.c  |  15 +-
 include/linux/power_supply.h               |   9 +-
 6 files changed, 211 insertions(+), 44 deletions(-)

-- 
2.20.1

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH v3 01/11] power: charger-manager: remove duplicate assignment
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 03/11] power: generic-adc-battery: fold psy_props[] to private data Michał Mirosław
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

num_properties is already copied earlier using memcpy().
Remove the duplicate.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v3: initial version
---
 drivers/power/supply/charger-manager.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index a21e1a2673f8..887f5bb879e5 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1728,7 +1728,6 @@ static int charger_manager_probe(struct platform_device *pdev)
 	memcpy(cm->charger_psy_desc.properties, default_charger_props,
 		sizeof(enum power_supply_property) *
 		ARRAY_SIZE(default_charger_props));
-	cm->charger_psy_desc.num_properties = psy_default.num_properties;
 
 	/* Find which optional psy-properties are available */
 	fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 03/11] power: generic-adc-battery: fold psy_props[] to private data
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 01/11] power: charger-manager: remove duplicate assignment Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Michał Mirosław
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

psy_desc->properties will become pointer to const, so we can't use it
for filling the property set. Let's append the list to private data
structure and avoid introducing another variable to temporarily hold
the pointer.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reported-by: kbuild test robot <lkp@intel.com>
---
v3: new patch, required before constification of property lists
---
 drivers/power/supply/generic-adc-battery.c | 30 ++++++++--------------
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index bc462d1ec963..b3b567914dd7 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -52,6 +52,7 @@ struct gab {
 	int	level;
 	int	status;
 	bool cable_plugged;
+	enum power_supply_property	psy_props[];
 };
 
 static struct gab *to_generic_bat(struct power_supply *psy)
@@ -246,7 +247,10 @@ static int gab_probe(struct platform_device *pdev)
 	int index = ARRAY_SIZE(gab_props);
 	bool any = false;
 
-	adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL);
+	adc_bat = devm_kzalloc(&pdev->dev,
+		struct_size(adc_bat, psy_props,
+			ARRAY_SIZE(gab_props) + ARRAY_SIZE(gab_chan_name)),
+		GFP_KERNEL);
 	if (!adc_bat) {
 		dev_err(&pdev->dev, "failed to allocate memory\n");
 		return -ENOMEM;
@@ -264,20 +268,8 @@ static int gab_probe(struct platform_device *pdev)
 	psy_desc->external_power_changed = gab_ext_power_changed;
 	adc_bat->pdata = pdata;
 
-	/*
-	 * copying the static properties and allocating extra memory for holding
-	 * the extra configurable properties received from platform data.
-	 */
-	psy_desc->properties = kcalloc(ARRAY_SIZE(gab_props) +
-					ARRAY_SIZE(gab_chan_name),
-					sizeof(*psy_desc->properties),
-					GFP_KERNEL);
-	if (!psy_desc->properties) {
-		ret = -ENOMEM;
-		goto first_mem_fail;
-	}
-
-	memcpy(psy_desc->properties, gab_props, sizeof(gab_props));
+	/* copy static properties */
+	memcpy(adc_bat->psy_props, gab_props, sizeof(gab_props));
 
 	/*
 	 * getting channel from iio and copying the battery properties
@@ -294,12 +286,12 @@ static int gab_probe(struct platform_device *pdev)
 			int index2;
 
 			for (index2 = 0; index2 < index; index2++) {
-				if (psy_desc->properties[index2] ==
+				if (adc_bat->psy_props[index2] ==
 				    gab_dyn_props[chan])
 					break;	/* already known */
 			}
 			if (index2 == index)	/* really new */
-				psy_desc->properties[index++] =
+				adc_bat->psy_props[index++] =
 					gab_dyn_props[chan];
 			any = true;
 		}
@@ -317,6 +309,7 @@ static int gab_probe(struct platform_device *pdev)
 	 * as come channels may be not be supported by the device.So
 	 * we need to take care of that.
 	 */
+	psy_desc->properties = adc_bat->psy_props;
 	psy_desc->num_properties = index;
 
 	adc_bat->psy = power_supply_register(&pdev->dev, psy_desc, &psy_cfg);
@@ -358,8 +351,6 @@ static int gab_probe(struct platform_device *pdev)
 			iio_channel_release(adc_bat->channel[chan]);
 	}
 second_mem_fail:
-	kfree(psy_desc->properties);
-first_mem_fail:
 	return ret;
 }
 
@@ -381,7 +372,6 @@ static int gab_remove(struct platform_device *pdev)
 			iio_channel_release(adc_bat->channel[chan]);
 	}
 
-	kfree(adc_bat->psy_desc.properties);
 	cancel_delayed_work(&adc_bat->bat_work);
 	return 0;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 02/11] power: charger-manager: don't write through desc->properties
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 01/11] power: charger-manager: remove duplicate assignment Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 03/11] power: generic-adc-battery: fold psy_props[] to private data Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-05-01 12:38   ` Sebastian Reichel
  2020-04-03 20:20 ` [PATCH v3 05/11] power: supply: core: allow to constify property lists Michał Mirosław
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

psy_desc->properties will become pointer to const.  Avoid writing
through the pointer to enable constification of the tables elsewhere.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v3: initial version
---
 drivers/power/supply/charger-manager.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 887f5bb879e5..7ecb82107efb 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1425,15 +1425,18 @@ static int cm_init_thermal_data(struct charger_manager *cm,
 		struct power_supply *fuel_gauge)
 {
 	struct charger_desc *desc = cm->desc;
+	enum power_supply_property *props;
 	union power_supply_propval val;
 	int ret;
 
+	props = (void *)cm->charger_psy_desc.properties;
+
 	/* Verify whether fuel gauge provides battery temperature */
 	ret = power_supply_get_property(fuel_gauge,
 					POWER_SUPPLY_PROP_TEMP, &val);
 
 	if (!ret) {
-		cm->charger_psy_desc.properties[cm->charger_psy_desc.num_properties] =
+		props[cm->charger_psy_desc.num_properties] =
 				POWER_SUPPLY_PROP_TEMP;
 		cm->charger_psy_desc.num_properties++;
 		cm->desc->measure_battery_temp = true;
@@ -1446,7 +1449,7 @@ static int cm_init_thermal_data(struct charger_manager *cm,
 			return PTR_ERR(cm->tzd_batt);
 
 		/* Use external thermometer */
-		cm->charger_psy_desc.properties[cm->charger_psy_desc.num_properties] =
+		props[cm->charger_psy_desc.num_properties] =
 				POWER_SUPPLY_PROP_TEMP_AMBIENT;
 		cm->charger_psy_desc.num_properties++;
 		cm->desc->measure_battery_temp = true;
@@ -1622,6 +1625,7 @@ static int charger_manager_probe(struct platform_device *pdev)
 	union power_supply_propval val;
 	struct power_supply *fuel_gauge;
 	struct power_supply_config psy_cfg = {};
+	enum power_supply_property *props;
 
 	if (IS_ERR(desc)) {
 		dev_err(&pdev->dev, "No platform data (desc) found\n");
@@ -1717,7 +1721,7 @@ static int charger_manager_probe(struct platform_device *pdev)
 	cm->charger_psy_desc.name = cm->psy_name_buf;
 
 	/* Allocate for psy properties because they may vary */
-	cm->charger_psy_desc.properties =
+	cm->charger_psy_desc.properties = props =
 		devm_kcalloc(&pdev->dev,
 			     ARRAY_SIZE(default_charger_props) +
 				NUM_CHARGER_PSY_OPTIONAL,
@@ -1725,7 +1729,7 @@ static int charger_manager_probe(struct platform_device *pdev)
 	if (!cm->charger_psy_desc.properties)
 		return -ENOMEM;
 
-	memcpy(cm->charger_psy_desc.properties, default_charger_props,
+	memcpy(props, default_charger_props,
 		sizeof(enum power_supply_property) *
 		ARRAY_SIZE(default_charger_props));
 
@@ -1738,14 +1742,14 @@ static int charger_manager_probe(struct platform_device *pdev)
 	}
 	if (!power_supply_get_property(fuel_gauge,
 					  POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
-		cm->charger_psy_desc.properties[cm->charger_psy_desc.num_properties] =
+		props[cm->charger_psy_desc.num_properties] =
 				POWER_SUPPLY_PROP_CHARGE_NOW;
 		cm->charger_psy_desc.num_properties++;
 	}
 	if (!power_supply_get_property(fuel_gauge,
 					  POWER_SUPPLY_PROP_CURRENT_NOW,
 					  &val)) {
-		cm->charger_psy_desc.properties[cm->charger_psy_desc.num_properties] =
+		props[cm->charger_psy_desc.num_properties] =
 				POWER_SUPPLY_PROP_CURRENT_NOW;
 		cm->charger_psy_desc.num_properties++;
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 05/11] power: supply: core: allow to constify property lists
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (2 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-05-01 12:36   ` Sebastian Reichel
  2020-04-03 20:20 ` [PATCH v3 04/11] power: supply: core: reduce power_supply_show_usb_type() parameters Michał Mirosław
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

Since tables pointed to by power_supply_desc->properties and
->usb_types are not expected to change after registration, mark
the pointers accordingly

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 include/linux/power_supply.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index dcd5a71e6c67..6a34df65d4d1 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -223,9 +223,9 @@ struct power_supply_config {
 struct power_supply_desc {
 	const char *name;
 	enum power_supply_type type;
-	enum power_supply_usb_type *usb_types;
+	const enum power_supply_usb_type *usb_types;
 	size_t num_usb_types;
-	enum power_supply_property *properties;
+	const enum power_supply_property *properties;
 	size_t num_properties;
 
 	/*
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 04/11] power: supply: core: reduce power_supply_show_usb_type() parameters
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (3 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 05/11] power: supply: core: allow to constify property lists Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-05-01 12:36   ` Sebastian Reichel
  2020-04-03 20:20 ` [PATCH v3 06/11] power: supply: core: fix HWMON temperature labels Michał Mirosław
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

Reduce power_supply_show_usb_type() parameter count by folding
power_supply_desc dereference into the function.  This makes following
patch making usb_types const easier.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/power/supply/power_supply_sysfs.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index f37ad4eae60b..51de3f47b25d 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -78,8 +78,7 @@ static const char * const power_supply_scope_text[] = {
 };
 
 static ssize_t power_supply_show_usb_type(struct device *dev,
-					  enum power_supply_usb_type *usb_types,
-					  ssize_t num_usb_types,
+					  const struct power_supply_desc *desc,
 					  union power_supply_propval *value,
 					  char *buf)
 {
@@ -88,8 +87,8 @@ static ssize_t power_supply_show_usb_type(struct device *dev,
 	bool match = false;
 	int i;
 
-	for (i = 0; i < num_usb_types; ++i) {
-		usb_type = usb_types[i];
+	for (i = 0; i < desc->num_usb_types; ++i) {
+		usb_type = desc->usb_types[i];
 
 		if (value->intval == usb_type) {
 			count += sprintf(buf + count, "[%s] ",
@@ -163,8 +162,7 @@ static ssize_t power_supply_show_property(struct device *dev,
 			      power_supply_type_text[value.intval]);
 		break;
 	case POWER_SUPPLY_PROP_USB_TYPE:
-		ret = power_supply_show_usb_type(dev, psy->desc->usb_types,
-						 psy->desc->num_usb_types,
+		ret = power_supply_show_usb_type(dev, psy->desc,
 						 &value, buf);
 		break;
 	case POWER_SUPPLY_PROP_SCOPE:
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 06/11] power: supply: core: fix HWMON temperature labels
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (4 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 04/11] power: supply: core: reduce power_supply_show_usb_type() parameters Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-05-01 12:39   ` Sebastian Reichel
  2020-04-03 20:20 ` [PATCH v3 07/11] power: supply: core: tabularize " Michał Mirosław
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Sebastian Reichel, Andrey Smirnov, Guenter Roeck; +Cc: linux-pm, linux-kernel

tempX_label files are swapped compared to what
power_supply_hwmon_temp_to_property() uses. Make them match.

Cc: stable@vger.kernel.org
Fixes: e67d4dfc9ff1 ("power: supply: Add HWMON compatibility layer")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2: split parameter checking to separate patch
---
 drivers/power/supply/power_supply_hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
index 75cf861ba492..67b6ee60085e 100644
--- a/drivers/power/supply/power_supply_hwmon.c
+++ b/drivers/power/supply/power_supply_hwmon.c
@@ -144,7 +144,7 @@ static int power_supply_hwmon_read_string(struct device *dev,
 					  u32 attr, int channel,
 					  const char **str)
 {
-	*str = channel ? "temp" : "temp ambient";
+	*str = channel ? "temp ambient" : "temp";
 	return 0;
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (5 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 06/11] power: supply: core: fix HWMON temperature labels Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-04-05  1:52   ` kbuild test robot
  2020-04-03 20:20 ` [PATCH v3 08/11] power: supply: core: hide unused HWMON labels Michał Mirosław
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

Rework power_supply_hwmon_read_string() to check it's parameters.
This allows to extend it later with labels for other types of
measurements.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2: split from fix temperature labels
v3: remove power_supply_hwmon_read_string() parameter checks
    as it is internal API (suggested by Guenter Roeck)
---
 drivers/power/supply/power_supply_hwmon.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
index 67b6ee60085e..5621e72a39f0 100644
--- a/drivers/power/supply/power_supply_hwmon.c
+++ b/drivers/power/supply/power_supply_hwmon.c
@@ -13,6 +13,11 @@ struct power_supply_hwmon {
 	unsigned long *props;
 };
 
+static const char *const ps_temp_label[] = {
+	"temp",
+	"ambient temp",
+};
+
 static int power_supply_hwmon_in_to_property(u32 attr)
 {
 	switch (attr) {
@@ -144,7 +149,14 @@ static int power_supply_hwmon_read_string(struct device *dev,
 					  u32 attr, int channel,
 					  const char **str)
 {
-	*str = channel ? "temp ambient" : "temp";
+	switch (type) {
+	case hwmon_temp:
+		*str = ps_temp_label[channel];
+		break;
+	default:
+		unreachable();
+	}
+
 	return 0;
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 08/11] power: supply: core: hide unused HWMON labels
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (6 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 07/11] power: supply: core: tabularize " Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-05-01 13:22   ` Sebastian Reichel
  2020-04-03 20:20 ` [PATCH v3 09/11] power: supply: core: add input voltage/current measurements Michał Mirosław
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

Currently HWMON emulation shows all labels (temp and ambient temp)
regardless if power supply supports reading the values. Check that at
least one property is enabled for each label.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v3: use a tabule for type checking instead of switch() sequence
---
 drivers/power/supply/power_supply_hwmon.c | 42 +++++++++++++++++++++--
 1 file changed, 39 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
index 5621e72a39f0..1b473deaf391 100644
--- a/drivers/power/supply/power_supply_hwmon.c
+++ b/drivers/power/supply/power_supply_hwmon.c
@@ -103,6 +103,39 @@ static bool power_supply_hwmon_is_a_label(enum hwmon_sensor_types type,
 	return type == hwmon_temp && attr == hwmon_temp_label;
 }
 
+struct hwmon_type_attr_list {
+	const u32 *attrs;
+	size_t n_attrs;
+};
+
+static const u32 ps_temp_attrs[] = {
+	hwmon_temp_input,
+	hwmon_temp_min, hwmon_temp_max,
+	hwmon_temp_min_alarm, hwmon_temp_max_alarm,
+};
+
+static const struct hwmon_type_attr_list ps_type_attrs[hwmon_max] = {
+	[hwmon_temp] = { ps_temp_attrs, ARRAY_SIZE(ps_temp_attrs) },
+};
+
+static bool power_supply_hwmon_has_input(
+	const struct power_supply_hwmon *psyhw,
+	enum hwmon_sensor_types type, int channel)
+{
+	const struct hwmon_type_attr_list *attr_list = &ps_type_attrs[type];
+	size_t i;
+
+	for (i = 0; i < attr_list->n_attrs; ++i) {
+		int prop = power_supply_hwmon_to_property(type,
+			attr_list->attrs[i], channel);
+
+		if (prop >= 0 && test_bit(prop, psyhw->props))
+			return true;
+	}
+
+	return false;
+}
+
 static bool power_supply_hwmon_is_writable(enum hwmon_sensor_types type,
 					   u32 attr)
 {
@@ -129,9 +162,12 @@ static umode_t power_supply_hwmon_is_visible(const void *data,
 	const struct power_supply_hwmon *psyhw = data;
 	int prop;
 
-
-	if (power_supply_hwmon_is_a_label(type, attr))
-		return 0444;
+	if (power_supply_hwmon_is_a_label(type, attr)) {
+		if (power_supply_hwmon_has_input(psyhw, type, channel))
+			return 0444;
+		else
+			return 0;
+	}
 
 	prop = power_supply_hwmon_to_property(type, attr, channel);
 	if (prop < 0 || !test_bit(prop, psyhw->props))
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 09/11] power: supply: core: add input voltage/current measurements
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (7 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 08/11] power: supply: core: hide unused HWMON labels Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 10/11] power: supply: core: add output voltage measurements Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 11/11] power: supply: core: document measurement points Michał Mirosław
  10 siblings, 0 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

Introduce input voltage and current limits and measurements.
This makes room for e.g. VBUS measurements in USB chargers.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2: add parameter checking in power_supply_hwmon_read_string()
v3: remove power_supply_hwmon_read_string() parameter checks
    as it is internal API (suggested by Guenter Roeck)
---
 drivers/power/supply/power_supply_hwmon.c | 97 +++++++++++++++++++++--
 drivers/power/supply/power_supply_sysfs.c |  2 +
 include/linux/power_supply.h              |  2 +
 3 files changed, 96 insertions(+), 5 deletions(-)

diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
index 1b473deaf391..0fd2e7ccb767 100644
--- a/drivers/power/supply/power_supply_hwmon.c
+++ b/drivers/power/supply/power_supply_hwmon.c
@@ -13,12 +13,17 @@ struct power_supply_hwmon {
 	unsigned long *props;
 };
 
+static const char *const ps_input_label[] = {
+	"battery",
+	"external source",
+};
+
 static const char *const ps_temp_label[] = {
 	"temp",
 	"ambient temp",
 };
 
-static int power_supply_hwmon_in_to_property(u32 attr)
+static int power_supply_hwmon_in0_to_property(u32 attr)
 {
 	switch (attr) {
 	case hwmon_in_average:
@@ -34,7 +39,31 @@ static int power_supply_hwmon_in_to_property(u32 attr)
 	}
 }
 
-static int power_supply_hwmon_curr_to_property(u32 attr)
+static int power_supply_hwmon_in1_to_property(u32 attr)
+{
+	switch (attr) {
+	case hwmon_in_max:
+		return POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT;
+	case hwmon_in_input:
+		return POWER_SUPPLY_PROP_INPUT_VOLTAGE_NOW;
+	default:
+		return -EINVAL;
+	}
+}
+
+static int power_supply_hwmon_in_to_property(u32 attr, int channel)
+{
+	switch (channel) {
+	case 0:
+		return power_supply_hwmon_in0_to_property(attr);
+	case 1:
+		return power_supply_hwmon_in1_to_property(attr);
+	default:
+		return -EINVAL;
+	}
+}
+
+static int power_supply_hwmon_curr0_to_property(u32 attr)
 {
 	switch (attr) {
 	case hwmon_curr_average:
@@ -48,6 +77,30 @@ static int power_supply_hwmon_curr_to_property(u32 attr)
 	}
 }
 
+static int power_supply_hwmon_curr1_to_property(u32 attr)
+{
+	switch (attr) {
+	case hwmon_curr_max:
+		return POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT;
+	case hwmon_curr_input:
+		return POWER_SUPPLY_PROP_INPUT_CURRENT_NOW;
+	default:
+		return -EINVAL;
+	}
+}
+
+static int power_supply_hwmon_curr_to_property(u32 attr, int channel)
+{
+	switch (channel) {
+	case 0:
+		return power_supply_hwmon_curr0_to_property(attr);
+	case 1:
+		return power_supply_hwmon_curr1_to_property(attr);
+	default:
+		return -EINVAL;
+	}
+}
+
 static int power_supply_hwmon_temp_to_property(u32 attr, int channel)
 {
 	if (channel) {
@@ -87,9 +140,9 @@ power_supply_hwmon_to_property(enum hwmon_sensor_types type,
 {
 	switch (type) {
 	case hwmon_in:
-		return power_supply_hwmon_in_to_property(attr);
+		return power_supply_hwmon_in_to_property(attr, channel);
 	case hwmon_curr:
-		return power_supply_hwmon_curr_to_property(attr);
+		return power_supply_hwmon_curr_to_property(attr, channel);
 	case hwmon_temp:
 		return power_supply_hwmon_temp_to_property(attr, channel);
 	default:
@@ -100,7 +153,9 @@ power_supply_hwmon_to_property(enum hwmon_sensor_types type,
 static bool power_supply_hwmon_is_a_label(enum hwmon_sensor_types type,
 					   u32 attr)
 {
-	return type == hwmon_temp && attr == hwmon_temp_label;
+	return (type == hwmon_temp && attr == hwmon_temp_label) ||
+	       (type == hwmon_in && attr == hwmon_in_label) ||
+	       (type == hwmon_curr && attr == hwmon_curr_label);
 }
 
 struct hwmon_type_attr_list {
@@ -114,7 +169,19 @@ static const u32 ps_temp_attrs[] = {
 	hwmon_temp_min_alarm, hwmon_temp_max_alarm,
 };
 
+static const u32 ps_in_attrs[] = {
+	hwmon_in_input, hwmon_in_average,
+	hwmon_in_min, hwmon_in_max,
+};
+
+static const u32 ps_curr_attrs[] = {
+	hwmon_curr_input, hwmon_curr_average,
+	hwmon_curr_max,
+};
+
 static const struct hwmon_type_attr_list ps_type_attrs[hwmon_max] = {
+	[hwmon_in] = { ps_in_attrs, ARRAY_SIZE(ps_in_attrs) },
+	[hwmon_curr] = { ps_curr_attrs, ARRAY_SIZE(ps_curr_attrs) },
 	[hwmon_temp] = { ps_temp_attrs, ARRAY_SIZE(ps_temp_attrs) },
 };
 
@@ -186,6 +253,11 @@ static int power_supply_hwmon_read_string(struct device *dev,
 					  const char **str)
 {
 	switch (type) {
+	case hwmon_in:
+	case hwmon_curr:
+		*str = ps_input_label[channel];
+		break;
+
 	case hwmon_temp:
 		*str = ps_temp_label[channel];
 		break;
@@ -303,15 +375,26 @@ static const struct hwmon_channel_info *power_supply_hwmon_info[] = {
 			   HWMON_T_MAX_ALARM),
 
 	HWMON_CHANNEL_INFO(curr,
+			   HWMON_C_LABEL   |
 			   HWMON_C_AVERAGE |
 			   HWMON_C_MAX     |
+			   HWMON_C_INPUT,
+
+			   HWMON_C_LABEL   |
+			   HWMON_C_MAX     |
 			   HWMON_C_INPUT),
 
 	HWMON_CHANNEL_INFO(in,
+			   HWMON_I_LABEL   |
 			   HWMON_I_AVERAGE |
 			   HWMON_I_MIN     |
 			   HWMON_I_MAX     |
+			   HWMON_I_INPUT,
+
+			   HWMON_I_LABEL   |
+			   HWMON_I_MAX     |
 			   HWMON_I_INPUT),
+
 	NULL
 };
 
@@ -376,6 +459,10 @@ int power_supply_add_hwmon_sysfs(struct power_supply *psy)
 		case POWER_SUPPLY_PROP_VOLTAGE_MIN:
 		case POWER_SUPPLY_PROP_VOLTAGE_MAX:
 		case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+		case POWER_SUPPLY_PROP_INPUT_CURRENT_NOW:
+		case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
+		case POWER_SUPPLY_PROP_INPUT_VOLTAGE_NOW:
+		case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT:
 			set_bit(prop, psyhw->props);
 			break;
 		default:
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 51de3f47b25d..1d1fb69516a8 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -273,7 +273,9 @@ static struct device_attribute power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(charge_control_limit_max),
 	POWER_SUPPLY_ATTR(charge_control_start_threshold),
 	POWER_SUPPLY_ATTR(charge_control_end_threshold),
+	POWER_SUPPLY_ATTR(input_current_now),
 	POWER_SUPPLY_ATTR(input_current_limit),
+	POWER_SUPPLY_ATTR(input_voltage_now),
 	POWER_SUPPLY_ATTR(input_voltage_limit),
 	POWER_SUPPLY_ATTR(input_power_limit),
 	POWER_SUPPLY_ATTR(energy_full_design),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 6a34df65d4d1..5313d1284aad 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -127,7 +127,9 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
 	POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD, /* in percents! */
 	POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD, /* in percents! */
+	POWER_SUPPLY_PROP_INPUT_CURRENT_NOW,
 	POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
+	POWER_SUPPLY_PROP_INPUT_VOLTAGE_NOW,
 	POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT,
 	POWER_SUPPLY_PROP_INPUT_POWER_LIMIT,
 	POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 10/11] power: supply: core: add output voltage measurements
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (8 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 09/11] power: supply: core: add input voltage/current measurements Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  2020-04-03 20:20 ` [PATCH v3 11/11] power: supply: core: document measurement points Michał Mirosław
  10 siblings, 0 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

Add support for supply output voltage to be measured and configured.
This might be different from the voltage on the storage element (battery).

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/power/supply/power_supply_hwmon.c | 25 +++++++++++++++++++++++
 drivers/power/supply/power_supply_sysfs.c |  3 +++
 include/linux/power_supply.h              |  3 +++
 3 files changed, 31 insertions(+)

diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
index 0fd2e7ccb767..9125854adcb0 100644
--- a/drivers/power/supply/power_supply_hwmon.c
+++ b/drivers/power/supply/power_supply_hwmon.c
@@ -16,6 +16,7 @@ struct power_supply_hwmon {
 static const char *const ps_input_label[] = {
 	"battery",
 	"external source",
+	"load",
 };
 
 static const char *const ps_temp_label[] = {
@@ -51,6 +52,20 @@ static int power_supply_hwmon_in1_to_property(u32 attr)
 	}
 }
 
+static int power_supply_hwmon_in2_to_property(u32 attr)
+{
+	switch (attr) {
+	case hwmon_in_min:
+		return POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MIN;
+	case hwmon_in_max:
+		return POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MAX;
+	case hwmon_in_input:
+		return POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_NOW;
+	default:
+		return -EINVAL;
+	}
+}
+
 static int power_supply_hwmon_in_to_property(u32 attr, int channel)
 {
 	switch (channel) {
@@ -58,6 +73,8 @@ static int power_supply_hwmon_in_to_property(u32 attr, int channel)
 		return power_supply_hwmon_in0_to_property(attr);
 	case 1:
 		return power_supply_hwmon_in1_to_property(attr);
+	case 2:
+		return power_supply_hwmon_in2_to_property(attr);
 	default:
 		return -EINVAL;
 	}
@@ -393,6 +410,11 @@ static const struct hwmon_channel_info *power_supply_hwmon_info[] = {
 
 			   HWMON_I_LABEL   |
 			   HWMON_I_MAX     |
+			   HWMON_I_INPUT,
+
+			   HWMON_I_LABEL   |
+			   HWMON_I_MIN     |
+			   HWMON_I_MAX     |
 			   HWMON_I_INPUT),
 
 	NULL
@@ -463,6 +485,9 @@ int power_supply_add_hwmon_sysfs(struct power_supply *psy)
 		case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
 		case POWER_SUPPLY_PROP_INPUT_VOLTAGE_NOW:
 		case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT:
+		case POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MIN:
+		case POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MAX:
+		case POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_NOW:
 			set_bit(prop, psyhw->props);
 			break;
 		default:
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 1d1fb69516a8..fb6f113b52bb 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -278,6 +278,9 @@ static struct device_attribute power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(input_voltage_now),
 	POWER_SUPPLY_ATTR(input_voltage_limit),
 	POWER_SUPPLY_ATTR(input_power_limit),
+	POWER_SUPPLY_ATTR(output_voltage_now),
+	POWER_SUPPLY_ATTR(output_voltage_min),
+	POWER_SUPPLY_ATTR(output_voltage_max),
 	POWER_SUPPLY_ATTR(energy_full_design),
 	POWER_SUPPLY_ATTR(energy_empty_design),
 	POWER_SUPPLY_ATTR(energy_full),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 5313d1284aad..f1ff8d230488 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -132,6 +132,9 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_INPUT_VOLTAGE_NOW,
 	POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT,
 	POWER_SUPPLY_PROP_INPUT_POWER_LIMIT,
+	POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_NOW,
+	POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MIN,
+	POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MAX,
 	POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
 	POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
 	POWER_SUPPLY_PROP_ENERGY_FULL,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v3 11/11] power: supply: core: document measurement points
  2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
                   ` (9 preceding siblings ...)
  2020-04-03 20:20 ` [PATCH v3 10/11] power: supply: core: add output voltage measurements Michał Mirosław
@ 2020-04-03 20:20 ` Michał Mirosław
  10 siblings, 0 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-04-03 20:20 UTC (permalink / raw)
  To: Andrey Smirnov, Guenter Roeck, Sebastian Reichel; +Cc: linux-kernel, linux-pm

Document used prefixes for input/output/storage voltages and currents.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 Documentation/power/power_supply_class.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/power/power_supply_class.rst b/Documentation/power/power_supply_class.rst
index 7b8c42f8b1de..c41b25aaa755 100644
--- a/Documentation/power/power_supply_class.rst
+++ b/Documentation/power/power_supply_class.rst
@@ -28,6 +28,12 @@ indication (including whether to use it at all) are fully controllable by
 user and/or specific machine defaults, per design principles of LED
 framework).
 
+There are three defined points of measurement for the benefit of mobile and
+UPS-like power supplies: INPUT (external power source), OUTPUT (power output
+from the module), and unmarked (power flowing to/from a storage element,
+eg. battery). Battery is viewed as a power source, so current flowing to
+the battery (charging it) is shown negative.
+
 
 Attributes/properties
 ~~~~~~~~~~~~~~~~~~~~~
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-03 20:20 ` [PATCH v3 07/11] power: supply: core: tabularize " Michał Mirosław
@ 2020-04-05  1:52   ` kbuild test robot
  2020-04-07 18:13     ` Nick Desaulniers
  0 siblings, 1 reply; 31+ messages in thread
From: kbuild test robot @ 2020-04-05  1:52 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: kbuild-all, clang-built-linux, Andrey Smirnov, Guenter Roeck,
	Sebastian Reichel, linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]

Hi "Michał,

I love your patch! Perhaps something to improve:

[auto build test WARNING on power-supply/for-next]
[also build test WARNING on hwmon/hwmon-next linus/master v5.6 next-20200404]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Micha-Miros-aw/extensions-and-fixes/20200405-044024
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: x86_64-randconfig-b002-20200405 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 62f3a9650a9f289a07a5f480764fb655178c2334)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/power/supply/power_supply_hwmon.o: warning: objtool: power_supply_hwmon_read_string() falls through to next function power_supply_hwmon_write()

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32968 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-05  1:52   ` kbuild test robot
@ 2020-04-07 18:13     ` Nick Desaulniers
  2020-04-07 19:55       ` Michał Mirosław
  2020-04-20  9:22       ` Michał Mirosław
  0 siblings, 2 replies; 31+ messages in thread
From: Nick Desaulniers @ 2020-04-07 18:13 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Michał Mirosław, kbuild-all, clang-built-linux,
	Andrey Smirnov, Guenter Roeck, Sebastian Reichel, LKML, linux-pm

On Sat, Apr 4, 2020 at 6:53 PM kbuild test robot <lkp@intel.com> wrote:
>
> Hi "Michał,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on power-supply/for-next]
> [also build test WARNING on hwmon/hwmon-next linus/master v5.6 next-20200404]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
>
> url:    https://github.com/0day-ci/linux/commits/Micha-Miros-aw/extensions-and-fixes/20200405-044024
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
> config: x86_64-randconfig-b002-20200405 (attached as .config)
> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 62f3a9650a9f289a07a5f480764fb655178c2334)
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         COMPILER=clang make.cross ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/power/supply/power_supply_hwmon.o: warning: objtool: power_supply_hwmon_read_string() falls through to next function power_supply_hwmon_write()

I'm guessing this is from the unreachable:
https://github.com/0day-ci/linux/commit/b8b2d14ca46ca54257f55c9af58ea25695b9ee36
I'll need to play with this some more as I couldn't reproduce with a
simplified test case, but looks like a compiler bug.  Filed
https://github.com/ClangBuiltLinux/linux/issues/978 for me to track.

-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-07 18:13     ` Nick Desaulniers
@ 2020-04-07 19:55       ` Michał Mirosław
  2020-04-07 19:57         ` Nick Desaulniers
  2020-04-20  9:22       ` Michał Mirosław
  1 sibling, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-07 19:55 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: kbuild test robot, kbuild-all, clang-built-linux, Andrey Smirnov,
	Guenter Roeck, Sebastian Reichel, LKML, linux-pm

On Tue, Apr 07, 2020 at 11:13:50AM -0700, Nick Desaulniers wrote:
> On Sat, Apr 4, 2020 at 6:53 PM kbuild test robot <lkp@intel.com> wrote:
> >
> > Hi "Michał,
> >
> > I love your patch! Perhaps something to improve:
> >
> > [auto build test WARNING on power-supply/for-next]
> > [also build test WARNING on hwmon/hwmon-next linus/master v5.6 next-20200404]
> > [if your patch is applied to the wrong git tree, please drop us a note to help
> > improve the system. BTW, we also suggest to use '--base' option to specify the
> > base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> >
> > url:    https://github.com/0day-ci/linux/commits/Micha-Miros-aw/extensions-and-fixes/20200405-044024
> > base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
> > config: x86_64-randconfig-b002-20200405 (attached as .config)
> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 62f3a9650a9f289a07a5f480764fb655178c2334)
> > reproduce:
> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         # save the attached .config to linux build tree
> >         COMPILER=clang make.cross ARCH=x86_64
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kbuild test robot <lkp@intel.com>
> >
> > All warnings (new ones prefixed by >>):
> >
> > >> drivers/power/supply/power_supply_hwmon.o: warning: objtool: power_supply_hwmon_read_string() falls through to next function power_supply_hwmon_write()
> 
> I'm guessing this is from the unreachable:
> https://github.com/0day-ci/linux/commit/b8b2d14ca46ca54257f55c9af58ea25695b9ee36
> I'll need to play with this some more as I couldn't reproduce with a
> simplified test case, but looks like a compiler bug.  Filed
> https://github.com/ClangBuiltLinux/linux/issues/978 for me to track.

Hi Nick,

Just guessing: have you tried adding another unrelated function to the
testcase? I would expect that 'fall through to next function' needs
some other function to match.

Best Regards,
Michał Mirosław

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-07 19:55       ` Michał Mirosław
@ 2020-04-07 19:57         ` Nick Desaulniers
  2020-04-07 22:31           ` Nick Desaulniers
  0 siblings, 1 reply; 31+ messages in thread
From: Nick Desaulniers @ 2020-04-07 19:57 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: kbuild test robot, kbuild-all, clang-built-linux, Andrey Smirnov,
	Guenter Roeck, Sebastian Reichel, LKML, linux-pm

On Tue, Apr 7, 2020 at 12:56 PM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
>
> On Tue, Apr 07, 2020 at 11:13:50AM -0700, Nick Desaulniers wrote:
> > On Sat, Apr 4, 2020 at 6:53 PM kbuild test robot <lkp@intel.com> wrote:
> > >
> > > Hi "Michał,
> > >
> > > I love your patch! Perhaps something to improve:
> > >
> > > [auto build test WARNING on power-supply/for-next]
> > > [also build test WARNING on hwmon/hwmon-next linus/master v5.6 next-20200404]
> > > [if your patch is applied to the wrong git tree, please drop us a note to help
> > > improve the system. BTW, we also suggest to use '--base' option to specify the
> > > base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> > >
> > > url:    https://github.com/0day-ci/linux/commits/Micha-Miros-aw/extensions-and-fixes/20200405-044024
> > > base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
> > > config: x86_64-randconfig-b002-20200405 (attached as .config)
> > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 62f3a9650a9f289a07a5f480764fb655178c2334)
> > > reproduce:
> > >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >         chmod +x ~/bin/make.cross
> > >         # save the attached .config to linux build tree
> > >         COMPILER=clang make.cross ARCH=x86_64
> > >
> > > If you fix the issue, kindly add following tag as appropriate
> > > Reported-by: kbuild test robot <lkp@intel.com>
> > >
> > > All warnings (new ones prefixed by >>):
> > >
> > > >> drivers/power/supply/power_supply_hwmon.o: warning: objtool: power_supply_hwmon_read_string() falls through to next function power_supply_hwmon_write()
> >
> > I'm guessing this is from the unreachable:
> > https://github.com/0day-ci/linux/commit/b8b2d14ca46ca54257f55c9af58ea25695b9ee36
> > I'll need to play with this some more as I couldn't reproduce with a
> > simplified test case, but looks like a compiler bug.  Filed
> > https://github.com/ClangBuiltLinux/linux/issues/978 for me to track.
>
> Hi Nick,
>
> Just guessing: have you tried adding another unrelated function to the
> testcase? I would expect that 'fall through to next function' needs
> some other function to match.

I was throwing the test case linked into godbolt and looking at the
generated assembly.  It contained no jumps, only movs and conditional
movs.  Thank you for the suggestion.


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-07 19:57         ` Nick Desaulniers
@ 2020-04-07 22:31           ` Nick Desaulniers
  0 siblings, 0 replies; 31+ messages in thread
From: Nick Desaulniers @ 2020-04-07 22:31 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: kbuild test robot, kbuild-all, clang-built-linux, Andrey Smirnov,
	Guenter Roeck, Sebastian Reichel, LKML, linux-pm, Ilie Halip

+ Ilie

On Tue, Apr 7, 2020 at 12:57 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> On Tue, Apr 7, 2020 at 12:56 PM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
> >
> > On Tue, Apr 07, 2020 at 11:13:50AM -0700, Nick Desaulniers wrote:
> > > On Sat, Apr 4, 2020 at 6:53 PM kbuild test robot <lkp@intel.com> wrote:
> > > >
> > > > Hi "Michał,
> > > >
> > > > I love your patch! Perhaps something to improve:
> > > >
> > > > [auto build test WARNING on power-supply/for-next]
> > > > [also build test WARNING on hwmon/hwmon-next linus/master v5.6 next-20200404]
> > > > [if your patch is applied to the wrong git tree, please drop us a note to help
> > > > improve the system. BTW, we also suggest to use '--base' option to specify the
> > > > base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> > > >
> > > > url:    https://github.com/0day-ci/linux/commits/Micha-Miros-aw/extensions-and-fixes/20200405-044024
> > > > base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
> > > > config: x86_64-randconfig-b002-20200405 (attached as .config)
> > > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 62f3a9650a9f289a07a5f480764fb655178c2334)
> > > > reproduce:
> > > >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > > >         chmod +x ~/bin/make.cross
> > > >         # save the attached .config to linux build tree
> > > >         COMPILER=clang make.cross ARCH=x86_64
> > > >
> > > > If you fix the issue, kindly add following tag as appropriate
> > > > Reported-by: kbuild test robot <lkp@intel.com>
> > > >
> > > > All warnings (new ones prefixed by >>):
> > > >
> > > > >> drivers/power/supply/power_supply_hwmon.o: warning: objtool: power_supply_hwmon_read_string() falls through to next function power_supply_hwmon_write()
> > >
> > > I'm guessing this is from the unreachable:
> > > https://github.com/0day-ci/linux/commit/b8b2d14ca46ca54257f55c9af58ea25695b9ee36
> > > I'll need to play with this some more as I couldn't reproduce with a
> > > simplified test case, but looks like a compiler bug.  Filed
> > > https://github.com/ClangBuiltLinux/linux/issues/978 for me to track.
> >
> > Hi Nick,
> >
> > Just guessing: have you tried adding another unrelated function to the
> > testcase? I would expect that 'fall through to next function' needs
> > some other function to match.

See Ilie's suggestion:
https://github.com/ClangBuiltLinux/linux/issues/978#issuecomment-610633039


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-07 18:13     ` Nick Desaulniers
  2020-04-07 19:55       ` Michał Mirosław
@ 2020-04-20  9:22       ` Michał Mirosław
  2020-05-01 12:47         ` Sebastian Reichel
  1 sibling, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-04-20  9:22 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: kbuild test robot, kbuild-all, clang-built-linux, Andrey Smirnov,
	Guenter Roeck, Sebastian Reichel, LKML, linux-pm

On Tue, Apr 07, 2020 at 11:13:50AM -0700, Nick Desaulniers wrote:
> On Sat, Apr 4, 2020 at 6:53 PM kbuild test robot <lkp@intel.com> wrote:
> >
> > Hi "Michał,
> >
> > I love your patch! Perhaps something to improve:
> >
> > [auto build test WARNING on power-supply/for-next]
> > [also build test WARNING on hwmon/hwmon-next linus/master v5.6 next-20200404]
> > [if your patch is applied to the wrong git tree, please drop us a note to help
> > improve the system. BTW, we also suggest to use '--base' option to specify the
> > base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> >
> > url:    https://github.com/0day-ci/linux/commits/Micha-Miros-aw/extensions-and-fixes/20200405-044024
> > base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
> > config: x86_64-randconfig-b002-20200405 (attached as .config)
> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 62f3a9650a9f289a07a5f480764fb655178c2334)
> > reproduce:
> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         # save the attached .config to linux build tree
> >         COMPILER=clang make.cross ARCH=x86_64
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kbuild test robot <lkp@intel.com>
> >
> > All warnings (new ones prefixed by >>):
> >
> > >> drivers/power/supply/power_supply_hwmon.o: warning: objtool: power_supply_hwmon_read_string() falls through to next function power_supply_hwmon_write()
> 
> I'm guessing this is from the unreachable:
> https://github.com/0day-ci/linux/commit/b8b2d14ca46ca54257f55c9af58ea25695b9ee36
> I'll need to play with this some more as I couldn't reproduce with a
> simplified test case, but looks like a compiler bug.  Filed
> https://github.com/ClangBuiltLinux/linux/issues/978 for me to track.

Hi,

For gcc this is bug 51513 [1]. This does not affect correctness of the
code, so I wonder if we should/need be trying to work around it.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51513

Best Regards,
Michał Mirosław

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 04/11] power: supply: core: reduce power_supply_show_usb_type() parameters
  2020-04-03 20:20 ` [PATCH v3 04/11] power: supply: core: reduce power_supply_show_usb_type() parameters Michał Mirosław
@ 2020-05-01 12:36   ` Sebastian Reichel
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 12:36 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Andrey Smirnov, Guenter Roeck, linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1907 bytes --]

Hi,

On Fri, Apr 03, 2020 at 10:20:32PM +0200, Michał Mirosław wrote:
> Reduce power_supply_show_usb_type() parameter count by folding
> power_supply_desc dereference into the function.  This makes following
> patch making usb_types const easier.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/power_supply_sysfs.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index f37ad4eae60b..51de3f47b25d 100644
> --- a/drivers/power/supply/power_supply_sysfs.c
> +++ b/drivers/power/supply/power_supply_sysfs.c
> @@ -78,8 +78,7 @@ static const char * const power_supply_scope_text[] = {
>  };
>  
>  static ssize_t power_supply_show_usb_type(struct device *dev,
> -					  enum power_supply_usb_type *usb_types,
> -					  ssize_t num_usb_types,
> +					  const struct power_supply_desc *desc,
>  					  union power_supply_propval *value,
>  					  char *buf)
>  {
> @@ -88,8 +87,8 @@ static ssize_t power_supply_show_usb_type(struct device *dev,
>  	bool match = false;
>  	int i;
>  
> -	for (i = 0; i < num_usb_types; ++i) {
> -		usb_type = usb_types[i];
> +	for (i = 0; i < desc->num_usb_types; ++i) {
> +		usb_type = desc->usb_types[i];
>  
>  		if (value->intval == usb_type) {
>  			count += sprintf(buf + count, "[%s] ",
> @@ -163,8 +162,7 @@ static ssize_t power_supply_show_property(struct device *dev,
>  			      power_supply_type_text[value.intval]);
>  		break;
>  	case POWER_SUPPLY_PROP_USB_TYPE:
> -		ret = power_supply_show_usb_type(dev, psy->desc->usb_types,
> -						 psy->desc->num_usb_types,
> +		ret = power_supply_show_usb_type(dev, psy->desc,
>  						 &value, buf);
>  		break;
>  	case POWER_SUPPLY_PROP_SCOPE:
> -- 
> 2.20.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 05/11] power: supply: core: allow to constify property lists
  2020-04-03 20:20 ` [PATCH v3 05/11] power: supply: core: allow to constify property lists Michał Mirosław
@ 2020-05-01 12:36   ` Sebastian Reichel
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 12:36 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Andrey Smirnov, Guenter Roeck, linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

Hi,

On Fri, Apr 03, 2020 at 10:20:32PM +0200, Michał Mirosław wrote:
> Since tables pointed to by power_supply_desc->properties and
> ->usb_types are not expected to change after registration, mark
> the pointers accordingly
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Thanks, queued.

-- Sebastian

>  include/linux/power_supply.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index dcd5a71e6c67..6a34df65d4d1 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -223,9 +223,9 @@ struct power_supply_config {
>  struct power_supply_desc {
>  	const char *name;
>  	enum power_supply_type type;
> -	enum power_supply_usb_type *usb_types;
> +	const enum power_supply_usb_type *usb_types;
>  	size_t num_usb_types;
> -	enum power_supply_property *properties;
> +	const enum power_supply_property *properties;
>  	size_t num_properties;
>  
>  	/*
> -- 
> 2.20.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 02/11] power: charger-manager: don't write through desc->properties
  2020-04-03 20:20 ` [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Michał Mirosław
@ 2020-05-01 12:38   ` Sebastian Reichel
  2020-05-01 13:30     ` Michał Mirosław
  0 siblings, 1 reply; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 12:38 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Andrey Smirnov, Guenter Roeck, linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Hi,

On Fri, Apr 03, 2020 at 10:20:31PM +0200, Michał Mirosław wrote:
> psy_desc->properties will become pointer to const.  Avoid writing
> through the pointer to enable constification of the tables elsewhere.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

For patches 1-3 I used my version, that I wrote in parallel while
reviewing a different patch series. It is slightly different, but
achieves the same goal.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 06/11] power: supply: core: fix HWMON temperature labels
  2020-04-03 20:20 ` [PATCH v3 06/11] power: supply: core: fix HWMON temperature labels Michał Mirosław
@ 2020-05-01 12:39   ` Sebastian Reichel
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 12:39 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Andrey Smirnov, Guenter Roeck, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]

Hi,

On Fri, Apr 03, 2020 at 10:20:33PM +0200, Michał Mirosław wrote:
> tempX_label files are swapped compared to what
> power_supply_hwmon_temp_to_property() uses. Make them match.
> 
> Cc: stable@vger.kernel.org
> Fixes: e67d4dfc9ff1 ("power: supply: Add HWMON compatibility layer")
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> v2: split parameter checking to separate patch
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/power_supply_hwmon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
> index 75cf861ba492..67b6ee60085e 100644
> --- a/drivers/power/supply/power_supply_hwmon.c
> +++ b/drivers/power/supply/power_supply_hwmon.c
> @@ -144,7 +144,7 @@ static int power_supply_hwmon_read_string(struct device *dev,
>  					  u32 attr, int channel,
>  					  const char **str)
>  {
> -	*str = channel ? "temp" : "temp ambient";
> +	*str = channel ? "temp ambient" : "temp";
>  	return 0;
>  }
>  
> -- 
> 2.20.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 07/11] power: supply: core: tabularize HWMON temperature labels
  2020-04-20  9:22       ` Michał Mirosław
@ 2020-05-01 12:47         ` Sebastian Reichel
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 12:47 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Nick Desaulniers, kbuild test robot, kbuild-all,
	clang-built-linux, Andrey Smirnov, Guenter Roeck, LKML, linux-pm

[-- Attachment #1: Type: text/plain, Size: 2744 bytes --]

Hi,

On Mon, Apr 20, 2020 at 11:22:09AM +0200, Michał Mirosław wrote:
> On Tue, Apr 07, 2020 at 11:13:50AM -0700, Nick Desaulniers wrote:
> > On Sat, Apr 4, 2020 at 6:53 PM kbuild test robot <lkp@intel.com> wrote:
> > >
> > > Hi "Michał,
> > >
> > > I love your patch! Perhaps something to improve:
> > >
> > > [auto build test WARNING on power-supply/for-next]
> > > [also build test WARNING on hwmon/hwmon-next linus/master v5.6 next-20200404]
> > > [if your patch is applied to the wrong git tree, please drop us a note to help
> > > improve the system. BTW, we also suggest to use '--base' option to specify the
> > > base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> > >
> > > url:    https://github.com/0day-ci/linux/commits/Micha-Miros-aw/extensions-and-fixes/20200405-044024
> > > base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
> > > config: x86_64-randconfig-b002-20200405 (attached as .config)
> > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 62f3a9650a9f289a07a5f480764fb655178c2334)
> > > reproduce:
> > >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >         chmod +x ~/bin/make.cross
> > >         # save the attached .config to linux build tree
> > >         COMPILER=clang make.cross ARCH=x86_64
> > >
> > > If you fix the issue, kindly add following tag as appropriate
> > > Reported-by: kbuild test robot <lkp@intel.com>
> > >
> > > All warnings (new ones prefixed by >>):
> > >
> > > >> drivers/power/supply/power_supply_hwmon.o: warning: objtool: power_supply_hwmon_read_string() falls through to next function power_supply_hwmon_write()
> > 
> > I'm guessing this is from the unreachable:
> > https://github.com/0day-ci/linux/commit/b8b2d14ca46ca54257f55c9af58ea25695b9ee36
> > I'll need to play with this some more as I couldn't reproduce with a
> > simplified test case, but looks like a compiler bug.  Filed
> > https://github.com/ClangBuiltLinux/linux/issues/978 for me to track.
> 
> Hi,
> 
> For gcc this is bug 51513 [1]. This does not affect correctness of the
> code, so I wonder if we should/need be trying to work around it.
> 
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51513

Yes, we need to work around it for now. If I understand the situation
correctly, a simple workaround would be:

default:
    /*
     * unreachable, but not explicitly marked because this triggers
     * a compiler bug in gcc and llvm:
     *
     *  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51513
     *  https://github.com/ClangBuiltLinux/linux/issues/978
     */
    break;

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 08/11] power: supply: core: hide unused HWMON labels
  2020-04-03 20:20 ` [PATCH v3 08/11] power: supply: core: hide unused HWMON labels Michał Mirosław
@ 2020-05-01 13:22   ` Sebastian Reichel
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 13:22 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Andrey Smirnov, Guenter Roeck, linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]

Hi,

On Fri, Apr 03, 2020 at 10:20:34PM +0200, Michał Mirosław wrote:
> Currently HWMON emulation shows all labels (temp and ambient temp)
> regardless if power supply supports reading the values. Check that at
> least one property is enabled for each label.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Thanks, queued.

-- Sebastian

> v3: use a tabule for type checking instead of switch() sequence
> ---
>  drivers/power/supply/power_supply_hwmon.c | 42 +++++++++++++++++++++--
>  1 file changed, 39 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
> index 5621e72a39f0..1b473deaf391 100644
> --- a/drivers/power/supply/power_supply_hwmon.c
> +++ b/drivers/power/supply/power_supply_hwmon.c
> @@ -103,6 +103,39 @@ static bool power_supply_hwmon_is_a_label(enum hwmon_sensor_types type,
>  	return type == hwmon_temp && attr == hwmon_temp_label;
>  }
>  
> +struct hwmon_type_attr_list {
> +	const u32 *attrs;
> +	size_t n_attrs;
> +};
> +
> +static const u32 ps_temp_attrs[] = {
> +	hwmon_temp_input,
> +	hwmon_temp_min, hwmon_temp_max,
> +	hwmon_temp_min_alarm, hwmon_temp_max_alarm,
> +};
> +
> +static const struct hwmon_type_attr_list ps_type_attrs[hwmon_max] = {
> +	[hwmon_temp] = { ps_temp_attrs, ARRAY_SIZE(ps_temp_attrs) },
> +};
> +
> +static bool power_supply_hwmon_has_input(
> +	const struct power_supply_hwmon *psyhw,
> +	enum hwmon_sensor_types type, int channel)
> +{
> +	const struct hwmon_type_attr_list *attr_list = &ps_type_attrs[type];
> +	size_t i;
> +
> +	for (i = 0; i < attr_list->n_attrs; ++i) {
> +		int prop = power_supply_hwmon_to_property(type,
> +			attr_list->attrs[i], channel);
> +
> +		if (prop >= 0 && test_bit(prop, psyhw->props))
> +			return true;
> +	}
> +
> +	return false;
> +}
> +
>  static bool power_supply_hwmon_is_writable(enum hwmon_sensor_types type,
>  					   u32 attr)
>  {
> @@ -129,9 +162,12 @@ static umode_t power_supply_hwmon_is_visible(const void *data,
>  	const struct power_supply_hwmon *psyhw = data;
>  	int prop;
>  
> -
> -	if (power_supply_hwmon_is_a_label(type, attr))
> -		return 0444;
> +	if (power_supply_hwmon_is_a_label(type, attr)) {
> +		if (power_supply_hwmon_has_input(psyhw, type, channel))
> +			return 0444;
> +		else
> +			return 0;
> +	}
>  
>  	prop = power_supply_hwmon_to_property(type, attr, channel);
>  	if (prop < 0 || !test_bit(prop, psyhw->props))
> -- 
> 2.20.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 02/11] power: charger-manager: don't write through desc->properties
  2020-05-01 12:38   ` Sebastian Reichel
@ 2020-05-01 13:30     ` Michał Mirosław
  2020-05-01 13:39       ` [PATCH] power: charger-manager: fix adding of optional properties Michał Mirosław
  2020-05-01 13:48       ` [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Sebastian Reichel
  0 siblings, 2 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-05-01 13:30 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Andrey Smirnov, Guenter Roeck, linux-kernel, linux-pm

On Fri, May 01, 2020 at 02:38:49PM +0200, Sebastian Reichel wrote:
> Hi,
> 
> On Fri, Apr 03, 2020 at 10:20:31PM +0200, Michał Mirosław wrote:
> > psy_desc->properties will become pointer to const.  Avoid writing
> > through the pointer to enable constification of the tables elsewhere.
> > 
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> For patches 1-3 I used my version, that I wrote in parallel while
> reviewing a different patch series. It is slightly different, but
> achieves the same goal.

There is a bug in the tree now regarding use of num_properties
in charger-manager.  Following patch should fix it.

Best Regards,
Michał Mirosław

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index a71e2ee81423..2ef53dc1f2fb 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1740,14 +1740,14 @@ static int charger_manager_probe(struct platform_device *pdev)
 	}
 	if (!power_supply_get_property(fuel_gauge,
 					  POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
-		properties[cm->charger_psy_desc.num_properties] =
+		properties[num_properties] =
 				POWER_SUPPLY_PROP_CHARGE_NOW;
 		num_properties++;
 	}
 	if (!power_supply_get_property(fuel_gauge,
 					  POWER_SUPPLY_PROP_CURRENT_NOW,
 					  &val)) {
-		properties[cm->charger_psy_desc.num_properties] =
+		properties[num_properties] =
 				POWER_SUPPLY_PROP_CURRENT_NOW;
 		num_properties++;
 	}

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH] power: charger-manager: fix adding of optional properties
  2020-05-01 13:30     ` Michał Mirosław
@ 2020-05-01 13:39       ` Michał Mirosław
  2020-05-01 13:51         ` Sebastian Reichel
  2020-05-01 13:48       ` [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Sebastian Reichel
  1 sibling, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-05-01 13:39 UTC (permalink / raw)
  To: Sebastian Reichel, Enric Balletbo i Serra
  Cc: Andrey Smirnov, Guenter Roeck, linux-pm, linux-kernel

Use num_properties to index added property.
This will prevent overwriting POWER_SUPPLY_PROP_CHARGE_NOW with
POWER_SUPPLY_PROP_CURRENT_NOW and leaving the latter entry
uninitialized.

For clarity, num_properties is initialized with length of the copied
array instead of relying on previously memcpy'd value.

Fixes: 0a46510addc7 ("power: supply: charger-manager: Prepare for const properties")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/power/supply/charger-manager.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index a71e2ee81423..2ef53dc1f2fb 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1729,7 +1729,7 @@ static int charger_manager_probe(struct platform_device *pdev)
 	memcpy(properties, default_charger_props,
 		sizeof(enum power_supply_property) *
 		ARRAY_SIZE(default_charger_props));
-	num_properties = psy_default.num_properties;
+	num_properties = ARRAY_SIZE(default_charger_props);
 
 	/* Find which optional psy-properties are available */
 	fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);
@@ -1740,14 +1740,14 @@ static int charger_manager_probe(struct platform_device *pdev)
 	}
 	if (!power_supply_get_property(fuel_gauge,
 					  POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
-		properties[cm->charger_psy_desc.num_properties] =
+		properties[num_properties] =
 				POWER_SUPPLY_PROP_CHARGE_NOW;
 		num_properties++;
 	}
 	if (!power_supply_get_property(fuel_gauge,
 					  POWER_SUPPLY_PROP_CURRENT_NOW,
 					  &val)) {
-		properties[cm->charger_psy_desc.num_properties] =
+		properties[num_properties] =
 				POWER_SUPPLY_PROP_CURRENT_NOW;
 		num_properties++;
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 02/11] power: charger-manager: don't write through desc->properties
  2020-05-01 13:30     ` Michał Mirosław
  2020-05-01 13:39       ` [PATCH] power: charger-manager: fix adding of optional properties Michał Mirosław
@ 2020-05-01 13:48       ` Sebastian Reichel
  1 sibling, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 13:48 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Andrey Smirnov, Guenter Roeck, linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]

Hi,

On Fri, May 01, 2020 at 03:30:08PM +0200, Michał Mirosław wrote:
> On Fri, May 01, 2020 at 02:38:49PM +0200, Sebastian Reichel wrote:
> > Hi,
> > 
> > On Fri, Apr 03, 2020 at 10:20:31PM +0200, Michał Mirosław wrote:
> > > psy_desc->properties will become pointer to const.  Avoid writing
> > > through the pointer to enable constification of the tables elsewhere.
> > > 
> > > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > For patches 1-3 I used my version, that I wrote in parallel while
> > reviewing a different patch series. It is slightly different, but
> > achieves the same goal.
> 
> There is a bug in the tree now regarding use of num_properties
> in charger-manager.  Following patch should fix it.

Thanks, I folded this into the charger-manager patch.

-- Sebastian

> Best Regards,
> Michał Mirosław
> 
> diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
> index a71e2ee81423..2ef53dc1f2fb 100644
> --- a/drivers/power/supply/charger-manager.c
> +++ b/drivers/power/supply/charger-manager.c
> @@ -1740,14 +1740,14 @@ static int charger_manager_probe(struct platform_device *pdev)
>  	}
>  	if (!power_supply_get_property(fuel_gauge,
>  					  POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
> -		properties[cm->charger_psy_desc.num_properties] =
> +		properties[num_properties] =
>  				POWER_SUPPLY_PROP_CHARGE_NOW;
>  		num_properties++;
>  	}
>  	if (!power_supply_get_property(fuel_gauge,
>  					  POWER_SUPPLY_PROP_CURRENT_NOW,
>  					  &val)) {
> -		properties[cm->charger_psy_desc.num_properties] =
> +		properties[num_properties] =
>  				POWER_SUPPLY_PROP_CURRENT_NOW;
>  		num_properties++;
>  	}

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH] power: charger-manager: fix adding of optional properties
  2020-05-01 13:39       ` [PATCH] power: charger-manager: fix adding of optional properties Michał Mirosław
@ 2020-05-01 13:51         ` Sebastian Reichel
  2020-05-01 14:15           ` Michał Mirosław
  2020-05-01 14:30           ` [PATCH] power: charger-manager: clarify num_properties starting value Michał Mirosław
  0 siblings, 2 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 13:51 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Enric Balletbo i Serra, Andrey Smirnov, Guenter Roeck, linux-pm,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

Hi,

On Fri, May 01, 2020 at 03:39:53PM +0200, Michał Mirosław wrote:
> Use num_properties to index added property.
> This will prevent overwriting POWER_SUPPLY_PROP_CHARGE_NOW with
> POWER_SUPPLY_PROP_CURRENT_NOW and leaving the latter entry
> uninitialized.
> 
> For clarity, num_properties is initialized with length of the copied
> array instead of relying on previously memcpy'd value.
> 
> Fixes: 0a46510addc7 ("power: supply: charger-manager: Prepare for const properties")
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

I folded your fix directly into the charger-manager patch, which did
not yet reach linux-next. If you send the num_properties part as a
separate one, I will merge it.

-- Sebastian

>  drivers/power/supply/charger-manager.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
> index a71e2ee81423..2ef53dc1f2fb 100644
> --- a/drivers/power/supply/charger-manager.c
> +++ b/drivers/power/supply/charger-manager.c
> @@ -1729,7 +1729,7 @@ static int charger_manager_probe(struct platform_device *pdev)
>  	memcpy(properties, default_charger_props,
>  		sizeof(enum power_supply_property) *
>  		ARRAY_SIZE(default_charger_props));
> -	num_properties = psy_default.num_properties;
> +	num_properties = ARRAY_SIZE(default_charger_props);
>  
>  	/* Find which optional psy-properties are available */
>  	fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);
> @@ -1740,14 +1740,14 @@ static int charger_manager_probe(struct platform_device *pdev)
>  	}
>  	if (!power_supply_get_property(fuel_gauge,
>  					  POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
> -		properties[cm->charger_psy_desc.num_properties] =
> +		properties[num_properties] =
>  				POWER_SUPPLY_PROP_CHARGE_NOW;
>  		num_properties++;
>  	}
>  	if (!power_supply_get_property(fuel_gauge,
>  					  POWER_SUPPLY_PROP_CURRENT_NOW,
>  					  &val)) {
> -		properties[cm->charger_psy_desc.num_properties] =
> +		properties[num_properties] =
>  				POWER_SUPPLY_PROP_CURRENT_NOW;
>  		num_properties++;
>  	}
> -- 
> 2.20.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH] power: charger-manager: fix adding of optional properties
  2020-05-01 13:51         ` Sebastian Reichel
@ 2020-05-01 14:15           ` Michał Mirosław
  2020-05-01 14:30           ` [PATCH] power: charger-manager: clarify num_properties starting value Michał Mirosław
  1 sibling, 0 replies; 31+ messages in thread
From: Michał Mirosław @ 2020-05-01 14:15 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Enric Balletbo i Serra, Andrey Smirnov, Guenter Roeck, linux-pm,
	linux-kernel

On Fri, May 01, 2020 at 03:51:09PM +0200, Sebastian Reichel wrote:
> Hi,
> 
> On Fri, May 01, 2020 at 03:39:53PM +0200, Michał Mirosław wrote:
> > Use num_properties to index added property.
> > This will prevent overwriting POWER_SUPPLY_PROP_CHARGE_NOW with
> > POWER_SUPPLY_PROP_CURRENT_NOW and leaving the latter entry
> > uninitialized.
> > 
> > For clarity, num_properties is initialized with length of the copied
> > array instead of relying on previously memcpy'd value.
> > 
> > Fixes: 0a46510addc7 ("power: supply: charger-manager: Prepare for const properties")
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > ---
> 
> I folded your fix directly into the charger-manager patch, which did
> not yet reach linux-next. If you send the num_properties part as a
> separate one, I will merge it.

Since your patch already changes the line, maybe you could squash first
hunk below into it?

> >  drivers/power/supply/charger-manager.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
> > index a71e2ee81423..2ef53dc1f2fb 100644
> > --- a/drivers/power/supply/charger-manager.c
> > +++ b/drivers/power/supply/charger-manager.c
> > @@ -1729,7 +1729,7 @@ static int charger_manager_probe(struct platform_device *pdev)
> >  	memcpy(properties, default_charger_props,
> >  		sizeof(enum power_supply_property) *
> >  		ARRAY_SIZE(default_charger_props));
> > -	num_properties = psy_default.num_properties;
> > +	num_properties = ARRAY_SIZE(default_charger_props);
> >  
> >  	/* Find which optional psy-properties are available */
> >  	fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);
[...]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH] power: charger-manager: clarify num_properties starting value
  2020-05-01 13:51         ` Sebastian Reichel
  2020-05-01 14:15           ` Michał Mirosław
@ 2020-05-01 14:30           ` Michał Mirosław
  2020-05-01 14:58             ` Sebastian Reichel
  1 sibling, 1 reply; 31+ messages in thread
From: Michał Mirosław @ 2020-05-01 14:30 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, linux-kernel

Initialize num_properties with length of the copied array instead
of relying on previously memcpy'd value. This makes it clear how
the array and the counter are related.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/power/supply/charger-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 415a9efa6816..2ef53dc1f2fb 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1729,7 +1729,7 @@ static int charger_manager_probe(struct platform_device *pdev)
 	memcpy(properties, default_charger_props,
 		sizeof(enum power_supply_property) *
 		ARRAY_SIZE(default_charger_props));
-	num_properties = psy_default.num_properties;
+	num_properties = ARRAY_SIZE(default_charger_props);
 
 	/* Find which optional psy-properties are available */
 	fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH] power: charger-manager: clarify num_properties starting value
  2020-05-01 14:30           ` [PATCH] power: charger-manager: clarify num_properties starting value Michał Mirosław
@ 2020-05-01 14:58             ` Sebastian Reichel
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-05-01 14:58 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]

Hi,

On Fri, May 01, 2020 at 04:30:43PM +0200, Michał Mirosław wrote:
> Initialize num_properties with length of the copied array instead
> of relying on previously memcpy'd value. This makes it clear how
> the array and the counter are related.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/charger-manager.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
> index 415a9efa6816..2ef53dc1f2fb 100644
> --- a/drivers/power/supply/charger-manager.c
> +++ b/drivers/power/supply/charger-manager.c
> @@ -1729,7 +1729,7 @@ static int charger_manager_probe(struct platform_device *pdev)
>  	memcpy(properties, default_charger_props,
>  		sizeof(enum power_supply_property) *
>  		ARRAY_SIZE(default_charger_props));
> -	num_properties = psy_default.num_properties;
> +	num_properties = ARRAY_SIZE(default_charger_props);
>  
>  	/* Find which optional psy-properties are available */
>  	fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);
> -- 
> 2.20.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-05-01 14:58 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 20:20 [PATCH v3 00/11] extensions and fixes Michał Mirosław
2020-04-03 20:20 ` [PATCH v3 01/11] power: charger-manager: remove duplicate assignment Michał Mirosław
2020-04-03 20:20 ` [PATCH v3 03/11] power: generic-adc-battery: fold psy_props[] to private data Michał Mirosław
2020-04-03 20:20 ` [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Michał Mirosław
2020-05-01 12:38   ` Sebastian Reichel
2020-05-01 13:30     ` Michał Mirosław
2020-05-01 13:39       ` [PATCH] power: charger-manager: fix adding of optional properties Michał Mirosław
2020-05-01 13:51         ` Sebastian Reichel
2020-05-01 14:15           ` Michał Mirosław
2020-05-01 14:30           ` [PATCH] power: charger-manager: clarify num_properties starting value Michał Mirosław
2020-05-01 14:58             ` Sebastian Reichel
2020-05-01 13:48       ` [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Sebastian Reichel
2020-04-03 20:20 ` [PATCH v3 05/11] power: supply: core: allow to constify property lists Michał Mirosław
2020-05-01 12:36   ` Sebastian Reichel
2020-04-03 20:20 ` [PATCH v3 04/11] power: supply: core: reduce power_supply_show_usb_type() parameters Michał Mirosław
2020-05-01 12:36   ` Sebastian Reichel
2020-04-03 20:20 ` [PATCH v3 06/11] power: supply: core: fix HWMON temperature labels Michał Mirosław
2020-05-01 12:39   ` Sebastian Reichel
2020-04-03 20:20 ` [PATCH v3 07/11] power: supply: core: tabularize " Michał Mirosław
2020-04-05  1:52   ` kbuild test robot
2020-04-07 18:13     ` Nick Desaulniers
2020-04-07 19:55       ` Michał Mirosław
2020-04-07 19:57         ` Nick Desaulniers
2020-04-07 22:31           ` Nick Desaulniers
2020-04-20  9:22       ` Michał Mirosław
2020-05-01 12:47         ` Sebastian Reichel
2020-04-03 20:20 ` [PATCH v3 08/11] power: supply: core: hide unused HWMON labels Michał Mirosław
2020-05-01 13:22   ` Sebastian Reichel
2020-04-03 20:20 ` [PATCH v3 09/11] power: supply: core: add input voltage/current measurements Michał Mirosław
2020-04-03 20:20 ` [PATCH v3 10/11] power: supply: core: add output voltage measurements Michał Mirosław
2020-04-03 20:20 ` [PATCH v3 11/11] power: supply: core: document measurement points Michał Mirosław

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).