Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deepin Kernel SIG] [Intel] Tpmi based drivers backport from 6.11 #541

Merged

Conversation

Avenger-285714
Copy link
Collaborator

backport the update and fix for TPMI based drivers.
major version and minor version update,
debugfs added
important bugfix

Test:
build and test TPMI related sysfs
intel SST related function ok
uncore driver sysfs works as expected.

Link: https://gitee.com/OpenCloudOS/OpenCloudOS-Kernel/pulls/276

spandruvada and others added 30 commits December 27, 2024 22:17
commit 8df012a upstream.

Display read and write blocked status of each TPMI feature in addition
to disabled and locked status.

This will require reading of read/write blocked state from the hardware.
Currently tpmi_read_feature_status(), doesn't provide this state.

Define TPMI feature state as defined in the TPMI spec. Modify the function
tpmi_read_feature_status() to update full feature state instead of just
disabled and locked state.

Intel-SIG: commit 8df012a platform/x86/intel/tpmi: Add debugfs support for read/write blocked.
Backport Intel_tpmi base driver for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit b87434f upstream.

If some TPMI features are disabled, don't create auxiliary devices. In
this way feature drivers will not load.

While creating auxiliary devices, call tpmi_read_feature_status() to
check feature state and return if the feature is disabled without
creating a device.

Intel-SIG: commit b87434f platform/x86/intel/tpmi: Don't create devices for disabled features.
Backport intel tpmi base driver update for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
…state

commit 72dd14d upstream.

Modify the external interface tpmi_get_feature_status() to get read
and write blocked instead of locked and disabled. Since auxiliary device
is not created when disabled, no use of returning disabled state. Also
locked state is not useful as feature driver can't use locked state
in a meaningful way.

Using read and write state, feature driver can decide which operations
to restrict for that feature.

Intel-SIG: commit 72dd14d platform/x86/intel/tpmi: Modify external interface to get read/write state.
Backport intel tpmi base driver update for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 046d7be upstream.

Move TPMI ID definitions to common include file. In this way other
feature drivers don't have to redefine.

Intel-SIG: commit 046d7be platform/x86/intel/tpmi: Move TPMI ID definition.
Backport intel tpmi base driver update for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 59eb081 upstream.

Check the major version from TPMI information header and fail to load
driver if the version is not supported.

Intel-SIG: commit 59eb081 platform/x86/intel/tpmi: Check major version change for TPMI Information.
Backport intel tpmi base driver update for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 1192534 upstream.

Align comments in kernel-doc for the struct intel_tpmi_plat_info.

Intel-SIG: commit 1192534 platform/x86/intel/tpmi: Align comments in kernel-doc.
Backport intel tpmi base driver update for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit c8405cc upstream.

TPMI information header added additional fields in version 2. Some of the
reserved fields in version 1 are used to define new fields.

Parse new fields and export as part of platform data. These fields include:
- PCI segment ID
- Partition ID of the package: If a package is represented by more than
  one PCI device, then partition ID along with cdie_mask, describes the
  scope. For example to update get/set properties for a compute die, one
  of the PCI MMIO region is selected from the partition ID.
- cdie_mask: Mask of all compute dies in this partition.

Intel-SIG: commit c8405cc platform/x86/intel/tpmi: Add additional TPMI header fields.
Backport intel tpmi base driver update for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Zhang Rui <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit da40828 upstream.

Allowed level mask is a mask of levels, which are currently allowed to
dynamically switch by the OS. Fused mask is a mask of all levels even if
OS is not allowed to switch.

Even if OS is not allowed to dynamically switch, it is still possible for
user to boot to a level by using BIOS option. To decide which level to
boot next time, user wants to check parameters (power, performance or
thermal) of that level to decide.

So, when passing the level mask for display to user space, use fuse
enabled mask, which has all levels.

Intel-SIG: commit da40828 platform/x86: ISST: Use fuse enabled mask instead of allowed levels.
Backport Intel speed select ISST driver support on TPMI.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit a22d36e upstream.

