* [PATCH] platform/x86/intel/pmc: initialize empty PMT read result
@ 2026-06-30 10:51 Yousef Alhouseen
2026-07-10 16:12 ` David Box
2026-07-21 17:16 ` Ilpo Järvinen
0 siblings, 2 replies; 3+ messages in thread
From: Yousef Alhouseen @ 2026-06-30 10:51 UTC (permalink / raw)
To: Rajneesh Bhardwaj, David E . Box
Cc: Hans de Goede, Ilpo Järvinen, platform-driver-x86,
linux-kernel, Yousef Alhouseen
pmc_core_pmt_get_lpm_req() returns the last telemetry read status. When
firmware exposes no enabled low-power modes, the loop does not run
and the function returns an uninitialized stack value.
Initialize the status to success so an empty mode set is handled
deterministically.
Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
---
drivers/platform/x86/intel/pmc/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index 825ba5fa0bcb..9f77c0716e59 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -1583,7 +1583,7 @@ int pmc_core_pmt_get_lpm_req(struct pmc_dev *pmcdev, struct pmc *pmc, struct tel
{
const u8 *lpm_indices;
int num_maps, mode_offset = 0;
- int ret, lpm_size;
+ int ret = 0, lpm_size;
u8 mode;
lpm_indices = pmc->map->lpm_reg_index;
--
2.54.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86/intel/pmc: initialize empty PMT read result
2026-06-30 10:51 [PATCH] platform/x86/intel/pmc: initialize empty PMT read result Yousef Alhouseen
@ 2026-07-10 16:12 ` David Box
2026-07-21 17:16 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: David Box @ 2026-07-10 16:12 UTC (permalink / raw)
To: Yousef Alhouseen
Cc: Rajneesh Bhardwaj, Hans de Goede, Ilpo Järvinen,
platform-driver-x86, linux-kernel
On Tue, Jun 30, 2026 at 12:51:01PM +0200, Yousef Alhouseen wrote:
> pmc_core_pmt_get_lpm_req() returns the last telemetry read status. When
> firmware exposes no enabled low-power modes, the loop does not run
> and the function returns an uninitialized stack value.
>
> Initialize the status to success so an empty mode set is handled
> deterministically.
>
> Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
> ---
> drivers/platform/x86/intel/pmc/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
> index 825ba5fa0bcb..9f77c0716e59 100644
> --- a/drivers/platform/x86/intel/pmc/core.c
> +++ b/drivers/platform/x86/intel/pmc/core.c
> @@ -1583,7 +1583,7 @@ int pmc_core_pmt_get_lpm_req(struct pmc_dev *pmcdev, struct pmc *pmc, struct tel
> {
> const u8 *lpm_indices;
> int num_maps, mode_offset = 0;
> - int ret, lpm_size;
> + int ret = 0, lpm_size;
> u8 mode;
>
> lpm_indices = pmc->map->lpm_reg_index;
> --
> 2.54.0
>
Reviewed-by: David E. Box <david.e.box@linux.intel.com>
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86/intel/pmc: initialize empty PMT read result
2026-06-30 10:51 [PATCH] platform/x86/intel/pmc: initialize empty PMT read result Yousef Alhouseen
2026-07-10 16:12 ` David Box
@ 2026-07-21 17:16 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2026-07-21 17:16 UTC (permalink / raw)
To: Rajneesh Bhardwaj, David E . Box, Yousef Alhouseen
Cc: platform-driver-x86, linux-kernel, Hans de Goede
On Tue, 30 Jun 2026 12:51:01 +0200, Yousef Alhouseen wrote:
> pmc_core_pmt_get_lpm_req() returns the last telemetry read status. When
> firmware exposes no enabled low-power modes, the loop does not run
> and the function returns an uninitialized stack value.
>
> Initialize the status to success so an empty mode set is handled
> deterministically.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.
The list of commits applied:
[1/1] platform/x86/intel/pmc: initialize empty PMT read result
commit: 408b87a481e3ab33cba00292e4c80a30ba97f995
--
i.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-21 17:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-30 10:51 [PATCH] platform/x86/intel/pmc: initialize empty PMT read result Yousef Alhouseen
2026-07-10 16:12 ` David Box
2026-07-21 17:16 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®