All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor
@ 2021-01-07 10:34 Alexandru Ardelean
  2021-01-07 10:34 ` [PATCH v3 1/4] hwmon: (ltc2945): wrap regmap into an ltc2945_state struct Alexandru Ardelean
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-07 10:34 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-kernel
  Cc: robh+dt, linux, jdelvare, mark.thoren, ardeleanalex, Alexandru Ardelean

Changeset adds support for sense resistor.

Changelog v2 -> v3:
* https://lore.kernel.org/linux-hwmon/20201111091259.46773-1-alexandru.ardelean@analog.com/
* dropped patch 'docs: hwmon: (ltc2945): change type of val to ULL in ltc2945_val_to_reg()'
* add patch 'hwmon: (ltc2945): clamp values before converting'
* for patch 'hwmon: (ltc2945): add support for sense resistor'
  - sense-resistor is represented in milli-ohms internally; this
    risks of any other potential overflows with the multiplication to
    1000; the scaling in the driver becomes simpler, but we can't allow
    a lower resistor value that 1 mOhm, and all resistor values
    need to be integer in mOhm.
  - added max power and max amps limits, adjusted to sense resistor
* for patch 'dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945 '
  added 'Reviewed-by: Rob Herring <robh@kernel.org>'

Alexandru Ardelean (4):
  hwmon: (ltc2945): wrap regmap into an ltc2945_state struct
  hwmon: (ltc2945): clamp values before converting
  hwmon: (ltc2945): add support for sense resistor
  dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945

 .../bindings/hwmon/adi,ltc2945.yaml           |  49 +++++++
 drivers/hwmon/ltc2945.c                       | 128 +++++++++++++++---
 2 files changed, 156 insertions(+), 21 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ltc2945.yaml

-- 
2.17.1


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

* [PATCH v3 1/4] hwmon: (ltc2945): wrap regmap into an ltc2945_state struct
  2021-01-07 10:34 [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
@ 2021-01-07 10:34 ` Alexandru Ardelean
  2021-01-07 10:34 ` [PATCH v3 2/4] hwmon: (ltc2945): clamp values before converting Alexandru Ardelean
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-07 10:34 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-kernel
  Cc: robh+dt, linux, jdelvare, mark.thoren, ardeleanalex, Alexandru Ardelean

The intent is to add pass the value of the sense resistor in the driver.
This change wraps a 'struct ltc2945_state', and moves the regmap reference
on that object.

Then we can add the value of the sense resistor, or other information that
would be useful for the driver.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/hwmon/ltc2945.c | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c
index ba9c868a8641..42a59170da78 100644
--- a/drivers/hwmon/ltc2945.c
+++ b/drivers/hwmon/ltc2945.c
@@ -58,6 +58,14 @@
 #define CONTROL_MULT_SELECT	(1 << 0)
 #define CONTROL_TEST_MODE	(1 << 4)
 
+/**
+ * struct ltc2945_state - driver instance specific data
+ * @regmap:		regmap object to access device registers
+ */
+struct ltc2945_state {
+	struct regmap		*regmap;
+};
+
 static inline bool is_power_reg(u8 reg)
 {
 	return reg < LTC2945_SENSE_H;
@@ -66,7 +74,8 @@ static inline bool is_power_reg(u8 reg)
 /* Return the value from the given register in uW, mV, or mA */
 static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
 {
-	struct regmap *regmap = dev_get_drvdata(dev);
+	struct ltc2945_state *st = dev_get_drvdata(dev);
+	struct regmap *regmap = st->regmap;
 	unsigned int control;
 	u8 buf[3];
 	long long val;
@@ -148,7 +157,8 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
 static int ltc2945_val_to_reg(struct device *dev, u8 reg,
 			      unsigned long val)
 {
-	struct regmap *regmap = dev_get_drvdata(dev);
+	struct ltc2945_state *st = dev_get_drvdata(dev);
+	struct regmap *regmap = st->regmap;
 	unsigned int control;
 	int ret;
 
@@ -234,7 +244,8 @@ static ssize_t ltc2945_value_store(struct device *dev,
 				   const char *buf, size_t count)
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
-	struct regmap *regmap = dev_get_drvdata(dev);
+	struct ltc2945_state *st = dev_get_drvdata(dev);
+	struct regmap *regmap = st->regmap;
 	u8 reg = attr->index;
 	unsigned long val;
 	u8 regbuf[3];
@@ -269,7 +280,8 @@ static ssize_t ltc2945_history_store(struct device *dev,
 				     const char *buf, size_t count)
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
-	struct regmap *regmap = dev_get_drvdata(dev);
+	struct ltc2945_state *st = dev_get_drvdata(dev);
+	struct regmap *regmap = st->regmap;
 	u8 reg = attr->index;
 	int num_regs = is_power_reg(reg) ? 3 : 2;
 	u8 buf_min[3] = { 0xff, 0xff, 0xff };
@@ -321,7 +333,8 @@ static ssize_t ltc2945_bool_show(struct device *dev,
 				 struct device_attribute *da, char *buf)
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
-	struct regmap *regmap = dev_get_drvdata(dev);
+	struct ltc2945_state *st = dev_get_drvdata(dev);
+	struct regmap *regmap = st->regmap;
 	unsigned int fault;
 	int ret;
 
@@ -448,15 +461,22 @@ static const struct regmap_config ltc2945_regmap_config = {
 static int ltc2945_probe(struct i2c_client *client)
 {
 	struct device *dev = &client->dev;
+	struct ltc2945_state *st;
 	struct device *hwmon_dev;
 	struct regmap *regmap;
 
+	st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
+	if (!st)
+		return -ENOMEM;
+
 	regmap = devm_regmap_init_i2c(client, &ltc2945_regmap_config);
 	if (IS_ERR(regmap)) {
 		dev_err(dev, "failed to allocate register map\n");
 		return PTR_ERR(regmap);
 	}
 
+	st->regmap = regmap;
+
 	/* Clear faults */
 	regmap_write(regmap, LTC2945_FAULT, 0x00);
 
-- 
2.17.1


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

* [PATCH v3 2/4] hwmon: (ltc2945): clamp values before converting
  2021-01-07 10:34 [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
  2021-01-07 10:34 ` [PATCH v3 1/4] hwmon: (ltc2945): wrap regmap into an ltc2945_state struct Alexandru Ardelean
