From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
"HyeongJun An" <sammiee5311@gmail.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 6.6.y 7/7] platform/x86: ISST: Return error during profile addition
Date: Wed, 9 Sep 2026 10:58:22 -0400 [thread overview]
Message-ID: <20260909145822.2742457-7-sashal@kernel.org> (raw)
In-Reply-To: <20260909145822.2742457-1-sashal@kernel.org>
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ Upstream commit f9a647cb8d90c09633a49a1e766e140e78012444 ]
If sst_add_perf_profiles() fails for memory allocation, it continues
to allow SST-CP (core-power) feature. But in practice this is not
very useful as to achieve some frequencies via SST-CP, an SST-PP
(perf-profile) level change is required.
Fixes: 0ab147bb840f ("platform/x86: ISST: Parse SST MMIO and update instance")
Cc: HyeongJun An <sammiee5311@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20260811222134.3912626-2-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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../x86/intel/speed_select_if/isst_tpmi_core.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
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 8382974f31027..a0c6c66b8442a 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
@@ -321,7 +321,7 @@ static int sst_add_perf_profiles(struct auxiliary_device *auxdev,
if (!pd_info->perf_levels) {
pd_info->pp_header.allowed_level_mask = 0;
pd_info->pp_header.level_en_mask = 0;
- return 0;
+ return -ENOMEM;
}
pd_info->ratio_unit = pd_info->pp_header.ratio_unit;
@@ -352,7 +352,7 @@ static int sst_add_perf_profiles(struct auxiliary_device *auxdev,
static int sst_main(struct auxiliary_device *auxdev, struct tpmi_per_power_domain_info *pd_info)
{
struct device *dev = &auxdev->dev;
- int i, mask, levels;
+ int i, ret, mask, levels;
*((u64 *)&pd_info->sst_header) = readq(pd_info->sst_base);
pd_info->sst_header.cp_offset *= 8;
@@ -387,8 +387,12 @@ static int sst_main(struct auxiliary_device *auxdev, struct tpmi_per_power_domai
levels = i;
mask <<= 1;
}
+
+ ret = sst_add_perf_profiles(auxdev, pd_info, levels + 1);
+ if (ret)
+ return ret;
+
pd_info->max_level = levels;
- sst_add_perf_profiles(auxdev, pd_info, levels + 1);
return 0;
}
--
2.53.0
prev parent reply other threads:[~2026-09-09 14:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 14:48 FAILED: patch "[PATCH] platform/x86: ISST: Return error during profile addition" failed to apply to 6.6-stable tree gregkh
2026-09-09 14:58 ` [PATCH 6.6.y 1/7] platform/x86: ISST: Ignore minor version change Sasha Levin
2026-09-09 14:58 ` [PATCH 6.6.y 2/7] platform/x86/intel/tpmi: Move TPMI ID definition Sasha Levin
2026-09-09 14:58 ` [PATCH 6.6.y 3/7] platform/x86: ISST: Process read/write blocked feature status Sasha Levin
2026-09-09 14:58 ` [PATCH 6.6.y 4/7] platform/x86: ISST: Use local variable for auxdev->dev Sasha Levin
2026-09-09 14:58 ` [PATCH 6.6.y 5/7] platform/x86: ISST: Validate level in perf mask ioctls Sasha Levin
2026-09-09 14:58 ` [PATCH 6.6.y 6/7] platform/x86: ISST: Use PP level enable mask Sasha Levin
2026-09-09 14:58 ` Sasha Levin [this message]
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=20260909145822.2742457-7-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=sammiee5311@gmail.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=stable@vger.kernel.org \
/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.