All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kubaj, Piotr" <piotr.kubaj@intel.com>
To: "linuxtestproject.agent@gmail.com" <linuxtestproject.agent@gmail.com>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] cpufreq.c: add new test for cpufreq sysfs interface validation
Date: Thu, 11 Jun 2026 13:05:58 +0000	[thread overview]
Message-ID: <1b449538e0328e5020d7c2529419ecfc349e8fdb.camel@intel.com> (raw)
In-Reply-To: <20260611123247.4081-1-linuxtestproject.agent@gmail.com>

The current check is correct. This is exactly the way our architect
suggested. This is because the values written by the user are not
written raw, but kernel uses them only as a suggestion and can be lower
or higher than specified, but need to always abide the values of
scaling_min_freq and scaling_max_freq - which is exactly what this test
checks.

2026-06-11 (木) の 12:32 +0000 に linuxtestproject.agent@gmail.com
さんは書きました:
> Hi Piotr,
> 
> On Thu, 11 Jun 2026 13:42:20 +0200, Piotr Kubaj wrote:
> > cpufreq.c: add new test for cpufreq sysfs interface validation
> 
> > +		if (cpuinfo_max_freq < scaling_max_freq) {
> > +			tst_res(TINFO, "cpuinfo_max_freq: %ld",
> > cpuinfo_max_freq);
> > +			tst_res(TINFO, "scaling_max_freq: %ld",
> > scaling_max_freq);
> > +			tst_res(TFAIL, "Failure setting %s",
> > path);
> > +		} else {
> > +			tst_res(TPASS, "Successfully set up %s",
> > path);
> > +		}
> 
> The frequency write-back checks throughout run() use one-directional
> comparisons. Here the test writes cpuinfo_max_freq to
> scaling_max_freq
> and reads it back, but only fails when the read value is *higher*
> than what was written. If the kernel rounded the value *down* (or the
> write silently failed to a lower value), the test would still report
> TPASS with "Successfully set up".
> 
> The same pattern applies to the scaling_min_freq checks further down,
> which only fail when the read value is *lower* than what was written.
> 
> Since the purpose of these checks is to validate that exact boundary
> values can be written, would it not be more correct to use != instead
> of < / > here?
> 
> > +		if (cpuinfo_max_freq < scaling_min_freq) {
> 
> Same issue: only catches upward deviations.
> 
> > +		if (cpuinfo_min_freq > scaling_min_freq) {
> 
> Same issue: only catches downward deviations.
> 
> > +		if (cpuinfo_min_freq > scaling_max_freq) {
> 
> Same issue: only catches downward deviations.
> 
> Verdict: Needs revision
> 
> ---
> Note:
> 
> 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
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.

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

  reply	other threads:[~2026-06-11 13:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 11:42 [LTP] [PATCH v9] cpufreq.c: add new test for cpufreq sysfs interface validation Piotr Kubaj
2026-06-11 12:32 ` [LTP] " linuxtestproject.agent
2026-06-11 13:05   ` Kubaj, Piotr [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-07 11:11 [LTP] [PATCH v8] " Piotr Kubaj
2026-05-07 11:57 ` [LTP] " linuxtestproject.agent
2026-05-06 13:08 [LTP] [PATCH v7] " Piotr Kubaj
2026-05-06 14:17 ` [LTP] " linuxtestproject.agent
2026-05-06  9:10 [LTP] [PATCH v6] " Piotr Kubaj
2026-05-06 12:47 ` [LTP] " linuxtestproject.agent
2026-05-05 11:02 [LTP] [PATCH v5] " Piotr Kubaj
2026-05-05 17:53 ` [LTP] " linuxtestproject.agent
2026-05-05  9:48 [LTP] [PATCH v4] " Piotr Kubaj
2026-05-05 10:53 ` [LTP] " linuxtestproject.agent
2026-05-04 10:08 [LTP] [PATCH v3] " Piotr Kubaj
2026-05-04 11:54 ` [LTP] " linuxtestproject.agent
2026-04-22 10:35 [LTP] [PATCH] " Piotr Kubaj
2026-04-22 11:11 ` [LTP] " linuxtestproject.agent

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=1b449538e0328e5020d7c2529419ecfc349e8fdb.camel@intel.com \
    --to=piotr.kubaj@intel.com \
    --cc=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    /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.