* [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests
2021-01-07 10:43 [igt-dev] [PATCH i-g-t 1/2] lib: Process kernel taints Chris Wilson
@ 2021-01-07 10:43 ` Chris Wilson
2021-01-08 12:28 ` Petri Latvala
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2021-01-07 10:43 UTC (permalink / raw
To: igt-dev; +Cc: petri.latvala, Chris Wilson
If the kernel generates a bad taint during the selftest (e.g. a
warning), declare the selftest to be a failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
lib/igt_kmod.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index ebeacd6fc..2ae45a1a1 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -29,6 +29,7 @@
#include "igt_core.h"
#include "igt_kmod.h"
#include "igt_sysfs.h"
+#include "igt_taints.h"
/**
* SECTION:igt_kmod
@@ -582,9 +583,12 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
const char *options,
const char *result)
{
+ unsigned long taints;
char buf[1024];
int err;
+ igt_skip_on(igt_kernel_tainted(&taints));
+
lseek(tst->kmsg, 0, SEEK_END);
snprintf(buf, sizeof(buf), "%s=1 %s", tl->param, options ?: "");
@@ -607,6 +611,8 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
"kselftest \"%s %s\" failed: %s [%d]\n",
tst->module_name, buf, strerror(-err), -err);
+ igt_assert_eq(igt_kernel_tainted(&taints), 0);
+
return err;
}
--
2.30.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests
2021-01-07 10:43 ` [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests Chris Wilson
@ 2021-01-08 12:28 ` Petri Latvala
0 siblings, 0 replies; 3+ messages in thread
From: Petri Latvala @ 2021-01-08 12:28 UTC (permalink / raw
To: Chris Wilson; +Cc: igt-dev
On Thu, Jan 07, 2021 at 10:43:28AM +0000, Chris Wilson wrote:
> If the kernel generates a bad taint during the selftest (e.g. a
> warning), declare the selftest to be a failure.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Neat and elegant.
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> ---
> lib/igt_kmod.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index ebeacd6fc..2ae45a1a1 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -29,6 +29,7 @@
> #include "igt_core.h"
> #include "igt_kmod.h"
> #include "igt_sysfs.h"
> +#include "igt_taints.h"
>
> /**
> * SECTION:igt_kmod
> @@ -582,9 +583,12 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
> const char *options,
> const char *result)
> {
> + unsigned long taints;
> char buf[1024];
> int err;
>
> + igt_skip_on(igt_kernel_tainted(&taints));
> +
> lseek(tst->kmsg, 0, SEEK_END);
>
> snprintf(buf, sizeof(buf), "%s=1 %s", tl->param, options ?: "");
> @@ -607,6 +611,8 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
> "kselftest \"%s %s\" failed: %s [%d]\n",
> tst->module_name, buf, strerror(-err), -err);
>
> + igt_assert_eq(igt_kernel_tainted(&taints), 0);
> +
> return err;
> }
>
> --
> 2.30.0
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests
@ 2021-01-13 2:38 Dixit, Ashutosh
0 siblings, 0 replies; 3+ messages in thread
From: Dixit, Ashutosh @ 2021-01-13 2:38 UTC (permalink / raw
To: igt-dev, Chris Wilson; +Cc: cq.tang, Petri Latvala
On Thu, Jan 07, 2021 at 10:43:28AM +0000, Chris Wilson wrote:
> If the kernel generates a bad taint during the selftest (e.g. a
> warning), declare the selftest to be a failure.
People are reporting selftests skipping if the kernel was previously
tainted due to an unrelated reason as a result of this commit (mostly in
personal testing). Is there any way to clear the kernel taint to avoid this
issue (without reverting this commit)? I have looked but haven't found
anything. Thanks.
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> lib/igt_kmod.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index ebeacd6fc..2ae45a1a1 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -29,6 +29,7 @@
> #include "igt_core.h"
> #include "igt_kmod.h"
> #include "igt_sysfs.h"
> +#include "igt_taints.h"
>
> /**
> * SECTION:igt_kmod
> @@ -582,9 +583,12 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
> const char *options,
> const char *result)
> {
> + unsigned long taints;
> char buf[1024];
> int err;
>
> + igt_skip_on(igt_kernel_tainted(&taints));
> +
> lseek(tst->kmsg, 0, SEEK_END);
>
> snprintf(buf, sizeof(buf), "%s=1 %s", tl->param, options ?: "");
> @@ -607,6 +611,8 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
> "kselftest \"%s %s\" failed: %s [%d]\n",
> tst->module_name, buf, strerror(-err), -err);
>
> + igt_assert_eq(igt_kernel_tainted(&taints), 0);
> +
> return err;
> }
>
> --
> 2.30.0
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-13 2:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-13 2:38 [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests Dixit, Ashutosh
-- strict thread matches above, loose matches on Subject: below --
2021-01-07 10:43 [igt-dev] [PATCH i-g-t 1/2] lib: Process kernel taints Chris Wilson
2021-01-07 10:43 ` [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests Chris Wilson
2021-01-08 12:28 ` Petri Latvala
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.