linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v4 2/3] hwmon: (amd_energy) Add documentation
@ 2020-04-25 15:41 Guenter Roeck
  2020-04-25 16:49 ` Naveen Krishna Ch
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2020-04-25 15:41 UTC (permalink / raw)
  To: Naveen Krishna Chatradhi; +Cc: linux-hwmon, naveenkrishna.ch

On Fri, Apr 24, 2020 at 08:50:55AM +0530, Naveen Krishna Chatradhi wrote:
> Document amd_energy driver with all chips supported by it.
> 
> Cc: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
> ---
> Changes in v4:
> None

Still:

/home/groeck/src/linux-stable/Documentation/hwmon/amd_energy.rst:36: WARNING: Unexpected indentation.
/home/groeck/src/linux-stable/Documentation/hwmon/amd_energy.rst:40: WARNING: Unexpected indentation.
/home/groeck/src/linux-stable/Documentation/hwmon/amd_energy.rst:44: WARNING: Unexpected indentation.

Please run something like 'make SPHINXDIRS=hwmon htmldocs' and make sure
it doesn't report any warnings.

Thanks,
Guenter

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

* Re: [PATCH v4 2/3] hwmon: (amd_energy) Add documentation
  2020-04-25 15:41 [PATCH v4 2/3] hwmon: (amd_energy) Add documentation Guenter Roeck
@ 2020-04-25 16:49 ` Naveen Krishna Ch
  0 siblings, 0 replies; 3+ messages in thread
From: Naveen Krishna Ch @ 2020-04-25 16:49 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Naveen Krishna Chatradhi, linux-hwmon

Hi Guenter

On Sat, 25 Apr 2020 at 21:11, Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Fri, Apr 24, 2020 at 08:50:55AM +0530, Naveen Krishna Chatradhi wrote:
> > Document amd_energy driver with all chips supported by it.
> >
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
> > ---
> > Changes in v4:
> > None
>
> Still:
>
> /home/groeck/src/linux-stable/Documentation/hwmon/amd_energy.rst:36: WARNING: Unexpected indentation.
> /home/groeck/src/linux-stable/Documentation/hwmon/amd_energy.rst:40: WARNING: Unexpected indentation.
> /home/groeck/src/linux-stable/Documentation/hwmon/amd_energy.rst:44: WARNING: Unexpected indentation.
>
> Please run something like 'make SPHINXDIRS=hwmon htmldocs' and make sure
> it doesn't report any warnings.
My bad, I was not aware of the indentation in the Documentation.
I could Identify the issue. Thank you for the tip, will keep this in mind.
>
> Thanks,
> Guenter



-- 
Shine bright,
(: Nav :)

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

* [PATCH v4 2/3] hwmon: (amd_energy) Add documentation
  2020-04-24  3:20 [PATCH v4 1/3] hwmon: Add amd_energy driver to report energy counters Naveen Krishna Chatradhi
@ 2020-04-24  3:20 ` Naveen Krishna Chatradhi
  0 siblings, 0 replies; 3+ messages in thread
From: Naveen Krishna Chatradhi @ 2020-04-24  3:20 UTC (permalink / raw)
  To: linux-hwmon; +Cc: naveenkrishna.ch, Naveen Krishna Chatradhi, Guenter Roeck

Document amd_energy driver with all chips supported by it.

Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
---
Changes in v4:
None

 Documentation/hwmon/amd_energy.rst | 84 ++++++++++++++++++++++++++++++
 Documentation/hwmon/index.rst      |  1 +
 2 files changed, 85 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..b5d176deec1d
--- /dev/null
+++ b/Documentation/hwmon/amd_energy.rst
@@ -0,0 +1,84 @@
+.. 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 <nchatrad@amd.com>
+
+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 Joules
+
+Users calculate power for a given domain by calculating
+	dEnergy/dTime for that domain.
+
+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
-- 
2.17.1


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

end of thread, other threads:[~2020-04-25 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 15:41 [PATCH v4 2/3] hwmon: (amd_energy) Add documentation Guenter Roeck
2020-04-25 16:49 ` Naveen Krishna Ch
  -- strict thread matches above, loose matches on Subject: below --
2020-04-24  3:20 [PATCH v4 1/3] hwmon: Add amd_energy driver to report energy counters Naveen Krishna Chatradhi
2020-04-24  3:20 ` [PATCH v4 2/3] hwmon: (amd_energy) Add documentation Naveen Krishna Chatradhi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).