From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.7 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9B2FC63799 for ; Thu, 22 Jul 2021 16:37:03 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13B566135A for ; Thu, 22 Jul 2021 16:37:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13B566135A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amperemail.onmicrosoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GVyld3kPJz30F6 for ; Fri, 23 Jul 2021 02:37:01 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=amperemail.onmicrosoft.com header.i=@amperemail.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-amperemail-onmicrosoft-com header.b=DPABuwHY; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=os.amperecomputing.com (client-ip=40.107.237.134; helo=nam12-bn8-obe.outbound.protection.outlook.com; envelope-from=thu@os.amperecomputing.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=amperemail.onmicrosoft.com header.i=@amperemail.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-amperemail-onmicrosoft-com header.b=DPABuwHY; dkim-atps=neutral Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2134.outbound.protection.outlook.com [40.107.237.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GVyl15ssFz2yL1 for ; Fri, 23 Jul 2021 02:36:26 +1000 (AEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XBT5K4JpJTjjGxE7ssRZMzSWdiZX1TjVsPZyv67PhdXyAqOfH+9lxDuTMjabtEEYOw4mZ2gNQZbeJO73BiulzedllB8o2Dqfw3kYT8vrYXGgWRXDkFaOEpT/UVeBJboCocrLzUePMU1DTZ5IwSmspr9KA7DhlqpeSvE1g8H+MLKdkbV1UDBUhM0CzU/IGieMvqIy5lDXfcejkM8OBXB2MxNhA/0p9AznxyT6CxpBJ4RolyiMVIwu2mpqCVzLNhacGRrTG4nQlFxGZoU28Y9/MjGGcOGmEJJzvUTsjjXKpSHoMeD8wsUU74W6+FZ2R/nhaqGyIaFiL4Je3sbe8jvVXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WuNWg+jjXoG7HT0taHnZOIyDQwuHl+0DDw7xRx7cUhM=; b=obfg4NJ6+SlyFKiHT/DbMPdkMHbpItLAxCskBgOqJrLugrQj+dG6SPI14mfA+F26sMFmu/tDSKxjEIyZBMBhAeQSFZNntkp459mOsFi3pfAp/i6pKzii28dSjhmi/KGAlDCfZN0cj8dl0Q9N9Rt+xK6mZETJTyh7vAWr8J8U+FFigbQFwSQ9dvjAfSVABshIanDOqFCNouqW43iilm2/swleZvJe3vbajXIgbsAFIRbZtyYWoPsBq6jZ5cox1RGga/V7iGGEPI+TutonygmC3jXH+gN2KPYwhXW7ggYFfd4boRG0FORd0htulH8hQMVIQolWBx+IiZ0wze18RGv6kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=amperemail.onmicrosoft.com; dkim=pass header.d=amperemail.onmicrosoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-amperemail-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WuNWg+jjXoG7HT0taHnZOIyDQwuHl+0DDw7xRx7cUhM=; b=DPABuwHYJLv7he6mHItrv5I45968w/2LRDIsAW7w9VDOeJzN0Z9hJ4JmzXre9H0rj3Qq5Q++ogNGwUJ/YnV6XqCS1Ig6oskjv4X/eCljDWVhxgW5aFYh7rh7JqMOznJT90jw1uwukKgjH9cwNLS4ALoIhCqFJwMCfFs3ChNZDnM= Authentication-Results: os.amperecomputing.com; dkim=none (message not signed) header.d=none; os.amperecomputing.com; dmarc=none action=none header.from=amperemail.onmicrosoft.com; Received: from DM6PR01MB5145.prod.exchangelabs.com (2603:10b6:5:56::16) by DM6PR01MB5995.prod.exchangelabs.com (2603:10b6:5:14d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Thu, 22 Jul 2021 16:36:07 +0000 Received: from DM6PR01MB5145.prod.exchangelabs.com ([fe80::a40b:475:ce32:50ab]) by DM6PR01MB5145.prod.exchangelabs.com ([fe80::a40b:475:ce32:50ab%7]) with mapi id 15.20.4352.026; Thu, 22 Jul 2021 16:36:07 +0000 Subject: Re: Add socsesor daemon to handle Ampere SoC sensors in dbus-sensors. To: Ed Tanous References: From: Thu Nguyen Message-ID: <0e248fdd-4517-434e-3288-6037bee44af1@amperemail.onmicrosoft.com> Date: Thu, 22 Jul 2021 23:35:59 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 In-Reply-To: Content-Type: multipart/alternative; boundary="------------5FC95433359985C59A07274E" Content-Language: en-US X-ClientProxiedBy: HK2PR0302CA0014.apcprd03.prod.outlook.com (2603:1096:202::24) To DM6PR01MB5145.prod.exchangelabs.com (2603:10b6:5:56::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2402:800:6344:4ed0:4d24:37d2:acb3:1492] (2402:800:6344:4ed0:4d24:37d2:acb3:1492) by HK2PR0302CA0014.apcprd03.prod.outlook.com (2603:1096:202::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Thu, 22 Jul 2021 16:36:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61ce35c4-dbf3-4780-9eaf-08d94d2ece45 X-MS-TrafficTypeDiagnostic: DM6PR01MB5995: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UNviJaks5zJqj4LtLZA4zxUUmVv9xXvXTiy3wKo4RlTeJqJi+oPkpusrnwlQIZwTXX1oQ2gGCd56WV13ZebAx7S8BSfgY2lekECTyYFBrm86QIvdq7QgWZ3ep159wJubzmBi2QwATQ7y76CaEBkOvyXRvLXnc0uiDPs5VQzif8aVVI5tPylkNsOiVGetbo4PH9vYZRRi1sb3P1DTD82fu5/WCdK1Z6/l8EmVDmSlWCEtF0pLrTHx3312fXZK5Ui3n+wxNtC0JIECRQKIuqzGnPPDVjjoQ1Hw+0YnbisV9RgwHmshyEqEs700Hlm/dg5CHfY4osHfIQUVvimmwsCe9WpnfF9peLncMhNX/A8JDKI5G0J2tk+2e6Wda7uWfunTNInV/GpJNzM+hD5MBMGL52odM38LfMRqpxJusTyFJ6AahpyOj6Pb5FPotkzaGaCcPJ2I+PUrpGVbeXK0TNqI74VaSxAw4xrqUrXVQpE2qbNHNQe+PAzjm/ewVV0DKoYq1k3BtKSuTDllEHOkROKC0CnSMZIuoJLQyE7kBk1Sci+Y2f1FaLv361p9ZTdpusXwlQUygO/Iu/JiCBiz0H8CHxEkWJbvUGPtRlnPFYtsIqgV9Qo/vcD0a5KRF4ScmyS8/tA//ikEe0WWedsHqffHCgkAagGFncpY8opbKJRp8vw9wbwSWUkr7iUy6XQakfujEPVWgscO7CJ+LjoMz0mYvA9yoDKRS73Pxo1EGJvVoaA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR01MB5145.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(366004)(376002)(39840400004)(136003)(31686004)(478600001)(66946007)(83170400001)(53546011)(6916009)(66476007)(66556008)(6666004)(33964004)(83380400001)(2616005)(52116002)(5660300002)(31696002)(8676002)(2906002)(30864003)(4326008)(42882007)(8936002)(107886003)(316002)(186003)(6486002)(54906003)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ckViTHhrUExrZzg0ZGwzemhwdVkwSm5aYWJlVHlmT1pOMkl4TUZ1WGRMSElC?= =?utf-8?B?MStmd2ZCZlEyemFJOGpGOFJBQWwvaFZ0dkpNVDQ3amdpbEJaNUtvUlQ3dEZl?= =?utf-8?B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S-Exchange-CrossTenant-Network-Message-Id: 61ce35c4-dbf3-4780-9eaf-08d94d2ece45 X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5145.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2021 16:36:07.5788 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BDDMM+EN/Bf7LNEU0E5fajHLpIuvtJBKA2K3plEPXqeDHI4ROX2ucOATWLwYbd3Ykuwvl6YcP/MQTRbnM2znoKzlnxs837lMBh4eznvNGGQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB5995 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "openbmc@lists.ozlabs.org" , Matt Spinler , Thang Nguyen OS Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" --------------5FC95433359985C59A07274E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 22/07/2021 23:15, Ed Tanous wrote: > On Thu, Jul 22, 2021 at 8:56 AM Thu Nguyen > wrote: >> Dear Ed Tanous, >> >> >> As we discussed before about the Ampere CPU daemon in OpenBmc general discord channel. I'm planing to submit the some patches which will add to AmpereSoC daemon source code to dbus-sensors for reviewing. This daemon will handle Ampere Altra SoC sensors. The functions of this daemon are the same as CPUSensor daemon which is handling Xeon CPU sensors. >> >> Below is what I will add. >> >> 1. Add some files to to Dbus-sensors source: >> >> ./src/AmpereSoCMain.cpp : Match the sensors configurations in entity-manager configuration file with sensor paths in the device driver. And create the SoC sensor dbus objects. > At this same time, we should rename "CPU sensor" to "Intel CPU" so we > can easily differentiate. Ideally your new daemon would also be > called "AmpereCPU" to keep the naming conventions the same. I will use AmpereCPU name. And will rename "CPU sensor" to "Intel CPU" > >> ./src/AmpereSoC.cpp : Create the sensor handler and update sensor values to the sensors dbus objects. >> >> ./include/AmpereSoC.hpp : Declare functions and constants. >> >> The structure and the functions of the files are similar the files which create ADCSensor daemon or PSUSensors daemon... >> >> 2. Add AmpereSoC daemon which will be named as "xyz.openbmc_project.socsensor.service". >> >> Below is dbus-sensors daemons in our system: > This list seems disconnected from AmpereSOC. Was there something you > were looking for input on there? > These are the list of daemons in our system: ~# systemctl | grep sensor phosphor-virtual-sensor.service active running Virtual sensors xyz.openbmc_project.adcsensor.service active running Adc Sensor xyz.openbmc_project.fansensor.service active running Fan Sensor xyz.openbmc_project.hwmontempsensor.service active running Hwmon Temp Sensor xyz.openbmc_project.psusensor.service active running PSU Sensor xyz.openbmc_project.socsensor.service active running SoC Sensor > > > 3. Add dbus interface to public sensor dbus objects. The name of this interface is "xyz.openbmc_project.SoCSensor". > > Below is some sensors in this dbus interface. > Neat. Below are some Ampere SoC sensors in SoCSensor dbus interface. ~# busctl tree xyz.openbmc_project.SoCSensor `-/xyz `-/xyz/openbmc_project |-/xyz/openbmc_project/inventory | `-/xyz/openbmc_project/inventory/system | `-/xyz/openbmc_project/inventory/system/chassis | `-/xyz/openbmc_project/inventory/system/chassis/motherboard | |-/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_1 | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_2 `-/xyz/openbmc_project/sensors |-/xyz/openbmc_project/sensors/current | |-/xyz/openbmc_project/sensors/current/S0_Core_VRD_Curr | |-/xyz/openbmc_project/sensors/current/S0_DIMM_VR1_Curr | |-/xyz/openbmc_project/sensors/current/S0_DIMM_VR2_Curr |-/xyz/openbmc_project/sensors/power | |-/xyz/openbmc_project/sensors/power/S0_Core_VRD_Pwr | |-/xyz/openbmc_project/sensors/power/S0_DIMM_VR1_Pwr | |-/xyz/openbmc_project/sensors/power/S0_DIMM_VR2_Pwr |-/xyz/openbmc_project/sensors/temperature | |-/xyz/openbmc_project/sensors/temperature/S0_Core_VRD_Temp | |-/xyz/openbmc_project/sensors/temperature/S0_DIMM_CH4_Temp | |-/xyz/openbmc_project/sensors/temperature/S0_DIMM_VRD_Temp `-/xyz/openbmc_project/sensors/voltage |-/xyz/openbmc_project/sensors/voltage/S0_CPU_VCORE |-/xyz/openbmc_project/sensors/voltage/S0_DIMM_VR1_Volt |-/xyz/openbmc_project/sensors/voltage/S0_DIMM_VR2_Volt >> >> >> 4. The causes of this adding are: >> + The Ampere SoCs and their interfaces are quite complicated to use the current daemons. > Considering that ampere CPUs support their own disparate OOB > interface, I suspect it's ideal that they would be separated out into > their own daemon. Currently, Our openbmc uses I2C and GPIO to communicate/monitor our CPU thru SCP to get sensors, errors and events. The openbmc is depend on SCP. > >> + We can't use CPUSensor daemon which is specific for Intel Xeon. We use I2C interface to access the SoC sensors which Intel Xeon using PCIE. > This is fine, and what I would've expected. CPU sensor is fairly > specific to PECI today. > >> + Our SoC hwmon drivers are different with the other hwmon drivers in linux kernel. We are using one MDF driver name ac01-smpro, it have three sub drivers ac01-hwmon which report the temperature, the consumed power, current and voltage of components in SOC. >> + In the near future, We append AmpereSoC daemon to monitor SoC RAS and SoC events as you suggested. >> >> Please let me know if you have any comments about this plan. > > I'm looking forward to the patches. I don't see any concerns, as > everything above looks like you're following the existing interfaces. > >> >> Thanks. >> >> Thu. >> >> >> >> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to Ampere Computing or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. Any unauthorized review, copying, or distribution of this email (or any attachments thereto) is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto. --------------5FC95433359985C59A07274E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit


On 22/07/2021 23:15, Ed Tanous wrote:
On Thu, Jul 22, 2021 at 8:56 AM Thu Nguyen
<thu@amperemail.onmicrosoft.com> wrote:
Dear Ed Tanous,


As we discussed before about the Ampere CPU daemon in OpenBmc general discord channel. I'm planing to submit the some patches which will add to AmpereSoC daemon source code to dbus-sensors for reviewing. This daemon will handle Ampere Altra SoC sensors. The functions of this daemon are the same as CPUSensor daemon which is handling Xeon CPU sensors.

Below is what I will add.

    1. Add some files to to Dbus-sensors source:

        ./src/AmpereSoCMain.cpp : Match the sensors configurations in entity-manager configuration file with sensor paths in the device driver. And create the SoC sensor dbus objects.
At this same time, we should rename "CPU sensor" to "Intel CPU" so we
can easily differentiate.  Ideally your new daemon would also be
called "AmpereCPU" to keep the naming conventions the same.
I will use AmpereCPU name. And will rename "CPU sensor" to "Intel CPU"

        ./src/AmpereSoC.cpp : Create the sensor handler and update sensor values to the sensors dbus objects.

        ./include/AmpereSoC.hpp : Declare functions and constants.

        The structure and the functions of the files are similar the files which create ADCSensor daemon or PSUSensors daemon...

    2. Add AmpereSoC daemon which will be named as "xyz.openbmc_project.socsensor.service".

        Below is dbus-sensors daemons in our system:
This list seems disconnected from AmpereSOC.  Was there something you
were looking for input on there?

These are the list of daemons in our system:
~# systemctl | grep sensor
phosphor-virtual-sensor.service                   active running   Virtual sensors
xyz.openbmc_project.adcsensor.service             active running   Adc Sensor
xyz.openbmc_project.fansensor.service             active running   Fan Sensor
xyz.openbmc_project.hwmontempsensor.service       active running   Hwmon Temp Sensor
xyz.openbmc_project.psusensor.service             active running   PSU Sensor
xyz.openbmc_project.socsensor.service             active running   SoC Sensor


    3. Add dbus interface to public sensor dbus objects. The name of this interface is "xyz.openbmc_project.SoCSensor".

        Below is some sensors in this dbus interface.
Neat.

Below are some Ampere SoC sensors in SoCSensor dbus interface.
~# busctl tree xyz.openbmc_project.SoCSensor
`-/xyz
`-/xyz/openbmc_project
    |-/xyz/openbmc_project/inventory
    | `-/xyz/openbmc_project/inventory/system
    |   `-/xyz/openbmc_project/inventory/system/chassis
    |     `-/xyz/openbmc_project/inventory/system/chassis/motherboard
    |       |-/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_1
    |       `-/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_2
    `-/xyz/openbmc_project/sensors
    |-/xyz/openbmc_project/sensors/current
    | |-/xyz/openbmc_project/sensors/current/S0_Core_VRD_Curr
    | |-/xyz/openbmc_project/sensors/current/S0_DIMM_VR1_Curr
    | |-/xyz/openbmc_project/sensors/current/S0_DIMM_VR2_Curr
    |-/xyz/openbmc_project/sensors/power
    | |-/xyz/openbmc_project/sensors/power/S0_Core_VRD_Pwr
    | |-/xyz/openbmc_project/sensors/power/S0_DIMM_VR1_Pwr
    | |-/xyz/openbmc_project/sensors/power/S0_DIMM_VR2_Pwr
    |-/xyz/openbmc_project/sensors/temperature
    | |-/xyz/openbmc_project/sensors/temperature/S0_Core_VRD_Temp
    | |-/xyz/openbmc_project/sensors/temperature/S0_DIMM_CH4_Temp
    | |-/xyz/openbmc_project/sensors/temperature/S0_DIMM_VRD_Temp
    `-/xyz/openbmc_project/sensors/voltage
        |-/xyz/openbmc_project/sensors/voltage/S0_CPU_VCORE
        |-/xyz/openbmc_project/sensors/voltage/S0_DIMM_VR1_Volt
        |-/xyz/openbmc_project/sensors/voltage/S0_DIMM_VR2_Volt

      


    4. The causes of this adding are:
        + The Ampere SoCs and their interfaces are quite complicated to use the current daemons.
Considering that ampere CPUs support their own disparate OOB
interface, I suspect it's ideal that they would be separated out into
their own daemon.
Currently, Our openbmc uses I2C and GPIO to communicate/monitor our CPU thru SCP to get sensors, errors and events.
The openbmc is depend on SCP.

        + We can't use CPUSensor daemon which is specific for Intel Xeon. We use I2C interface to access the SoC sensors which Intel Xeon using PCIE.
This is fine, and what I would've expected.  CPU sensor is fairly
specific to PECI today.

        + Our SoC hwmon drivers are different with the other hwmon drivers in linux kernel. We are using one MDF driver name ac01-smpro, it have three sub drivers ac01-hwmon which report the temperature, the consumed power, current and voltage of components in SOC.
        + In the near future, We append AmpereSoC daemon to monitor SoC RAS and SoC events as you suggested.

    Please let me know if you have any comments about this plan.

I'm looking forward to the patches.  I don't see any concerns, as
everything above looks like you're following the existing interfaces.


Thanks.

Thu.



CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to Ampere Computing or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. Any unauthorized review, copying, or distribution of this email (or any attachments thereto) is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.
--------------5FC95433359985C59A07274E--