public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Piotr Kubaj <piotr.kubaj@intel.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] cpufreq.c: add new test for cpufreq sysfs interface validation
Date: Wed, 22 Apr 2026 11:11:39 +0000	[thread overview]
Message-ID: <20260422111139.4036-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260422103542.20933-2-piotr.kubaj@intel.com>

Hi Piotr,

On 2026-04-22, Piotr Kubaj wrote:
> cpufreq.c: add new test for cpufreq sysfs interface validation

> +static long *previous_scaling_max_freq, *previous_scaling_min_freq;
> +
> +static void cleanup(void)
> +{
> [...]
> +               SAFE_FILE_PRINTF(path, "%ld", previous_scaling_max_freq[i]);
> [...]
> +               SAFE_FILE_PRINTF(path, "%ld", previous_scaling_min_freq[i]);

Both arrays are zeroed by SAFE_CALLOC in setup() and only populated
inside run(). If run() aborts before reaching the per-CPU save loops
(e.g. a SAFE_OPEN or SAFE_FILE_SCANF fails on an earlier cpufreq node),
cleanup() writes 0 to scaling_max_freq and scaling_min_freq for every
online CPU, leaving the system in an invalid state.

Read the original per-CPU values in setup() instead.

Pre-existing issues noticed in the surrounding code (not introduced
by this patch):

- cpufreq.c:116 — strstr(contents, "performance powersave") assumes
  a specific governor ordering that the kernel does not guarantee.
- cpufreq.c:170 — same issue for "performance schedutil".

---
Note:

Our agent completed the review of the patch.

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2026-04-22 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 10:35 [LTP] [PATCH] cpufreq.c: add new test for cpufreq sysfs interface validation Piotr Kubaj
2026-04-22 11:11 ` linuxtestproject.agent [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=20260422111139.4036-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=piotr.kubaj@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