Add Ampere's Altra SMPro MFD and its child drivers
Subsystems (7)
v6 cover Add Ampere's Altra SMPro MFD and its child drivers
The SMpro co-processor on Ampere Altra processor family is to monitor and report various data included hwmon-related info, RAS errors, and other miscellaneous information. The SMPro MFD driver intializes the register map and instantiates all sub-devices. All the specifics will be handled in the child drivers.
This patch set includes support for Ampere SMpro hwmon, errmon, and misc as the child drivers. The hwmon driver supports accessing various CPU sensors provided by the SMpro co-processor including temperature, power, voltages, and current found on Ampere Altra processor family. The errmon driver supports monitoring and reporting RAS-related errors. The misc driver is to support reporting boot progress and other miscellaneous information.
v6:
+ Introduced smpro-errmon, smpro-misc as smpro-mfd sub-device [Quan]
+ Comments for v5: https://lkml.org/lkml/2021/7/13/49
v5:
+ Introduced the smpro-mfd driver and drop the use of simple-mfd-i2c driver to avoid DT node with no resource in child device DT nodes [Rob]
+ Removed the use of reg DT property in child driver [Quan]
+ Validated ManufactureID when probing smpro-mfd drivers [Quan]
+ As child devices are instantiated by SMPro MFD driver, drop the ManufacturerID checking in child driver, ie: smpro-hwmon [Quan]
+ Revised commit messages [Quan]
v4:
+ Revised commit message [Quan]
+ Fixed build issue found by kernel test robot [Guenter]
+ Returned regmap_read() error code [Guenter]
v3:
+ Supported list of compatible string [Rob]
+ Introduced reg property in DT to specify reg offset [Rob]
+ Updated description and other minor changes in yaml file [Rob]
+ Handled negative temperature value [Guenter]
+ Returned -ENODEV if Manufacturer ID is wrong [Guenter]
+ Refactored smpro_read_string() and smpro_temp_read() [Guenter]
+ Removed smpro_write() function [Guenter]
+ Added minor refactor changes [Quan]
v2:
+ Used 'struct of_device_id's .data attribute [Lee Jones]
+ Removed "virtual" sensors [Guenter]
+ Fixed typo "mili" to "milli", "nanoWatt" to "microWatt" [Guenter]
+ Reported SOC_TDP as "Socket TDP" using max attributes [Guenter]
+ Clarified "highest" meaning in documentation [Guenter]
+ Corrected return error code when host is turn off [Guenter]
+ Reported MEM HOT Threshold for all DIMMs as temp*_crit [Guenter]
+ Removed license info as SPDX-License-Identifier existed [Guenter]
+ Added is_visible() support [Guenter]
+ Used HWMON_CHANNEL_INFO() macro and LABEL attributes [Guenter]
+ Made is_valid_id() return boolean [Guenter]
+ Returned -EPROBE_DEFER when smpro reg inaccessible [Guenter]
+ Removed unnecessary error message when dev register fail [Guenter]
+ Removed Socket TDP sensor [Quan]
+ Changed "ampere,ac01-smpro" to "ampere,smpro" [Quan]
+ Included sensor type and channel in labels [Quan]
+ Refactorized code to fix checkpatch.pl --strict complaint [Quan]
Quan Nguyen (9):
dt-bindings: mfd: Add bindings for Ampere Altra SMPro MFD driver
mfd: smpro-mfd: Adds Ampere's Altra SMpro MFD driver
hwmon: smpro: Add Ampere's Altra smpro-hwmon driver
docs: hwmon: (smpro-hwmon) Add documentation
regmap: Introduces regmap lock helpers
misc: smpro-errmon: Add Ampere's SMpro error monitor driver
docs: misc-devices: (smpro-errmon) Add documentation
misc: smpro-misc: Add Ampere's Altra SMpro misc driver
docs: misc-devices: (smpro-misc) Add documentation
.../devicetree/bindings/mfd/ampere,smpro.yaml | 48 ++ Documentation/hwmon/index.rst | 1 + Documentation/hwmon/smpro-hwmon.rst | 101 ++++ Documentation/misc-devices/index.rst | 2 + Documentation/misc-devices/smpro-errmon.rst | 206 +++++++ Documentation/misc-devices/smpro-misc.rst | 82 +++ drivers/base/regmap/regmap.c | 12 + drivers/hwmon/Kconfig | 8 + drivers/hwmon/Makefile | 1 + drivers/hwmon/smpro-hwmon.c | 463 ++++++++++++++ drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/smpro-mfd.c | 78 +++ drivers/misc/Kconfig | 14 + drivers/misc/Makefile | 2 + drivers/misc/smpro-errmon.c | 571 ++++++++++++++++++ drivers/misc/smpro-misc.c | 177 ++++++ include/linux/regmap.h | 2 + 18 files changed, 1781 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/ampere,smpro.yaml create mode 100644 Documentation/hwmon/smpro-hwmon.rst create mode 100644 Documentation/misc-devices/smpro-errmon.rst create mode 100644 Documentation/misc-devices/smpro-misc.rst create mode 100644 drivers/hwmon/smpro-hwmon.c create mode 100644 drivers/mfd/smpro-mfd.c create mode 100644 drivers/misc/smpro-errmon.c create mode 100644 drivers/misc/smpro-misc.c
Signature · 1 line
2.28.0
PATCH v6 1/9 dt-bindings: mfd: Add bindings for Ampere Altra SMPro MFD driver
Adds device tree bindings for SMPro MFD driver found on the Mt.Jade hardware reference platform with Ampere's Altra Processor family.
The SMpro co-processor on Ampere Altra processor family is to monitor and report various data included hwmon-related info, RAS errors, and other miscellaneous information.
---
Changes in v6:
+ None
Changes in v5:
+ Dropped ../bindings/hwmon/ampere,ac01-hwmon.yaml file [Quan]
+ Removed patternProperties section and child DT nodes in example section [Quan]
+ Revised commit message [Quan]
Changes in v4:
+ Revised the commit message to clarify how the specific info will be handled commented by Rob.
Changes in v3:
+ Supported list of compatible string [Rob]
+ Introduced reg property in DT to specify reg offset [Rob]
+ Updated description and other minor changes in yaml file [Rob]
Changes in v2:
+ Changed "ampere,ac01-smpro" to "ampere,smpro" [Quan]
.../devicetree/bindings/mfd/ampere,smpro.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/ampere,smpro.yaml
Documentation/devicetree/bindings/mfd/ampere,smpro.yaml new file +48 -0
@@ -0,0 +1,48 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/ampere,smpro.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ampere Altra SMPro firmware driver + +maintainers: + - Quan Nguyen <[email protected]> + +description: | + Ampere Altra SMPro firmware may contain different blocks like hardware + monitoring, error monitoring and other miscellaneous features. + +properties: + compatible: + enum: + - ampere,smpro + + reg: + description: + I2C device address. + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + smpro at 4f { + compatible = "ampere,smpro"; + reg = <0x4f>; + }; + };
Signature · 1 line
2.28.0
PATCH v6 2/9 mfd: smpro-mfd: Adds Ampere's Altra SMpro MFD driver
In reply to Quan NguyenAdds Multi-function devices driver for SMpro co-processor found on the Mt.Jade hardware reference platform with Ampere's Altra processor family.
---
Changes in v6:
+ Update license part to reflect that this driver is clone from simple-mfd-i2c driver [Quan]
Changes in v5:
+ Dropped the use of simple-mfd-i2c driver [Quan]
+ Introduced drivers/mfd/smpro-mfd.c driver to instantiate sub-devices. This is to avoid DT nodes without resource issue [Quan]
+ Revised commit message [Quan]
Changes in v4:
+ Add "depends on I2C" to fix build issue found by kernel test robot [Guenter]
Changes in v3:
+ None
Changes in v2:
+ Used 'struct of_device_id's .data attribute [Lee Jones]
drivers/mfd/Kconfig | 12 +++++++ drivers/mfd/Makefile | 1 + drivers/mfd/smpro-mfd.c | 76 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 drivers/mfd/smpro-mfd.c
drivers/mfd/Kconfig +12 -0
@@ -77,6 +77,18 @@ config MFD_AS3711 help Support for the AS3711 PMIC from AMS +config MFD_SMPRO + tristate "Ampere Computing MFD SMpro core driver" + depends on I2C + select MFD_CORE + select REGMAP_I2C + help + Say yes here to enable SMpro driver support for Ampere's Altra + processor family. + + Ampere's Altra SMpro exposes an I2C regmap interface that can + be accessed by child devices. + config MFD_AS3722 tristate "ams AS3722 Power Management IC" select MFD_CORE
drivers/mfd/Makefile +1 -0
@@ -267,6 +267,7 @@ obj-$(CONFIG_MFD_QCOM_PM8008) += qcom-pm8008.o obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o +obj-$(CONFIG_MFD_SMPRO) += smpro-mfd.o obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o
drivers/mfd/smpro-mfd.c new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.28.0
Re: [PATCH v6 2/9] mfd: smpro-mfd: Adds Ampere's Altra SMpro MFD driver
Quoted 72 lines · Quan Nguyen
Adds Multi-function devices driver for SMpro co-processor found on the Mt.Jade hardware reference platform with Ampere's Altra processor family.
Signed-off-by Quan Nguyen <[email protected]>---
Changes in v6:
+ Update license part to reflect that this driver is clone from simple-mfd-i2c driver [Quan]Changes in v5:
+ Dropped the use of simple-mfd-i2c driver [Quan]
+ Introduceddrivers/mfd/smpro-mfd.cdriver to instantiate sub-devices. This is to avoid DT nodes without resource issue [Quan]
+ Revised commit message [Quan]Changes in v4:
+ Add "depends on I2C" to fix build issue found by kernel test robot [Guenter]Changes in v3:
+ NoneChanges in v2:
+ Used 'struct of_device_id's .data attribute [Lee Jones]drivers/mfd/Kconfig | 12 +++++++ drivers/mfd/Makefile | 1 + drivers/mfd/smpro-mfd.c | 76 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 drivers/mfd/smpro-mfd.cdrivers/mfd/Kconfig +12
-0@@ -77,6 +77,18 @@ config MFD_AS3711 help Support for the AS3711 PMIC from AMS +config MFD_SMPRO + tristate "Ampere Computing MFD SMpro core driver" + depends on I2C + select MFD_CORE + select REGMAP_I2C + help + Say yes here to enable SMpro driver support for Ampere's Altra + processor family. + + Ampere's Altra SMpro exposes an I2C regmap interface that can + be accessed by child devices. + config MFD_AS3722 tristate "ams AS3722 Power Management IC" select MFD_COREdrivers/mfd/Makefile +1
-0@@ -267,6 +267,7 @@ obj-$(CONFIG_MFD_QCOM_PM8008) += qcom-pm8008.o obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o +obj-$(CONFIG_MFD_SMPRO) += smpro-mfd.o obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o obj-$(CONFIG_MFD_ATC260X) += atc260x-core.odrivers/mfd/smpro-mfd.c new file +0
-0
drivers/mfd/smpro-mfd.c line 8
Quoted 8 lines
drivers/mfd/smpro-mfd.c new file +8
-0@@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Ampere Altra Family SMPro MFD - I2C +* +* Copyright (c) 2021, Ampere Computing LLC +* Author: Quan Nguyen <[email protected]> +* +* Based on simple-mfd-i2c.c:
Why aren't you just using this?
Quoted 12 lines
drivers/mfd/smpro-mfd.c new file +12
-0+* Copyright (c) by Michael Walle <[email protected]> +*/ + +#include <linux/i2c.h> +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/of_platform.h> +#include <linux/mfd/core.h> +#include <linux/regmap.h> + +/* Identification Registers */ +#define MANUFACTURER_ID_REG 0x02
drivers/mfd/smpro-mfd.c line 30
Quoted 10 lines
drivers/mfd/smpro-mfd.c new file +10
-0+#define AMPERE_MANUFACTURER_ID 0xCD3A + +static const struct regmap_config simple_word_regmap_config = { + .reg_bits =8 , + .val_bits =16 , +}; + +static const struct mfd_cell smpro_devs[] = { +MFD_CELL_NAME ("smpro-hwmon" ), +};
What are the other devices?
Quoted 45 lines
drivers/mfd/smpro-mfd.c new file +45
-0+static int smpro_mfd_probe (struct i2c_client *i2c) +{ +const struct regmap_config *config; +struct regmap *regmap; +unsigned int val; +int ret; + + config =device_get_match_data (&i2c->dev); +if (!config) + config = &simple_word_regmap_config; + + regmap =devm_regmap_init_i2c (i2c, config); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +/* Check for valid ID */ + ret =regmap_read (regmap,MANUFACTURER_ID_REG , &val); +if (ret) +return ret; + +if (val !=AMPERE_MANUFACTURER_ID ) +return -ENODEV ; + +return devm_mfd_add_devices (&i2c->dev,PLATFORM_DEVID_AUTO , + smpro_devs,ARRAY_SIZE (smpro_devs),NULL ,0 ,NULL ); +} + +static const struct of_device_id smpro_mfd_of_match[] = { + { .compatible ="ampere,smpro" , .data = &simple_word_regmap_config }, + {} +}; +MODULE_DEVICE_TABLE (of, smpro_mfd_of_match); + +static struct i2c_driver smpro_mfd_driver = { + .probe_new = smpro_mfd_probe, + .driver = { + .name ="smpro-mfd-i2c" , + .of_match_table = smpro_mfd_of_match, + }, +}; +module_i2c_driver (smpro_mfd_driver); + +MODULE_AUTHOR ("Quan Nguyen <[email protected]>" ); +MODULE_DESCRIPTION ("SMPRO MFD - I2C driver" ); +MODULE_LICENSE ("GPL v2" );
Signature · 4 lines
Lee Jones [???] Principal Technical Lead - Developer Services Linaro.org ? Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH v6 2/9] mfd: smpro-mfd: Adds Ampere's Altra SMpro MFD driver
In reply to Quan NguyenDear Lee Jone,
My apologize as I did not see any of your replys for this series. Maybe due to my bad junk setting,
So this email is to address your comment in
https://lkml.org/lkml/2022/2/8/254
Please see my inline below.
Thanks for the review,
- Quan
Quoted 72 lines · Quan Nguyen
Adds Multi-function devices driver for SMpro co-processor found on the Mt.Jade hardware reference platform with Ampere's Altra processor family.
Signed-off-by Quan Nguyen <[email protected]>---
Changes in v6:
+ Update license part to reflect that this driver is clone from simple-mfd-i2c driver [Quan]Changes in v5:
+ Dropped the use of simple-mfd-i2c driver [Quan]
+ Introduceddrivers/mfd/smpro-mfd.cdriver to instantiate sub-devices. This is to avoid DT nodes without resource issue [Quan]
+ Revised commit message [Quan]Changes in v4:
+ Add "depends on I2C" to fix build issue found by kernel test robot [Guenter]Changes in v3:
+ NoneChanges in v2:
+ Used 'struct of_device_id's .data attribute [Lee Jones]drivers/mfd/Kconfig | 12 +++++++ drivers/mfd/Makefile | 1 + drivers/mfd/smpro-mfd.c | 76 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+)create mode 100644
drivers/mfd/smpro-mfd.cdrivers/mfd/Kconfig +12
-0@@ -77,6 +77,18 @@ config MFD_AS3711 help Support for the AS3711 PMIC from AMS +config MFD_SMPRO + tristate "Ampere Computing MFD SMpro core driver" + depends on I2C + select MFD_CORE + select REGMAP_I2C + help + Say yes here to enable SMpro driver support for Ampere's Altra + processor family. + + Ampere's Altra SMpro exposes an I2C regmap interface that can + be accessed by child devices. + config MFD_AS3722 tristate "ams AS3722 Power Management IC" select MFD_COREdrivers/mfd/Makefile +1
-0@@ -267,6 +267,7 @@ obj-$(CONFIG_MFD_QCOM_PM8008) += qcom-pm8008.o obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o +obj-$(CONFIG_MFD_SMPRO) += smpro-mfd.o obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o obj-$(CONFIG_MFD_ATC260X) += atc260x-core.odrivers/mfd/smpro-mfd.c new file +0
-0
drivers/mfd/smpro-mfd.c line 8
Quoted 8 lines
drivers/mfd/smpro-mfd.c new file +8
-0@@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Ampere Altra Family SMPro MFD - I2C +* +* Copyright (c) 2021, Ampere Computing LLC +* Author: Quan Nguyen <[email protected]> +* +* Based on simple-mfd-i2c.c:
[Lee Jones] Why aren't you just using this?
Mainly, on this series, is because we need to add empty DT nodes for child drivers to be instantiated which was NAK because DT nodes should be for describe HW specific other than to instantiate drivers.
And, as other reason, in my new version, I found that we will need separate MFD driver so that multiple type of bus access could be handled (by using regmap_bus->read/write()).
Quoted 12 lines
drivers/mfd/smpro-mfd.c new file +12
-0+* Copyright (c) by Michael Walle <[email protected]> +*/ + +#include <linux/i2c.h> +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/of_platform.h> +#include <linux/mfd/core.h> +#include <linux/regmap.h> + +/* Identification Registers */ +#define MANUFACTURER_ID_REG 0x02
drivers/mfd/smpro-mfd.c line 30
Quoted 10 lines
drivers/mfd/smpro-mfd.c new file +10
-0+#define AMPERE_MANUFACTURER_ID 0xCD3A + +static const struct regmap_config simple_word_regmap_config = { + .reg_bits =8 , + .val_bits =16 , +}; + +static const struct mfd_cell smpro_devs[] = { +MFD_CELL_NAME ("smpro-hwmon" ), +};
[Lee Jones] What are the other devices?
The other devices are smpro-errmon (to query HW error reported by Altra Family processor) and smpro-misc (to handle other miscellaneous info).
Quoted 46 lines
drivers/mfd/smpro-mfd.c new file +46
-0+ +static int smpro_mfd_probe (struct i2c_client *i2c) +{ +const struct regmap_config *config; +struct regmap *regmap; +unsigned int val; +int ret; + + config =device_get_match_data (&i2c->dev); +if (!config) + config = &simple_word_regmap_config; + + regmap =devm_regmap_init_i2c (i2c, config); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +/* Check for valid ID */ + ret =regmap_read (regmap,MANUFACTURER_ID_REG , &val); +if (ret) +return ret; + +if (val !=AMPERE_MANUFACTURER_ID ) +return -ENODEV ; + +return devm_mfd_add_devices (&i2c->dev,PLATFORM_DEVID_AUTO , + smpro_devs,ARRAY_SIZE (smpro_devs),NULL ,0 ,NULL ); +} + +static const struct of_device_id smpro_mfd_of_match[] = { + { .compatible ="ampere,smpro" , .data = &simple_word_regmap_config }, + {} +}; +MODULE_DEVICE_TABLE (of, smpro_mfd_of_match); + +static struct i2c_driver smpro_mfd_driver = { + .probe_new = smpro_mfd_probe, + .driver = { + .name ="smpro-mfd-i2c" , + .of_match_table = smpro_mfd_of_match, + }, +}; +module_i2c_driver (smpro_mfd_driver); + +MODULE_AUTHOR ("Quan Nguyen <[email protected]>" ); +MODULE_DESCRIPTION ("SMPRO MFD - I2C driver" ); +MODULE_LICENSE ("GPL v2" );
PATCH v6 3/9 hwmon: smpro: Add Ampere's Altra smpro-hwmon driver
In reply to Quan NguyenThis commit adds support for Ampere SMpro hwmon driver. This driver supports accessing various CPU sensors provided by the SMpro co-processor including temperature, power, voltages, and current.
---
Changes in v6:
+ None
Changes in v5:
+ Drop ManufacturerID checking when probe as it was checked during smpro-mfd probing [Quan]
+ Drop the use of register offset [Quan]
+ Removed the use of compatible string as it is instantiated by smpro-mfd driver [Quan]
+ Thanks Guenter for the Reviewed-by in last version, but it was not added because there's some changes in this version. Really appreciate if you could help again, thank you.
Changes in v4:
+ Returned regmap_read() error code [Guenter]
Changes in v3:
+ Handled negative temperature value [Guenter]
+ Returned -ENODEV if Manufacturer ID is wrong [Guenter]
+ Refactored smpro_read_string() and smpro_temp_read() [Guenter]
+ Removed smpro_write() function [Guenter]
+ Added minor refactor changes [Quan]
Changes in v2:
+ Removed "virtual" sensors [Guenter]
+ Reported SOC_TDP as "Socket TDP" using max attributes [Guenter]
+ Corrected return error code when host is turn off [Guenter]
+ Reported MEM HOT Threshold for all DIMMs as temp*_crit [Guenter]
+ Removed license info as SPDX-License-Identifier existed [Guenter]
+ Added is_visible() support [Guenter]
+ Used HWMON_CHANNEL_INFO() macro and LABEL attributes [Guenter]
+ Made is_valid_id() return boolean [Guenter]
+ Returned -EPROBE_DEFER when smpro reg inaccessible [Guenter]
+ Removed unnecessary error message when dev register fail [Guenter]
+ Removed Socket TDP sensor [Quan]
+ Included sensor type and channel in labels [Quan]
+ Refactorized code to fix checkpatch.pl --strict complaint [Quan]
drivers/hwmon/Kconfig | 8 + drivers/hwmon/Makefile | 1 + drivers/hwmon/smpro-hwmon.c | 463 ++++++++++++++++++++++++++++++++++++ 3 files changed, 472 insertions(+) create mode 100644 drivers/hwmon/smpro-hwmon.c
drivers/hwmon/Kconfig +8 -0
@@ -67,6 +67,14 @@ config SENSORS_ABITUGURU3 This driver can also be built as a module. If so, the module will be called abituguru3. +config SENSORS_SMPRO + tristate "Ampere's Altra SMpro hardware monitoring driver" + depends on MFD_SMPRO + help + If you say yes here you get support for the thermal, voltage, + current and power sensors of Ampere's Altra processor family SoC + with SMpro co-processor. + config SENSORS_AD7314 tristate "Analog Devices AD7314 and compatibles" depends on SPI
drivers/hwmon/Makefile +1 -0
@@ -181,6 +181,7 @@ obj-$(CONFIG_SENSORS_SHT4x) += sht4x.o obj-$(CONFIG_SENSORS_SHTC1) += shtc1.o obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o obj-$(CONFIG_SENSORS_SMM665) += smm665.o +obj-$(CONFIG_SENSORS_SMPRO) += smpro-hwmon.o obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o
drivers/hwmon/smpro-hwmon.c new file +463 -0
463 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH v6 4/9 docs: hwmon: (smpro-hwmon) Add documentation
In reply to Quan NguyenAdd documentation for the Ampere(R)'s Altra(R) SMpro hwmon driver.
---
Changes in v6:
+ None
Changes in v5:
+ None
Changes in v4:
+ None
Changes in v3:
+ None
Changes in v2:
+ Removed "virtual" sensors [Guenter]
+ Fixed typo "mili" to "milli", "nanoWatt" to "microWatt" [Guenter]
+ Reported SOC_TDP as "Socket TDP" using max attributes [Guenter]
+ Clarified "highest" meaning in documentation [Guenter]
+ Reported MEM HOT Threshold for all DIMMs as temp*_crit [Guenter]
+ Removed Socket TDP sensor [Quan]
+ Included sensor type and channel in labels [Quan]
Documentation/hwmon/index.rst | 1 + Documentation/hwmon/smpro-hwmon.rst | 101 ++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Documentation/hwmon/smpro-hwmon.rst
Documentation/hwmon/index.rst +1 -0
@@ -180,6 +180,7 @@ Hardware Monitoring Kernel Drivers sis5595 sl28cpld smm665 + smpro-hwmon smsc47b397 smsc47m192 smsc47m1
Documentation/hwmon/smpro-hwmon.rst new file +101 -0
101 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH v6 5/9 regmap: Introduces regmap lock helpers
In reply to Quan NguyenThis commit introduces regmap_acquire/release_lock() functions and makes them available for drivers that need atomic access of regmap registers
---
Change in v6:
+ First introduced in v6 [Quan]
drivers/base/regmap/regmap.c | 12 ++++++++++++ include/linux/regmap.h | 2 ++ 2 files changed, 14 insertions(+)
drivers/base/regmap/regmap.c +12 -0
@@ -87,6 +87,18 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg, }EXPORT_SYMBOL_GPL (regmap_check_range_table); +void regmap_acquire_lock (struct regmap *map) +{ + map->lock (map->lock_arg); +} +EXPORT_SYMBOL_GPL (regmap_acquire_lock); + +void regmap_release_lock (struct regmap *map) +{ + map->unlock (map->lock_arg); +} +EXPORT_SYMBOL_GPL (regmap_release_lock); +bool regmap_writeable (struct regmap *map,unsigned int reg) {if (map->max_register && reg > map->max_register)
include/linux/regmap.h +2 -0
@@ -1194,6 +1194,8 @@ int regmap_async_complete(struct regmap *map);bool regmap_can_raw_write (struct regmap *map);size_t regmap_get_raw_read_max (struct regmap *map);size_t regmap_get_raw_write_max (struct regmap *map); +void regmap_acquire_lock (struct regmap *map); +void regmap_release_lock (struct regmap *map);int regcache_sync (struct regmap *map); int regcache_sync_region(struct regmap *map, unsigned int min,
Signature · 1 line
2.28.0
Mark Brown
maintainerRe: [PATCH v6 5/9] regmap: Introduces regmap lock helpers
Quoted 2 lines · Quan Nguyen
This commit introduces regmap_acquire/release_lock() functions and makes them available for drivers that need atomic access of regmap registers
You've not explained what something would need this for and how
it's expected to work - we don't provide unlocked access to the
regmap to client drivers so I don't see how one could safely use
this. It's unclear to me what this would mean or why it's not
better implemented in the client driver.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20211224/c96c1038/attachment.sig>
Re: [PATCH v6 5/9] regmap: Introduces regmap lock helpers
Quoted 9 lines · Mark Brown
Quoted 2 lines · Quan Nguyen
This commit introduces regmap_acquire/release_lock() functions and makes them available for drivers that need atomic access of regmap registers
You've not explained what something would need this for and how it's expected to work - we don't provide unlocked access to the regmap to client drivers so I don't see how one could safely use this. It's unclear to me what this would mean or why it's not better implemented in the client driver.
Thanks a lot for the review, Mark.
As per my comment in the other email, this code will be removed in my next version.
Thanks,
- Quan
PATCH v6 6/9 misc: smpro-errmon: Add Ampere's SMpro error monitor driver
In reply to Quan NguyenThis commit adds Ampere's SMpro error monitor driver for monitoring and reporting RAS-related errors as reported by SMpro co-processor found on Ampere's Altra processor family.
---
Change in v6:
+ First introduced in v6 [Quan]
drivers/mfd/smpro-mfd.c | 1 + drivers/misc/Kconfig | 7 + drivers/misc/Makefile | 1 + drivers/misc/smpro-errmon.c | 571 ++++++++++++++++++++++++++++++++++++ 4 files changed, 580 insertions(+) create mode 100644 drivers/misc/smpro-errmon.c
drivers/mfd/smpro-mfd.c +1 -0
@@ -27,6 +27,7 @@ static const struct regmap_config simple_word_regmap_config = {static const struct mfd_cell smpro_devs[] = {MFD_CELL_NAME ("smpro-hwmon" ), +MFD_CELL_NAME ("smpro-errmon" ), };static int smpro_mfd_probe (struct i2c_client *i2c)
drivers/misc/Kconfig +7 -0
@@ -176,6 +176,13 @@ config SGI_XP this feature will allow for direct communication between SSIs based on a network adapter and DMA messaging. +config SMPRO_ERRMON + tristate "Ampere Computing SMPro error monitor driver" + depends on MFD_SMPRO || COMPILE_TEST + help + If you say yes here you get support for error monitor function + provides by Ampere Computing's SoC with SMpro processor. + config CS5535_MFGPT tristate "CS5535/CS5536 Geode Multi-Function General Purpose Timer (MFGPT) support" depends on MFD_CS5535
drivers/misc/Makefile +1 -0
@@ -23,6 +23,7 @@ obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o obj-$(CONFIG_KGDB_TESTS) += kgdbts.o obj-$(CONFIG_SGI_XP) += sgi-xp/ obj-$(CONFIG_SGI_GRU) += sgi-gru/ +obj-$(CONFIG_SMPRO_ERRMON) += smpro-errmon.o obj-$(CONFIG_CS5535_MFGPT) += cs5535-mfgpt.o obj-$(CONFIG_GEHC_ACHC) += gehc-achc.o obj-$(CONFIG_HP_ILO) += hpilo.o
drivers/misc/smpro-errmon.c new file +571 -0
571 lines not on this page · raw message
Signature · 1 line
2.28.0
Greg Kroah-Hartman
maintainerRe: [PATCH v6 6/9] misc: smpro-errmon: Add Ampere's SMpro error monitor driver
Quoted 9 lines · Quan Nguyen
This commit adds Ampere's SMpro error monitor driver for monitoring and reporting RAS-related errors as reported by SMpro co-processor found on Ampere's Altra processor family.
Signed-off-by Quan Nguyen <[email protected]>---
Change in v6:
+ First introduced in v6 [Quan]
Quoted 6 lines
drivers/mfd/smpro-mfd.c | 1 + drivers/misc/Kconfig | 7 + drivers/misc/Makefile | 1 + drivers/misc/smpro-errmon.c | 571 ++++++++++++++++++++++++++++++++++++ 4 files changed, 580 insertions(+) create mode 100644 drivers/misc/smpro-errmon.c
You need Documentation/ABI/ updates when you add sysfs files. Please do that for your next version of this patch.
Also remember that sysfs is only "one value per file", this driver seems to violate that in huge ways and is not ok.
thanks,
greg k-h
Re: [PATCH v6 6/9] misc: smpro-errmon: Add Ampere's SMpro error monitor driver
Quoted 17 lines · Greg Kroah-Hartman
Quoted 9 lines · Quan Nguyen
This commit adds Ampere's SMpro error monitor driver for monitoring and reporting RAS-related errors as reported by SMpro co-processor found on Ampere's Altra processor family.
Signed-off-by Quan Nguyen <[email protected]>---
Change in v6:
+ First introduced in v6 [Quan]Quoted 6 lines
drivers/mfd/smpro-mfd.c | 1 + drivers/misc/Kconfig | 7 + drivers/misc/Makefile | 1 + drivers/misc/smpro-errmon.c | 571 ++++++++++++++++++++++++++++++++++++ 4 files changed, 580 insertions(+)create mode 100644
drivers/misc/smpro-errmon.c
Quoted 3 lines
You need
Documentation/ABI/updates when you add sysfs files. Please do that for your next version of this patch.
Thanks greg for the review,
Will update Documentation/ABI/testing/sysfs-* file in next version.
Quoted 3 lines
Also remember that sysfs is only "one value per file", this driver seems to violate that in huge ways and is not ok.
These sysfs's does not return "multi value per file" but a single record of data, one example is to return the 48-byte ARM RAS Vendor specific error record.
Thanks
- Quan
Mark Brown
maintainerRe: [PATCH v6 6/9] misc: smpro-errmon: Add Ampere's SMpro error monitor driver
In reply to Quan NguyenQuoted 12 lines · Quan Nguyen
drivers/misc/smpro-errmon.c new file +12
-0+static int read_i2c_block_data (struct i2c_client *client,u16 address,u16 length,u8 *data) +{ +unsigned char outbuf[MAX_READ_BLOCK_LENGTH ]; +unsigned char inbuf[2 ]; +struct i2c_msg msgs[2 ]; +ssize_t ret; + + inbuf[0 ] = (address &0xff ); + inbuf[1 ] = length; + + msgs[0 ].addr = client->addr; + msgs[0 ].flags = client->flags &I2C_M_TEN ;
drivers/misc/smpro-errmon.c line 190
Quoted 10 lines
drivers/misc/smpro-errmon.c new file +10
-0+ msgs[0 ].len =2 ; + msgs[0 ].buf = inbuf; + + msgs[1 ].addr = client->addr; + msgs[1 ].flags = (client->flags &I2C_M_TEN ) |I2C_M_RD ; + msgs[1 ].len = length; + msgs[1 ].buf = outbuf; + + ret =i2c_transfer (client->adapter, msgs,NUM_I2C_MESSAGES ); +if (ret <0 )
regmap already supports bulk data access so it's not clear why we
would open code this. Given that this is a single I2C transfer
it's also unclear why we'd need to export the regmap lock - a
single I2C transfer is atomic@the bus level so the regmap lock
isn't providing any additional concurrency protection.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20211224/86f8c99e/attachment.sig>
Re: [PATCH v6 6/9] misc: smpro-errmon: Add Ampere's SMpro error monitor driver
Quoted 22 lines · Mark Brown
Quoted 20 lines · Quan Nguyen
drivers/misc/smpro-errmon.c new file +20
-0+static int read_i2c_block_data (struct i2c_client *client,u16 address,u16 length,u8 *data) +{ +unsigned char outbuf[MAX_READ_BLOCK_LENGTH ]; +unsigned char inbuf[2 ]; +struct i2c_msg msgs[2 ]; +ssize_t ret; + + inbuf[0 ] = (address &0xff ); + inbuf[1 ] = length; + + msgs[0 ].addr = client->addr; + msgs[0 ].flags = client->flags &I2C_M_TEN ; + msgs[0 ].len =2 ; + msgs[0 ].buf = inbuf; + + msgs[1 ].addr = client->addr; + msgs[1 ].flags = (client->flags &I2C_M_TEN ) |I2C_M_RD ; + msgs[1 ].len = length; + msgs[1 ].buf = outbuf; +
Quoted 8 lines
drivers/misc/smpro-errmon.c line 190
Quoted 2 lines
drivers/misc/smpro-errmon.c new file +2
-0+ ret =i2c_transfer (client->adapter, msgs,NUM_I2C_MESSAGES ); +if (ret <0 )regmap already supports bulk data access so it's not clear why we would open code this. Given that this is a single I2C transfer it's also unclear why we'd need to export the regmap lock - a single I2C transfer is atomic at the bus level so the regmap lock isn't providing any additional concurrency protection.
Thanks a lot for the review, Mark.
Even though the single i2c transfer is atomic at the bus level, but my concerns is that the transfer may be interlaced with some other transaction from the regmap which was guarded by regmap's lock. And so making these accesses atomic in regmap level should be done as well. That is why I need the regmap's lock export for user driver.
But your comment made re-think about the code, and I think we can handle multiple types of transfer by using remap_bus->read/write(). The read_i2c_block_data() is now replaced by regmap_noinc_read() and hence, remove the use of regmap's lock. These changes will be included in my next version.
Thanks,
- Quan
kernel test robot
build botRe: [PATCH v6 6/9] misc: smpro-errmon: Add Ampere's SMpro error monitor driver
In reply to Quan NguyenI love your patch! Yet something to improve:
Hi Quan,
I love your patch! Yet something to improve:
[auto build test ERROR on lee-mfd/for-mfd-next]
[also build test ERROR on char-misc/char-misc-testing groeck-staging/hwmon-next v5.16-rc7 next-20211224] [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/Quan-Nguyen/Add-Ampere-s-Altra-SMPro-MFD-and-its-child-drivers/20211224-121646 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20211228/202112281453.2HN7j1Av-lkp(a)intel.com/config) compiler: riscv64-linux-gcc (GCC) 11.2.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/51360698e4a65a15d70786670f2f82a78e877217
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Quan-Nguyen/Add-Ampere-s-Altra-SMPro-MFD-and-its-child-drivers/20211224-121646 git checkout 51360698e4a65a15d70786670f2f82a78e877217
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash drivers/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from include/linux/kobject.h:20,
from include/linux/of.h:17,
from include/linux/irqdomain.h:35,
from include/linux/acpi.h:13,
from include/linux/i2c.h:13,
from drivers/misc/smpro-errmon.c:9:
>> drivers/misc/smpro-errmon.c:430:23: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
430 | static DEVICE_ATTR_RO(errors_core_ce);
| ^~~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:430:8: note: in expansion of macro 'DEVICE_ATTR_RO'
430 | static DEVICE_ATTR_RO(errors_core_ce);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:430:23: note: (near initialization for 'dev_attr_errors_core_ce.show')
430 | static DEVICE_ATTR_RO(errors_core_ce);
| ^~~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:430:8: note: in expansion of macro 'DEVICE_ATTR_RO'
430 | static DEVICE_ATTR_RO(errors_core_ce);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:436:23: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
436 | static DEVICE_ATTR_RO(errors_core_ue);
| ^~~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:436:8: note: in expansion of macro 'DEVICE_ATTR_RO'
436 | static DEVICE_ATTR_RO(errors_core_ue);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:436:23: note: (near initialization for 'dev_attr_errors_core_ue.show')
436 | static DEVICE_ATTR_RO(errors_core_ue);
| ^~~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:436:8: note: in expansion of macro 'DEVICE_ATTR_RO'
436 | static DEVICE_ATTR_RO(errors_core_ue);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:442:23: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
442 | static DEVICE_ATTR_RO(errors_mem_ce);
| ^~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:442:8: note: in expansion of macro 'DEVICE_ATTR_RO'
442 | static DEVICE_ATTR_RO(errors_mem_ce);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:442:23: note: (near initialization for 'dev_attr_errors_mem_ce.show')
442 | static DEVICE_ATTR_RO(errors_mem_ce);
| ^~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:442:8: note: in expansion of macro 'DEVICE_ATTR_RO'
442 | static DEVICE_ATTR_RO(errors_mem_ce);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:448:23: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
448 | static DEVICE_ATTR_RO(errors_mem_ue);
| ^~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:448:8: note: in expansion of macro 'DEVICE_ATTR_RO'
448 | static DEVICE_ATTR_RO(errors_mem_ue);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:448:23: note: (near initialization for 'dev_attr_errors_mem_ue.show')
448 | static DEVICE_ATTR_RO(errors_mem_ue);
| ^~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:448:8: note: in expansion of macro 'DEVICE_ATTR_RO'
448 | static DEVICE_ATTR_RO(errors_mem_ue);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:454:23: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
454 | static DEVICE_ATTR_RO(errors_pcie_ce);
| ^~~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:454:8: note: in expansion of macro 'DEVICE_ATTR_RO'
454 | static DEVICE_ATTR_RO(errors_pcie_ce);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:454:23: note: (near initialization for 'dev_attr_errors_pcie_ce.show')
454 | static DEVICE_ATTR_RO(errors_pcie_ce);
| ^~~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:454:8: note: in expansion of macro 'DEVICE_ATTR_RO'
454 | static DEVICE_ATTR_RO(errors_pcie_ce);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:460:23: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
460 | static DEVICE_ATTR_RO(errors_pcie_ue);
| ^~~~~~~~~~~~~~
include/linux/sysfs.h:117:19: note: in definition of macro '__ATTR_RO'
117 | .show = _name##_show, \
| ^~~~~
drivers/misc/smpro-errmon.c:460:8: note: in expansion of macro 'DEVICE_ATTR_RO'
460 | static DEVICE_ATTR_RO(errors_pcie_ue);
| ^~~~~~~~~~~~~~
drivers/misc/smpro-errmon.c:460:23: note: (near initialization for 'dev_attr_errors_pcie_ue.show')
460 | static DEVICE_ATTR_RO(errors_pcie_ue);vim +430 drivers/misc/smpro-errmon.c
425
426 static int errors_core_ce_show(struct device *dev, struct device_attribute *da, char *buf)
427 {
428 return smpro_error_data_read(dev, da, buf, CORE_CE_ERRS);
429 }
> 430 static DEVICE_ATTR_RO(errors_core_ce);
431
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [PATCH v6 6/9] misc: smpro-errmon: Add Ampere's SMpro error monitor driver
In reply to Quan NguyenQuoted 10 lines · Quan Nguyen
This commit adds Ampere's SMpro error monitor driver for monitoring and reporting RAS-related errors as reported by SMpro co-processor found on Ampere's Altra processor family.
Signed-off-by Quan Nguyen <[email protected]>---
Change in v6:
+ First introduced in v6 [Quan]drivers/mfd/smpro-mfd.c | 1 +
Separate patch please.
Quoted 5 lines
drivers/misc/Kconfig | 7 + drivers/misc/Makefile | 1 + drivers/misc/smpro-errmon.c | 571 ++++++++++++++++++++++++++++++++++++ 4 files changed, 580 insertions(+) create mode 100644 drivers/misc/smpro-errmon.c
Signature · 4 lines
Lee Jones [???] Senior Technical Lead - Developer Services Linaro.org ? Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH v6 6/9] misc: smpro-errmon: Add Ampere's SMpro error monitor driver
In reply to Quan NguyenDear Lee Jones,
This mail is to reply your comment in https://lkml.org/lkml/2021/12/29/120
Thanks for the review,
- Quan
Quoted 10 lines · Quan Nguyen
This commit adds Ampere's SMpro error monitor driver for monitoring and reporting RAS-related errors as reported by SMpro co-processor found on Ampere's Altra processor family.
Signed-off-by Quan Nguyen <[email protected]>---
Change in v6:
+ First introduced in v6 [Quan]drivers/mfd/smpro-mfd.c | 1 +
[Lee Jones] Separate patch please
Will separate this smpro-mfd.c in single patch only in my next version
Quoted 6 lines
drivers/misc/Kconfig | 7 + drivers/misc/Makefile | 1 + drivers/misc/smpro-errmon.c | 571 ++++++++++++++++++++++++++++++++++++ 4 files changed, 580 insertions(+)create mode 100644
drivers/misc/smpro-errmon.c
PATCH v6 7/9 docs: misc-devices: (smpro-errmon) Add documentation
In reply to Quan NguyenAdds documentation for Ampere(R)'s Altra(R) SMpro errmon driver.
---
Change in v6:
+ First introduced in v6 [Quan]
Documentation/misc-devices/index.rst | 1 + Documentation/misc-devices/smpro-errmon.rst | 206 ++++++++++++++++++++ 2 files changed, 207 insertions(+) create mode 100644 Documentation/misc-devices/smpro-errmon.rst
Documentation/misc-devices/index.rst +1 -0
@@ -26,6 +26,7 @@ fit into other categories. lis3lv02d max6875 pci-endpoint-test + smpro-errmon spear-pcie-gadget uacce xilinx_sdfec
Documentation/misc-devices/smpro-errmon.rst new file +206 -0
206 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH v6 8/9 misc: smpro-misc: Add Ampere's Altra SMpro misc driver
In reply to Quan NguyenThis commit adds driver support for accessing various information reported by Ampere's SMpro co-processor such as Boot Progress and other miscellaneous data.
---
Change in v6:
+ First introduced in v6 [Quan]
drivers/mfd/smpro-mfd.c | 1 + drivers/misc/Kconfig | 7 ++ drivers/misc/Makefile | 1 + drivers/misc/smpro-misc.c | 177 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 drivers/misc/smpro-misc.c
drivers/mfd/smpro-mfd.c +1 -0
@@ -28,6 +28,7 @@ static const struct regmap_config simple_word_regmap_config = {static const struct mfd_cell smpro_devs[] = {MFD_CELL_NAME ("smpro-hwmon" ),MFD_CELL_NAME ("smpro-errmon" ), +MFD_CELL_NAME ("smpro-misc" ), };static int smpro_mfd_probe (struct i2c_client *i2c)
drivers/misc/Kconfig +7 -0
@@ -183,6 +183,13 @@ config SMPRO_ERRMON If you say yes here you get support for error monitor function provides by Ampere Computing's SoC with SMpro processor. +config SMPRO_MISC + tristate "Ampere Computing SMPro miscellaneous driver" + depends on MFD_SMPRO || COMPILE_TEST + help + If you say yes here you get support for the miscellaleous function + provides by Ampere Computing's SoC with SMpro processor. + config CS5535_MFGPT tristate "CS5535/CS5536 Geode Multi-Function General Purpose Timer (MFGPT) support" depends on MFD_CS5535
drivers/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ obj-$(CONFIG_KGDB_TESTS) += kgdbts.o obj-$(CONFIG_SGI_XP) += sgi-xp/ obj-$(CONFIG_SGI_GRU) += sgi-gru/ obj-$(CONFIG_SMPRO_ERRMON) += smpro-errmon.o +obj-$(CONFIG_SMPRO_MISC) += smpro-misc.o obj-$(CONFIG_CS5535_MFGPT) += cs5535-mfgpt.o obj-$(CONFIG_GEHC_ACHC) += gehc-achc.o obj-$(CONFIG_HP_ILO) += hpilo.o
drivers/misc/smpro-misc.c new file +177 -0
177 lines not on this page · raw message
Signature · 1 line
2.28.0
Re: [PATCH v6 8/9] misc: smpro-misc: Add Ampere's Altra SMpro misc driver
Quoted 10 lines · Quan Nguyen
This commit adds driver support for accessing various information reported by Ampere's SMpro co-processor such as Boot Progress and other miscellaneous data.
Signed-off-by Quan Nguyen <[email protected]>---
Change in v6:
+ First introduced in v6 [Quan]drivers/mfd/smpro-mfd.c | 1 +
Please pull all of these patches out.
There are no build dependencies here.
Quoted 11 lines
drivers/misc/Kconfig | 7 ++ drivers/misc/Makefile | 1 + drivers/misc/smpro-misc.c | 177 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 drivers/misc/smpro-misc.cdrivers/mfd/smpro-mfd.c +0
-0
drivers/mfd/smpro-mfd.c static const struct regmap_config simple_word_regmap_config = { · line 31
Quoted 4 lines
drivers/mfd/smpro-mfd.c +1
-0@@ -28,6 +28,7 @@ static const struct regmap_config simple_word_regmap_config = {static const struct mfd_cell smpro_devs[] = {MFD_CELL_NAME ("smpro-hwmon" ),MFD_CELL_NAME ("smpro-errmon" ), +MFD_CELL_NAME ("smpro-misc" ),
Misc is a Linuxisum which are not allowed in DT.
What does this driver actually do?
Signature · 4 lines
Lee Jones [???] Senior Technical Lead - Developer Services Linaro.org ? Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH v6 8/9] misc: smpro-misc: Add Ampere's Altra SMpro misc driver
In reply to Quan NguyenDear Lee Jones,
This to reply your comment in https://lkml.org/lkml/2021/12/29/121
Thanks for the review,
- Quan
Quoted 10 lines · Quan Nguyen
This commit adds driver support for accessing various information reported by Ampere's SMpro co-processor such as Boot Progress and other miscellaneous data.
Signed-off-by Quan Nguyen <[email protected]>---
Change in v6:
+ First introduced in v6 [Quan]drivers/mfd/smpro-mfd.c | 1 +
[Lee Jones]
Please pull all of these patches out.
There are no build dependencies here.
[Quan]
Will separate this smpro-mfd and other child drivers in next version
Quoted 11 lines
drivers/misc/Kconfig | 7 ++ drivers/misc/Makefile | 1 + drivers/misc/smpro-misc.c | 177 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 186 insertions(+)create mode 100644
drivers/misc/smpro-misc.cdrivers/mfd/smpro-mfd.c +0
-0
drivers/mfd/smpro-mfd.c static const struct regmap_config simple_word_regmap_config = { · line 31
Quoted 4 lines
drivers/mfd/smpro-mfd.c +1
-0@@ -28,6 +28,7 @@ static const struct regmap_config simple_word_regmap_config = {static const struct mfd_cell smpro_devs[] = {MFD_CELL_NAME ("smpro-hwmon" ),MFD_CELL_NAME ("smpro-errmon" ), +MFD_CELL_NAME ("smpro-misc" ),
[Lee Jones]
Misc is a Linuxisum which are not allowed in DT.
What does this driver actually do?
[Quan]
This drivers is to report the boot progress to BMC and allow BMC to configure the Soc Power Limit of Ampere's Altra family processor.
Arnd Bergmann
maintainerRe: [PATCH v6 8/9] misc: smpro-misc: Add Ampere's Altra SMpro misc driver
Quoted 13 lines · Quan Nguyen
drivers/mfd/smpro-mfd.c static const struct regmap_config simple_word_regmap_config = { · line 31
Quoted 9 lines
drivers/mfd/smpro-mfd.c +1
-0@@ -28,6 +28,7 @@ static const struct regmap_config simple_word_regmap_config = {static const struct mfd_cell smpro_devs[] = {MFD_CELL_NAME ("smpro-hwmon" ),MFD_CELL_NAME ("smpro-errmon" ), +MFD_CELL_NAME ("smpro-misc" ),[Lee Jones]
Misc is a Linuxisum which are not allowed in DT.
Quoted 5 lines
What does this driver actually do?
[Quan]
This drivers is to report the boot progress to BMC and allow BMC to configure the Soc Power Limit of Ampere's Altra family processor.
That doesn't sound like it should be platform specific at all, but rather a generic BMC interface. I see you already have the openbmc list on Cc, so I assume the right people can see this. Presumably this is a BMC that already runs on openbmc and can have a platform-independent interface for doing this.
Arnd
PATCH v6 9/9 docs: misc-devices: (smpro-misc) Add documentation
In reply to Quan NguyenAdds documentation for the Ampere(R)'s Altra(R) SMpro misc driver.
---
Change in v6:
+ First introduced in v6 [Quan]
Documentation/misc-devices/index.rst | 1 + Documentation/misc-devices/smpro-misc.rst | 82 +++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 Documentation/misc-devices/smpro-misc.rst
Documentation/misc-devices/index.rst +1 -0
@@ -27,6 +27,7 @@ fit into other categories. max6875 pci-endpoint-test smpro-errmon + smpro-misc spear-pcie-gadget uacce xilinx_sdfec
Documentation/misc-devices/smpro-misc.rst new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
2.28.0