All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Suma Hegde <suma.hegde@amd.com>,
	platform-driver-x86@vger.kernel.org,
	Naveen Krishna Chatradhi <nchatrad@amd.com>
Subject: Re: [PATCH v3 2/3] platform/x86/amd/hsmp: add support for metrics tbl
Date: Fri, 22 Sep 2023 11:56:11 +0300 (EEST)	[thread overview]
Message-ID: <166b4e9d-71e7-a95d-e11a-895f2c5dd2f8@linux.intel.com> (raw)
In-Reply-To: <39a60d46-a916-9921-4c6a-5c95bcdbb82e@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4284 bytes --]

On Thu, 21 Sep 2023, Hans de Goede wrote:
> On 9/19/23 15:07, Ilpo Järvinen wrote:
> > On Tue, 19 Sep 2023, Suma Hegde wrote:
> > 
> >> AMD MI300 MCM provides GET_METRICS_TABLE message to retrieve
> >> all the system management information from SMU.
> >>
> >> The metrics table is made available as hexadecimal sysfs binary file
> >> under per socket sysfs directory created at
> >> /sys/devices/platform/amd_hsmp/socket%d/metrics_bin
> >>
> >> Metrics table definitions will be documented as part of Public PPR.
> >> The same is defined in the amd_hsmp.h header.
> >>
> >> Signed-off-by: Suma Hegde <suma.hegde@amd.com>
> >> Reviewed-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
> >> ---
> >> Changes since v1:
> >> 1. Remove HSMP_DEVNODE_NAME and HSMP_CDEV_NAME macro definitions in
> >> this patch
> >> 2. Remove extra space in comments for HSMP_GET_METRIC_TABLE_VER,
> >>    HSMP_GET_METRIC_TABLE and HSMP_GET_METRIC_TABLE_DRAM_ADDR enum
> >>    definition in amd_hsmp.h files
> >> 3. Change check, count == 0 to !count in hsmp_metric_tbl_read() function
> >> 4. Add hsmp_metric_table_visible() function 
> >> 5. hsmp_create_metric_tbl_sysfs_file() is renamed as hsmp_init_metric_tbl_bin_attr()
> >>    and code is also modified slightly
> >> 6. Modify hsmp_create_sysfs_file() to use devm_device_add_groups()
> >> 7. Change from cleanup label to deregister label
> >> 8. Add dev_err print in hsmp_get_tbl_dram_base()
> >> 9. Reword "Unable to Failed" in hsmp_get_tbl_dram_base()
> >> 10. Add HSMP_GRP_NAME_SIZE and NUM_ATTRS macros
> >> 11. Remove sysfs cleanup code in hsmp_pltdrv_remove()
> >> 12. Correct ATRR typo error
> >> 13. Change sprintf to snprintf
> >> 14. Check metrics table support only against HSMP_PROTO_VER6
> >> Changes since v2:
> >> 1. squash documentation patch into this patch
> >> 2. change from num_sockets to plat_dev.num_sockets
> >>
> >>  Documentation/arch/x86/amd_hsmp.rst  |  16 +++
> >>  arch/x86/include/uapi/asm/amd_hsmp.h | 109 ++++++++++++++++
> >>  drivers/platform/x86/amd/hsmp.c      | 180 ++++++++++++++++++++++++++-
> >>  3 files changed, 302 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/Documentation/arch/x86/amd_hsmp.rst b/Documentation/arch/x86/amd_hsmp.rst
> >> index 440e4b645a1c..a4c308784818 100644
> >> --- a/Documentation/arch/x86/amd_hsmp.rst
> >> +++ b/Documentation/arch/x86/amd_hsmp.rst
> >> @@ -41,6 +41,22 @@ In-kernel integration:
> >>   * Locking across callers is taken care by the driver.
> >>  
> >>  
> >> +HSMP sysfs interface
> >> +====================
> >> +
> >> +1. Metrics table binary sysfs
> >> +
> >> +AMD MI300A MCM provides GET_METRICS_TABLE message to retrieve
> >> +all the system management information from SMU.
> >> +
> >> +The metrics table is made available as hexadecimal sysfs binary file
> >> +under per socket sysfs directory created at
> >> +/sys/devices/platform/amd_hsmp/socket%d/metrics_bin
> >> +
> >> +Metrics table definitions will be documented as part of Public PPR.
> >> +The same is defined in the amd_hsmp.h header.
> >> +
> >> +
> >>  An example
> >>  ==========
> >>  
> > 
> > I'd have expected to have the sysfs documentation appear under 
> > Documentation/ABI/testing/sysfs-...
> 
> Actually it is somewhat normal for sysfs files to be paired
> together with other documentation when there is more extensive
> documentation then just the sysfs files, see e.g. :
> 
> Documentation/admin-guide/laptops/thinkpad-acpi.rst

Okay but that seems to result in attempting to handle deprecation 
within that file too which feels wrong beyond just hacing documentation in 
an unusual location.

> So there is precedent for this and I think it make sense
> to keep all the documentation in one place, rather then to add
> a Documentation/ABI/testing/sysfs-platform-amd-hsmp file
> just for the sysfs attributes .
> 
> OTOH people are used to look for sysfs attribute documentation
> in a place like Documentation/ABI/testing/sysfs-platform-amd-hsmp,
> but I think that keeping all the docs together is more important.
> 
> So I have a slight preference for keeping this as is and
> just merging v3 of this series as is.
> 
> Ilpo, what do you think ?

I don't have strong preference myself if you think the current location 
is fine. So feel free to merge it as is.

-- 
 i.

  reply	other threads:[~2023-09-22  8:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  9:20 [PATCH v3 1/3] platform/x86/amd/hsmp: create plat specific struct Suma Hegde
2023-09-19  9:20 ` [PATCH v3 2/3] platform/x86/amd/hsmp: add support for metrics tbl Suma Hegde
2023-09-19 13:07   ` Ilpo Järvinen
2023-09-21 15:14     ` Hans de Goede
2023-09-22  8:56       ` Ilpo Järvinen [this message]
2023-09-26  8:20         ` Hans de Goede
2023-09-19  9:20 ` [PATCH v3 3/3] platform/x86/amd/hsmp: improve the error log Suma Hegde
2023-09-19 13:00   ` Ilpo Järvinen
2023-09-19 13:00 ` [PATCH v3 1/3] platform/x86/amd/hsmp: create plat specific struct Ilpo Järvinen
2023-09-26 13:05 ` Ilpo Järvinen
2023-09-27 11:18   ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=166b4e9d-71e7-a95d-e11a-895f2c5dd2f8@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=nchatrad@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=suma.hegde@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.