All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kubaj, Piotr" <piotr.kubaj@intel.com>
To: "chrubis@suse.cz" <chrubis@suse.cz>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>,
	"linuxtestproject.agent@gmail.com"
	<linuxtestproject.agent@gmail.com>
Subject: Re: [LTP] thermal: add new test group
Date: Wed, 10 Jun 2026 08:02:44 +0000	[thread overview]
Message-ID: <4ba236b8e3c815ba2a6ce3ced8a3cef73e0aad51.camel@intel.com> (raw)
In-Reply-To: <aigF9StEMr3oNPFD@yuki.lan>

I think your changes look good, please push!

2026-06-09 (火) の 14:24 +0200 に Cyril Hrubis さんは書きました:
> Hi!
> I've been debugging the test random failures and it all boils down to
> two things:
> 
> - the sysfs temperature values are in mC the increment we have is way
>   too small
> 
> - we need to set the trigger value in the while(sleep_time > 0) loop
>   otherwise we can end up running all the iterations with a value
> that
>   is too high (if we enter the function when the CPU temperature was
>   high)
> 
> The test runs reliably for me with -i 100 with these changes, I can
> push
> the test with these changes added if you agree:
> 
> diff --git a/testcases/kernel/thermal/thermal_interrupt_events.c
> b/testcases/kernel/thermal/thermal_interrupt_events.c
> index 42e1532f6..ed55632dc 100644
> --- a/testcases/kernel/thermal/thermal_interrupt_events.c
> +++ b/testcases/kernel/thermal/thermal_interrupt_events.c
> @@ -20,10 +20,10 @@
>  #include "tst_timer_test.h"
> 
>  #define        TEST_RUNTIME    ((RUNTIME + SLEEPTIME) * (SLEEPTIME /
> 2) + COOLDOWN)
> -#define        RUNTIME         30
> +#define        RUNTIME         10
>  #define        SLEEPTIME       10
>  #define        COOLDOWN        300
> -#define        TEMP_INCREMENT  10
> +#define        TEMP_INCREMENT  5000
> 
>  static bool *x86_pkg_temp_tz;
>  static char temp_path[PATH_MAX], trip_path[PATH_MAX];
> @@ -135,13 +135,8 @@ static void cpu_workload(double run_time)
>         }
>  }
> 
> -static void test_zone(int i)
> +static void set_trippoint(void)
>  {
> -       int sleep_time = SLEEPTIME;
> -       double run_time = RUNTIME;
> -
> -       snprintf(temp_path, PATH_MAX,
> "/sys/class/thermal/thermal_zone%d/temp", i);
> -       tst_res(TINFO, "Testing %s", temp_path);
>         SAFE_FILE_SCANF(temp_path, "%d", &temp);
>         if (temp < 0)
>                 tst_brk(TBROK, "Unexpected zone temperature value
> %d", temp);
> @@ -150,10 +145,21 @@ static void test_zone(int i)
> 
>         temp_high = temp + TEMP_INCREMENT;
> 
> -       snprintf(trip_path, PATH_MAX,
> "/sys/class/thermal/thermal_zone%d/trip_point_1_temp", i);
> -
>         tst_res(TDEBUG, "Setting new trip_point_1_temp value: %d",
> temp_high);
>         SAFE_FILE_PRINTF(trip_path, "%d", temp_high);
> +}
> +
> +static void test_zone(int i)
> +{
> +       int sleep_time = SLEEPTIME;
> +       double run_time = RUNTIME;
> +
> +       snprintf(temp_path, PATH_MAX,
> "/sys/class/thermal/thermal_zone%d/temp", i);
> +       snprintf(trip_path, PATH_MAX,
> "/sys/class/thermal/thermal_zone%d/trip_point_1_temp", i);
> +
> +       tst_res(TINFO, "Testing %s", temp_path);
> +
> +       set_trippoint();
> 
>         while (sleep_time > 0) {
>                 tst_res(TDEBUG, "Running for %f seconds, then
> sleeping for %d seconds", run_time, sleep_time);
> @@ -173,7 +179,9 @@ static void test_zone(int i)
>                 if (temp > temp_high)
>                         break;
>                 sleep(sleep_time--);
> -               run_time -= 3;
> +               run_time--;
> +
> +               set_trippoint();
>         }
>  }
> 
---------------------------------------------------------------------
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-10  8:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 13:34 [LTP] [PATCH v21] thermal: add new test group Piotr Kubaj
2026-05-14 14:19 ` [LTP] " linuxtestproject.agent
2026-05-15 14:42   ` Petr Vorel
2026-05-18  8:11     ` Kubaj, Piotr
2026-05-27  7:28       ` Kubaj, Piotr
2026-05-27 19:45         ` Petr Vorel
2026-06-09 12:24         ` Cyril Hrubis
2026-06-10  8:02           ` Kubaj, Piotr [this message]
2026-06-12 14:12             ` Cyril Hrubis
  -- strict thread matches above, loose matches on Subject: below --
2026-05-14  9:36 [LTP] [PATCH v20] " Piotr Kubaj
2026-05-14 12:00 ` [LTP] " linuxtestproject.agent
2026-05-15 14:39   ` Petr Vorel
2026-05-06 11:24 [LTP] [PATCH v19] " Piotr Kubaj
2026-05-06 14:16 ` [LTP] " linuxtestproject.agent
2026-05-06 14:23   ` Andrea Cervesato via ltp
2026-04-30  8:42 [LTP] [PATCH v18] " Piotr Kubaj
2026-04-30  9:18 ` [LTP] " linuxtestproject.agent
2026-04-30 11:28   ` Kubaj, Piotr
2026-04-28 12:46 [LTP] [PATCH v17] " Piotr Kubaj
2026-04-28 14:41 ` [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=4ba236b8e3c815ba2a6ce3ced8a3cef73e0aad51.camel@intel.com \
    --to=piotr.kubaj@intel.com \
    --cc=chrubis@suse.cz \
    --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.