[v9,13/13] Documentation: amd-pstate: introduce new global sysfs attributes

Message ID 20221225163442.2205660-14-perry.yuan@amd.com
State New
Headers
Series Implement AMD Pstate EPP Driver |

Commit Message

Yuan, Perry Dec. 25, 2022, 4:34 p.m. UTC
  The amd-pstate driver supports switching working modes at runtime.
Users can view and change modes by interacting with the "status" sysfs
attribute.

1) check driver mode:
$ cat /sys/devices/system/cpu/amd-pstate/status

2) switch mode:
`# echo "passive" | sudo tee /sys/devices/system/cpu/amd-pstate/status`
or
`# echo "active" | sudo tee /sys/devices/system/cpu/amd-pstate/status`

Signed-off-by: Perry Yuan <perry.yuan@amd.com>
---
 Documentation/admin-guide/pm/amd-pstate.rst | 29 +++++++++++++++++++++
 1 file changed, 29 insertions(+)
  

Comments

Mario Limonciello Jan. 4, 2023, 12:35 a.m. UTC | #1
On 12/25/2022 10:34, Perry Yuan wrote:
> The amd-pstate driver supports switching working modes at runtime.
> Users can view and change modes by interacting with the "status" sysfs
> attribute.
> 
> 1) check driver mode:
> $ cat /sys/devices/system/cpu/amd-pstate/status
> 
> 2) switch mode:
> `# echo "passive" | sudo tee /sys/devices/system/cpu/amd-pstate/status`
> or
> `# echo "active" | sudo tee /sys/devices/system/cpu/amd-pstate/status`
> 
> Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> ---
>   Documentation/admin-guide/pm/amd-pstate.rst | 29 +++++++++++++++++++++
>   1 file changed, 29 insertions(+)
> 
> diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst
> index 62744dae3c5f..5f6379475b32 100644
> --- a/Documentation/admin-guide/pm/amd-pstate.rst
> +++ b/Documentation/admin-guide/pm/amd-pstate.rst
> @@ -339,6 +339,35 @@ processor must provide at least nominal performance requested and go higher if c
>   operating conditions allow.
>   
>   
> +User Space Interface in ``sysfs``
> +=================================
> +
> +Global Attributes
> +-----------------
> +
> +``amd-pstate`` exposes several global attributes (files) in ``sysfs`` to
> +control its functionality at the system level.  They are located in the
> +``/sys/devices/system/cpu/amd-pstate/`` directory and affect all CPUs.
> +
> +``status``
> +	Operation mode of the driver: "active", "passive" or "disable".
> +
> +	"active"
> +		The driver is functional and in the ``active mode``
> +
> +	"passive"
> +		The driver is functional and in the ``passive mode``
> +
> +	"disable"
> +		The driver is unregistered and not functional now.
> +
> +        This attribute can be written to in order to change the driver's
> +        operation mode or to unregister it.  The string written to it must be
> +        one of the possible values of it and, if successful, writing one of
> +        these values to the sysfs file will cause the driver to cause the driver

"will cause the driver to cause the driver to"?

Presumably you mean just "will cause the driver to"

With that fixed:

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> +        to switch over to the operation mode represented by that string - or to be
> +        unregistered in the "disable" case.
> +
>   ``cpupower`` tool support for ``amd-pstate``
>   ===============================================
>
  
Yuan, Perry Jan. 5, 2023, 6:21 a.m. UTC | #2
[AMD Official Use Only - General]

Hi Mario. 

