From patchwork Fri May 15 18:52:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 11552889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF7A0138A for ; Fri, 15 May 2020 18:52:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDF2E206D8 for ; Fri, 15 May 2020 18:52:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="k+CvVpGd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726023AbgEOSwz (ORCPT ); Fri, 15 May 2020 14:52:55 -0400 Received: from mail-co1nam11on2083.outbound.protection.outlook.com ([40.107.220.83]:58624 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726144AbgEOSwy (ORCPT ); Fri, 15 May 2020 14:52:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DRDXF1zxbRn4RQgURAF+8s/13stEfjwplPsia8CdF9zoK7etndTtuIS+5u4YJgbtL3zY5YyJEJwxug5actThfILnR/RHjroDaGp5KMoyc9bRPbfMmItX9aHSWUgoc+3m7SWOZqx6mliD+wINBGqEoEIRndXlARZM9G4rIELdrxN38rLMaY8Uh9addKLlVFXKcmHDzBRQQjgnhMEFdJTqgaJefo/VybMjxnNKCuLBDXUfbYtDS5i9QJUhyEI4G4IGlPq/za/JNYnl3wAWN5IaXNwFS+ka6dFXMKrC3TmhanO7KabpjGn2DzqoemNhvZMrAs55B79VqaVyJFXfjQAgZw== 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=sy+rbwKbDpfBhGh3/LBKLt84hueo9PL2UoD11571M3E=; b=gbd9br+qzYtLGdfqI0W66+eZZm+kgLvq/CmNXa/B7LipT/qB+yGhPVmYoJToSqSRHRr4uTP+7Ao31i8dF4FF8NGMRyLAijIFoEuEWyCxo9yOLn7cvh9Az9GvMOsgVBqI/3SICZUdUjjRbQDQSoJR5Ta+tNDZohL1Ue54ZyaPqC/oQZ700N+uKTFYe90B3z34nlHeMqmtlVzbZnlHkTk2FNwvlDVLVV4UClUKgejMIn+1pb5Qv6Q3f7EkHIkqCcAxF7ckJUTo5x1aNOgIMgruw+No2YM2Ihc0jIEwK2Pr7R4VhsRgnKZW0ZDOl9nUo41EaP3EqyiUI3NSMzoc3eC01g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sy+rbwKbDpfBhGh3/LBKLt84hueo9PL2UoD11571M3E=; b=k+CvVpGdHjakD0jwGXDeosfxeTEmVzkBCiyM/jGW5+WJqr6qW7t1laGB3tKuz5HW767oLAIBXbr7SKHdtGOK/hZyq1amoZKMuSa6BiWLucFwQRTuRx/5Tqr885zmyHgTflkXeJG8dxz16fSjSpVKGHlhVrT5FStB3zLHxZZbKFE= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from BY5PR12MB4212.namprd12.prod.outlook.com (2603:10b6:a03:202::8) by BY5PR12MB3891.namprd12.prod.outlook.com (2603:10b6:a03:1a3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Fri, 15 May 2020 18:52:50 +0000 Received: from BY5PR12MB4212.namprd12.prod.outlook.com ([fe80::9ce:3ab2:f0ee:47b2]) by BY5PR12MB4212.namprd12.prod.outlook.com ([fe80::9ce:3ab2:f0ee:47b2%5]) with mapi id 15.20.3000.016; Fri, 15 May 2020 18:52:50 +0000 From: Naveen Krishna Chatradhi To: linux-hwmon@vger.kernel.org Cc: naveenkrishna.ch@gmail.com, Naveen Krishna Chatradhi , Guenter Roeck Subject: [PATCH 1/3 v6] hwmon: Add amd_energy driver to report energy counters Date: Sat, 16 May 2020 00:22:32 +0530 Message-Id: <20200515185234.30687-1-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: MA1PR0101CA0034.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::20) To BY5PR12MB4212.namprd12.prod.outlook.com (2603:10b6:a03:202::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from milan-ETHANOL-X.amd.com (165.204.156.251) by MA1PR0101CA0034.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Fri, 15 May 2020 18:52:48 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.156.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3156ab32-0fc4-46b5-1705-08d7f9012aaa X-MS-TrafficTypeDiagnostic: BY5PR12MB3891: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:338; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h1Qmit3aK9Wght5AtCV+qEpGoYLqcFj93R5+x/PKlZ1aInXS9jIFPBKxeT9er+b4SKdabWO9/nfp4NsFj3yCPnmcPwY3L9nIlKQ3ytiR/DUDD++R7/7Aw9Sn6V72wLU7B4wS7tWeYuh1amTR2WoNONdNPnWXup6sRVRkGCVfhZjldK2ctG1flnlZt9uCmRxClQZOxqRl7fCkYh/MtjjW+Oxq4eCbJ09tZt/O/hNJyjqohweUT7vtZYoNHK4A9XRCeJBXkMtOX9BNmjLphRWh2wPY2VaUMzVXE08WaIoFhCgSVgvyO96golje7XKvwi2Bo2rriKnPlTu1IarTA3lCfG+bWNrA6avk06bDEjJ+XuIrrpSHI2wt6vMt4J1jvFWvuOJ9rYs0w/8ca39MvVbQUxNBpc/GmXDyReHb4b+v7tHvNR+RnMZu9ZQ4A++tfvlxuzawPv+WhFPlJlAA9F5n4l3qKJSa40/Z2Rj1g84ksnHyfTKUGBpu6AhH3OwcZ4NG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4212.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(136003)(346002)(396003)(39860400002)(366004)(6486002)(52116002)(7696005)(8676002)(8936002)(36756003)(478600001)(5660300002)(26005)(30864003)(316002)(2616005)(66556008)(66476007)(16526019)(2906002)(6916009)(956004)(54906003)(1076003)(66946007)(6666004)(186003)(4326008)(6606295002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tUhssKCxSXs18g+tbNQyhFVYV/f4YbLo0vzbdYDwFY2g5mIVCpWFTFWt61Dq2nLpKNPAD+jjuBJBsDEa7FgqSOMcsTts8iZgq067vTR7krx9ZRyZkNVVWEccb6feOAF3lq6JT8RD8zL219+rrsUUEqe0u1ePmUvl9GgHDO1SVnIngqSzKqfQr+V15QttUilGwG6153gNSJJULvtyX2kCINQC8Fcqgbo43Axm9LQGPNWF83GpE5pj/oZL2qehQboAzjURgEIe4yhwrvyURs6HjyHvZQ7A2YX2lgYtoADEvbeXZY2JtzL5Rc+8PFR0V4KdRibl5AYG61nPJ9/Mf/y5QGlcVZcLA3Lw1vt9K6HPAP2BopeeDOzyPozNHLD0mQFindPGcSxFTIB6J57z9lCkp9WPa7Y1TcZZtBrGAPHaLevPfSVlZtur3VgxYgusVAL/4lK1oB+eEVrUWLh8IcxDDyOyqlprdYmx5zHSsP3hKZhEXZgq13YPPNb5yAlTIfvr X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3156ab32-0fc4-46b5-1705-08d7f9012aaa X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 18:52:50.4408 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6lChcxw+LhPtY8adlt6hOVa6KG0RG8iKMu+YJ2QRE6WKFuDuvCrFOtTGGqsmaKUZtfUIjdhmfFXH5FizYqx6og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3891 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org This patch adds hwmon based amd_energy driver support for family 17h processors from AMD. The driver provides following interface to the userspace 1. Reports the per core consumption * file: "energy%d_input", label: "Ecore%03d" 2. Reports per socket energy consumption * file: "energy%d_input", label: "Esocket%d" 3. To, increase the wrap around time of the socket energy counters, a 64bit accumultor is implemented. 4. Reports scaled energy value in Joules. Cc: Guenter Roeck Signed-off-by: Naveen Krishna Chatradhi --- Changes in v6: 1. Implement core accumulation 2. Remove enumurating sibling threads 3. Fix bug in accumulation 4. Few other minor comments addressed drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/amd_energy.c | 413 +++++++++++++++++++++++++++++++++++++ 3 files changed, 424 insertions(+) create mode 100644 drivers/hwmon/amd_energy.c diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 4c62f900bf7e..e165e10c49ef 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -324,6 +324,16 @@ config SENSORS_FAM15H_POWER This driver can also be built as a module. If so, the module will be called fam15h_power. +config SENSORS_AMD_ENERGY + tristate "AMD RAPL MSR based Energy driver" + depends on X86 + help + If you say yes here you get support for core and package energy + sensors, based on RAPL MSR for AMD family 17h and above CPUs. + + This driver can also be built as a module. If so, the module + will be called as amd_energy. + config SENSORS_APPLESMC tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" depends on INPUT && X86 diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index b0b9c8e57176..318f89dc7133 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -45,6 +45,7 @@ obj-$(CONFIG_SENSORS_ADT7411) += adt7411.o obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o +obj-$(CONFIG_SENSORS_AMD_ENERGY) += amd_energy.o obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o obj-$(CONFIG_SENSORS_ARM_SCMI) += scmi-hwmon.o obj-$(CONFIG_SENSORS_ARM_SCPI) += scpi-hwmon.o diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c new file mode 100644 index 000000000000..f2cd5e2e1339 --- /dev/null +++ b/drivers/hwmon/amd_energy.c @@ -0,0 +1,413 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/* + * Copyright (C) 2020 Advanced Micro Devices, Inc. + */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "amd_energy" + +#define ENERGY_PWR_UNIT_MSR 0xC0010299 +#define ENERGY_CORE_MSR 0xC001029A +#define ENERGY_PKG_MSR 0xC001029B + +#define AMD_ENERGY_UNIT_MASK 0x01F00 +#define AMD_ENERGY_MASK 0xFFFFFFFF + +struct amd_energy_data { + struct hwmon_channel_info energy_info; + const struct hwmon_channel_info *info[2]; + struct hwmon_chip_info chip; + /* Lock around the accumulator */ + struct mutex lock; + /* Energy Status Units */ + u64 energy_units; + /* An accumulator for each socket */ + u64 *sock_energy_ctrs; + u64 *core_energy_ctrs; + u64 *sock_prev_value; + u64 *core_prev_value; +}; + +static struct task_struct *wrap_accumulate; +static int nr_cpus, nr_socks; +static char buf[10]; + +static int amd_energy_read_labels(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, + const char **str) +{ + if (channel >= nr_cpus) + scnprintf(buf, 10, "Esocket%u", channel - nr_cpus); + else + scnprintf(buf, 10, "Ecore%03u", channel); + + *str = buf; + + return 0; +} + +static int get_energy_units(struct amd_energy_data *data) +{ + u64 rapl_units; + int ret; + + ret = rdmsrl_safe(ENERGY_PWR_UNIT_MSR, &rapl_units); + if (ret) + return ret; + + data->energy_units = (rapl_units & AMD_ENERGY_UNIT_MASK) >> 8; + return 0; +} + +static void amd_accumulate_delta(struct amd_energy_data *data, + u64 input, int cu, bool is_core) +{ + input &= AMD_ENERGY_MASK; + + mutex_lock(&data->lock); + if (!is_core) { + if (input >= data->sock_prev_value[cu]) + data->sock_energy_ctrs[cu] += + input - data->sock_prev_value[cu]; + else + data->sock_energy_ctrs[cu] += UINT_MAX - + data->sock_prev_value[cu] + input; + + data->sock_prev_value[cu] = input; + } else { + if (input >= data->core_prev_value[cu]) + data->core_energy_ctrs[cu] += + input - data->core_prev_value[cu]; + else + data->core_energy_ctrs[cu] += UINT_MAX - + data->core_prev_value[cu] + input; + + data->core_prev_value[cu] = input; + } + mutex_unlock(&data->lock); +} + +static int read_accumulate(struct amd_energy_data *data) +{ + int ret, cu; + u64 input = 0, core_input = 0; + static int core_id; + + for (cu = 0; cu < nr_socks; cu++) { + int cpu; + + cpu = cpumask_first_and(cpu_online_mask, + cpumask_of_node(cu)); + + ret = rdmsrl_safe_on_cpu(cpu, ENERGY_PKG_MSR, &input); + if (ret) + return ret; + + amd_accumulate_delta(data, input, cu, false); + } + + if (core_id >= nr_cpus) + core_id = 0; + + if (!cpu_online(core_id)) { + ret = -ENODEV; + goto out; + } + + ret = rdmsrl_safe_on_cpu(core_id, ENERGY_CORE_MSR, &core_input); + if (ret) + goto out; + + amd_accumulate_delta(data, core_input, core_id, true); + +out: + core_id++; + return ret; +} + +static void amd_add_delta(struct amd_energy_data *data, + u64 *input, int ch, bool is_core) +{ + mutex_lock(&data->lock); + if (!is_core) { + if (*input >= data->sock_prev_value[ch]) + *input += data->sock_energy_ctrs[ch] - + data->sock_prev_value[ch]; + else + *input += UINT_MAX - data->sock_prev_value[ch] + + data->sock_energy_ctrs[ch]; + } else { + if (*input >= data->core_prev_value[ch]) + *input += data->core_energy_ctrs[ch] - + data->core_prev_value[ch]; + else + *input += UINT_MAX - data->core_prev_value[ch] + + data->core_energy_ctrs[ch]; + } + mutex_unlock(&data->lock); +} + +static int amd_energy_read(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, long *val) +{ + struct amd_energy_data *data = dev_get_drvdata(dev); + int ret, cpu; + u64 input; + bool is_core; + + if (channel >= nr_cpus) { + is_core = false; + channel = channel - nr_cpus; + cpu = cpumask_first_and(cpu_online_mask, + cpumask_of_node + (channel)); + ret = rdmsrl_safe_on_cpu(cpu, ENERGY_PKG_MSR, &input); + if (ret) + return -EAGAIN; + } else { + is_core = true; + cpu = channel; + if (!cpu_online(cpu)) + return -ENODEV; + + ret = rdmsrl_safe_on_cpu(cpu, ENERGY_CORE_MSR, &input); + if (ret) + return -EAGAIN; + } + + input &= AMD_ENERGY_MASK; + amd_add_delta(data, &input, channel, is_core); + + if (data->energy_units == 0 && get_energy_units(data)) + return -EAGAIN; + + /* Energy consumed = (1/(2^ESU) * RAW * 1000000UL) μJoules */ + *val = (long)div64_ul(input * 1000000UL, + BIT(data->energy_units)); + + return 0; +} + +static umode_t amd_energy_is_visible(const void *_data, + enum hwmon_sensor_types type, + u32 attr, int channel) +{ + return 0444; +} + +static int energy_accumulator(void *p) +{ + struct amd_energy_data *data = (struct amd_energy_data *)p; + + while (!kthread_should_stop()) { + /* + * Ignoring the conditions such as + * cpu being offline or rdmsr failure + */ + read_accumulate(data); + + set_current_state(TASK_INTERRUPTIBLE); + if (kthread_should_stop()) + break; + + /* + * On a 240W system, with default resolution the + * Socket Energy status register may wrap around in + * 2^32*15.3 e-6/240 = 273.8041 secs (~4.5 mins) + * + * let us accumulate for every 100secs + */ + schedule_timeout(msecs_to_jiffies(100000)); + } + return 0; +} + +static const struct hwmon_ops amd_energy_ops = { + .is_visible = amd_energy_is_visible, + .read = amd_energy_read, + .read_string = amd_energy_read_labels, +}; + +static int amd_create_sensor(struct device *dev, + struct amd_energy_data *data, + u8 type, u32 config) +{ + int i, num_siblings; + u32 *s_config; + struct hwmon_channel_info *info = &data->energy_info; + + /* Identify the number of siblings per core */ + num_siblings = ((cpuid_ebx(0x8000001e) >> 8) & 0xff) + 1; + + nr_socks = num_possible_nodes(); + + /* + * Energy counter register is accessed at core level. + * Hence, filterout the siblings. + */ + nr_cpus = num_present_cpus()/num_siblings; + + s_config = devm_kcalloc(dev, nr_cpus + nr_socks, + sizeof(u32), GFP_KERNEL); + if (!s_config) + return -ENOMEM; + + data->sock_energy_ctrs = devm_kcalloc(dev, nr_socks, + sizeof(u64), GFP_KERNEL); + if (!data->sock_energy_ctrs) + return -ENOMEM; + + data->core_energy_ctrs = devm_kcalloc(dev, nr_cpus, + sizeof(u64), GFP_KERNEL); + if (!data->core_energy_ctrs) + return -ENOMEM; + + data->sock_prev_value = devm_kcalloc(dev, nr_socks, + sizeof(u64), GFP_KERNEL); + if (!data->sock_prev_value) + return -ENOMEM; + + data->core_prev_value = devm_kcalloc(dev, nr_cpus, + sizeof(u64), GFP_KERNEL); + if (!data->core_prev_value) + return -ENOMEM; + + info->type = type; + info->config = s_config; + + for (i = 0; i < nr_cpus + nr_socks; i++) + s_config[i] = config; + + return 0; +} + +static int amd_energy_probe(struct platform_device *pdev) +{ + struct device *hwmon_dev; + struct amd_energy_data *data; + struct device *dev = &pdev->dev; + int ret; + + data = devm_kzalloc(dev, + sizeof(struct amd_energy_data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->chip.ops = &amd_energy_ops; + data->chip.info = data->info; + + /* Populate per-core energy reporting */ + data->info[0] = &data->energy_info; + amd_create_sensor(dev, data, hwmon_energy, + HWMON_E_INPUT | HWMON_E_LABEL); + + mutex_init(&data->lock); + + ret = get_energy_units(data); + if (ret) + return ret; + + hwmon_dev = devm_hwmon_device_register_with_info(dev, DRVNAME, + data, + &data->chip, + NULL); + if (IS_ERR(hwmon_dev)) + return PTR_ERR(hwmon_dev); + + wrap_accumulate = kthread_run(energy_accumulator, data, + "%s", dev_name(hwmon_dev)); + if (IS_ERR(wrap_accumulate)) + return PTR_ERR(wrap_accumulate); + + return PTR_ERR_OR_ZERO(wrap_accumulate); +} + +static int amd_energy_remove(struct platform_device *pdev) +{ + if (wrap_accumulate) + kthread_stop(wrap_accumulate); + + return 0; +} + +static const struct platform_device_id amd_energy_ids[] = { + { .name = DRVNAME, }, + {} +}; +MODULE_DEVICE_TABLE(platform, amd_energy_ids); + +static struct platform_driver amd_energy_driver = { + .probe = amd_energy_probe, + .remove = amd_energy_remove, + .id_table = amd_energy_ids, + .driver = { + .name = DRVNAME, + }, +}; + +static struct platform_device *amd_energy_platdev; + +static const struct x86_cpu_id cpu_ids[] __initconst = { + X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL), + {} +}; +MODULE_DEVICE_TABLE(x86cpu, cpu_ids); + +static int __init amd_energy_init(void) +{ + int ret; + + if (!x86_match_cpu(cpu_ids)) + return -ENODEV; + + ret = platform_driver_register(&amd_energy_driver); + if (ret) + return ret; + + amd_energy_platdev = platform_device_alloc(DRVNAME, 0); + if (!amd_energy_platdev) + return -ENOMEM; + + ret = platform_device_add(amd_energy_platdev); + if (ret) { + platform_device_put(amd_energy_platdev); + platform_driver_unregister(&amd_energy_driver); + return ret; + } + + return ret; +} + +static void __exit amd_energy_exit(void) +{ + platform_device_unregister(amd_energy_platdev); + platform_driver_unregister(&amd_energy_driver); +} + +module_init(amd_energy_init); +module_exit(amd_energy_exit); + +MODULE_DESCRIPTION("Driver for AMD Energy reporting from RAPL MSR via HWMON interface"); +MODULE_AUTHOR("Naveen Krishna Chatradhi "); +MODULE_LICENSE("GPL"); From patchwork Fri May 15 18:52:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 11552891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 333A1138A for ; Fri, 15 May 2020 18:53:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17FCF20728 for ; Fri, 15 May 2020 18:53:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="UFnYWvNY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726221AbgEOSxB (ORCPT ); Fri, 15 May 2020 14:53:01 -0400 Received: from mail-eopbgr700061.outbound.protection.outlook.com ([40.107.70.61]:23904 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726144AbgEOSxB (ORCPT ); Fri, 15 May 2020 14:53:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZjnTFaehwPo/12rGEFp39pDUH8FUOv4DZVXZ9Y3uuYB8QcIfmO2Kg2/Zir14ZdOq5nBtvAPrSnWyqpU/J48jTmXxKALFbr8u9oJFPptr1jWHa2qoHU5JkErPriZ1lfGFZXKzKtQ1HXGSaFvbAJpucw7HWk/eUXdCnFCAJX/deBDtGBYf6+KOTugW2Q6YxnlLvVnQhDRWbk7/BieOEacHYZUay2qCXXwsdWuQV8TAuK0uusQ/sFLeX+5f/YiWwwH1THKhWy5Rtf7jD8Z5jWAX8g9hJ/A+uxa/p+BMjRaIXcFht4Cn6JP9OJsZGPNIGLAes0xatV4KQPQmk6jTSyufSw== 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=Hb8cIk+3E8YbhwNG2ftK6AU63vjk07+cDbSEsuJ4mfg=; b=BNJKsBdMpoigwWtWHnjGBgp0ZBFZt1LLV2jWFZd8bF2Xm4cU/dv6nfBllnU7QtqS2BCSlJTRFThH0SA/DwYY9H9qDJp4fGxYvco+dJQOlOz8n8Zg76oly7zjNfysAeK7rYTRADNRT3N66SrRRHUKtQo48piI+EC4zfQ3Is4ZHWnnAGMXbdtsokQ5bH45S89VukEktKThIFUlCG07ulN1uL7TEETwxhIw9aYueHEnYe3o1pSH4tOWEQOFx0MbDohdrqLUTtu9vzVR9HCQM0R9tre2PaUDkMT2TqidpiE8JfIdpdRImwlh/scK0sFZ6r3gkxBqOSBJEhx8yML5867VHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hb8cIk+3E8YbhwNG2ftK6AU63vjk07+cDbSEsuJ4mfg=; b=UFnYWvNYCtUnJI2Qtp4l/nres2XspKz+U5MrHFzbfCrMJ+1Evr7wkeS4tsouY7620qsVQxLYWDIRV2zZJtC0VqhOXEDajp80O+TipkT7OJHSFJmpI+Bn44NUYHNf79XsY7XocKsSr/pNs4IoBmGVG5ES6KU43mI2tVERrHiMaAg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from BY5PR12MB4212.namprd12.prod.outlook.com (2603:10b6:a03:202::8) by BY5PR12MB3860.namprd12.prod.outlook.com (2603:10b6:a03:1ac::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Fri, 15 May 2020 18:52:58 +0000 Received: from BY5PR12MB4212.namprd12.prod.outlook.com ([fe80::9ce:3ab2:f0ee:47b2]) by BY5PR12MB4212.namprd12.prod.outlook.com ([fe80::9ce:3ab2:f0ee:47b2%5]) with mapi id 15.20.3000.016; Fri, 15 May 2020 18:52:58 +0000 From: Naveen Krishna Chatradhi To: linux-hwmon@vger.kernel.org Cc: naveenkrishna.ch@gmail.com, Naveen Krishna Chatradhi , Guenter Roeck Subject: [PATCH 2/3 v6] hwmon: (amd_energy) Add documentation Date: Sat, 16 May 2020 00:22:33 +0530 Message-Id: <20200515185234.30687-2-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200515185234.30687-1-nchatrad@amd.com> References: <20200515185234.30687-1-nchatrad@amd.com> X-ClientProxiedBy: MA1PR0101CA0034.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::20) To BY5PR12MB4212.namprd12.prod.outlook.com (2603:10b6:a03:202::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from milan-ETHANOL-X.amd.com (165.204.156.251) by MA1PR0101CA0034.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Fri, 15 May 2020 18:52:56 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.156.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4d6c3325-3a71-4445-3e7b-08d7f9012f5c X-MS-TrafficTypeDiagnostic: BY5PR12MB3860: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mr9CyKQj73VNog7OjV5NBa81OcqOgZ6LuRh519D5iUTx5v4FbnDJFX8hSlFzPLZH8lAocvclQkdqNVUUx2VKLyeMS8416IRdimqFlWmdlM5r8T4Vz3OhvN6IHCO0UfKh1u9UbzQ1JALLEEpRqt1ajAcOaTRFbiZyvkPNVHEQ8P/lJAm+cFl9c1Uc3C7H9gUaQdfMwMTwdA60DyKYpIwcMLdzbJgAvgkl6R1j4nAAvgyFLV3ZPKhzC6HcaD2ayubZddkUczRmnUw8f8/qMOzZR5W6GDbFkokHdNWOSvvJu9koVjHVpPe2L7Zne5/3brhO+/k99SEaAy2G/eps5Gm/1BeuZxljrFhGWSBp/bOPtYcYWng8xGHmD+Y+vRnMNMCjqKYSiK5XMjY+khHmI2thNb14kMJT8CZaDSezi/LSCQXW3XhrEo6QKrpxs7JjEpfUAAc4Oq4JQevxx873Gqwda8xdZ6XMJJdn3Nm+N4Oo7fCbBWiSUH1NaZE7QFz6L/gu4Awy/Qrkiue7DQjESX8rOwHlPme3mONS3PTrXKQmrSgHWbdyYmMWXsbL4AMORCQJnfVxqQuKe5xCmAX8ujQhV9PbEE9ELOR5SuTvQgU8iUo0xgJKuge0Lr+YX/C1PpJa X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4212.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(2906002)(36756003)(7696005)(6916009)(478600001)(66946007)(956004)(5660300002)(66556008)(186003)(4326008)(52116002)(1076003)(66476007)(16526019)(2616005)(6486002)(8676002)(8936002)(6666004)(54906003)(26005)(966005)(316002)(24770200002)(43620500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0Z7AScBfq9IhV3Epy6wy8huA6fU2q1/ZCbZfVvLG2qHEhliESbTA8CHcXdwxdT/djiAnjiXdGHXwxqAX73VONsV6jcgbIVt4GhXyNYMuPxLAsrByQZJlkM91ncoPgeatuHMwCar8tQCXNH8aHPllLTJQ7cmvOAp3AqNkLJa8qpZYu3n7evYr7UoZmLTYDWyBjX2x1vxs+MzD2+hk8Sbo3M5firjabSlrDR/m3PiIvax6YxcZ1yVyldhj2VfkxgY2QAwPS26YY+xT0876gGUcGT9oM5Tzs/mdr2QDbDFEP95fKXY+hZ+kOTTm2sFK+Ad49/nDUgDG03fV3LXPEt3wi65FIBgPYhL8MegDEuLlJRnttWZ4SmDuSJNl6loCbhB2h/QafkYJsoeBV9cknjHO7GPH3qpLr7VES1xYVGfWyYJ8AlNCKWSr0aiIG7r7/XHYcWBL/M9pZ1hvveD6rz7mh5rgpwoSkoC7RsE1DbTdaL98q1ovzv0cBwxaidGiXDoO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d6c3325-3a71-4445-3e7b-08d7f9012f5c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 18:52:58.3053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w/zjvrYJjfkOl4SHfaUcXnPknrZnsTaPpCFv2tMFbcSi565FB4jU2wcLoASh72OMY+eSadxhjOO3onHGUwWJmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3860 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Document amd_energy driver with all chips supported by it. Cc: Guenter Roeck Signed-off-by: Naveen Krishna Chatradhi --- Changes in v6: 1. Update energy accumulation section Documentation/hwmon/amd_energy.rst | 103 +++++++++++++++++++++++++++++ Documentation/hwmon/index.rst | 1 + 2 files changed, 104 insertions(+) create mode 100644 Documentation/hwmon/amd_energy.rst diff --git a/Documentation/hwmon/amd_energy.rst b/Documentation/hwmon/amd_energy.rst new file mode 100644 index 000000000000..4bf5997db22b --- /dev/null +++ b/Documentation/hwmon/amd_energy.rst @@ -0,0 +1,103 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver amd_energy +========================== + +Supported chips: + +* AMD Family 17h Processors + + Prefix: 'amd_energy' + + Addresses used: RAPL MSRs + + Datasheets: + + - Processor Programming Reference (PPR) for AMD Family 17h Model 01h, Revision B1 Processors + + https://developer.amd.com/wp-content/resources/55570-B1_PUB.zip + + - Preliminary Processor Programming Reference (PPR) for AMD Family 17h Model 31h, Revision B0 Processors + + https://developer.amd.com/wp-content/resources/56176_ppr_Family_17h_Model_71h_B0_pub_Rev_3.06.zip + +Author: Naveen Krishna Chatradhi + +Description +----------- + +The Energy driver exposes the energy counters that are +reported via the Running Average Power Limit (RAPL) +Model-specific Registers (MSRs) via the hardware monitor +(HWMON) sysfs interface. + +1. Power, Energy and Time Units + MSR_RAPL_POWER_UNIT/ C001_0299: + shared with all cores in the socket + +2. Energy consumed by each Core + MSR_CORE_ENERGY_STATUS/ C001_029A: + 32-bitRO, Accumulator, core-level power reporting + +3. Energy consumed by Socket + MSR_PACKAGE_ENERGY_STATUS/ C001_029B: + 32-bitRO, Accumulator, socket-level power reporting, + shared with all cores in socket + +These registers are updated every 1ms and cleared on +reset of the system. + +Energy Caluclation +------------------ + +Energy information (in Joules) is based on the multiplier, +1/2^ESU; where ESU is an unsigned integer read from +MSR_RAPL_POWER_UNIT register. Default value is 10000b, +indicating energy status unit is 15.3 micro-Joules increment. + +Reported values are scaled as per the formula + +scaled value = ((1/2^ESU) * (Raw value) * 1000000UL) in uJoules + +Users calculate power for a given domain by calculating + dEnergy/dTime for that domain. + +Energy accumulation +-------------------------- + +Current, Socket energy status register is 32bit, assuming a 240W +2P system, the register would wrap around in + + 2^32*15.3 e-6/240 * 2 = 547.60833024 secs to wrap(~9 mins) + +The Core energy register may wrap around after several days. + +To improve the wrap around time, a kernel thread is implemented +to accumulate the socket energy counters and one core energy counter +per run to a respective 64-bit counter. The kernel thread starts +running during probe, wakes up every 100secs and stops running +when driver is removed. + +A socket and core energy read would return the current register +value added to the respective energy accumulator. + +Sysfs attributes +---------------- + +=============== ======== ===================================== +Attribute Label Description +=============== ======== ===================================== + +* For index N between [1] and [nr_cpus] + +=============== ======== ====================================== +energy[N]_input EcoreX Core Energy X = [0] to [nr_cpus - 1] + Measured input core energy +=============== ======== ====================================== + +* For N between [nr_cpus] and [nr_cpus + nr_socks] + +=============== ======== ====================================== +energy[N]_input EsocketX Socket Energy X = [0] to [nr_socks -1] + Measured input socket energy +=============== ======== ====================================== diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst index 8ef62fd39787..fc4b89810e67 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst @@ -39,6 +39,7 @@ Hardware Monitoring Kernel Drivers adt7470 adt7475 amc6821 + amd_energy asb100 asc7621 aspeed-pwm-tacho From patchwork Fri May 15 18:52:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 11552893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB269138A for ; Fri, 15 May 2020 18:53:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3FA2206D8 for ; Fri, 15 May 2020 18:53:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="n8D/TSVH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726223AbgEOSxD (ORCPT ); Fri, 15 May 2020 14:53:03 -0400 Received: from mail-eopbgr700077.outbound.protection.outlook.com ([40.107.70.77]:45217 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726144AbgEOSxD (ORCPT ); Fri, 15 May 2020 14:53:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D4mhE9wJnOUMKEvgP4/NSHeyxZMpchVz6wloZRP4qPs9t2aE5GSVN+6AI0tmP1OfUPMXcmD8ThRzI2G00tIV7ughYroW/hFV+3V4XY56RZkP6lc98eogr9GavN0op0rTPEnHhgEYbftsfvRR/WDA4rV0gc6zy8r6N7+0HC+NWvXW/U3walwI+9QSkSZHJjUPU5SWKVDGlZXka5eWsu8swD8lbOEJG9UBMe7bx6fFprN11Oi6BFUoHHncmZNp2NKuft90MgFXayZ+uHqTFED1vstPxeL9GF6E86T/ifn4HFFPrtzNcZqx+z2GMX8o0f7Ydxr7b9OzVdFNiOv5GeEhMQ== 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=OOinFidRBjYbV5iC5lH6fB1KecSfu632JbR9h4uoYmg=; b=LbXL3DJeyIs6Ih3nra+WhkNeWvew9mduHfM52Oo8XqyODm0Bl8x/LQxWdrrBiywr3SuE+qD8pNZ+fwrBvsTSIZrvMPMyosbjDDB94G8sF9yLOKxiWWHCGuJLYMiV+OXdzlVjqveXIgRAYYESpzE/ouFPUs+ATJAyrbzT1IRRGJH9DEbGkgfANEdXwv6MbNhPTronw1DVN9t4M8WVLHAzosjWC3vyVFAfiHgz4qIWJP9BIfAimjCcYkAsXC1rVbfRFeTpD8yhvQCFjKPkTEWj626badkM6i8DDIflfTlXXMwKYPKTQHJMIdXacTt3PqmNcICsDMbAARMYMceli5xvnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OOinFidRBjYbV5iC5lH6fB1KecSfu632JbR9h4uoYmg=; b=n8D/TSVHY3kMVlNwFRzTiUpFW1lzonGeD/+HRCZ9IkCceVG3Vz2CVMAOt4Bm/xr9A5gWw+GwbTjk3GXoQlegTWWvj+i0J3LfzPoQ3+JyOvoxOT4FPPoEUa7Zq44d4yByqEME1uHil+6Tv2VZwjizU/l3RID8mXb6C5KGTnuX/tI= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from BY5PR12MB4212.namprd12.prod.outlook.com (2603:10b6:a03:202::8) by BY5PR12MB3860.namprd12.prod.outlook.com (2603:10b6:a03:1ac::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Fri, 15 May 2020 18:53:01 +0000 Received: from BY5PR12MB4212.namprd12.prod.outlook.com ([fe80::9ce:3ab2:f0ee:47b2]) by BY5PR12MB4212.namprd12.prod.outlook.com ([fe80::9ce:3ab2:f0ee:47b2%5]) with mapi id 15.20.3000.016; Fri, 15 May 2020 18:53:01 +0000 From: Naveen Krishna Chatradhi To: linux-hwmon@vger.kernel.org Cc: naveenkrishna.ch@gmail.com, Naveen Krishna Chatradhi , Guenter Roeck Subject: [PATCH 3/3 v6] MAINTAINERS: add entry for AMD energy driver Date: Sat, 16 May 2020 00:22:34 +0530 Message-Id: <20200515185234.30687-3-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200515185234.30687-1-nchatrad@amd.com> References: <20200515185234.30687-1-nchatrad@amd.com> X-ClientProxiedBy: MA1PR0101CA0034.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::20) To BY5PR12MB4212.namprd12.prod.outlook.com (2603:10b6:a03:202::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from milan-ETHANOL-X.amd.com (165.204.156.251) by MA1PR0101CA0034.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Fri, 15 May 2020 18:52:59 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.156.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4f552f04-3660-46a7-8d6e-08d7f9013123 X-MS-TrafficTypeDiagnostic: BY5PR12MB3860: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qf67kYDSz85BpMzRvtgINGSD6DcVLNfr5+cBIy+MXhQC/epdQe7qBkk1MKqzGiZG76GcFhnohyBq7h5s0PXc99CC781XXfu6iVBxtGiEtGveLfx+eHc0NPYNCLXSj5YXRchf+zJwGhwTmu8Jlg6VCGgPq9XZulSlmD6fBD8tLjejeeVKS4dtXIimwAoohPqGQDV4Trtotjis78pR8qbjjtN7jCzo50J337tUIixl3ZkU3+yFTkcln79Kd2LG9EvW56ofN6zgI8oILDhYdnTskEG/Zb+J3WB5+LdowR6ysYvwcpeOixilIXawzZykENgU+STxVTJiDlIUinb8PDOhIk+orLWegF0Yjw7FHj3z37XZrn4Lx2Z7kuLA1X+nfFAiJ3bpxtGoxmLaYC9Zo4yPEhvGoFHIx4PPYx7WWm4BB9V7TBHcHgDFizfIVgfihcnI X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4212.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(2906002)(36756003)(7696005)(6916009)(478600001)(66946007)(956004)(5660300002)(4744005)(66556008)(186003)(4326008)(52116002)(1076003)(66476007)(16526019)(2616005)(6486002)(8676002)(8936002)(6666004)(54906003)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: QAn+w/KuHhLPQLrcm2KcLFaAHnlTzTeVHYqSS1/UqcObRxp2+wdkX8HQE5lOOpELQkHlTpshvX7PV1kA49EWWNaPq/luE5bvFV4UrjN9R7HyGIHNwOO0pjnGrOCanaXtYEG+cY053NguEdpCmbnlqgFX2K1tKIroa8mObobqBKoyIH4OMhag+FFOwpbirI3yOIYTA11cfWUspykdLzV+tY9+grZCFC0zn6mXSOHzV7bfTxghOSKyFazUuEi/ukTInk+TUYv139K5ufZRwFVVM08qLwhsEBO8P34C1t9pqk5xJvQaSovRFMobeiprSZmIYM7NK0BOxfQP9HqYFZaT2THKHN4gVbc1H8aPn8MHHNwZzFYUw40cZ/2KHxvlKE49FlAIHZ1SjKH8TAvM9N0vFnExWJD5whfZOS62dcf2jgj6mfZom2by2LbG/EasDErNJb2LClc1GmFr/ZoGEOUwgCqJG1EI2gaYWQOLc1wWEAqUew9eIeErNjc5DB8ooeOZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f552f04-3660-46a7-8d6e-08d7f9013123 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 18:53:01.5690 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CiEe0EoPyrewl3w3Hy7J7sO6JJjOENqtNSc+7+8eI7bcCe8MMgPrBUOwENv/e15hESQze4LIzb0/9l5sTk0njg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3860 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org The kernel driver is part of HWMON subsystem. Cc: Guenter Roeck Signed-off-by: Naveen Krishna Chatradhi --- Change in v6: None MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 091ec22c1a23..7e7393f9a0e5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -842,6 +842,13 @@ S: Supported T: git git://people.freedesktop.org/~agd5f/linux F: drivers/gpu/drm/amd/display/ +AMD ENERGY DRIVER +M: Naveen Krishna Chatradhi +L: linux-hwmon@vger.kernel.org +S: Maintained +F: Documentation/hwmon/amd_energy.rst +F: drivers/hwmon/amd_energy.c + AMD FAM15H PROCESSOR POWER MONITORING DRIVER M: Huang Rui L: linux-hwmon@vger.kernel.org