@@ -773,6 +773,7 @@ static void __igt_kunit(struct igt_ktest *tst, const char *opts)
results = ktap_parser_start(tst->kmsg, is_builtin);
if (igt_debug_on(igt_kmod_load(tst->module_name, opts) < 0)) {
+ ktap_parser_cancel();
igt_ignore_warn(ktap_parser_stop());
igt_skip("Unable to load %s module\n", tst->module_name);
}
@@ -587,6 +587,12 @@ struct ktap_test_results *ktap_parser_start(int fd, bool is_builtin)
return &results;
}
+void ktap_parser_cancel(void)
+{
+ ktap_args.is_running = false;
+ pthread_cancel(ktap_parser_thread);
+}
+
int ktap_parser_stop(void)
{
ktap_args.is_running = false;
@@ -45,6 +45,7 @@ struct ktap_test_results {
struct ktap_test_results *ktap_parser_start(int fd, bool is_builtin);
+void ktap_parser_cancel(void);
int ktap_parser_stop(void);
#endif /* IGT_KTAP_H */