It is possible that SST level 0 or base level is not present in some
configurations. So don't set level 0 mask in level_en_mask by default.

Intel-SIG: commit a22d36e platform/x86: ISST: Allow level 0 to be not present.
Backport Intel speed select ISST driver support on TPMI.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 7525cea upstream.

The driver is using 256 as the size while calling devm_ioremap(). The
maximum offset can be obtained from isst_mmio_range. Add a field "size"
to the isst_mmio_range and use it instead of hardcoding.

No functional impact is expected.

Intel-SIG: commit 7525cea platform/x86: intel_speed_select_if: Remove hardcoded map size.
Backport Intel speed select ISST driver support on TPMI.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 23f392e upstream.

Replace devm_ioremap() with devm_ioremap_resource() by defining a
resource.

Intel-SIG: commit 23f392e platform/x86: intel_speed_select_if: Use devm_ioremap_resource.
Backport Intel SST driver for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Suggested-by: Andy Shevchenko <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 07510a5 upstream.

The hardware definition of every TPMI feature contains a major and minor
version. When there is a change in the MMIO offset or change in the
definition of a field, hardware will change major version. For addition
of new fields without modifying existing MMIO offsets or fields, only the
minor version is changed.

Driver is developed to support SST functionality for a major and minor
version. If the hardware changes major version, since offsets and
definitions are changed, driver cannot continue to provide SST interface
to users. Driver can still function with a minor version change as it will
just miss the new functionality added by the hardware. The current
implementation doesn't ignore any version change.

If there is mismatch with the minor version, continue with an information
log message. If there is mismatch with the major version, log error and
exit.

Intel-SIG: commit 07510a5 platform/x86: ISST: Ignore minor version change.
Backport Intel SST driver for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 8bed9ff upstream.

When a feature is read blocked, don't continue to read SST information
and register with SST core.

When the feature is write blocked, continue to offer read interface for
SST parameters, but don't allow any operation to change state. A state
change results from SST level change, feature change or class of service
change.

Intel-SIG: commit 8bed9ff platform/x86: ISST: Process read/write blocked feature status.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
…stems

commit e8b4223 upstream.

When HWP (Hardware P-states) is disabled, dynamic SST features are
disabled. But user should still be able to read the current core-power
state, with legacy P-states. This will allow users to read current
configuration with static SST enabled from BIOS.

To address this, do not call disable_dynamic_sst_features() when the
request is for reading the state.

Intel-SIG: commit e8b4223 platform/x86: ISST: Allow reading core-power state on HWP disabled systems.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 8c5a689 upstream.

Define a local variable for &auxdev->dev and use to shorten length of
lines. No functional change is done.

Intel-SIG: commit 8c5a689 platform/x86: ISST: Use local variable for auxdev->dev.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Suggested-by: Andy Shevchenko <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit fe4211d upstream.

Instead of long lines for assignment to tpmi_sst->power_domain_info, use
a local variable pd_info and assign later. Also move the assignment
of number of resources after the assignment of pd_info.

No functional change is expected.

Intel-SIG: commit fe4211d platform/x86: ISST: Shorten the assignments for power_domain_info.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 9d1d362 upstream.

A partitioned system has two different PCI VSEC devices per package.
A non-partitioned device has only one PCI VSEC device per package.
The current implementation only supports non partitioned systems.

Each partition maps a set of power domains. Other than reading from
different MMIO regions, there is no change in the SST functionality.
The scope of SST control is still per power domain. Hence user space
does not need to be aware of existence of partitions.

With partitions, existing per package information defined using struct
tpmi_sst_struct is enhanced to store information for both partitions. A
mapping function map_partition_power_domain_id() is introduced, which
maps to correct partition and index. This mapping function is called
in get_instance() and isst_if_clos_assoc(), before indexing into
tpmi_sst_struct->power_domain_info[].

