From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "David E. Box" <david.e.box@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org,
srinivas.pandruvada@linux.intel.com,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
tony.luck@intel.com, xi.pardee@linux.intel.com,
Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH 10/15] platform/x86/intel/tpmi: Relocate platform info to intel_vsec.h
Date: Tue, 20 May 2025 17:54:05 +0300 (EEST) [thread overview]
Message-ID: <b8b5bcf8-bac9-4e92-f876-2c6ac595596f@linux.intel.com> (raw)
In-Reply-To: <20250430212106.369208-11-david.e.box@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 10283 bytes --]
On Wed, 30 Apr 2025, David E. Box wrote:
> The TPMI platform information provides a mapping of OOBMSM PCI devices to
> logical CPUs. Since this mapping is consistent across all OOBMSM features
> (e.g., TPMI, PMT, SDSi), it can be leveraged by multiple drivers. To
> facilitate reuse, relocate the struct intel_tpmi_plat_info to intel_vsec.h,
> renaming it to struct oobmsm_plat_info, making it accessible to other
> features. While modifying headers, place them in alphabetical order.
>
> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> ---
> drivers/platform/x86/intel/plr_tpmi.c | 3 ++-
> .../intel/speed_select_if/isst_tpmi_core.c | 9 ++++---
> .../uncore-frequency/uncore-frequency-tpmi.c | 5 ++--
> drivers/platform/x86/intel/vsec_tpmi.c | 4 +--
> drivers/powercap/intel_rapl_tpmi.c | 9 ++++---
> include/linux/intel_tpmi.h | 26 ++-----------------
> include/linux/intel_vsec.h | 22 ++++++++++++++++
> 7 files changed, 41 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/platform/x86/intel/plr_tpmi.c b/drivers/platform/x86/intel/plr_tpmi.c
> index 2b55347a5a93..58132da47745 100644
> --- a/drivers/platform/x86/intel/plr_tpmi.c
> +++ b/drivers/platform/x86/intel/plr_tpmi.c
> @@ -14,6 +14,7 @@
> #include <linux/err.h>
> #include <linux/gfp_types.h>
> #include <linux/intel_tpmi.h>
> +#include <linux/intel_vsec.h>
> #include <linux/io.h>
> #include <linux/iopoll.h>
> #include <linux/kstrtox.h>
> @@ -256,7 +257,7 @@ DEFINE_SHOW_STORE_ATTRIBUTE(plr_status);
>
> static int intel_plr_probe(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id)
> {
> - struct intel_tpmi_plat_info *plat_info;
> + struct oobmsm_plat_info *plat_info;
> struct dentry *dentry;
> int i, num_resources;
> struct resource *res;
> diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> index 9978cdd19851..875afa6835cd 100644
> --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> @@ -22,6 +22,7 @@
> #include <linux/auxiliary_bus.h>
> #include <linux/delay.h>
> #include <linux/intel_tpmi.h>
> +#include <linux/intel_vsec.h>
> #include <linux/fs.h>
> #include <linux/io.h>
> #include <linux/kernel.h>
> @@ -1446,7 +1447,7 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev)
> {
> struct tpmi_per_power_domain_info *pd_info;
> bool read_blocked = 0, write_blocked = 0;
> - struct intel_tpmi_plat_info *plat_info;
> + struct oobmsm_plat_info *plat_info;
> struct device *dev = &auxdev->dev;
> struct tpmi_sst_struct *tpmi_sst;
> u8 i, num_resources, io_die_cnt;
> @@ -1598,7 +1599,7 @@ EXPORT_SYMBOL_NS_GPL(tpmi_sst_dev_add, "INTEL_TPMI_SST");
> void tpmi_sst_dev_remove(struct auxiliary_device *auxdev)
> {
> struct tpmi_sst_struct *tpmi_sst = auxiliary_get_drvdata(auxdev);
> - struct intel_tpmi_plat_info *plat_info;
> + struct oobmsm_plat_info *plat_info;
>
> plat_info = tpmi_get_platform_data(auxdev);
> if (!plat_info)
> @@ -1620,7 +1621,7 @@ void tpmi_sst_dev_suspend(struct auxiliary_device *auxdev)
> {
> struct tpmi_sst_struct *tpmi_sst = auxiliary_get_drvdata(auxdev);
> struct tpmi_per_power_domain_info *power_domain_info;
> - struct intel_tpmi_plat_info *plat_info;
> + struct oobmsm_plat_info *plat_info;
> void __iomem *cp_base;
>
> plat_info = tpmi_get_platform_data(auxdev);
> @@ -1648,7 +1649,7 @@ void tpmi_sst_dev_resume(struct auxiliary_device *auxdev)
> {
> struct tpmi_sst_struct *tpmi_sst = auxiliary_get_drvdata(auxdev);
> struct tpmi_per_power_domain_info *power_domain_info;
> - struct intel_tpmi_plat_info *plat_info;
> + struct oobmsm_plat_info *plat_info;
> void __iomem *cp_base;
>
> plat_info = tpmi_get_platform_data(auxdev);
> diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c
> index 4aa6c227ec82..23a86feb12ef 100644
> --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c
> +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c
> @@ -22,9 +22,10 @@
> #include <linux/auxiliary_bus.h>
> #include <linux/bitfield.h>
> #include <linux/bits.h>
> +#include <linux/intel_tpmi.h>
> +#include <linux/intel_vsec.h>
> #include <linux/io.h>
> #include <linux/module.h>
> -#include <linux/intel_tpmi.h>
>
> #include "uncore-frequency-common.h"
>
> @@ -421,7 +422,7 @@ static void remove_cluster_entries(struct tpmi_uncore_struct *tpmi_uncore)
> static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id)
> {
> bool read_blocked = 0, write_blocked = 0;
> - struct intel_tpmi_plat_info *plat_info;
> + struct oobmsm_plat_info *plat_info;
> struct tpmi_uncore_struct *tpmi_uncore;
> bool uncore_sysfs_added = false;
> int ret, i, pkg = 0;
> diff --git a/drivers/platform/x86/intel/vsec_tpmi.c b/drivers/platform/x86/intel/vsec_tpmi.c
> index 5c383a27bbe8..d95a0d994546 100644
> --- a/drivers/platform/x86/intel/vsec_tpmi.c
> +++ b/drivers/platform/x86/intel/vsec_tpmi.c
> @@ -116,7 +116,7 @@ struct intel_tpmi_info {
> struct intel_vsec_device *vsec_dev;
> int feature_count;
> u64 pfs_start;
> - struct intel_tpmi_plat_info plat_info;
> + struct oobmsm_plat_info plat_info;
> void __iomem *tpmi_control_mem;
> struct dentry *dbgfs_dir;
> };
> @@ -187,7 +187,7 @@ struct tpmi_feature_state {
> /* Used during auxbus device creation */
> static DEFINE_IDA(intel_vsec_tpmi_ida);
>
> -struct intel_tpmi_plat_info *tpmi_get_platform_data(struct auxiliary_device *auxdev)
> +struct oobmsm_plat_info *tpmi_get_platform_data(struct auxiliary_device *auxdev)
> {
> struct intel_vsec_device *vsec_dev = auxdev_to_ivdev(auxdev);
>
> diff --git a/drivers/powercap/intel_rapl_tpmi.c b/drivers/powercap/intel_rapl_tpmi.c
> index af2368f4db10..82201bf4685d 100644
> --- a/drivers/powercap/intel_rapl_tpmi.c
> +++ b/drivers/powercap/intel_rapl_tpmi.c
> @@ -9,9 +9,10 @@
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> #include <linux/auxiliary_bus.h>
> -#include <linux/io.h>
> -#include <linux/intel_tpmi.h>
> #include <linux/intel_rapl.h>
> +#include <linux/intel_tpmi.h>
> +#include <linux/intel_vsec.h>
> +#include <linux/io.h>
> #include <linux/module.h>
> #include <linux/slab.h>
>
> @@ -48,7 +49,7 @@ enum tpmi_rapl_register {
>
> struct tpmi_rapl_package {
> struct rapl_if_priv priv;
> - struct intel_tpmi_plat_info *tpmi_info;
> + struct oobmsm_plat_info *tpmi_info;
> struct rapl_package *rp;
> void __iomem *base;
> struct list_head node;
> @@ -253,7 +254,7 @@ static int intel_rapl_tpmi_probe(struct auxiliary_device *auxdev,
> const struct auxiliary_device_id *id)
> {
> struct tpmi_rapl_package *trp;
> - struct intel_tpmi_plat_info *info;
> + struct oobmsm_plat_info *info;
> struct resource *res;
> u32 offset;
> int ret;
> diff --git a/include/linux/intel_tpmi.h b/include/linux/intel_tpmi.h
> index ff480b47ae64..d1fe2469b0a4 100644
> --- a/include/linux/intel_tpmi.h
> +++ b/include/linux/intel_tpmi.h
> @@ -7,6 +7,7 @@
> #define _INTEL_TPMI_H_
>
> #include <linux/bitfield.h>
Add an empty line here.
Once that is addressed,
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> +struct oobmsm_plat_info;
>
> #define TPMI_VERSION_INVALID 0xff
> #define TPMI_MINOR_VERSION(val) FIELD_GET(GENMASK(4, 0), val)
> @@ -26,30 +27,7 @@ enum intel_tpmi_id {
> TPMI_INFO_ID = 0x81, /* Special ID for PCI BDF and Package ID information */
> };
>
> -/**
> - * struct intel_tpmi_plat_info - Platform information for a TPMI device instance
> - * @cdie_mask: Mask of all compute dies in the partition
> - * @package_id: CPU Package id
> - * @partition: Package partition id when multiple VSEC PCI devices per package
> - * @segment: PCI segment ID
> - * @bus_number: PCI bus number
> - * @device_number: PCI device number
> - * @function_number: PCI function number
> - *
> - * Structure to store platform data for a TPMI device instance. This
> - * struct is used to return data via tpmi_get_platform_data().
> - */
> -struct intel_tpmi_plat_info {
> - u16 cdie_mask;
> - u8 package_id;
> - u8 partition;
> - u8 segment;
> - u8 bus_number;
> - u8 device_number;
> - u8 function_number;
> -};
> -
> -struct intel_tpmi_plat_info *tpmi_get_platform_data(struct auxiliary_device *auxdev);
> +struct oobmsm_plat_info *tpmi_get_platform_data(struct auxiliary_device *auxdev);
> struct resource *tpmi_get_resource_at_index(struct auxiliary_device *auxdev, int index);
> int tpmi_get_resource_count(struct auxiliary_device *auxdev);
> int tpmi_get_feature_status(struct auxiliary_device *auxdev, int feature_id, bool *read_blocked,
> diff --git a/include/linux/intel_vsec.h b/include/linux/intel_vsec.h
> index a07796d7d43b..cd78d0b2e623 100644
> --- a/include/linux/intel_vsec.h
> +++ b/include/linux/intel_vsec.h
> @@ -144,6 +144,28 @@ struct intel_vsec_device {
> unsigned long cap_id;
> };
>
> +/**
> + * struct oobmsm_plat_info - Platform information for a device instance
> + * @cdie_mask: Mask of all compute dies in the partition
> + * @package_id: CPU Package id
> + * @partition: Package partition id when multiple VSEC PCI devices per package
> + * @segment: PCI segment ID
> + * @bus_number: PCI bus number
> + * @device_number: PCI device number
> + * @function_number: PCI function number
> + *
> + * Structure to store platform data for a OOBMSM device instance.
> + */
> +struct oobmsm_plat_info {
> + u16 cdie_mask;
> + u8 package_id;
> + u8 partition;
> + u8 segment;
> + u8 bus_number;
> + u8 device_number;
> + u8 function_number;
> +};
> +
> int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
> struct intel_vsec_device *intel_vsec_dev,
> const char *name);
>
--
i.
next prev parent reply other threads:[~2025-05-20 14:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 21:20 [PATCH 00/15] Intel VSEC/PMT: Introduce Discovery Driver David E. Box
2025-04-30 21:20 ` [PATCH 01/15] MAINTAINERS: Add link to documentation of Intel PMT ABI David E. Box
2025-04-30 21:20 ` [PATCH 02/15] platform/x86/intel/vsec: Add private data for per-device data David E. Box
2025-04-30 21:20 ` [PATCH 03/15] platform/x86/intel/vsec: Create wrapper to walk PCI config space David E. Box
2025-04-30 21:20 ` [PATCH 04/15] platform/x86/intel/vsec: Add device links to enforce dependencies David E. Box
2025-05-20 13:51 ` Ilpo Järvinen
2025-06-16 16:04 ` David E. Box
2025-04-30 21:20 ` [PATCH 05/15] platform/x86/intel/vsec: Skip absent features during initialization David E. Box
2025-04-30 21:20 ` [PATCH 06/15] platform/x86/intel/vsec: Skip driverless features David E. Box
2025-04-30 21:20 ` [PATCH 07/15] platform/x86/intel/vsec: Add new Discovery feature David E. Box
2025-05-20 14:01 ` Ilpo Järvinen
2025-04-30 21:20 ` [PATCH 08/15] platform/x86/intel/pmt: Add PMT Discovery driver David E. Box
2025-05-20 14:32 ` Ilpo Järvinen
2025-05-20 20:59 ` David E. Box
2025-04-30 21:20 ` [PATCH 09/15] docs: Add ABI documentation for intel_pmt feature directories David E. Box
2025-05-20 14:51 ` Ilpo Järvinen
2025-04-30 21:20 ` [PATCH 10/15] platform/x86/intel/tpmi: Relocate platform info to intel_vsec.h David E. Box
2025-05-20 14:54 ` Ilpo Järvinen [this message]
2025-04-30 21:21 ` [PATCH 11/15] platform/x86/intel/vsec: Set OOBMSM to CPU mapping David E. Box
2025-04-30 21:21 ` [PATCH 12/15] platform/x86/intel/tpmi: Get OOBMSM CPU mapping from TPMI David E. Box
2025-04-30 21:21 ` [PATCH 13/15] platform/x86/intel/pmt/discovery: Get telemetry attributes David E. Box
2025-04-30 21:21 ` [PATCH 14/15] platform/x86/intel/pmt/telemetry: Add API to retrieve telemetry regions by feature David E. Box
2025-05-20 15:05 ` Ilpo Järvinen
2025-04-30 21:21 ` [PATCH 15/15] platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API David E. Box
2025-05-16 15:30 ` [PATCH 00/15] Intel VSEC/PMT: Introduce Discovery Driver Luck, Tony
2025-05-19 17:22 ` Luck, Tony
2025-05-19 17:32 ` 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=b8b5bcf8-bac9-4e92-f876-2c6ac595596f@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=david.e.box@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tony.luck@intel.com \
--cc=xi.pardee@linux.intel.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 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).