mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-21 15:43:21 +02:00
57c347a2e2
In some cases a driver using services of vsec_tpmi driver requires some
processing before vsec_tpmi exits. For example a children using debugfs
can't use debugfs as this will be deleted by the vsec_tpmi driver.
This is the case when unbind using PCI driver interface. In this case
the remove callback of vsec_tpmi driver is called first, then remove
callback of its children.
Add support of blocking chain notifiers support. Notify on successful probe
and before clean up in the remove callback.
Fixes: 811f67c516 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Stable@vger.kernel.org
Link: https://patch.msgid.link/20260430151103.1549733-3-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* intel_tpmi.h: Intel TPMI core external interface
|
|
*/
|
|
|
|
#ifndef _INTEL_TPMI_H_
|
|
#define _INTEL_TPMI_H_
|
|
|
|
#include <linux/bitfield.h>
|
|
|
|
struct oobmsm_plat_info;
|
|
|
|
#define TPMI_VERSION_INVALID 0xff
|
|
#define TPMI_MINOR_VERSION(val) FIELD_GET(GENMASK(4, 0), val)
|
|
#define TPMI_MAJOR_VERSION(val) FIELD_GET(GENMASK(7, 5), val)
|
|
|
|
/*
|
|
* List of supported TMPI IDs.
|
|
* Some TMPI IDs are not used by Linux, so the numbers are not consecutive.
|
|
*/
|
|
enum intel_tpmi_id {
|
|
TPMI_ID_RAPL = 0, /* Running Average Power Limit */
|
|
TPMI_ID_PEM = 1, /* Power and Perf excursion Monitor */
|
|
TPMI_ID_UNCORE = 2, /* Uncore Frequency Scaling */
|
|
TPMI_ID_SST = 5, /* Speed Select Technology */
|
|
TPMI_ID_PLR = 0xc, /* Performance Limit Reasons */
|
|
TPMI_CONTROL_ID = 0x80, /* Special ID for getting feature status */
|
|
TPMI_INFO_ID = 0x81, /* Special ID for PCI BDF and Package ID information */
|
|
};
|
|
|
|
#define TPMI_CORE_INIT 0
|
|
#define TPMI_CORE_EXIT 1
|
|
|
|
int tpmi_register_notifier(struct notifier_block *nb);
|
|
int tpmi_unregister_notifier(struct notifier_block *nb);
|
|
|
|
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,
|
|
bool *write_blocked);
|
|
struct dentry *tpmi_get_debugfs_dir(struct auxiliary_device *auxdev);
|
|
#endif
|