The TPMI core platform info provides partition id and compute die ID
mask for each partition. Use this information to order power domains,
so that compute dies are presented before IO dies to match hardware
defined compute die ID for each CPU.

Intel-SIG: commit 9d1d362 platform/x86: ISST: Support partitioned systems.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Zhang Rui <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit e4e365b upstream.

Use in_range() macro to simplify range check.

No functional impact is expected.

Intel-SIG: commit e4e365b platform/x86: ISST: Use in_range() to check package ID validity.
Backport Intel SST driver for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Suggested-by: Andy Shevchenko <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit afad974 upstream.

Add dev_fmt for formatting log messages.

No functional impact is expected.

Intel-SIG: commit afad974 platform/x86: ISST: Add dev_fmt.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Suggested-by: Andy Shevchenko <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 05857e1 upstream.

Add missing MODULE_DESCRIPTION() to ISST modules.

Intel-SIG: commit 05857e1 platform/x86: ISST: Add missing MODULE_DESCRIPTION.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 76f09e2 upstream.

SST SST-BF and SST-TF can be enabled/disabled per SST-PP level. So return
a mask of all levels, where the feature is supported, instead of just for
level 0.

Since the return value returns all levels mask, not just level 0, update
API version.

Intel-SIG: commit 76f09e2 platform/x86: ISST: Support SST-BF and SST-TF per level.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Zhang Rui <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit a4edf67 upstream.

In tpmi_sst_dev_remove(), tpmi_sst is dereferenced after being freed.
Fix this by reordering the kfree() post the dereference.

Intel-SIG: commit a4edf67 platform/x86: ISST: fix use-after-free in tpmi_sst_dev_remove().
Backport intel SST driver update for 6.6 from 6.11

Fixes: 9d1d362 ("platform/x86: ISST: Support partitioned systems")
Signed-off-by: Harshit Mogalapalli <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 1630dc626c87b300627fe7591f4f63f8f136f935 upstream.

SST common module is loaded when model specific or TPMI SST driver
registers for services. There are model specific features used in SST
common modules which are checked with a CPU model list. So, this module
is model specific.

There are some use cases where loading the common module independently
only on the supported CPU models helps. The first use case is for
preventing SST TPMI module loading if the model specific features are
not implemented. The second use case for presenting information to
user space when SST is used in OOB (Out of Band) mode.

1.
With TPMI, SST interface is architectural. This means that no need to add
new PCI device IDs for new CPU models. This means that there can be lag
in adding CPU models for the model specific features in the common
module. For example, before adding CPU model to GRANITERAPIDS_D to
hpm_cpu_ids[], SST is still functional for some features and but will
get/set wrong data for features like SST-CP. This is because IOCTL
ISST_IF_GET_PHY_ID, will not give correct mapping for newer CPU models.
So adding explicit model check during load time will prevent such cases.
For unsupported CPU models, common driver will fail to load and hence
dependent modules will not be loaded.

