platform/x86/amd/hsmp: Add support for variable-sized metrics tables#16
Open
muralimk-amd wants to merge 2 commits intoamd:masterfrom
Open
platform/x86/amd/hsmp: Add support for variable-sized metrics tables#16muralimk-amd wants to merge 2 commits intoamd:masterfrom
muralimk-amd wants to merge 2 commits intoamd:masterfrom
Conversation
Add support for the new metrics table format introduced in AMD Family 1Ah Model 50h-5Fh processors with HSMP protocol version 7. Use CPU family/model and protocol versions to map respective variable-sized metric table configurations. The exported hsmp_metric_tbl_read() function provides offset support for variable-sized tables. Co-developed-by: Muralidhara M K <muralimk@amd.com> Signed-off-by: Muralidhara M K <muralimk@amd.com> Signed-off-by: Muthusamy Ramalingam <muthusamy.ramalingam@amd.com>
The below 2 upstream commits remove read_new() and bin_attrs_new.
Add linux version check in our driver appropriately.
commit 1d6249c1ce826fcf03c695973095eb4a50fb7fd2
Author: Thomas Weißschuh <linux@weissschuh.net>
Date: Mon Aug 11 11:13:35 2025 +0200
sysfs: remove bin_attribute::read_new/write_new()
commit 44d454fcffa8b08d6d66df132121c1d387fa85db
Author: Thomas Weißschuh <linux@weissschuh.net>
Date: Mon Aug 11 11:13:36 2025 +0200
sysfs: remove attribute_group::bin_attrs_new
nchatrad
requested changes
Mar 13, 2026
| .attr = { .name = HSMP_METRICS_TABLE_NAME, .mode = 0444}, \ | ||
| .private = (void *)index, \ | ||
| .read = hsmp_metric_tbl_plat_read, \ | ||
| .size = sizeof(struct hsmp_metric_table), \ |
Collaborator
There was a problem hiding this comment.
we can have this check just around the one line 142. no need to duplicate the entire struct
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0)
also, do not mix the tab, space indentation changes in this pathc. submit a separate patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for the new metrics table format introduced in AMD Family 1Ah Model 50h-5Fh processors with HSMP protocol version 7.
Use CPU family/model and protocol versions to map respective variable-sized metric table configurations.
The exported hsmp_metric_tbl_read() function provides offset support for variable-sized tables.