@ 2021-01-07 10:34 ` Alexandru Ardelean
  2021-01-07 10:34 ` [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-07 10:34 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-kernel
  Cc: robh+dt, linux, jdelvare, mark.thoren, ardeleanalex, Alexandru Ardelean

We can compute the full-scale values for power, voltages and current, and
apply them before conversion.

This way we sanitize the input from userspace a bit.
We can't however clamp the value for power, since that is represented in
micro-Watts. The full-scale power that can be represented is around 10480
Watts, which in micro-Watts ends up being around 10 billion micro-Watts.

Current and voltage is represented in millis, so these can be clamped.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/hwmon/ltc2945.c | 48 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c
index 42a59170da78..41df2c8b7673 100644
--- a/drivers/hwmon/ltc2945.c
+++ b/drivers/hwmon/ltc2945.c
@@ -58,6 +58,15 @@
 #define CONTROL_MULT_SELECT	(1 << 0)
 #define CONTROL_TEST_MODE	(1 << 4)
 
+/* Full scale ranges (page 4 of the datasheet) */
+
+#define LTC2945_VIN_FULL_SCALE_MV	102375
+#define LTC2945_ADIN_FULL_SCALE_MV	2048
+
+/* Power and current computed assuming a 1mOhm sense resistor */
+#define LTC2945_POWER_FULL_SCALE_UW	10485759375ULL
+#define LTC2945_SENSE_FULL_SCALE_MA	102375
+
 /**
  * struct ltc2945_state - driver instance specific data
  * @regmap:		regmap object to access device registers
@@ -154,6 +163,43 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
 	return val;
 }
 
+static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
+{
+	switch (reg) {
+	case LTC2945_POWER_H:
+	case LTC2945_MAX_POWER_H:
+	case LTC2945_MIN_POWER_H:
+	case LTC2945_MAX_POWER_THRES_H:
+	case LTC2945_MIN_POWER_THRES_H:
+		/* No sense in clamping now, LTC2945_POWER_FULL_SCALE_UW is larger than UINT32_MAX */
+		return val;
+	case LTC2945_VIN_H:
+	case LTC2945_MAX_VIN_H:
+	case LTC2945_MIN_VIN_H:
+	case LTC2945_MAX_VIN_THRES_H:
+	case LTC2945_MIN_VIN_THRES_H:
+		return clamp_val(val, 0, LTC2945_VIN_FULL_SCALE_MV);
+	case LTC2945_ADIN_H:
+	case LTC2945_MAX_ADIN_H:
+	case LTC2945_MIN_ADIN_THRES_H:
+	case LTC2945_MAX_ADIN_THRES_H:
+	case LTC2945_MIN_ADIN_H:
+		return clamp_val(val, 0, LTC2945_ADIN_FULL_SCALE_MV);
+	case LTC2945_SENSE_H:
+	case LTC2945_MAX_SENSE_H:
+	case LTC2945_MIN_SENSE_H:
+	case LTC2945_MAX_SENSE_THRES_H:
+	case LTC2945_MIN_SENSE_THRES_H:
+		return clamp_val(val, 0, LTC2945_SENSE_FULL_SCALE_MA);
+	default:
+		/*
+		 * This is unlikely to happen, and if it does, it should
+		 * error out on the next call, we can't return negative here
+		 */
+		return 0;
+	}
+}
+
 static int ltc2945_val_to_reg(struct device *dev, u8 reg,
 			      unsigned long val)
 {
@@ -257,6 +303,8 @@ static ssize_t ltc2945_value_store(struct device *dev,
 	if (ret)
 		return ret;
 
+	val = ltc2945_val_clamp(reg, val);
+
 	/* convert to register value, then clamp and write result */
 	regval = ltc2945_val_to_reg(dev, reg, val);
 	if (is_power_reg(reg)) {
-- 
2.17.1


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

* [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 10:34 [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
  2021-01-07 10:34 ` [PATCH v3 1/4] hwmon: (ltc2945): wrap regmap into an ltc2945_state struct Alexandru Ardelean
  2021-01-07 10:34 ` [PATCH v3 2/4] hwmon: (ltc2945): clamp values before converting Alexandru Ardelean
@ 2021-01-07 10:34 ` Alexandru Ardelean
  2021-01-07 13:28     ` kernel test robot
                     ` (2 more replies)
  2021-01-07 10:34 ` [PATCH v3 4/4] dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945 Alexandru Ardelean
  2021-01-07 15:28 ` [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Guenter Roeck
  4 siblings, 3 replies; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-07 10:34 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-kernel
  Cc: robh+dt, linux, jdelvare, mark.thoren, ardeleanalex, Alexandru Ardelean

The sense resistor is a parameter of the board. It should be configured in
the driver via a device-tree / ACPI property, so that the proper current
measurements can be done in the driver.

It shouldn't be necessary that userspace need to know about the value of
the resistor. It makes things a bit harder to make the application code
portable from one board to another.

This change implements support for the sense resistor to be configured from
DT/ACPI and used in current calculations.
Also, the maximum power and current that can be represented by the driver
are scaled with the value of the sense resistor.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/hwmon/ltc2945.c | 60 ++++++++++++++++++++++++++---------------
 1 file changed, 39 insertions(+), 21 deletions(-)

diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c
index 41df2c8b7673..e60b15832b0e 100644
--- a/drivers/hwmon/ltc2945.c
+++ b/drivers/hwmon/ltc2945.c
@@ -70,9 +70,15 @@
 /**
  * struct ltc2945_state - driver instance specific data
  * @regmap:		regmap object to access device registers
+ * @max_power_uw:	maximum power that can be represented based on sense resistor
+ * @max_current_ma:	maximum current that can be represented based on sense resistor
+ * @r_sense_mohm:	current sense resistor value
  */
 struct ltc2945_state {
 	struct regmap		*regmap;
+	u32			max_power_uw;
+	u32			max_current_ma;
+	u32			r_sense_mohm;
 };
 
 static inline bool is_power_reg(u8 reg)
@@ -110,9 +116,8 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
 	case LTC2945_MAX_POWER_THRES_H:
 	case LTC2945_MIN_POWER_THRES_H:
 		/*
-		 * Convert to uW by assuming current is measured with
-		 * an 1mOhm sense resistor, similar to current
-		 * measurements.
+		 * Convert to uW by and scale it with the configured
+		 * sense resistor, similar to current measurements.
 		 * Control register bit 0 selects if voltage at SENSE+/VDD
 		 * or voltage at ADIN is used to measure power.
 		 */
@@ -126,6 +131,7 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
 			/* 0.5 mV * 25 uV = 0.0125 uV resolution. */
 			val = (val * 25LL) >> 1;
 		}
+		val /= st->r_sense_mohm;
 		break;
 	case LTC2945_VIN_H:
 	case LTC2945_MAX_VIN_H:
@@ -149,13 +155,11 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
 	case LTC2945_MAX_SENSE_THRES_H:
 	case LTC2945_MIN_SENSE_THRES_H:
 		/*
-		 * 25 uV resolution. Convert to current as measured with
-		 * an 1 mOhm sense resistor, in mA. If a different sense
-		 * resistor is installed, calculate the actual current by
-		 * dividing the reported current by the sense resistor value
-		 * in mOhm.
+		 * 25 uV resolution. Convert to current and scale it
+		 * with the value of the sense resistor.
 		 */
 		val *= 25;
+		val /= st->r_sense_mohm;
 		break;
 	default:
 		return -EINVAL;
@@ -163,7 +167,8 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
 	return val;
 }
 
-static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
+static unsigned long ltc2945_val_clamp(struct ltc2945_state *st, u8 reg,
+				       unsigned long val)
 {
 	switch (reg) {
 	case LTC2945_POWER_H:
@@ -171,8 +176,7 @@ static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
 	case LTC2945_MIN_POWER_H:
 	case LTC2945_MAX_POWER_THRES_H:
 	case LTC2945_MIN_POWER_THRES_H:
-		/* No sense in clamping now, LTC2945_POWER_FULL_SCALE_UW is larger than UINT32_MAX */
-		return val;
+		return clamp_val(val, 0, st->max_power_uw);
 	case LTC2945_VIN_H:
 	case LTC2945_MAX_VIN_H:
 	case LTC2945_MIN_VIN_H:
@@ -190,7 +194,7 @@ static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
 	case LTC2945_MIN_SENSE_H:
 	case LTC2945_MAX_SENSE_THRES_H:
 	case LTC2945_MIN_SENSE_THRES_H:
-		return clamp_val(val, 0, LTC2945_SENSE_FULL_SCALE_MA);
+		return clamp_val(val, 0, st->max_current_ma);
 	default:
 		/*
 		 * This is unlikely to happen, and if it does, it should
@@ -215,9 +219,8 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
 	case LTC2945_MAX_POWER_THRES_H:
 	case LTC2945_MIN_POWER_THRES_H:
 		/*
-		 * Convert to register value by assuming current is measured
-		 * with an 1mOhm sense resistor, similar to current
-		 * measurements.
+		 * Convert to register value, scale it with the configured sense
+		 * resistor value, similar to current measurements.
 		 * Control register bit 0 selects if voltage at SENSE+/VDD
 		 * or voltage at ADIN is used to measure power, which in turn
 		 * determines register calculations.
@@ -236,6 +239,7 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
 			 */
 			val = DIV_ROUND_CLOSEST(val, 25) * 2;
 		}
+		val *= st->r_sense_mohm;
 		break;
 	case LTC2945_VIN_H:
 	case LTC2945_MAX_VIN_H:
@@ -259,12 +263,10 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
 	case LTC2945_MAX_SENSE_THRES_H:
 	case LTC2945_MIN_SENSE_THRES_H:
 		/*
-		 * 25 uV resolution. Convert to current as measured with
-		 * an 1 mOhm sense resistor, in mA. If a different sense
-		 * resistor is installed, calculate the actual current by
-		 * dividing the reported current by the sense resistor value
-		 * in mOhm.
+		 * 25 uV resolution. Convert to current and scale it
+		 * with the value of the sense resistor, in mA.
 		 */
+		val *= st->r_sense_mohm;
 		val = DIV_ROUND_CLOSEST(val, 25);
 		break;
 	default:
@@ -303,7 +305,7 @@ static ssize_t ltc2945_value_store(struct device *dev,
 	if (ret)
 		return ret;
 
-	val = ltc2945_val_clamp(reg, val);
+	val = ltc2945_val_clamp(st, reg, val);
 
 	/* convert to register value, then clamp and write result */
 	regval = ltc2945_val_to_reg(dev, reg, val);
@@ -512,6 +514,7 @@ static int ltc2945_probe(struct i2c_client *client)
 	struct ltc2945_state *st;
 	struct device *hwmon_dev;
 	struct regmap *regmap;
+	u64 val64;
 
 	st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
 	if (!st)
@@ -523,7 +526,22 @@ static int ltc2945_probe(struct i2c_client *client)
 		return PTR_ERR(regmap);
 	}
 
+	if (device_property_read_u32(dev, "shunt-resistor-micro-ohms",
+				     &st->r_sense_mohm))
+		st->r_sense_mohm = 1000;
+
+	if (st->r_sense_mohm < 1000) {
+		dev_err(dev, "Value too small for sense resistor, minimum 1000\n");
+		return -EINVAL;
+	}
+	st->r_sense_mohm /= 1000;
+
 	st->regmap = regmap;
+	val64 = LTC2945_POWER_FULL_SCALE_UW / st->r_sense_mohm;
+	/* clamp power to ULONG_MAX, since we represent it on 32 bits */
+	st->max_power_uw = clamp_val(val64, 0, ULONG_MAX);
+
+	st->max_current_ma = LTC2945_SENSE_FULL_SCALE_MA / st->r_sense_mohm;
 
 	/* Clear faults */
 	regmap_write(regmap, LTC2945_FAULT, 0x00);
-- 
2.17.1


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

* [PATCH v3 4/4] dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945
  2021-01-07 10:34 [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
                   ` (2 preceding siblings ...)
  2021-01-07 10:34 ` [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
@ 2021-01-07 10:34 ` Alexandru Ardelean
  2021-01-07 15:28 ` [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Guenter Roeck
  4 siblings, 0 replies; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-07 10:34 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-kernel
  Cc: robh+dt, linux, jdelvare, mark.thoren, ardeleanalex, Alexandru Ardelean

This change adds a device-tree binding documentation for the Linear
Technology (now Analog Devices) LTC2945 Wide Range I2C Power Monitor.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 .../bindings/hwmon/adi,ltc2945.yaml           | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ltc2945.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2945.yaml b/Documentation/devicetree/bindings/hwmon/adi,ltc2945.yaml
new file mode 100644
index 000000000000..e49d7da09f74
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2945.yaml
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/adi,ltc2945.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Linear Technology LTC2945 Wide Range I2C Power Monitor
+
+maintainers:
+  - Guenter Roeck <linux@roeck-us.net>
+
+description: |
+  The LTC2945  is a rail-to-rail system monitor that measures current, voltage,
+  and power consumption.
+
+properties:
+  compatible:
+    enum:
+      - adi,ltc2945
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description:
+      The value of curent sense resistor in microohms. If not provided,
+      a default value of 1000 microohms is used.
+    default: 1000
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+           #address-cells = <1>;
+           #size-cells = <0>;
+
+           ltc2945_i2c: ltc2945@6f {
+                   compatible = "adi,ltc2945";
+                   reg = <0x6f>;
+
+                   shunt-resistor-micro-ohms = <20000>;
+           };
+    };
+...
-- 
2.17.1


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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 10:34 ` [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
@ 2021-01-07 13:28     ` kernel test robot
  2021-01-07 14:23     ` kernel test robot
  2021-01-07 15:25   ` Guenter Roeck
  2 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2021-01-07 13:28 UTC (permalink / raw)
  To: Alexandru Ardelean, linux-hwmon, devicetree, linux-kernel
  Cc: kbuild-all, robh+dt, linux, jdelvare, mark.thoren, ardeleanalex,
	Alexandru Ardelean

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

Hi Alexandru,

I love your patch! Yet something to improve:

[auto build test ERROR on hwmon/hwmon-next]
[also build test ERROR on v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: openrisc-randconfig-r011-20210107 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
        git checkout 1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc 

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

All errors (new ones prefixed by >>, old ones prefixed by <<):

ERROR: modpost: "__mulsi3" [net/vmw_vsock/vsock.ko] undefined!
ERROR: modpost: "__mulsi3" [net/9p/9pnet.ko] undefined!
ERROR: modpost: "__mulsi3" [net/can/can-bcm.ko] undefined!
ERROR: modpost: "__mulsi3" [net/can/can.ko] undefined!
ERROR: modpost: "__mulsi3" [net/ax25/ax25.ko] undefined!
ERROR: modpost: "__mulsi3" [net/netrom/netrom.ko] undefined!
ERROR: modpost: "__mulsi3" [net/lapb/lapb.ko] undefined!
ERROR: modpost: "__mulsi3" [net/packet/af_packet.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/xtensa/snd-soc-xtfpga-i2s.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/uniphier/snd-soc-uniphier-aio-cpu.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/sunxi/sun4i-i2s.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/sti/snd-soc-sti.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/img/img-spdif-in.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-easrc.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-esai.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-ssi.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-asrc.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/bcm/snd-soc-cygnus.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/atmel/snd-soc-mchp-i2s-mcc.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-sgtl5000.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rt5645.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rt5616.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rl6231.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-nau8822.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-cs42l42.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/motu/snd-firewire-motu.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/tascam/snd-firewire-tascam.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/digi00x/snd-firewire-digi00x.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/snd-isight.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/dice/snd-dice.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/snd-firewire-lib.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/usb/hiface/snd-usb-hiface.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/most/most_usb.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/counter/counter.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwtracing/stm/stm_core.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/rpmsg/virtio_rpmsg_bus.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_vsock.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_scsi.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_net.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/occ/occ-hwmon-common.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/wm8350-hwmon.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83l786ng.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83l785ts.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83627ehf.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp421.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp401.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp108.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp102.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/thmc50.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/amc6821.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/stts751.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sparx5-temp.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/smsc47b397.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/shtc1.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sht3x.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sht21.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sht15.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sch5627.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sch56xx-common.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/pwm-fan.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/pc87427.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ntc_thermistor.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/npcm750-pwm-fan.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct7904.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct7802.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct6775.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct6683.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/mr75203.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tc654.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/mc13783-adc.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6697.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6650.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6642.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6639.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6621.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max1619.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4261.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4260.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4245.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4215.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4151.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2992.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2990.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2947-core.ko] undefined!
>> ERROR: modpost: "__divdi3" [drivers/hwmon/ltc2945.ko] undefined!
>> ERROR: modpost: "__udivdi3" [drivers/hwmon/ltc2945.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2945.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm95245.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm95241.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm90.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm83.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm78.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm77.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm75.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm73.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/jc42.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ina209.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ibmpex.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/gpio-fan.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/gl520sm.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/g762.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/g760a.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ftsteutates.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/f75375s.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/emc6w201.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/emc1403.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ds1621.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ds620.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/dme1737.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/corsair-psu.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/corsair-cpro.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/bt1-pvt.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/aspeed-pwm-tacho.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/asc7621.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/as370-hwmon.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7475.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7470.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7462.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7x10.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ads7828.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm9240.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1031.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1029.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1026.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1025.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1021.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adc128d818.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ad7418.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83791d.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83795.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83792d.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83773g.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83627hf.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/hwmon-vid.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/ubi/ubi.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/mtdoops.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/sm_ftl.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/rfd_ftl.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/ftl.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/mtd.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_nandbiterrs.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_torturetest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_subpagetest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_stresstest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_speedtest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_pagetest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_oobtest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/nand/nandcore.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/nand/onenand/onenand.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/maps/sc520cdp.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/lpddr/lpddr_cmds.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/lpddr/qinfo_probe.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/gen_probe.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_cmdset_0001.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_cmdset_0002.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_util.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_probe.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/parsers/redboot.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/parsers/sharpslpart.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/sbp/sbp_target.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/loopback/tcm_loop.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_user.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_file.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_iblock.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_mod.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwtracing/intel_th/intel_th_sth.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwtracing/intel_th/intel_th_gth.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/most/dim2/most_dim2.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/most/sound/most_sound.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/emxx_udc/emxx_udc.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/vmk80xx.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/usbdux.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/comedi_test.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/kcomedilib/kcomedilib.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/comedi.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/greybus/gb-hid.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/usbhid/usbhid.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-sensor-hub.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-wiimote.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-waltop.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-sony.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-multitouch.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-microsoft.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-mcp2221.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-magicmouse.ko] undefined!

---
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: 33676 bytes --]

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
@ 2021-01-07 13:28     ` kernel test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2021-01-07 13:28 UTC (permalink / raw)
  To: kbuild-all

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

Hi Alexandru,

I love your patch! Yet something to improve:

[auto build test ERROR on hwmon/hwmon-next]
[also build test ERROR on v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: openrisc-randconfig-r011-20210107 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
        git checkout 1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc 

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

All errors (new ones prefixed by >>, old ones prefixed by <<):

ERROR: modpost: "__mulsi3" [net/vmw_vsock/vsock.ko] undefined!
ERROR: modpost: "__mulsi3" [net/9p/9pnet.ko] undefined!
ERROR: modpost: "__mulsi3" [net/can/can-bcm.ko] undefined!
ERROR: modpost: "__mulsi3" [net/can/can.ko] undefined!
ERROR: modpost: "__mulsi3" [net/ax25/ax25.ko] undefined!
ERROR: modpost: "__mulsi3" [net/netrom/netrom.ko] undefined!
ERROR: modpost: "__mulsi3" [net/lapb/lapb.ko] undefined!
ERROR: modpost: "__mulsi3" [net/packet/af_packet.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/xtensa/snd-soc-xtfpga-i2s.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/uniphier/snd-soc-uniphier-aio-cpu.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/sunxi/sun4i-i2s.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/sti/snd-soc-sti.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/img/img-spdif-in.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-easrc.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-esai.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-ssi.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-asrc.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/bcm/snd-soc-cygnus.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/atmel/snd-soc-mchp-i2s-mcc.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-sgtl5000.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rt5645.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rt5616.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rl6231.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-nau8822.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-cs42l42.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/motu/snd-firewire-motu.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/tascam/snd-firewire-tascam.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/digi00x/snd-firewire-digi00x.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/snd-isight.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/dice/snd-dice.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/firewire/snd-firewire-lib.ko] undefined!
ERROR: modpost: "__mulsi3" [sound/usb/hiface/snd-usb-hiface.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/most/most_usb.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/counter/counter.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwtracing/stm/stm_core.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/rpmsg/virtio_rpmsg_bus.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_vsock.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_scsi.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_net.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/occ/occ-hwmon-common.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/wm8350-hwmon.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83l786ng.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83l785ts.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83627ehf.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp421.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp401.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp108.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp102.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/thmc50.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/amc6821.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/stts751.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sparx5-temp.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/smsc47b397.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/shtc1.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sht3x.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sht21.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sht15.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sch5627.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/sch56xx-common.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/pwm-fan.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/pc87427.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ntc_thermistor.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/npcm750-pwm-fan.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct7904.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct7802.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct6775.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/nct6683.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/mr75203.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/tc654.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/mc13783-adc.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6697.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6650.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6642.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6639.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max6621.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/max1619.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4261.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4260.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4245.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4215.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4151.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2992.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2990.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2947-core.ko] undefined!
>> ERROR: modpost: "__divdi3" [drivers/hwmon/ltc2945.ko] undefined!
>> ERROR: modpost: "__udivdi3" [drivers/hwmon/ltc2945.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2945.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm95245.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm95241.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm90.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm83.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm78.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm77.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm75.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/lm73.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/jc42.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ina209.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ibmpex.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/gpio-fan.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/gl520sm.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/g762.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/g760a.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ftsteutates.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/f75375s.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/emc6w201.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/emc1403.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ds1621.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ds620.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/dme1737.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/corsair-psu.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/corsair-cpro.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/bt1-pvt.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/aspeed-pwm-tacho.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/asc7621.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/as370-hwmon.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7475.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7470.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7462.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7x10.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ads7828.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm9240.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1031.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1029.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1026.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1025.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1021.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/adc128d818.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/ad7418.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83791d.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83795.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83792d.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83773g.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/w83627hf.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwmon/hwmon-vid.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/ubi/ubi.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/mtdoops.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/sm_ftl.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/rfd_ftl.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/ftl.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/mtd.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_nandbiterrs.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_torturetest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_subpagetest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_stresstest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_speedtest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_pagetest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_oobtest.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/nand/nandcore.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/nand/onenand/onenand.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/maps/sc520cdp.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/lpddr/lpddr_cmds.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/lpddr/qinfo_probe.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/gen_probe.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_cmdset_0001.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_cmdset_0002.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_util.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_probe.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/parsers/redboot.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/mtd/parsers/sharpslpart.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/sbp/sbp_target.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/loopback/tcm_loop.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_user.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_file.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_iblock.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/target/target_core_mod.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwtracing/intel_th/intel_th_sth.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hwtracing/intel_th/intel_th_gth.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/most/dim2/most_dim2.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/most/sound/most_sound.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/emxx_udc/emxx_udc.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/vmk80xx.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/usbdux.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/comedi_test.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/kcomedilib/kcomedilib.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/comedi/comedi.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/greybus/gb-hid.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/usbhid/usbhid.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-sensor-hub.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-wiimote.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-waltop.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-sony.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-multitouch.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-microsoft.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-mcp2221.ko] undefined!
ERROR: modpost: "__mulsi3" [drivers/hid/hid-magicmouse.ko] undefined!

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

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

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 13:28     ` kernel test robot
  (?)
@ 2021-01-07 14:10     ` Alexandru Ardelean
  -1 siblings, 0 replies; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-07 14:10 UTC (permalink / raw)
  To: kernel test robot
  Cc: Alexandru Ardelean, linux-hwmon, devicetree, LKML, kbuild-all,
	Rob Herring, Guenter Roeck, jdelvare, Thoren, Mark

On Thu, Jan 7, 2021 at 3:29 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Alexandru,
>
> I love your patch! Yet something to improve:

Huh?

I'm stumped.
This looks like it may not be related to my patch?

I'll take a look deeper in a couple of days.

>
> [auto build test ERROR on hwmon/hwmon-next]
> [also build test ERROR on v5.11-rc2 next-20210104]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
>
> url:    https://github.com/0day-ci/linux/commits/Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
> config: openrisc-randconfig-r011-20210107 (attached as .config)
> compiler: or1k-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://github.com/0day-ci/linux/commit/1c0d97e2ccf58d83a895972d54b652adb1aba1c4
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
>         git checkout 1c0d97e2ccf58d83a895972d54b652adb1aba1c4
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>, old ones prefixed by <<):
>
> ERROR: modpost: "__mulsi3" [net/vmw_vsock/vsock.ko] undefined!
> ERROR: modpost: "__mulsi3" [net/9p/9pnet.ko] undefined!
> ERROR: modpost: "__mulsi3" [net/can/can-bcm.ko] undefined!
> ERROR: modpost: "__mulsi3" [net/can/can.ko] undefined!
> ERROR: modpost: "__mulsi3" [net/ax25/ax25.ko] undefined!
> ERROR: modpost: "__mulsi3" [net/netrom/netrom.ko] undefined!
> ERROR: modpost: "__mulsi3" [net/lapb/lapb.ko] undefined!
> ERROR: modpost: "__mulsi3" [net/packet/af_packet.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/xtensa/snd-soc-xtfpga-i2s.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/uniphier/snd-soc-uniphier-aio-cpu.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/sunxi/sun4i-i2s.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/sti/snd-soc-sti.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/img/img-spdif-in.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-easrc.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-esai.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-ssi.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/fsl/snd-soc-fsl-asrc.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/bcm/snd-soc-cygnus.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/atmel/snd-soc-mchp-i2s-mcc.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-sgtl5000.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rt5645.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rt5616.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-rl6231.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-nau8822.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/soc/codecs/snd-soc-cs42l42.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/firewire/motu/snd-firewire-motu.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/firewire/tascam/snd-firewire-tascam.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/firewire/digi00x/snd-firewire-digi00x.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/firewire/snd-isight.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/firewire/dice/snd-dice.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/firewire/snd-firewire-lib.ko] undefined!
> ERROR: modpost: "__mulsi3" [sound/usb/hiface/snd-usb-hiface.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/most/most_usb.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/counter/counter.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwtracing/stm/stm_core.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/rpmsg/virtio_rpmsg_bus.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/vhost/vhost.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_vsock.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_scsi.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/vhost/vhost_net.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/occ/occ-hwmon-common.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/wm8350-hwmon.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83l786ng.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83l785ts.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83627ehf.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp421.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp401.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp108.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/tmp102.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/thmc50.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/amc6821.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/stts751.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/sparx5-temp.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/smsc47b397.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/shtc1.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/sht3x.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/sht21.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/sht15.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/sch5627.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/sch56xx-common.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/pwm-fan.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/pc87427.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ntc_thermistor.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/npcm750-pwm-fan.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/nct7904.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/nct7802.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/nct6775.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/nct6683.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/mr75203.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/tc654.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/mc13783-adc.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/max6697.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/max6650.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/max6642.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/max6639.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/max6621.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/max1619.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4261.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4260.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4245.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4215.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc4151.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2992.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2990.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2947-core.ko] undefined!
> >> ERROR: modpost: "__divdi3" [drivers/hwmon/ltc2945.ko] undefined!
> >> ERROR: modpost: "__udivdi3" [drivers/hwmon/ltc2945.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ltc2945.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm95245.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm95241.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm90.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm83.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm78.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm77.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm75.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/lm73.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/jc42.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ina209.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ibmpex.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/gpio-fan.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/gl520sm.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/g762.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/g760a.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ftsteutates.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/f75375s.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/emc6w201.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/emc1403.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ds1621.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ds620.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/dme1737.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/corsair-psu.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/corsair-cpro.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/bt1-pvt.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/aspeed-pwm-tacho.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/asc7621.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/as370-hwmon.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7475.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7470.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7462.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adt7x10.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ads7828.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adm9240.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1031.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1029.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1026.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1025.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adm1021.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/adc128d818.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/ad7418.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83791d.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83795.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83792d.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83773g.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/w83627hf.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwmon/hwmon-vid.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/ubi/ubi.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/mtdoops.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/sm_ftl.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/rfd_ftl.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/ftl.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/mtd.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_nandbiterrs.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_torturetest.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_subpagetest.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_stresstest.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_speedtest.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_pagetest.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/tests/mtd_oobtest.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/nand/nandcore.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/nand/onenand/onenand.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/maps/sc520cdp.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/lpddr/lpddr_cmds.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/lpddr/qinfo_probe.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/chips/gen_probe.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_cmdset_0001.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_cmdset_0002.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_util.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/chips/cfi_probe.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/parsers/redboot.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/mtd/parsers/sharpslpart.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/target/sbp/sbp_target.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/target/loopback/tcm_loop.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/target/target_core_user.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/target/target_core_file.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/target/target_core_iblock.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/target/target_core_mod.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwtracing/intel_th/intel_th_sth.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hwtracing/intel_th/intel_th_gth.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/most/dim2/most_dim2.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/most/sound/most_sound.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/emxx_udc/emxx_udc.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/vmk80xx.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/usbdux.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/comedi/drivers/comedi_test.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/comedi/kcomedilib/kcomedilib.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/comedi/comedi.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/greybus/gb-hid.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/usbhid/usbhid.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-sensor-hub.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-wiimote.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-waltop.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-sony.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-multitouch.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-microsoft.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-mcp2221.ko] undefined!
> ERROR: modpost: "__mulsi3" [drivers/hid/hid-magicmouse.ko] undefined!
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 10:34 ` [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
@ 2021-01-07 14:23     ` kernel test robot
  2021-01-07 14:23     ` kernel test robot
  2021-01-07 15:25   ` Guenter Roeck
  2 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2021-01-07 14:23 UTC (permalink / raw)
  To: Alexandru Ardelean, linux-hwmon, devicetree, linux-kernel
  Cc: kbuild-all, robh+dt, linux, jdelvare, mark.thoren, ardeleanalex,
	Alexandru Ardelean

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

Hi Alexandru,

I love your patch! Yet something to improve:

[auto build test ERROR on hwmon/hwmon-next]
[also build test ERROR on v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: i386-randconfig-a002-20210107 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
        git checkout 1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All errors (new ones prefixed by >>):

   ld: drivers/hwmon/ltc2945.o: in function `ltc2945_value_show':
   ltc2945.c:(.text+0x50e): undefined reference to `__divdi3'
>> ld: ltc2945.c:(.text+0x553): undefined reference to `__divdi3'
   ld: drivers/hwmon/ltc2945.o: in function `ltc2945_probe':
   ltc2945.c:(.text+0x63d): undefined reference to `__udivdi3'

---
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: 41379 bytes --]

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
@ 2021-01-07 14:23     ` kernel test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2021-01-07 14:23 UTC (permalink / raw)
  To: kbuild-all

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

Hi Alexandru,

I love your patch! Yet something to improve:

[auto build test ERROR on hwmon/hwmon-next]
[also build test ERROR on v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: i386-randconfig-a002-20210107 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexandru-Ardelean/hwmon-ltc2945-add-support-for-sense-resistor/20210107-183412
        git checkout 1c0d97e2ccf58d83a895972d54b652adb1aba1c4
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All errors (new ones prefixed by >>):

   ld: drivers/hwmon/ltc2945.o: in function `ltc2945_value_show':
   ltc2945.c:(.text+0x50e): undefined reference to `__divdi3'
>> ld: ltc2945.c:(.text+0x553): undefined reference to `__divdi3'
   ld: drivers/hwmon/ltc2945.o: in function `ltc2945_probe':
   ltc2945.c:(.text+0x63d): undefined reference to `__udivdi3'

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

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

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 10:34 ` [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
  2021-01-07 13:28     ` kernel test robot
  2021-01-07 14:23     ` kernel test robot
@ 2021-01-07 15:25   ` Guenter Roeck
  2021-01-07 15:44     ` Alexandru Ardelean
  2 siblings, 1 reply; 15+ messages in thread
From: Guenter Roeck @ 2021-01-07 15:25 UTC (permalink / raw)
  To: Alexandru Ardelean
  Cc: linux-hwmon, devicetree, linux-kernel, robh+dt, jdelvare,
	mark.thoren, ardeleanalex

On Thu, Jan 07, 2021 at 12:34:16PM +0200, Alexandru Ardelean wrote:
> The sense resistor is a parameter of the board. It should be configured in
> the driver via a device-tree / ACPI property, so that the proper current
> measurements can be done in the driver.
> 
> It shouldn't be necessary that userspace need to know about the value of
> the resistor. It makes things a bit harder to make the application code
> portable from one board to another.
> 
> This change implements support for the sense resistor to be configured from
> DT/ACPI and used in current calculations.
> Also, the maximum power and current that can be represented by the driver
> are scaled with the value of the sense resistor.
> 

In a way you are correct, but that applies to all hwmon
drivers, not just to this one. A solution which only applies
to a single driver doesn't solve the underlying problem,
which would be the desire or need to provide kernel-based
scaling for hwmon drivers. As such, I am not inclined to accept
this patch. We should think about a generic solution instead.

Note that this patch doesn't compile on 32-bit targets.

Thanks,
Guenter

> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
>  drivers/hwmon/ltc2945.c | 60 ++++++++++++++++++++++++++---------------
>  1 file changed, 39 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c
> index 41df2c8b7673..e60b15832b0e 100644
> --- a/drivers/hwmon/ltc2945.c
> +++ b/drivers/hwmon/ltc2945.c
> @@ -70,9 +70,15 @@
>  /**
>   * struct ltc2945_state - driver instance specific data
>   * @regmap:		regmap object to access device registers
> + * @max_power_uw:	maximum power that can be represented based on sense resistor
> + * @max_current_ma:	maximum current that can be represented based on sense resistor
> + * @r_sense_mohm:	current sense resistor value
>   */
>  struct ltc2945_state {
>  	struct regmap		*regmap;
> +	u32			max_power_uw;
> +	u32			max_current_ma;
> +	u32			r_sense_mohm;
>  };
>  
>  static inline bool is_power_reg(u8 reg)
> @@ -110,9 +116,8 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
>  	case LTC2945_MAX_POWER_THRES_H:
>  	case LTC2945_MIN_POWER_THRES_H:
>  		/*
> -		 * Convert to uW by assuming current is measured with
> -		 * an 1mOhm sense resistor, similar to current
> -		 * measurements.
> +		 * Convert to uW by and scale it with the configured
> +		 * sense resistor, similar to current measurements.
>  		 * Control register bit 0 selects if voltage at SENSE+/VDD
>  		 * or voltage at ADIN is used to measure power.
>  		 */
> @@ -126,6 +131,7 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
>  			/* 0.5 mV * 25 uV = 0.0125 uV resolution. */
>  			val = (val * 25LL) >> 1;
>  		}
> +		val /= st->r_sense_mohm;
>  		break;
>  	case LTC2945_VIN_H:
>  	case LTC2945_MAX_VIN_H:
> @@ -149,13 +155,11 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
>  	case LTC2945_MAX_SENSE_THRES_H:
>  	case LTC2945_MIN_SENSE_THRES_H:
>  		/*
> -		 * 25 uV resolution. Convert to current as measured with
> -		 * an 1 mOhm sense resistor, in mA. If a different sense
> -		 * resistor is installed, calculate the actual current by
> -		 * dividing the reported current by the sense resistor value
> -		 * in mOhm.
> +		 * 25 uV resolution. Convert to current and scale it
> +		 * with the value of the sense resistor.
>  		 */
>  		val *= 25;
> +		val /= st->r_sense_mohm;
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -163,7 +167,8 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
>  	return val;
>  }
>  
> -static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
> +static unsigned long ltc2945_val_clamp(struct ltc2945_state *st, u8 reg,
> +				       unsigned long val)
>  {
>  	switch (reg) {
>  	case LTC2945_POWER_H:
> @@ -171,8 +176,7 @@ static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
>  	case LTC2945_MIN_POWER_H:
>  	case LTC2945_MAX_POWER_THRES_H:
>  	case LTC2945_MIN_POWER_THRES_H:
> -		/* No sense in clamping now, LTC2945_POWER_FULL_SCALE_UW is larger than UINT32_MAX */
> -		return val;
> +		return clamp_val(val, 0, st->max_power_uw);
>  	case LTC2945_VIN_H:
>  	case LTC2945_MAX_VIN_H:
>  	case LTC2945_MIN_VIN_H:
> @@ -190,7 +194,7 @@ static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
>  	case LTC2945_MIN_SENSE_H:
>  	case LTC2945_MAX_SENSE_THRES_H:
>  	case LTC2945_MIN_SENSE_THRES_H:
> -		return clamp_val(val, 0, LTC2945_SENSE_FULL_SCALE_MA);
> +		return clamp_val(val, 0, st->max_current_ma);
>  	default:
>  		/*
>  		 * This is unlikely to happen, and if it does, it should
> @@ -215,9 +219,8 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
>  	case LTC2945_MAX_POWER_THRES_H:
>  	case LTC2945_MIN_POWER_THRES_H:
>  		/*
> -		 * Convert to register value by assuming current is measured
> -		 * with an 1mOhm sense resistor, similar to current
> -		 * measurements.
> +		 * Convert to register value, scale it with the configured sense
> +		 * resistor value, similar to current measurements.
>  		 * Control register bit 0 selects if voltage at SENSE+/VDD
>  		 * or voltage at ADIN is used to measure power, which in turn
>  		 * determines register calculations.
> @@ -236,6 +239,7 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
>  			 */
>  			val = DIV_ROUND_CLOSEST(val, 25) * 2;
>  		}
> +		val *= st->r_sense_mohm;
>  		break;
>  	case LTC2945_VIN_H:
>  	case LTC2945_MAX_VIN_H:
> @@ -259,12 +263,10 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
>  	case LTC2945_MAX_SENSE_THRES_H:
>  	case LTC2945_MIN_SENSE_THRES_H:
>  		/*
> -		 * 25 uV resolution. Convert to current as measured with
> -		 * an 1 mOhm sense resistor, in mA. If a different sense
> -		 * resistor is installed, calculate the actual current by
> -		 * dividing the reported current by the sense resistor value
> -		 * in mOhm.
> +		 * 25 uV resolution. Convert to current and scale it
> +		 * with the value of the sense resistor, in mA.
>  		 */
> +		val *= st->r_sense_mohm;
>  		val = DIV_ROUND_CLOSEST(val, 25);
>  		break;
>  	default:
> @@ -303,7 +305,7 @@ static ssize_t ltc2945_value_store(struct device *dev,
>  	if (ret)
>  		return ret;
>  
> -	val = ltc2945_val_clamp(reg, val);
> +	val = ltc2945_val_clamp(st, reg, val);
>  
>  	/* convert to register value, then clamp and write result */
>  	regval = ltc2945_val_to_reg(dev, reg, val);
> @@ -512,6 +514,7 @@ static int ltc2945_probe(struct i2c_client *client)
>  	struct ltc2945_state *st;
>  	struct device *hwmon_dev;
>  	struct regmap *regmap;
> +	u64 val64;
>  
>  	st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
>  	if (!st)
> @@ -523,7 +526,22 @@ static int ltc2945_probe(struct i2c_client *client)
>  		return PTR_ERR(regmap);
>  	}
>  
> +	if (device_property_read_u32(dev, "shunt-resistor-micro-ohms",
> +				     &st->r_sense_mohm))
> +		st->r_sense_mohm = 1000;
> +
> +	if (st->r_sense_mohm < 1000) {
> +		dev_err(dev, "Value too small for sense resistor, minimum 1000\n");
> +		return -EINVAL;
> +	}
> +	st->r_sense_mohm /= 1000;
> +
>  	st->regmap = regmap;
> +	val64 = LTC2945_POWER_FULL_SCALE_UW / st->r_sense_mohm;
> +	/* clamp power to ULONG_MAX, since we represent it on 32 bits */
> +	st->max_power_uw = clamp_val(val64, 0, ULONG_MAX);
> +
> +	st->max_current_ma = LTC2945_SENSE_FULL_SCALE_MA / st->r_sense_mohm;
>  
>  	/* Clear faults */
>  	regmap_write(regmap, LTC2945_FAULT, 0x00);
> -- 
> 2.17.1
> 

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

* Re: [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 10:34 [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
                   ` (3 preceding siblings ...)
  2021-01-07 10:34 ` [PATCH v3 4/4] dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945 Alexandru Ardelean
@ 2021-01-07 15:28 ` Guenter Roeck
  4 siblings, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2021-01-07 15:28 UTC (permalink / raw)
  To: Alexandru Ardelean
  Cc: linux-hwmon, devicetree, linux-kernel, robh+dt, jdelvare,
	mark.thoren, ardeleanalex

On Thu, Jan 07, 2021 at 12:34:13PM +0200, Alexandru Ardelean wrote:
> Changeset adds support for sense resistor.
> 
> Changelog v2 -> v3:
> * https://lore.kernel.org/linux-hwmon/20201111091259.46773-1-alexandru.ardelean@analog.com/
> * dropped patch 'docs: hwmon: (ltc2945): change type of val to ULL in ltc2945_val_to_reg()'
> * add patch 'hwmon: (ltc2945): clamp values before converting'
> * for patch 'hwmon: (ltc2945): add support for sense resistor'
>   - sense-resistor is represented in milli-ohms internally; this
>     risks of any other potential overflows with the multiplication to
>     1000; the scaling in the driver becomes simpler, but we can't allow
>     a lower resistor value that 1 mOhm, and all resistor values
>     need to be integer in mOhm.
>   - added max power and max amps limits, adjusted to sense resistor
> * for patch 'dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945 '
>   added 'Reviewed-by: Rob Herring <robh@kernel.org>'
> 
> Alexandru Ardelean (4):
>   hwmon: (ltc2945): wrap regmap into an ltc2945_state struct
>   hwmon: (ltc2945): clamp values before converting
>   hwmon: (ltc2945): add support for sense resistor
>   dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945
> 

As mentioned in patch 3/3, this series solves a generic problem
affecting all hwmon drivers, but it only solves it for one of those
drivers. We should work on a generic solution (in-kernel scaling)
instead, one that works for all hwmon drivers, not just one.

Thanks,
Guenter

>  .../bindings/hwmon/adi,ltc2945.yaml           |  49 +++++++
>  drivers/hwmon/ltc2945.c                       | 128 +++++++++++++++---
>  2 files changed, 156 insertions(+), 21 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ltc2945.yaml
> 
> -- 
> 2.17.1
> 

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 15:25   ` Guenter Roeck
@ 2021-01-07 15:44     ` Alexandru Ardelean
  2021-01-07 17:35       ` Guenter Roeck
  0 siblings, 1 reply; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-07 15:44 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Alexandru Ardelean, linux-hwmon, devicetree, LKML, Rob Herring,
	jdelvare, Thoren, Mark

On Thu, Jan 7, 2021 at 5:25 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Thu, Jan 07, 2021 at 12:34:16PM +0200, Alexandru Ardelean wrote:
> > The sense resistor is a parameter of the board. It should be configured in
> > the driver via a device-tree / ACPI property, so that the proper current
> > measurements can be done in the driver.
> >
> > It shouldn't be necessary that userspace need to know about the value of
> > the resistor. It makes things a bit harder to make the application code
> > portable from one board to another.
> >
> > This change implements support for the sense resistor to be configured from
> > DT/ACPI and used in current calculations.
> > Also, the maximum power and current that can be represented by the driver
> > are scaled with the value of the sense resistor.
> >
>
> In a way you are correct, but that applies to all hwmon
> drivers, not just to this one. A solution which only applies
> to a single driver doesn't solve the underlying problem,
> which would be the desire or need to provide kernel-based
> scaling for hwmon drivers. As such, I am not inclined to accept
> this patch. We should think about a generic solution instead.

I agree that scaling is an issue with hwmon [seeing as how IIO does it already].
Maybe I can adapt some things from IIO.
But I can't promise/commit to it quite yet.

>
> Note that this patch doesn't compile on 32-bit targets.

Yeah, my bad.
I only tested with  make allmodconfig, and that doesn't do a good job
at providing linker issues.

>
> Thanks,
> Guenter
>
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> >  drivers/hwmon/ltc2945.c | 60 ++++++++++++++++++++++++++---------------
> >  1 file changed, 39 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c
> > index 41df2c8b7673..e60b15832b0e 100644
> > --- a/drivers/hwmon/ltc2945.c
> > +++ b/drivers/hwmon/ltc2945.c
> > @@ -70,9 +70,15 @@
> >  /**
> >   * struct ltc2945_state - driver instance specific data
> >   * @regmap:          regmap object to access device registers
> > + * @max_power_uw:    maximum power that can be represented based on sense resistor
> > + * @max_current_ma:  maximum current that can be represented based on sense resistor
> > + * @r_sense_mohm:    current sense resistor value
> >   */
> >  struct ltc2945_state {
> >       struct regmap           *regmap;
> > +     u32                     max_power_uw;
> > +     u32                     max_current_ma;
> > +     u32                     r_sense_mohm;
> >  };
> >
> >  static inline bool is_power_reg(u8 reg)
> > @@ -110,9 +116,8 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
> >       case LTC2945_MAX_POWER_THRES_H:
> >       case LTC2945_MIN_POWER_THRES_H:
> >               /*
> > -              * Convert to uW by assuming current is measured with
> > -              * an 1mOhm sense resistor, similar to current
> > -              * measurements.
> > +              * Convert to uW by and scale it with the configured
> > +              * sense resistor, similar to current measurements.
> >                * Control register bit 0 selects if voltage at SENSE+/VDD
> >                * or voltage at ADIN is used to measure power.
> >                */
> > @@ -126,6 +131,7 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
> >                       /* 0.5 mV * 25 uV = 0.0125 uV resolution. */
> >                       val = (val * 25LL) >> 1;
> >               }
> > +             val /= st->r_sense_mohm;
> >               break;
> >       case LTC2945_VIN_H:
> >       case LTC2945_MAX_VIN_H:
> > @@ -149,13 +155,11 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
> >       case LTC2945_MAX_SENSE_THRES_H:
> >       case LTC2945_MIN_SENSE_THRES_H:
> >               /*
> > -              * 25 uV resolution. Convert to current as measured with
> > -              * an 1 mOhm sense resistor, in mA. If a different sense
> > -              * resistor is installed, calculate the actual current by
> > -              * dividing the reported current by the sense resistor value
> > -              * in mOhm.
> > +              * 25 uV resolution. Convert to current and scale it
> > +              * with the value of the sense resistor.
> >                */
> >               val *= 25;
> > +             val /= st->r_sense_mohm;
> >               break;
> >       default:
> >               return -EINVAL;
> > @@ -163,7 +167,8 @@ static long long ltc2945_reg_to_val(struct device *dev, u8 reg)
> >       return val;
> >  }
> >
> > -static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
> > +static unsigned long ltc2945_val_clamp(struct ltc2945_state *st, u8 reg,
> > +                                    unsigned long val)
> >  {
> >       switch (reg) {
> >       case LTC2945_POWER_H:
> > @@ -171,8 +176,7 @@ static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
> >       case LTC2945_MIN_POWER_H:
> >       case LTC2945_MAX_POWER_THRES_H:
> >       case LTC2945_MIN_POWER_THRES_H:
> > -             /* No sense in clamping now, LTC2945_POWER_FULL_SCALE_UW is larger than UINT32_MAX */
> > -             return val;
> > +             return clamp_val(val, 0, st->max_power_uw);
> >       case LTC2945_VIN_H:
> >       case LTC2945_MAX_VIN_H:
> >       case LTC2945_MIN_VIN_H:
> > @@ -190,7 +194,7 @@ static unsigned long ltc2945_val_clamp(u8 reg, unsigned long val)
> >       case LTC2945_MIN_SENSE_H:
> >       case LTC2945_MAX_SENSE_THRES_H:
> >       case LTC2945_MIN_SENSE_THRES_H:
> > -             return clamp_val(val, 0, LTC2945_SENSE_FULL_SCALE_MA);
> > +             return clamp_val(val, 0, st->max_current_ma);
> >       default:
> >               /*
> >                * This is unlikely to happen, and if it does, it should
> > @@ -215,9 +219,8 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
> >       case LTC2945_MAX_POWER_THRES_H:
> >       case LTC2945_MIN_POWER_THRES_H:
> >               /*
> > -              * Convert to register value by assuming current is measured
> > -              * with an 1mOhm sense resistor, similar to current
> > -              * measurements.
> > +              * Convert to register value, scale it with the configured sense
> > +              * resistor value, similar to current measurements.
> >                * Control register bit 0 selects if voltage at SENSE+/VDD
> >                * or voltage at ADIN is used to measure power, which in turn
> >                * determines register calculations.
> > @@ -236,6 +239,7 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
> >                        */
> >                       val = DIV_ROUND_CLOSEST(val, 25) * 2;
> >               }
> > +             val *= st->r_sense_mohm;
> >               break;
> >       case LTC2945_VIN_H:
> >       case LTC2945_MAX_VIN_H:
> > @@ -259,12 +263,10 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg,
> >       case LTC2945_MAX_SENSE_THRES_H:
> >       case LTC2945_MIN_SENSE_THRES_H:
> >               /*
> > -              * 25 uV resolution. Convert to current as measured with
> > -              * an 1 mOhm sense resistor, in mA. If a different sense
> > -              * resistor is installed, calculate the actual current by
> > -              * dividing the reported current by the sense resistor value
> > -              * in mOhm.
> > +              * 25 uV resolution. Convert to current and scale it
> > +              * with the value of the sense resistor, in mA.
> >                */
> > +             val *= st->r_sense_mohm;
> >               val = DIV_ROUND_CLOSEST(val, 25);
> >               break;
> >       default:
> > @@ -303,7 +305,7 @@ static ssize_t ltc2945_value_store(struct device *dev,
> >       if (ret)
> >               return ret;
> >
> > -     val = ltc2945_val_clamp(reg, val);
> > +     val = ltc2945_val_clamp(st, reg, val);
> >
> >       /* convert to register value, then clamp and write result */
> >       regval = ltc2945_val_to_reg(dev, reg, val);
> > @@ -512,6 +514,7 @@ static int ltc2945_probe(struct i2c_client *client)
> >       struct ltc2945_state *st;
> >       struct device *hwmon_dev;
> >       struct regmap *regmap;
> > +     u64 val64;
> >
> >       st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
> >       if (!st)
> > @@ -523,7 +526,22 @@ static int ltc2945_probe(struct i2c_client *client)
> >               return PTR_ERR(regmap);
> >       }
> >
> > +     if (device_property_read_u32(dev, "shunt-resistor-micro-ohms",
> > +                                  &st->r_sense_mohm))
> > +             st->r_sense_mohm = 1000;
> > +
> > +     if (st->r_sense_mohm < 1000) {
> > +             dev_err(dev, "Value too small for sense resistor, minimum 1000\n");
> > +             return -EINVAL;
> > +     }
> > +     st->r_sense_mohm /= 1000;
> > +
> >       st->regmap = regmap;
> > +     val64 = LTC2945_POWER_FULL_SCALE_UW / st->r_sense_mohm;
> > +     /* clamp power to ULONG_MAX, since we represent it on 32 bits */
> > +     st->max_power_uw = clamp_val(val64, 0, ULONG_MAX);
> > +
> > +     st->max_current_ma = LTC2945_SENSE_FULL_SCALE_MA / st->r_sense_mohm;
> >
> >       /* Clear faults */
> >       regmap_write(regmap, LTC2945_FAULT, 0x00);
> > --
> > 2.17.1
> >

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 15:44     ` Alexandru Ardelean
@ 2021-01-07 17:35       ` Guenter Roeck
  2021-01-08  9:18         ` Alexandru Ardelean
  0 siblings, 1 reply; 15+ messages in thread
From: Guenter Roeck @ 2021-01-07 17:35 UTC (permalink / raw)
  To: Alexandru Ardelean
  Cc: Alexandru Ardelean, linux-hwmon, devicetree, LKML, Rob Herring,
	jdelvare, Thoren, Mark

On Thu, Jan 07, 2021 at 05:44:33PM +0200, Alexandru Ardelean wrote:
> >
> > Note that this patch doesn't compile on 32-bit targets.
> 
> Yeah, my bad.
> I only tested with  make allmodconfig, and that doesn't do a good job
> at providing linker issues.
> 
The problem is the 64-bit divide operation introduced with your patch.
You'd see that if you build allmodconfig with ARCH=i386.

Guenter

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

* Re: [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor
  2021-01-07 17:35       ` Guenter Roeck
@ 2021-01-08  9:18         ` Alexandru Ardelean
  0 siblings, 0 replies; 15+ messages in thread
From: Alexandru Ardelean @ 2021-01-08  9:18 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Alexandru Ardelean, linux-hwmon, devicetree, LKML, Rob Herring,
	jdelvare, Thoren, Mark

On Thu, Jan 7, 2021 at 7:35 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Thu, Jan 07, 2021 at 05:44:33PM +0200, Alexandru Ardelean wrote:
> > >
> > > Note that this patch doesn't compile on 32-bit targets.
> >
> > Yeah, my bad.
> > I only tested with  make allmodconfig, and that doesn't do a good job
> > at providing linker issues.
> >
> The problem is the 64-bit divide operation introduced with your patch.
> You'd see that if you build allmodconfig with ARCH=i386.

Oh, right.
That thought actually escaped me.

Thanks for the tip
Alex

>
> Guenter

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

end of thread, other threads:[~2021-01-08  9:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 10:34 [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
2021-01-07 10:34 ` [PATCH v3 1/4] hwmon: (ltc2945): wrap regmap into an ltc2945_state struct Alexandru Ardelean
2021-01-07 10:34 ` [PATCH v3 2/4] hwmon: (ltc2945): clamp values before converting Alexandru Ardelean
2021-01-07 10:34 ` [PATCH v3 3/4] hwmon: (ltc2945): add support for sense resistor Alexandru Ardelean
2021-01-07 13:28   ` kernel test robot
2021-01-07 13:28     ` kernel test robot
2021-01-07 14:10     ` Alexandru Ardelean
2021-01-07 14:23   ` kernel test robot
2021-01-07 14:23     ` kernel test robot
2021-01-07 15:25   ` Guenter Roeck
2021-01-07 15:44     ` Alexandru Ardelean
2021-01-07 17:35       ` Guenter Roeck
2021-01-08  9:18         ` Alexandru Ardelean
2021-01-07 10:34 ` [PATCH v3 4/4] dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945 Alexandru Ardelean
2021-01-07 15:28 ` [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.