From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org,
"Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>,
igt-dev@lists.freedesktop.org,
"Isabella Basso" <isabbasso@riseup.net>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
intel-xe@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t v2 06/17] lib/ktap: Make sure we fail on premature cancel
Date: Mon, 11 Sep 2023 10:55:51 +0200 [thread overview]
Message-ID: <20230911105551.63e22f66@maurocar-mobl2> (raw)
In-Reply-To: <20230908123233.137134-25-janusz.krzysztofik@linux.intel.com>
On Fri, 8 Sep 2023 14:32:40 +0200
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> wrote:
> After loading a kunit test module that executes some kunit test cases, we
> evaluate overall result of an IGT subtest that corresponds to that module
> based on an error code returned by kunit_parser_stop() helper, obtained
> from a .ret field of a ktap_args structure. That code is now assigned to
> that structure field right before completion of the KTAP parser thread
> start routine. If the thread is canceled for some reason then the return
> code will be undefined.
>
> Initialize the return code on KTAP parser startup with a value that
> indicates a failure, then change it to success when so indicated by result
> of KTAP parsing.
>
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> ---
> lib/igt_ktap.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/lib/igt_ktap.c b/lib/igt_ktap.c
> index 123a40d183..84fb13218f 100644
> --- a/lib/igt_ktap.c
> +++ b/lib/igt_ktap.c
> @@ -579,9 +579,7 @@ igt_ktap_parser_start:
> igt_ktap_parser_end:
> results.still_running = false;
>
> - if (failed_tests || !found_tests)
> - ktap_args.ret = IGT_EXIT_FAILURE;
> - else
> + if (found_tests && !failed_tests)
> ktap_args.ret = IGT_EXIT_SUCCESS;
>
> return NULL;
> @@ -598,6 +596,7 @@ struct ktap_test_results *ktap_parser_start(int fd, bool is_builtin)
> ktap_args.fd = fd;
> ktap_args.is_builtin = is_builtin;
> ktap_args.is_running = true;
> + ktap_args.ret = IGT_EXIT_FAILURE;
> pthread_create(&ktap_parser_thread, NULL, igt_ktap_parser, NULL);
>
> return &results;
next prev parent reply other threads:[~2023-09-11 8:55 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 12:32 [Intel-gfx] [PATCH i-g-t v2 00/17] Fix IGT Kunit implementation issues Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 01/17] lib/kunit: Drop unused file stream Janusz Krzysztofik
2023-09-15 10:36 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 02/17] lib/kunit: Stop loading kunit module explicitly Janusz Krzysztofik
2023-09-15 10:36 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 03/17] lib/kunit: Fix struct kmod_module kunit_kmod not freed Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 04/17] lib/kunit: Optimize calls to igt_success/skip/fail() Janusz Krzysztofik
2023-09-11 8:49 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 05/17] lib/kunit: Fix illegal igt_fail() calls inside subtest body Janusz Krzysztofik
2023-09-11 8:52 ` Mauro Carvalho Chehab
2023-09-11 9:28 ` Janusz Krzysztofik
2023-09-11 11:57 ` Mauro Carvalho Chehab
2023-09-13 13:03 ` Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 06/17] lib/ktap: Make sure we fail on premature cancel Janusz Krzysztofik
2023-09-11 8:55 ` Mauro Carvalho Chehab [this message]
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 07/17] lib/ktap: Don't ignore interrupt signals Janusz Krzysztofik
2023-09-11 9:01 ` Mauro Carvalho Chehab
2023-09-13 14:04 ` Janusz Krzysztofik
2023-09-15 12:25 ` Mauro Carvalho Chehab
2023-09-15 13:06 ` Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 08/17] lib/kunit: Cancel KTP parser on module load failure Janusz Krzysztofik
2023-09-11 9:02 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 09/17] lib/ktap: Drop is_running flag Janusz Krzysztofik
2023-09-11 9:03 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 10/17] lib/ktap: Read /dev/kmsg in blocking mode Janusz Krzysztofik
2023-09-15 10:42 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 11/17] lib/kunit: Fail / skip on kernel taint Janusz Krzysztofik
2023-09-15 10:43 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 12/17] lib/ktap: Use IGT linked lists for storing KTAP results Janusz Krzysztofik
2023-09-15 10:44 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 13/17] lib/ktap: Reimplement KTAP parser Janusz Krzysztofik
2023-09-15 11:45 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-15 12:28 ` [Intel-gfx] " Mauro Carvalho Chehab
2023-09-15 13:09 ` Janusz Krzysztofik
2023-09-15 13:35 ` Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 14/17] lib/kunit: Load test modules in background Janusz Krzysztofik
2023-09-15 12:11 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 15/17] lib/kunit: Parse KTAP report from the main process thread Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 16/17] lib/kunit: Strip "_test" or "_kunit" suffix from subtest names Janusz Krzysztofik
2023-09-15 11:42 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 17/17] lib/kunit: Omit suite name prefix if the same as subtest name Janusz Krzysztofik
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=20230911105551.63e22f66@maurocar-mobl2 \
--to=mauro.chehab@linux.intel.com \
--cc=dominik.karol.piatkowski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=isabbasso@riseup.net \
--cc=janusz.krzysztofik@linux.intel.com \
--cc=mchehab@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox