All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Add MPS MP5920 Host-Swap controller
       [not found] <20240702115252.981416-1-xzeol.ref@yahoo.com>
@ 2024-07-02 11:52 ` Alex Vdovydchenko
  2024-07-02 11:52   ` [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920 Alex Vdovydchenko
  2024-07-02 11:52   ` [PATCH v4 2/2] hwmon: add MP5920 driver Alex Vdovydchenko
  0 siblings, 2 replies; 11+ messages in thread
From: Alex Vdovydchenko @ 2024-07-02 11:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sean Anderson,
	Guenter Roeck, Jean Delvare, Jonathan Corbet, Delphine CC Chiu
  Cc: devicetree, linux-kernel, linux-hwmon, linux-doc, linux-i2c,
	Alex Vdovydchenko

This series of patches adds the MP5920 Host-swap controller, which is used
as a protection and control IC for devices that are being inserted into a live
backplane. MP5920 acts as a voltage regulator (MP5911 etc) supervisor. IC
utilizes pmbus and provides monitoring, statistics and limits to electrical and
thermal characteristics such as:
- input and output voltage
- output current
- output power
- IC temperature

One must take into account the nonlinear character of readings, so there will be
a statistical error in the range 5–10 percents, depending on current passing
through. In order to use the IC, make sure to specify a valid I2C address
(consult to datasheet and dts-bindings)
MP5920 datasheet: https://www.monolithicpower.com/en/mp5920.html

Changes in v2:
  -  fixed typos
Changes in v3:
  -  removed unnecessary license blob
  -  removed unnecessary headers
  -  edited device tables style
  -  added chip name checking in probing
  -  fixed typos in pmbus_driver_info struct initialization
Changes in v4:
  -  added i2c_check_functionality in probing
  -  refactored usage of dev_err_probe insted of dev_err
  -  edited chip name string handling while printing
  -  restored .driver.of_match_table, keeping i2c_driver "old" style

Alex Vdovydchenko (2):
  dt-bindings: hwmon: Add MPS mp5920
  hwmon: add MP5920 driver

 .../devicetree/bindings/trivial-devices.yaml  |  2 +
 Documentation/hwmon/index.rst                 |  1 +
 Documentation/hwmon/mp5920.rst                | 91 ++++++++++++++++++
 drivers/hwmon/pmbus/Kconfig                   |  9 ++
 drivers/hwmon/pmbus/Makefile                  |  1 +
 drivers/hwmon/pmbus/mp5920.c                  | 93 +++++++++++++++++++
 6 files changed, 197 insertions(+)
 create mode 100644 Documentation/hwmon/mp5920.rst
 create mode 100644 drivers/hwmon/pmbus/mp5920.c

-- 
2.43.0


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

* [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920
  2024-07-02 11:52 ` [PATCH v4 0/2] Add MPS MP5920 Host-Swap controller Alex Vdovydchenko
@ 2024-07-02 11:52   ` Alex Vdovydchenko
  2024-07-02 13:10     ` Krzysztof Kozlowski
  2024-07-02 19:29     ` Guenter Roeck
  2024-07-02 11:52   ` [PATCH v4 2/2] hwmon: add MP5920 driver Alex Vdovydchenko
  1 sibling, 2 replies; 11+ messages in thread
From: Alex Vdovydchenko @ 2024-07-02 11:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sean Anderson,
	Guenter Roeck, Jean Delvare, Jonathan Corbet, Delphine CC Chiu
  Cc: devicetree, linux-kernel, linux-hwmon, linux-doc, linux-i2c,
	Alex Vdovydchenko

Add support for MPS mp5920 controller

Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index ff70f0926..cb2fc26d9 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -296,6 +296,8 @@ properties:
           - mps,mp2975
             # Monolithic Power Systems Inc. multi-phase controller mp2993
           - mps,mp2993
+            # Monolithic Power Systems Inc. multi-phase hot-swap controller mp5920
+          - mps,mp5920
             # Monolithic Power Systems Inc. multi-phase hot-swap controller mp5990
           - mps,mp5990
             # Monolithic Power Systems Inc. digital step-down converter mp9941
-- 
2.43.0


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

* [PATCH v4 2/2] hwmon: add MP5920 driver
  2024-07-02 11:52 ` [PATCH v4 0/2] Add MPS MP5920 Host-Swap controller Alex Vdovydchenko
  2024-07-02 11:52   ` [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920 Alex Vdovydchenko
@ 2024-07-02 11:52   ` Alex Vdovydchenko
  2024-07-02 19:00     ` Thomas Weißschuh
                       ` (3 more replies)
  1 sibling, 4 replies; 11+ messages in thread
From: Alex Vdovydchenko @ 2024-07-02 11:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sean Anderson,
	Guenter Roeck, Jean Delvare, Jonathan Corbet, Delphine CC Chiu
  Cc: devicetree, linux-kernel, linux-hwmon, linux-doc, linux-i2c,
	Alex Vdovydchenko

Add support for MPS Hot-Swap controller mp5920. This driver exposes
telemetry and limit value readings and writings.

Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
---
 Documentation/hwmon/index.rst  |  1 +
 Documentation/hwmon/mp5920.rst | 91 +++++++++++++++++++++++++++++++++
 drivers/hwmon/pmbus/Kconfig    |  9 ++++
 drivers/hwmon/pmbus/Makefile   |  1 +
 drivers/hwmon/pmbus/mp5920.c   | 93 ++++++++++++++++++++++++++++++++++
 5 files changed, 195 insertions(+)
 create mode 100644 Documentation/hwmon/mp5920.rst
 create mode 100644 drivers/hwmon/pmbus/mp5920.c

diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index e92a3d5c7..9eba7e402 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -168,6 +168,7 @@ Hardware Monitoring Kernel Drivers
    mp2975
    mp2993
    mp5023
+   mp5920
    mp5990
    mp9941
    mpq8785
--- /dev/null
+++ b/Documentation/hwmon/mp5920.rst
@@ -0,0 +1,91 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Kernel driver mp5920
+====================
+
+Supported chips:
+
+  * MPS MP5920
+
+    Prefix: 'mp5920'
+
+  * Datasheet
+
+    Publicly available at the MPS website : https://www.monolithicpower.com/en/mp5920.html
+
+Authors:
+
+	Tony Ao <tony_ao@wiwynn.com>
+	Alex Vdovydchenko <xzeol@yahoo.com>
+
+Description
+-----------
+
+This driver implements support for Monolithic Power Systems, Inc. (MPS)
+MP5920 Hot-Swap Controller.
+
+Device compliant with:
+
+- PMBus rev 1.3 interface.
+
+Device supports direct and linear format for reading input voltage,
+output voltage, output current, input power and temperature.
+
+The driver exports the following attributes via the 'sysfs' files
+for input voltage:
+
+**in1_input**
+
+**in1_label**
+
+**in1_rated_max**
+
+**in1_rated_min**
+
+**in1_crit**
+
+**in1_alarm**
+
+The driver provides the following attributes for output voltage:
+
+**in2_input**
+
+**in2_label**
+
+**in2_rated_max**
+
+**in2_rated_min**
+
+**in2_alarm**
+
+The driver provides the following attributes for output current:
+
+**curr1_input**
+
+**curr1_label**
+
+**curr1_crit**
+
+**curr1_alarm**
+
+**curr1_rated_max**
+
+The driver provides the following attributes for input power:
+
+**power1_input**
+
+**power1_label**
+
+**power1_max**
+
+**power1_rated_max**
+
+The driver provides the following attributes for temperature:
+
+**temp1_input**
+
+**temp1_max**
+
+**temp1_crit**
+
+**temp1_alarm**
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -371,6 +371,15 @@ config SENSORS_MP5023
 	  This driver can also be built as a module. If so, the module will
 	  be called mp5023.
 
+config SENSORS_MP5920
+	tristate "MPS MP5920"
+	help
+	  If you say yes here you get hardware monitoring support for Monolithic
+	  MP5920.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called mp5920.
+
 config SENSORS_MP5990
 	tristate "MPS MP5990"
 	help
--- a/drivers/hwmon/pmbus/Makefile
+++ b/drivers/hwmon/pmbus/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_SENSORS_MP2888)	+= mp2888.o
 obj-$(CONFIG_SENSORS_MP2975)	+= mp2975.o
 obj-$(CONFIG_SENSORS_MP2993)	+= mp2993.o
 obj-$(CONFIG_SENSORS_MP5023)	+= mp5023.o
+obj-$(CONFIG_SENSORS_MP5920)	+= mp5920.o
 obj-$(CONFIG_SENSORS_MP5990)	+= mp5990.o
 obj-$(CONFIG_SENSORS_MP9941)	+= mp9941.o
 obj-$(CONFIG_SENSORS_MPQ7932)	+= mpq7932.o
--- /dev/null
+++ b/drivers/hwmon/pmbus/mp5920.c
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include "pmbus.h"
+
+static struct pmbus_driver_info mp5920_info = {
+	.pages = 1,
+	.format[PSC_VOLTAGE_IN] = direct,
+	.format[PSC_VOLTAGE_OUT] = direct,
+	.format[PSC_CURRENT_OUT] = direct,
+	.format[PSC_POWER] = direct,
+	.format[PSC_TEMPERATURE] = direct,
+	.m[PSC_VOLTAGE_IN] = 2266,
+	.b[PSC_VOLTAGE_IN] = 0,
+	.R[PSC_VOLTAGE_IN] = -1,
+	.m[PSC_VOLTAGE_OUT] = 2266,
+	.b[PSC_VOLTAGE_OUT] = 0,
+	.R[PSC_VOLTAGE_OUT] = -1,
+	.m[PSC_CURRENT_OUT] = 546,
+	.b[PSC_CURRENT_OUT] = 0,
+	.R[PSC_CURRENT_OUT] = -2,
+	.m[PSC_POWER] = 5840,
+	.b[PSC_POWER] = 0,
+	.R[PSC_POWER] = -3,
+	.m[PSC_TEMPERATURE] = 1067,
+	.b[PSC_TEMPERATURE] = 20500,
+	.R[PSC_TEMPERATURE] = -2,
+	.func[0] = PMBUS_HAVE_VIN  | PMBUS_HAVE_VOUT |
+		PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT |
+		PMBUS_HAVE_TEMP,
+};
+
+static int mp5920_probe(struct i2c_client *client)
+{
+	struct device *dev =  &client->dev;
+	int ret;
+	u8 buf[I2C_SMBUS_BLOCK_MAX];
+
+	if (!i2c_check_functionality(client->adapter,
+				     I2C_FUNC_SMBUS_READ_WORD_DATA))
+		return -ENODEV;
+
+	ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, buf);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to read PMBUS_MFR_MODEL\n");
+
+	if (ret != 6 || strncmp(buf, "MP5920", 6)) {
+		return dev_err_probe(dev, -ENODEV, "Model '%.*s' not supported\n",
+				     sizeof(buf), buf);
+	}
+
+	return pmbus_do_probe(client, &mp5920_info);
+}
+
+static const struct of_device_id mp5920_of_match[] = {
+	{ .compatible = "mps,mp5920" },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(of, mp5920_of_match);
+
+static const struct i2c_device_id mp5920_id[] = {
+	{ "mp5920" },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(i2c, mp5920_id);
+
+static struct i2c_driver mp5920_driver = {
+	.driver = {
+		.name = "mp5920",
+		.of_match_table = mp5920_of_match,
+	},
+	.probe = mp5920_probe,
+	.id_table = mp5920_id,
+};
+
+module_i2c_driver(mp5920_driver);
+
+MODULE_AUTHOR("Tony Ao <tony_ao@wiwynn.com>");
+MODULE_AUTHOR("Alex Vdovydchenko <xzeol@yahoo.com>");
+MODULE_DESCRIPTION("PMBus driver for MP5920 HSC");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(PMBUS);
-- 
2.43.0


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

* Re: [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920
  2024-07-02 11:52   ` [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920 Alex Vdovydchenko
@ 2024-07-02 13:10     ` Krzysztof Kozlowski
  2024-07-02 19:29     ` Guenter Roeck
  1 sibling, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-02 13:10 UTC (permalink / raw)
  To: Alex Vdovydchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Sean Anderson, Guenter Roeck, Jean Delvare, Jonathan Corbet,
	Delphine CC Chiu
  Cc: devicetree, linux-kernel, linux-hwmon, linux-doc, linux-i2c

On 02/07/2024 13:52, Alex Vdovydchenko wrote:
> Add support for MPS mp5920 controller
> 
> Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>

So you keep ignoring and ignoring?

<form letter>
This is a friendly reminder during the review process.

It looks like you received a tag and forgot to add it.

If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions, under or above your Signed-off-by tag. Tag is "received", when
provided in a message replied to you on the mailing list. Tools like b4
can help here. However, there's no need to repost patches *only* to add
the tags. The upstream maintainer will do that for tags received on the
version they apply.

https://elixir.bootlin.com/linux/v6.5-rc3/source/Documentation/process/submitting-patches.rst#L577

If a tag was not added on purpose, please state why and what changed.
</form letter>

Best regards,
Krzysztof


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

* Re: [PATCH v4 2/2] hwmon: add MP5920 driver
  2024-07-02 11:52   ` [PATCH v4 2/2] hwmon: add MP5920 driver Alex Vdovydchenko
@ 2024-07-02 19:00     ` Thomas Weißschuh
  2024-07-02 19:39       ` Guenter Roeck
  2024-07-02 19:36     ` Guenter Roeck
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2024-07-02 19:00 UTC (permalink / raw)
  To: Alex Vdovydchenko
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sean Anderson,
	Guenter Roeck, Jean Delvare, Jonathan Corbet, Delphine CC Chiu,
	devicetree, linux-kernel, linux-hwmon, linux-doc, linux-i2c

On 2024-07-02 14:52:51+0000, Alex Vdovydchenko wrote:
> Add support for MPS Hot-Swap controller mp5920. This driver exposes
> telemetry and limit value readings and writings.
> 
> Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
> ---
>  Documentation/hwmon/index.rst  |  1 +
>  Documentation/hwmon/mp5920.rst | 91 +++++++++++++++++++++++++++++++++
>  drivers/hwmon/pmbus/Kconfig    |  9 ++++
>  drivers/hwmon/pmbus/Makefile   |  1 +
>  drivers/hwmon/pmbus/mp5920.c   | 93 ++++++++++++++++++++++++++++++++++
>  5 files changed, 195 insertions(+)
>  create mode 100644 Documentation/hwmon/mp5920.rst
>  create mode 100644 drivers/hwmon/pmbus/mp5920.c

The entry in MAINTAINERS seems to be missing.

Otherwise:

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>

<snip>

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

* Re: [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920
  2024-07-02 11:52   ` [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920 Alex Vdovydchenko
  2024-07-02 13:10     ` Krzysztof Kozlowski
@ 2024-07-02 19:29     ` Guenter Roeck
  2024-07-03 15:49       ` Conor Dooley
  1 sibling, 1 reply; 11+ messages in thread
From: Guenter Roeck @ 2024-07-02 19:29 UTC (permalink / raw)
  To: Alex Vdovydchenko
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sean Anderson,
	Jean Delvare, Jonathan Corbet, Delphine CC Chiu, devicetree,
	linux-kernel, linux-hwmon, linux-doc, linux-i2c

On Tue, Jul 02, 2024 at 02:52:50PM +0300, Alex Vdovydchenko wrote:
> Add support for MPS mp5920 controller
> 
> Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
> ---

Applied, after adding Conor's Ack from v3.

Guenter

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

* Re: [PATCH v4 2/2] hwmon: add MP5920 driver
  2024-07-02 11:52   ` [PATCH v4 2/2] hwmon: add MP5920 driver Alex Vdovydchenko
  2024-07-02 19:00     ` Thomas Weißschuh
@ 2024-07-02 19:36     ` Guenter Roeck
  2024-07-03  4:53     ` kernel test robot
  2024-07-03  5:27     ` kernel test robot
  3 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2024-07-02 19:36 UTC (permalink / raw)
  To: Alex Vdovydchenko
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sean Anderson,
	Jean Delvare, Jonathan Corbet, Delphine CC Chiu, devicetree,
	linux-kernel, linux-hwmon, linux-doc, linux-i2c

On Tue, Jul 02, 2024 at 02:52:51PM +0300, Alex Vdovydchenko wrote:
> Add support for MPS Hot-Swap controller mp5920. This driver exposes
> telemetry and limit value readings and writings.
> 
> Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>

Applied.

Guenter

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

* Re: [PATCH v4 2/2] hwmon: add MP5920 driver
  2024-07-02 19:00     ` Thomas Weißschuh
@ 2024-07-02 19:39       ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2024-07-02 19:39 UTC (permalink / raw)
  To: Thomas Weißschuh, Alex Vdovydchenko
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sean Anderson,
	Jean Delvare, Jonathan Corbet, Delphine CC Chiu, devicetree,
	linux-kernel, linux-hwmon, linux-doc, linux-i2c

On 7/2/24 12:00, Thomas Weißschuh wrote:
> On 2024-07-02 14:52:51+0000, Alex Vdovydchenko wrote:
>> Add support for MPS Hot-Swap controller mp5920. This driver exposes
>> telemetry and limit value readings and writings.
>>
>> Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
>> ---
>>   Documentation/hwmon/index.rst  |  1 +
>>   Documentation/hwmon/mp5920.rst | 91 +++++++++++++++++++++++++++++++++
>>   drivers/hwmon/pmbus/Kconfig    |  9 ++++
>>   drivers/hwmon/pmbus/Makefile   |  1 +
>>   drivers/hwmon/pmbus/mp5920.c   | 93 ++++++++++++++++++++++++++++++++++
>>   5 files changed, 195 insertions(+)
>>   create mode 100644 Documentation/hwmon/mp5920.rst
>>   create mode 100644 drivers/hwmon/pmbus/mp5920.c
> 
> The entry in MAINTAINERS seems to be missing.
> 

That isn't mandatory; checkpatch asks for it, but I prefer not to have it
in the first place if the submitter doesn't really plan to maintain it.

> Otherwise:
> 
> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
> 

Thanks,
Guenter


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

* Re: [PATCH v4 2/2] hwmon: add MP5920 driver
  2024-07-02 11:52   ` [PATCH v4 2/2] hwmon: add MP5920 driver Alex Vdovydchenko
  2024-07-02 19:00     ` Thomas Weißschuh
  2024-07-02 19:36     ` Guenter Roeck
@ 2024-07-03  4:53     ` kernel test robot
  2024-07-03  5:27     ` kernel test robot
  3 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2024-07-03  4:53 UTC (permalink / raw)
  To: Alex Vdovydchenko; +Cc: oe-kbuild-all

Hi Alex,

kernel test robot noticed the following build warnings:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on next-20240702]
[cannot apply to robh/for-next krzk-dt/for-next linus/master v6.10-rc6]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Alex-Vdovydchenko/dt-bindings-hwmon-Add-MPS-mp5920/20240702-202656
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/20240702115252.981416-3-xzeol%40yahoo.com
patch subject: [PATCH v4 2/2] hwmon: add MP5920 driver
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20240703/202407031245.ZIvUCyeR-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240703/202407031245.ZIvUCyeR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407031245.ZIvUCyeR-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/hwmon/pmbus/mp5920.c: In function 'mp5920_probe':
>> drivers/hwmon/pmbus/mp5920.c:49:62: warning: field precision specifier '.*' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
      49 |                 return dev_err_probe(dev, -ENODEV, "Model '%.*s' not supported\n",
         |                                                            ~~^~
         |                                                              |
         |                                                              int
      50 |                                      sizeof(buf), buf);
         |                                      ~~~~~~~~~~~              
         |                                      |
         |                                      long unsigned int


vim +49 drivers/hwmon/pmbus/mp5920.c

    33	
    34	static int mp5920_probe(struct i2c_client *client)
    35	{
    36		struct device *dev =  &client->dev;
    37		int ret;
    38		u8 buf[I2C_SMBUS_BLOCK_MAX];
    39	
    40		if (!i2c_check_functionality(client->adapter,
    41					     I2C_FUNC_SMBUS_READ_WORD_DATA))
    42			return -ENODEV;
    43	
    44		ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, buf);
    45		if (ret < 0)
    46			return dev_err_probe(dev, ret, "Failed to read PMBUS_MFR_MODEL\n");
    47	
    48		if (ret != 6 || strncmp(buf, "MP5920", 6)) {
  > 49			return dev_err_probe(dev, -ENODEV, "Model '%.*s' not supported\n",
    50					     sizeof(buf), buf);
    51		}
    52	
    53		return pmbus_do_probe(client, &mp5920_info);
    54	}
    55	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH v4 2/2] hwmon: add MP5920 driver
  2024-07-02 11:52   ` [PATCH v4 2/2] hwmon: add MP5920 driver Alex Vdovydchenko
                       ` (2 preceding siblings ...)
  2024-07-03  4:53     ` kernel test robot
@ 2024-07-03  5:27     ` kernel test robot
  3 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2024-07-03  5:27 UTC (permalink / raw)
  To: Alex Vdovydchenko; +Cc: llvm, oe-kbuild-all

Hi Alex,

kernel test robot noticed the following build warnings:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on next-20240702]
[cannot apply to robh/for-next krzk-dt/for-next linus/master v6.10-rc6]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Alex-Vdovydchenko/dt-bindings-hwmon-Add-MPS-mp5920/20240702-202656
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/20240702115252.981416-3-xzeol%40yahoo.com
patch subject: [PATCH v4 2/2] hwmon: add MP5920 driver
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240703/202407031340.i4o4meQh-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 326ba38a991250a8587a399a260b0f7af2c9166a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240703/202407031340.i4o4meQh-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407031340.i4o4meQh-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/hwmon/pmbus/mp5920.c:2:
   In file included from include/linux/i2c.h:13:
   In file included from include/linux/acpi.h:39:
   In file included from include/acpi/acpi_io.h:7:
   In file included from arch/arm64/include/asm/acpi.h:14:
   In file included from include/linux/memblock.h:12:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     500 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     501 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     507 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     508 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     519 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     520 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     528 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     529 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/mp5920.c:49:48: warning: field precision should have type 'int', but argument has type 'unsigned long' [-Wformat]
      49 |                 return dev_err_probe(dev, -ENODEV, "Model '%.*s' not supported\n",
         |                                                            ~~^~
      50 |                                      sizeof(buf), buf);
         |                                      ~~~~~~~~~~~
   6 warnings generated.


vim +49 drivers/hwmon/pmbus/mp5920.c

    33	
    34	static int mp5920_probe(struct i2c_client *client)
    35	{
    36		struct device *dev =  &client->dev;
    37		int ret;
    38		u8 buf[I2C_SMBUS_BLOCK_MAX];
    39	
    40		if (!i2c_check_functionality(client->adapter,
    41					     I2C_FUNC_SMBUS_READ_WORD_DATA))
    42			return -ENODEV;
    43	
    44		ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, buf);
    45		if (ret < 0)
    46			return dev_err_probe(dev, ret, "Failed to read PMBUS_MFR_MODEL\n");
    47	
    48		if (ret != 6 || strncmp(buf, "MP5920", 6)) {
  > 49			return dev_err_probe(dev, -ENODEV, "Model '%.*s' not supported\n",
    50					     sizeof(buf), buf);
    51		}
    52	
    53		return pmbus_do_probe(client, &mp5920_info);
    54	}
    55	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920
  2024-07-02 19:29     ` Guenter Roeck
@ 2024-07-03 15:49       ` Conor Dooley
  0 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2024-07-03 15:49 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Alex Vdovydchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Sean Anderson, Jean Delvare, Jonathan Corbet, Delphine CC Chiu,
	devicetree, linux-kernel, linux-hwmon, linux-doc, linux-i2c

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

On Tue, Jul 02, 2024 at 12:29:07PM -0700, Guenter Roeck wrote:
> On Tue, Jul 02, 2024 at 02:52:50PM +0300, Alex Vdovydchenko wrote:
> > Add support for MPS mp5920 controller
> > 
> > Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
> > ---
> 
> Applied, after adding Conor's Ack from v3.

Thanks :)

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

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

end of thread, other threads:[~2024-07-03 15:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240702115252.981416-1-xzeol.ref@yahoo.com>
2024-07-02 11:52 ` [PATCH v4 0/2] Add MPS MP5920 Host-Swap controller Alex Vdovydchenko
2024-07-02 11:52   ` [PATCH v4 1/2] dt-bindings: hwmon: Add MPS mp5920 Alex Vdovydchenko
2024-07-02 13:10     ` Krzysztof Kozlowski
2024-07-02 19:29     ` Guenter Roeck
2024-07-03 15:49       ` Conor Dooley
2024-07-02 11:52   ` [PATCH v4 2/2] hwmon: add MP5920 driver Alex Vdovydchenko
2024-07-02 19:00     ` Thomas Weißschuh
2024-07-02 19:39       ` Guenter Roeck
2024-07-02 19:36     ` Guenter Roeck
2024-07-03  4:53     ` kernel test robot
2024-07-03  5:27     ` kernel test robot

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.