> -----Original Message-----
> From: Limonciello, Mario <Mario.Limonciello@amd.com>
> Sent: Wednesday, January 4, 2023 8:35 AM
> To: Yuan, Perry <Perry.Yuan@amd.com>; rafael.j.wysocki@intel.com; Huang,
> Ray <Ray.Huang@amd.com>; viresh.kumar@linaro.org
> Cc: Sharma, Deepak <Deepak.Sharma@amd.com>; Fontenot, Nathan
> <Nathan.Fontenot@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Huang, Shimmer
> <Shimmer.Huang@amd.com>; Du, Xiaojian <Xiaojian.Du@amd.com>; Meng,
> Li (Jassmine) <Li.Meng@amd.com>; Karny, Wyes <Wyes.Karny@amd.com>;
> linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v9 13/13] Documentation: amd-pstate: introduce new
> global sysfs attributes
> 
> On 12/25/2022 10:34, Perry Yuan wrote:
> > The amd-pstate driver supports switching working modes at runtime.
> > Users can view and change modes by interacting with the "status" sysfs
> > attribute.
> >
> > 1) check driver mode:
> > $ cat /sys/devices/system/cpu/amd-pstate/status
> >
> > 2) switch mode:
> > `# echo "passive" | sudo tee
> > /sys/devices/system/cpu/amd-pstate/status`
> > or
> > `# echo "active" | sudo tee /sys/devices/system/cpu/amd-pstate/status`
> >
> > Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> > ---
> >   Documentation/admin-guide/pm/amd-pstate.rst | 29
> +++++++++++++++++++++
> >   1 file changed, 29 insertions(+)
> >
> > diff --git a/Documentation/admin-guide/pm/amd-pstate.rst
> > b/Documentation/admin-guide/pm/amd-pstate.rst
> > index 62744dae3c5f..5f6379475b32 100644
> > --- a/Documentation/admin-guide/pm/amd-pstate.rst
> > +++ b/Documentation/admin-guide/pm/amd-pstate.rst
> > @@ -339,6 +339,35 @@ processor must provide at least nominal
> performance requested and go higher if c
> >   operating conditions allow.
> >
> >
> > +User Space Interface in ``sysfs``
> > +=================================
> > +
> > +Global Attributes
> > +-----------------
> > +
> > +``amd-pstate`` exposes several global attributes (files) in ``sysfs``
> > +to control its functionality at the system level.  They are located
> > +in the ``/sys/devices/system/cpu/amd-pstate/`` directory and affect all
> CPUs.
> > +
> > +``status``
> > +	Operation mode of the driver: "active", "passive" or "disable".
> > +
> > +	"active"
> > +		The driver is functional and in the ``active mode``
> > +
> > +	"passive"
> > +		The driver is functional and in the ``passive mode``
> > +
> > +	"disable"
> > +		The driver is unregistered and not functional now.
> > +
> > +        This attribute can be written to in order to change the driver's
> > +        operation mode or to unregister it.  The string written to it must be
> > +        one of the possible values of it and, if successful, writing one of
> > +        these values to the sysfs file will cause the driver to cause
> > + the driver
> 
> "will cause the driver to cause the driver to"?
> 
> Presumably you mean just "will cause the driver to"
> 
> With that fixed:
> 
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

Thanks for the review, will fix the words and pick up the RB tag in v10. 

Perry.

> 
> > +        to switch over to the operation mode represented by that string - or
> to be
> > +        unregistered in the "disable" case.
> > +
> >   ``cpupower`` tool support for ``amd-pstate``
> >   ===============================================
> >
  

Patch

diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst
index 62744dae3c5f..5f6379475b32 100644
--- a/Documentation/admin-guide/pm/amd-pstate.rst
+++ b/Documentation/admin-guide/pm/amd-pstate.rst
@@ -339,6 +339,35 @@  processor must provide at least nominal performance requested and go higher if c
 operating conditions allow.
 
 
+User Space Interface in ``sysfs``
+=================================
+
+Global Attributes
+-----------------
+
+``amd-pstate`` exposes several global attributes (files) in ``sysfs`` to
+control its functionality at the system level.  They are located in the
+``/sys/devices/system/cpu/amd-pstate/`` directory and affect all CPUs.
+
+``status``
+	Operation mode of the driver: "active", "passive" or "disable".
+
+	"active"
+		The driver is functional and in the ``active mode``
+
+	"passive"
+		The driver is functional and in the ``passive mode``
+
+	"disable"
+		The driver is unregistered and not functional now.
+
+        This attribute can be written to in order to change the driver's
+        operation mode or to unregister it.  The string written to it must be
+        one of the possible values of it and, if successful, writing one of
+        these values to the sysfs file will cause the driver to cause the driver
+        to switch over to the operation mode represented by that string - or to be
+        unregistered in the "disable" case.
+
 ``cpupower`` tool support for ``amd-pstate``
 ===============================================