From patchwork Tue May 19 15:50:09 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: 11558075 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 3634090 for ; Tue, 19 May 2020 15:50:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15B4B207C4 for ; Tue, 19 May 2020 15:50:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="WBrNARdC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729247AbgESPue (ORCPT ); Tue, 19 May 2020 11:50:34 -0400 Received: from mail-bn8nam11on2087.outbound.protection.outlook.com ([40.107.236.87]:1957 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728534AbgESPue (ORCPT ); Tue, 19 May 2020 11:50:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O3KvrEvNxhGakb+xUrh3SmXHbz3eS15bb4R8pU/c5VteR/5ZmTsMh62Se47usxYnc6DHJxFFs3o90/dLhLqk9XEVoi/jYZ1vUT0AkpkjwneTI8ZZvrL/8jSW5kbcne6UqE1wkjVtTHI3qqX3CBcWCEkGjMCiLA6TtTO19XNWd8XWMoYKkNXXtB4+eNcJGb84RXMsL5b3qn/iKwwX6KEoW2369xJyUPCNzpURZrp824ckxazodfdiyvImeRALACgVAMYYOEnG3r+kLmNXuJVDaWO2D4Oy8BdxlgntOEy/01peOm0OaochEl2qQvMw24I3m7LopeAxXBdRU0o/aeEObg== 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=UjS+DdiUtUm4QhHaYpEXZsYsGGt4lSCj1oVBFk+4MlU=; b=nRsBvjGXE6dpicSOmrPCnfbwwPfBFO4SSMNItK6Ripq5V/QGYF2v0owAuYc8F7i98uTzxhsCTialKbGZIkfB3tZwfdFu+wWHzHYkCFSv23g5HbsgJmWgKykjLmm/GdDpP/0K/2XtjmSz8Bhz3oVxpAWjqEFEw1buCsFE7MYgarcDRFnj/4SWS9bdtaXwfeb7Y/EyPKtPp+SVdJ+FxF43skgaNu4NBkadxLXbvctuLmMeipXX8OGqswRHhlLt5Q2D/sIsfPRT3xYf3Dy4pz1wBO1J0weL+7cHptoY7YLALzpk4JI7fxCDHfhTdJ75IX43rTiLzoNtY1lsMKMhR/SGtQ== 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=UjS+DdiUtUm4QhHaYpEXZsYsGGt4lSCj1oVBFk+4MlU=; b=WBrNARdCK3G7DHsW7PMwb3gMvtvVp+mBl8FzAhMiFmMyOGDD3f1AgzymoD6yHAk64zF0er3Saqx0kL2G0ZTt56KEADjDSvDOU5u5PWE1FOB7uY7sCimxJEoWyNKK64pbtfZAuPtWqiFy30WahdwUp01a5EsZnkuUDZpaY4GEhFI= 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 BY5PR12MB4051.namprd12.prod.outlook.com (2603:10b6:a03:20c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.25; Tue, 19 May 2020 15:50:29 +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.034; Tue, 19 May 2020 15:50:29 +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 v7] hwmon: Add amd_energy driver to report energy counters Date: Tue, 19 May 2020 21:20:09 +0530 Message-Id: <20200519155011.56184-1-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: MAXPR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::12) 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 MAXPR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Tue, 19 May 2020 15:50:27 +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: 3893cfb3-f4d2-4348-9351-08d7fc0c5ae0 X-MS-TrafficTypeDiagnostic: BY5PR12MB4051: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:338; X-Forefront-PRVS: 040866B734 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HcS68USLqhcSwXZM5o+heMp6yQAA23FfvGgGB8VobCxmWSdTAVcAQwDCSpeDFfBhyjDMpe6wAgQqu1VLURNrWwMzqe5q1tETeeA8Csk5vDGUl9I6WMB3aP9zgnKNeoHDwolxKxczSvaUk3ASJXlb9pyjqHeQOgVRvxbDycnHafhWDJ0fYcgZtRQx/5fYnVC0rYZTA/mfYGEGQZXPewrCgsjf+a4Ov25ivn2RU6ht3+xEzIM/+GJRkNMfPQBwijT0rLcdnDT+T6lwB0dvUTJalDukxJ3s8/p0nUUKYpEMXDrvzFDtpFOhTs1sap5iBgH2qKadrjW8+MI7zaB5xZXmDN66QJzocVT/yxtegO5Jl89e1b2kS3KnV3VI7QiIPl86H2CIrkv6U/VFHryzF7CSVzZD4rb9ARkORGP/i5q3supiVs//T+lYIrQtoaouMPlezH8QSLsQ0CXUDLBacz8lvTG2FxlR4KAVQR9VynkU6+mUKwJTzn7P84Q//8qUZ/M+ 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)(396003)(39860400002)(376002)(136003)(346002)(366004)(16526019)(316002)(186003)(2616005)(956004)(26005)(52116002)(36756003)(1076003)(6916009)(54906003)(4326008)(8936002)(7696005)(5660300002)(30864003)(66476007)(66946007)(66556008)(2906002)(6486002)(8676002)(6666004)(478600001)(6606295002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: l66+a815+jRESE9fKbr9i6HfB9QbJ8JXbSnhfnHEIBYmm0LC7OYFMYFjVjr9se8fV+D5RYpawZ6BJSEjATtuAGzxYTd5LlWYOJLkxBmypzyEItYAoNJbcKQ0mh9Z/dOFuRe1MhSnNNJns4vXSeLrz1U+MEcgpu70V4gvfONXyoFtQxgazF6tIauKpnjogOYeF/qcUaZykiDAyQXG/82FHi+iV5X721oMj2vCzxycUMmlYyZi8HFMOWg49pfIwii5EJWNqHCk5Vz05t5B0WNqfjBan7Sf/TfJhbyym4Q5Uhc6I4fNJ9V9qflbu2Q/nAzgIyg1VJu1gA5dSUiRTBO0as3Gt6aGBdRTeoYAHLh5+NSVfxK0y6V4tNSq2LWhROIpDmnX1MXklHFEyJNwbCBfBgpAHKovHqAIHs30zFoT4GUu/gRGCBlM+Sh1Ff2ZNsHEQqLyqySB4xVkuJMHv+EXuyNDe2gG5L8triR7sA+KA/DM1ByUHVdPd6nT4FktZh5O X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3893cfb3-f4d2-4348-9351-08d7fc0c5ae0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2020 15:50:29.3387 (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: HeU/Yjn+v3U3X4AEnawkazjP4MXqoQ92KnJ5SkX3h7ii7Zsx2iC2F+f2QFbwRPumDuNdt9Uv8IE5K5mOxvEc/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4051 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 v7: 1. Move all static variables into the data structure 2. Move the read-update code under the mutex lock drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/amd_energy.c | 406 +++++++++++++++++++++++++++++++++++++ 3 files changed, 417 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..bc8b643a37d5 --- /dev/null +++ b/drivers/hwmon/amd_energy.c @@ -0,0 +1,406 @@ +// 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 sensor_accumulator { + u64 energy_ctr; + u64 prev_value; + char label[10]; +}; + +struct amd_energy_data { + struct hwmon_channel_info energy_info; + const struct hwmon_channel_info *info[2]; + struct hwmon_chip_info chip; + struct task_struct *wrap_accumulate; + /* Lock around the accumulator */ + struct mutex lock; + /* An accumulator for each core and socket */ + struct sensor_accumulator *accums; + /* Energy Status Units */ + u64 energy_units; + int nr_cpus; + int nr_socks; + int core_id; +}; + +static int amd_energy_read_labels(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, + const char **str) +{ + struct amd_energy_data *data = dev_get_drvdata(dev); + + *str = data->accums[channel].label; + return 0; +} + +static void get_energy_units(struct amd_energy_data *data) +{ + u64 rapl_units; + + rdmsrl_safe(ENERGY_PWR_UNIT_MSR, &rapl_units); + data->energy_units = (rapl_units & AMD_ENERGY_UNIT_MASK) >> 8; +} + +static void accumulate_socket_delta(struct amd_energy_data *data, + int sock, int cpu) +{ + struct sensor_accumulator *s_accum; + u64 input; + + mutex_lock(&data->lock); + rdmsrl_safe_on_cpu(cpu, ENERGY_PKG_MSR, &input); + input &= AMD_ENERGY_MASK; + + s_accum = &data->accums[data->nr_cpus + sock]; + if (input >= s_accum->prev_value) + s_accum->energy_ctr += + input - s_accum->prev_value; + else + s_accum->energy_ctr += UINT_MAX - + s_accum->prev_value + input; + + s_accum->prev_value = input; + mutex_unlock(&data->lock); +} + +static void accumulate_core_delta(struct amd_energy_data *data) +{ + struct sensor_accumulator *c_accum; + u64 input; + int cpu; + + mutex_lock(&data->lock); + if (data->core_id >= data->nr_cpus) + data->core_id = 0; + + cpu = data->core_id; + + if (!cpu_online(cpu)) + goto out; + + rdmsrl_safe_on_cpu(cpu, ENERGY_CORE_MSR, &input); + input &= AMD_ENERGY_MASK; + + c_accum = &data->accums[cpu]; + + if (input >= c_accum->prev_value) + c_accum->energy_ctr += + input - c_accum->prev_value; + else + c_accum->energy_ctr += UINT_MAX - + c_accum->prev_value + input; + + c_accum->prev_value = input; + +out: + data->core_id++; + mutex_unlock(&data->lock); +} + +static void read_accumulate(struct amd_energy_data *data) +{ + int sock; + + for (sock = 0; sock < data->nr_socks; sock++) { + int cpu; + + cpu = cpumask_first_and(cpu_online_mask, + cpumask_of_node(sock)); + + accumulate_socket_delta(data, sock, cpu); + } + + accumulate_core_delta(data); +} + +static void amd_add_delta(struct amd_energy_data *data, int ch, + int cpu, long *val, bool is_core) +{ + struct sensor_accumulator *s_accum, *c_accum; + u64 input; + + mutex_lock(&data->lock); + if (!is_core) { + rdmsrl_safe_on_cpu(cpu, ENERGY_PKG_MSR, &input); + input &= AMD_ENERGY_MASK; + + s_accum = &data->accums[ch]; + if (input >= s_accum->prev_value) + input += s_accum->energy_ctr - + s_accum->prev_value; + else + input += UINT_MAX - s_accum->prev_value + + s_accum->energy_ctr; + } else { + rdmsrl_safe_on_cpu(cpu, ENERGY_CORE_MSR, &input); + input &= AMD_ENERGY_MASK; + + c_accum = &data->accums[ch]; + if (input >= c_accum->prev_value) + input += c_accum->energy_ctr - + c_accum->prev_value; + else + input += UINT_MAX - c_accum->prev_value + + c_accum->energy_ctr; + } + + /* Energy consumed = (1/(2^ESU) * RAW * 1000000UL) μJoules */ + *val = div64_ul(input * 1000000UL, BIT(data->energy_units)); + + 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 cpu; + + if (channel >= data->nr_cpus) { + cpu = cpumask_first_and(cpu_online_mask, + cpumask_of_node + (channel - data->nr_cpus)); + amd_add_delta(data, channel, cpu, val, false); + } else { + cpu = channel; + if (!cpu_online(cpu)) + return -ENODEV; + + amd_add_delta(data, channel, cpu, val, true); + } + + 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) +{ + struct hwmon_channel_info *info = &data->energy_info; + struct sensor_accumulator *accums; + int i, num_siblings, cpus, sockets; + u32 *s_config; + + /* Identify the number of siblings per core */ + num_siblings = ((cpuid_ebx(0x8000001e) >> 8) & 0xff) + 1; + + sockets = num_possible_nodes(); + + /* + * Energy counter register is accessed at core level. + * Hence, filterout the siblings. + */ + cpus = num_present_cpus() / num_siblings; + + s_config = devm_kcalloc(dev, cpus + sockets, + sizeof(u32), GFP_KERNEL); + if (!s_config) + return -ENOMEM; + + accums = devm_kcalloc(dev, cpus + sockets, + sizeof(struct sensor_accumulator), + GFP_KERNEL); + if (!accums) + return -ENOMEM; + + info->type = type; + info->config = s_config; + + data->nr_cpus = cpus; + data->nr_socks = sockets; + data->accums = accums; + + for (i = 0; i < cpus + sockets; i++) { + s_config[i] = config; + if (i < cpus) + scnprintf(accums[i].label, 10, + "Ecore%03u", i); + else + scnprintf(accums[i].label, 10, + "Esocket%u", (i - cpus)); + } + + 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; + + 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; + + dev_set_drvdata(dev, data); + /* 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); + get_energy_units(data); + + hwmon_dev = devm_hwmon_device_register_with_info(dev, DRVNAME, + data, + &data->chip, + NULL); + if (IS_ERR(hwmon_dev)) + return PTR_ERR(hwmon_dev); + + data->wrap_accumulate = kthread_run(energy_accumulator, data, + "%s", dev_name(hwmon_dev)); + if (IS_ERR(data->wrap_accumulate)) + return PTR_ERR(data->wrap_accumulate); + + return PTR_ERR_OR_ZERO(data->wrap_accumulate); +} + +static int amd_energy_remove(struct platform_device *pdev) +{ + struct amd_energy_data *data = dev_get_drvdata(&pdev->dev); + + if (data && data->wrap_accumulate) + kthread_stop(data->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 Tue May 19 15:50:10 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: 11558077 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 721EE13B1 for ; Tue, 19 May 2020 15:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5405520809 for ; Tue, 19 May 2020 15:50:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="VgS7LlSh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729089AbgESPu5 (ORCPT ); Tue, 19 May 2020 11:50:57 -0400 Received: from mail-bn8nam11on2045.outbound.protection.outlook.com ([40.107.236.45]:6249 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728534AbgESPu4 (ORCPT ); Tue, 19 May 2020 11:50:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=meVTBiq7rAmxWOpXt9BZebjVfdgxBvXORXyAWS6XR73d0NeCIVjp6l/AuHkIVm52BpTIFP+Xtxy+5PnkR2t1XdqzsE37dsdYjFBkqBLKK/dLidzHSw5lrT1Srgk2lgJ1wK07YDhX42Bh9dMCIuM07632ENN8Rb1V2M4V5mwW2C8DzyZhnv23XeGPZM6GLaunhZwHVC5KUXd54AC/t6LUNse+WfbegfhLngPRW41hKYOGHLZ85jo1PO8/lFookD2XxWdzu2ONL4BqRy4r1dX2VQHxOkDOHEZmeaZ3+dxnFd6/g4U5l27V8d0cMU6rpd7iNSm3Ee/CHRvRVU/iPHpsoQ== 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=30uEXZuvaZntmM0ICrbf0KMjruuwpqC5BhSmttMVfgc=; b=aFbziVtZ+u//pWmjaek1Q+OEiVE48GxIAzIHVDq6cs9Tsil9R6FlCtzPtGXdCafSZsBdcykWT4Pzyt3Ehu3wFEcWpSAiE0syiPLt/KWeX6DWJlKbJ8B9C5opL6LOGvFJPJ/lgR0Yx4sipEWXHtXJpCh/5e5T1zlf/JG4IjvjtCd/4uIJ2JTiIhNL2amCiHGW4fnqO/ofZK7aKJRUt8yWBh+tngkvSxh/mxEuqPt20zqRxPkek0zFyiet+P50ufHohCfbnKMZ1MspArdAUnH2mja+64AYMobvxvgAdAGunB9pOzOVyidiDJhIYvrnZ3Tj7RhP3bw9NXwtOw/Xt51rug== 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=30uEXZuvaZntmM0ICrbf0KMjruuwpqC5BhSmttMVfgc=; b=VgS7LlShyBDK2+sWC4WanHBgzt+RURFs184dKsDizpQslyFTHBH2SxKAAkmdHSy5D3Ucv/AGWvOSgvi0tBTKrDIKLRkqLEvsddvpMqpQ+FZv14qxQyKigPXYl91sCM7x6xRlM5HWkP1e1LTtlNNo/ubgOqNBztwJCrPGFR1U4YE= 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 BY5PR12MB4051.namprd12.prod.outlook.com (2603:10b6:a03:20c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.25; Tue, 19 May 2020 15:50:54 +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.034; Tue, 19 May 2020 15:50:54 +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 v7] hwmon: (amd_energy) Add documentation Date: Tue, 19 May 2020 21:20:10 +0530 Message-Id: <20200519155011.56184-2-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200519155011.56184-1-nchatrad@amd.com> References: <20200519155011.56184-1-nchatrad@amd.com> X-ClientProxiedBy: MAXPR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::12) 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 MAXPR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Tue, 19 May 2020 15:50:52 +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: e1f6de98-3f19-4c10-02cb-08d7fc0c6978 X-MS-TrafficTypeDiagnostic: BY5PR12MB4051: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 040866B734 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 85W309MhjtwMhDw/IV9VxW94bh4tkiBlW4bdDUeazvxIbWhm3TmO8g070Sp3OvRGFRrl3SQzMWkjQEZ9rM2e6fVa+6V0cdST4NrUt4V0GcU8rsT5D9+oYKPiHKAoKdhq6HtbVWsuUPRuFnJoXxToDwzYWFXenenO2eLp/yrILNJB79NZQ7CfxfnziSlAaV9ec00LBI6ZVSHdv+iorvCpnP+VgxKiRQg8JBeWlvgYmCreAgLktV6RXDMUh9+wmwLGzoqmqK0KAAI71GpYyq08qqVIqA0xRkPFIyLURz4Jz7HtPLFsEFPuh+mL9OW/DErZUrUslPXdFzfZS4Tx44ewiR/neHXTyV0NLAm/cD1tdxGKneQGHQWOCyi9v7GOkpFiV4s1tbH9/fEDdo8JxAN5DPro6JtNO3N+X8LrtCX3A0B+pl2usNWdREQ+f5tp2mJR4iTKlPvvFwT9rLpC0CU261lFvm/pQhF3a32773SHD1Sq19hIjwJ/1dXAMTwAR6jyuMQyhvCAPSHYR9snX4/qTrYYblZhfI7YZugVHShWlLGkU2aiW6uULKK6ANKDEQJepsw+HdHbO8eSt8coMEUuTvdYYy0G8rHoM+GXyZ0BQkBqKEwLj8Yt24PFk8spdauD 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)(396003)(39860400002)(376002)(136003)(346002)(366004)(16526019)(316002)(186003)(2616005)(956004)(26005)(966005)(52116002)(36756003)(1076003)(6916009)(54906003)(4326008)(8936002)(7696005)(5660300002)(66476007)(66946007)(66556008)(2906002)(6486002)(8676002)(6666004)(478600001)(24770200002)(43620500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SJedrsxKs8UK+svdFbQ+6V8cPJMbahFuelU+2KUB9RgHyF4ALoh+80u2W6hOFPzDGM7g06Er8D7Gj8IKTXnahFSC05l0qkO3rhEjIFdyxrhjmxV7FYwPXCghwV4JGuejzE5JIuLMBolPbzd0k2oLqpXzIPfTLmotDVVBa1LO0+3kzdWeeZ8lqFxWPPzOUvA21v2PIOAvq9w2LQDPa46C9cteMZdsbO3T5kB+9ckNAY9bRqcq7VmRGgQ3yNtVrzbBWe3xKSodZzu+THnTYo4qddNIceSdax6ZaQEIqQ0bRoMdD2AE038K+RAS8bLPX34GoYWajxiOAxJeiURzgvvodCHsxRSuA5pW3FcvfS/y8gcusaNFpLEQP0PSVBRugGGkxsS+fNd+YO+Yyn+2E5QUwgezcmoSgJgBCo1gEWYHciO7LS5urmcU4/hTSTzbAQRlyqQTQRcXC3CNgZsGQbuwEwfiqAMjVn8A/EfCzbaxgem5lgYHwW9QWGtGYlHUj3BE X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1f6de98-3f19-4c10-02cb-08d7fc0c6978 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2020 15:50:53.7167 (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: PEVQAZ4Qo/oDOtdpHVPUBk+7RE4sXpbXX08McPcJWkEqBhMIj6f5XSNJ7PF8JeM62oFpFlaOmYrjWBmLbcvTuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4051 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Document amd_energy driver with energy sensors supported by it. Cc: Guenter Roeck Signed-off-by: Naveen Krishna Chatradhi --- Changes in v7: 1. Add a note explaining the siblings behavior Documentation/hwmon/amd_energy.rst | 109 +++++++++++++++++++++++++++++ Documentation/hwmon/index.rst | 1 + 2 files changed, 110 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..f8288edff664 --- /dev/null +++ b/Documentation/hwmon/amd_energy.rst @@ -0,0 +1,109 @@ +.. 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. + +Note: If SMT is enabled, Linux enumerates all threads as cpus. +Since, the energy status registers are accessed at core level, +reading those registers from the sibling threads would result +in duplicate values. Hence, energy counter entries are not +populated for the siblings. + +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 Tue May 19 15:50:11 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: 11558079 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 769AD90 for ; Tue, 19 May 2020 15:51:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DE18207FB for ; Tue, 19 May 2020 15:51:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="g/mHUQbh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729160AbgESPvA (ORCPT ); Tue, 19 May 2020 11:51:00 -0400 Received: from mail-mw2nam12on2050.outbound.protection.outlook.com ([40.107.244.50]:39680 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728534AbgESPu7 (ORCPT ); Tue, 19 May 2020 11:50:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IdkTK++ClntNEv/hf2Iyg7oJ1Nk6cyyxnHTOi5wEN+/M+LRBQLjEAwKhstA5QPpdXkJoSu7yDTcdcQOp4WFVI0xuzbYX69C6KDt/fb07NPU1/RARoBlGjuN9GClSpt9CNq7ju/WFTKAsJ5N21MN5dlFC+CJNEN7AX0lpwIhHk6Gu3vb4H7wsBt5HqFNi/a9uPaeNyoWIsbluQxd+cOiAtGiCxEE9svylpdhhT7X3SHFp05fvQ9Z20Zx0H0Lu0dZUqtESqb8xQ+rafeIORZGuC/n9nzCcGZosCacWPRUhmNSe9tHhmNa13YkTSQ/G8V3d0WQIN9POmF6KZIgFAbmWQw== 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=7XmiJdFVZjIdUVeYHoSzaUVLmGesmjp5n1oFXXp8W3M=; b=RZKZ+oD60/eHxzR4ms5qWD8vie6ooiM3Vf7EOaval/vRryvAs+Jt4pf1muTGga9M/DNV/b/Twl/En5ClP4zAtzgITuBbnl6ORXGkfHS4UUkWvino+bZobIgLvuCZVv6GkyMeAQXxc9VEeOfOFWHOH3tGkAShyOuvIfcFxBPCeSu0SINDF79SZwVR+iOOIImZBi2U3nwyESRz2t3VcAyJYf4osk5qWPTdPdVFZK1gYZaNvkGDTm1oMXWIC0cYhcmjyeaoorV9saCTfxWFUidC9+s+PHN0CyvBDDpcb3JQfd/+f9XCXEJOgOA5HScPX7NUNzFeaIYlTIWBJmqRBAPtgw== 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=7XmiJdFVZjIdUVeYHoSzaUVLmGesmjp5n1oFXXp8W3M=; b=g/mHUQbhukP02LgTHsP+NB0xUYryTWymLyoirPEgEtX5jue7uC65c5cNlGEOmtY0rXK1XzKsEpmdUYb+XAccFv2aSREuiheuVRjPP93BiVMIw1rEP1si2FwDpm6WOzfpU3TGy8CCV9eQG/VOie1OZSPKArcukoWMWjptQPuWgQE= 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 BY5SPR01MB0022.namprd12.prod.outlook.com (2603:10b6:a03:1a3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Tue, 19 May 2020 15:50:57 +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.034; Tue, 19 May 2020 15:50:57 +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 v7] MAINTAINERS: add entry for AMD energy driver Date: Tue, 19 May 2020 21:20:11 +0530 Message-Id: <20200519155011.56184-3-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200519155011.56184-1-nchatrad@amd.com> References: <20200519155011.56184-1-nchatrad@amd.com> X-ClientProxiedBy: MAXPR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::12) 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 MAXPR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Tue, 19 May 2020 15:50:55 +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: 3893d29a-59fa-45e4-b689-08d7fc0c6ba5 X-MS-TrafficTypeDiagnostic: BY5SPR01MB0022: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-Forefront-PRVS: 040866B734 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d3dao1+ClqdObJagq9dsnZgcO8fkMThoEfi1FuFF1Yyyk4LhU48yi5brq+6zAbPnmKitfhPe3JkeP4/euJpbIa3D/N6ASDhZiJVqa52XpEzoCOppHEKcxS+bWVt6sBDBoDj4PriJj3ambCUgl/soN9+xSvIhwoD39QQu6MThYfcYlfJD58gGgbc4cX4xiSk+R/Nxt7uh5xnURZyPEbWvMgBSASiXrt3YQRqzTtbKE0+dpSKCg577f23d+w6qO1x1X2jtC+uDdcm+tg6vL5j0Mm3fHWREMTqR0lEzDspWaGdGgXPIJ0nolAFxaLhhXGdXuLxBBbiyuv9Dx+ApMhkFW2zGGxmlr9WVVIp7JdO6Jj2kV3jIwzI4LTsQSou2BMhkk+6/h+aZ+GP6rMW2GzFL3OjScGrQTBvCJgQm1A3KVbM967PtIBU3tXWQgfhwhUtP 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)(136003)(396003)(346002)(376002)(366004)(8676002)(2906002)(956004)(16526019)(2616005)(6486002)(66556008)(66946007)(66476007)(4326008)(36756003)(4744005)(54906003)(7696005)(478600001)(6666004)(316002)(26005)(6916009)(8936002)(5660300002)(186003)(1076003)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7sH42NnDQNNkop9roOrGF0Ccjo8D4lmD4PRAXzESf65RFyqQt73uLb+saDYVBSKGo0LYaFsFt0kcifzVxii2g8Mly7p8MxUOIZzl6qdGVGEB21s48RW2zz2/v6tybR9pBYc7yEfQxnlGwV/RloT6r1j4uaIOIIrudpzSrCcxdiwl+9qlSwi+WAvuPxJ0/SIFu8NnvIdVMezXgF9ODf0nM1eYGCpc2Ez/eNh4fKzultwh3kPHH/H9jFNAOUq/4+fA7iuuekVfKftKK4Qg6aoHGkn/SyAWtpUOA+faKTS00H+wAYh8jgacdKdE44lqtQBWqkgNVJhe+j4Ilp9UC97MC1vN/I8K0xp+XUtPWYRtUsObRXT02KdICqNa98MFkBG4kqgP439nhBfUC2YewOx6V8yrFdym77QyVUhygHDVvjOLaqb0TBAd0YMV9sXSK4jxB2agE/RwauLEEurB80HTaKJ5DQ2wCUse8fdgOwmq4yLWT5j/gfzVz2bYoBzRDABt X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3893d29a-59fa-45e4-b689-08d7fc0c6ba5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2020 15:50:57.6066 (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: sPifPkdMdkWtZiKffKAz46lxTkY1CIIM/g7H/XF3dMcSv8I6aGwAPB2SPNyQsIh0dBP6GDmozS7DpF/GrrMctg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5SPR01MB0022 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 --- Changes in v7: 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