2.
When the SST TPMI features are controlled by some OOB agent (not from OS
interface), even if the CPU model is supported, there will be no user
space interface available for tools as SST TPMI modules will not
be loaded. User space interface is registered when TPMI modules call
isst_if_cdev_register(). Even in this case user space orchestrator
software needs to get power domain information to schedule workload and
get/set turbo ratio limits. This information is exposed by the common
module using IOCTLs ISST_IF_GET_PHY_ID and ISST_IF_MSR_COMMAND
respectively. Since the user space MSR access can be locked, direct MSR
access from the user space is not an option using /dev/cpu/*/msr.

Converge all the existing model checks to one common place and
use driver data to differentiate. On successful model check
call isst_misc_reg().

Intel-SIG: commit 1630dc626c87 platform/x86: ISST: Add model specific loading for common module.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Zhang Rui <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 3ea025fb4b5f1a0b66df25eba50b2a1071f01080 upstream.

Some SkyLake server variants don't support any SST functionality. No use
of providing any SST related interfaces on them.

All supported SkyLake servers provide mailbox interface via MSR. So check
for the presence of MSR 0xB0 and 0xB1. If not present don't load common
module.

Move defines for MSR_OS_MAILBOX_INTERFACE and MSR_OS_MAILBOX_DATA to
common header file to avoid duplicating them.

Intel-SIG: commit 3ea025fb4b5f platform/x86: ISST: Avoid some SkyLake server models.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 2f9514f005530502452c34295e77bdfb395b5bc6 upstream.

When the TPMI interface is present, use this interface instead of legacy.
On some systems legacy IO device is also present. Using both interfaces
together is confusing and may set the hardware in inconsistent state.

When TPMI interface is present, don't load legacy drivers.

Intel-SIG: commit 2f9514f00553 platform/x86: ISST: Use only TPMI interface when present.
Backport intel SST driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Zhang Rui <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 46ee21e9f59205e54943dfe51b2dc8a9352ca37d upstream.

When only the last resource is invalid, tpmi_sst_dev_add() is returing
error even if there are other valid resources before. This function
should return error when there are no valid resources.

Here tpmi_sst_dev_add() is returning "ret" variable. But this "ret"
variable contains the failure status of last call to sst_main(), which
failed for the invalid resource. But there may be other valid resources
before the last entry.

To address this, do not update "ret" variable for sst_main() return
status.

If there are no valid resources, it is already checked for by !inst
below the loop and -ENODEV is returned.

Intel-SIG: commit 46ee21e9f592 platform/x86: ISST: Fix return value on last invalid resource.
Backport intel SST driver update for 6.6 from 6.11

Fixes: 9d1d362 ("platform/x86: ISST: Support partitioned systems")
Signed-off-by: Srinivas Pandruvada <[email protected]>
Cc: [email protected] # 6.10+
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 440814caedb0e33c56f0478d7fa5b54479013904 upstream.

After commit '1630dc626c87 ("platform/x86: ISST: Add model specific
loading for common module")' isst_misc_reg() and isst_misc_unreg() can be
simplified. Since these functions are only called during module_init()
and module_exit() respectively, there is no contention while calling
misc_register()/misc_deregister or isst_if_cpu_info_init()/
isst_if_cpu_info_exit().

Hence remove mutex and reference counting.

Intel-SIG: commit 440814caedb0 platform/x86: ISST: Simplify isst_misc_reg() and isst_misc_unreg().
Backport Intel speed select ISST driver support on TPMI.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
[ yingbao jia: amend commit log ]
Signed-off-by: yingbao jia <[email protected]>
commit 4b0d9c8 upstream.

The hardware definition of every TPMI feature contains a major and minor
version. When there is a change in the MMIO offset or change in the
definition of a field, hardware will change major version. For addition
of new fields without modifying existing MMIO offsets or fields, only the
minor version is changed.

Driver is developed to support uncore frequency control (UFS) for a major
and minor version. If the hardware changes major version, since offsets
and definitions are changed, driver cannot continue to provide UFS
interface to users. Driver can still function with minor version change
as it will just miss the new functionality added by the hardware.

The current implementation logs information message and skips adding
uncore sysfs entry for a resource for any version mismatch. Check major
and minor version mismatch for every valid resource and fail on any major
version mismatch by logging an error message. A valid resource has a
version which is not 0xFF.

If there is mismatch with the minor version, continue with a log message.

Intel-SIG: commit 4b0d9c8 platform/x86/intel-uncore-freq: Ignore minor version change.
Backport Intel-uncore-freq driver support for 6.6 from 6.11.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
…atus

commit b06458d upstream.

When a feature is read blocked, don't continue to read uncore information
and register with uncore core.

When the feature is write blocked, continue to offer read interface but
block setting uncore limits.

Intel-SIG: commit b06458d platform/x86/intel-uncore-freq: Process read/write blocked feature status.
Backport intel uncore-freq driver update for 6.6 from 6.11

Signed-off-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit bc774d4 upstream.

No new changes will be added for minor version 2. Change the minor
version number to 2 and stop displaying log message for unsupported
minor version 2.

Intel-SIG: commit bc774d4 platform/x86/intel-uncore-freq: Increase minor number support.
Backport intel uncore-freq driver update for 6.6 from 6.10

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
Tero Kristo added 7 commits December 27, 2024 22:18
commit 36f70045528f5639bb50b3b74c7925943cf6983a upstream.

Rename the various bitmasks from the 'UNCORE_GENMASK_*' to
'UNCORE_*_MASK', and re-order them based on the register they reside in.

No functional change intended.

Intel-SIG: commit 36f70045528f platform/x86/intel-uncore-freq: Re-arrange bit masks.
Backport intel uncore-freq driver update from 6.11

Signed-off-by: Tero Kristo <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 4babdbdce6a05ae6f228c1ae1e61a4bc91a91d33 upstream.

Get rid of any magic bitmasks from the code. Define proper macros for
these, and use the bitfield operations to access them.

No functional change intended.

Intel-SIG: commit 4babdbdce6a0 platform/x86/intel-uncore-freq: Get rid of magic values.
Backport intel uncore-freq driver update from 6.11

Signed-off-by: Tero Kristo <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 90583374f1a0951d563de50aeac6357b724d08f6 upstream.

Get rid of the hardcoded / magic min_max argument from internal APIs.
Instead, use an enumerated index value for it.

No functional change intended.

Intel-SIG: commit 90583374f1a0 platform/x86/intel-uncore-freq: Get rid of magic min_max argument.
Backport intel uncore-freq driver update from 6.11

Signed-off-by: Tero Kristo <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit 69207a0f17d4e5a9bdd9feeece26a84add305157 upstream.

Use the enumerated index for selecting the uncore driver parameter to
read, instead of reading everything. This is done in preparation to
expand the API to access more parameters later.

No functional change intended.

Intel-SIG: commit 69207a0f17d4 platform/x86/intel-uncore-freq: Use uncore_index with read_control_freq.
Backport intel uncore-freq driver update from 6.11

Signed-off-by: Tero Kristo <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ij: Removed underscores from variable names]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit d766abfbea9c8f2e7c87c59a572a1ae7f7ee5909 upstream.

Get rid of uncore_read_freq driver API. Instead, add a new entry to the
enumerated read interface and use this.

No functional change intended.

Intel-SIG: commit d766abfbea9c platform/x86/intel-uncore-freq: Get rid of uncore_read_freq driver API.
Backport intel uncore-freq driver update from 6.11

Signed-off-by: Tero Kristo <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
commit b2cc9f908af19dd851dd4642325daf0e86614885 upstream.

The macros to create sysfs entries are going to be used for other
attributes in addition to current min/max frequencies only, so rename
these to be more generic.

No functional change intended.

Intel-SIG: commit b2cc9f908af1 platform/x86/intel-uncore-freq: Rename the sysfs helper macro names.
Backport intel uncore-freq driver update from 6.11

Signed-off-by: Tero Kristo <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
…ency

commit 7b3ffe0d815d15310545f77d444ada92c5d26903 upstream.

Use the generic sysfs helpers for reading the current frequency also,
and remove the custom ones.

No functional change intended.

Intel-SIG: commit 7b3ffe0d815d platform/x86/intel-uncore-freq: Use generic helpers for current frequency.
Backport intel uncore-freq driver update from 6.11

Signed-off-by: Tero Kristo <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Yingbao Jia: amend commit log ]
Signed-off-by: Yingbao Jia <[email protected]>
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from avenger-285714. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Avenger-285714
Copy link
Collaborator Author

测试通过

@Avenger-285714 Avenger-285714 merged commit 450a12c into deepin-community:linux-6.6.y Dec 28, 2024
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants