Skip to content

Commit 033a944

Browse files
committed
Merge tag 'livepatching-for-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
Pull livepatching update from Petr Mladek: - Make a selftest more reliable * tag 'livepatching-for-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: selftests/livepatch: better synchronize test_klp_callbacks_busy
2 parents a9cf69d + 55eb9a6 commit 033a944

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/livepatch/test_klp_callbacks_busy.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ MODULE_PARM_DESC(block_transition, "block_transition (default=false)");
1616

1717
static void busymod_work_func(struct work_struct *work);
1818
static DECLARE_WORK(work, busymod_work_func);
19+
static DECLARE_COMPLETION(busymod_work_started);
1920

2021
static void busymod_work_func(struct work_struct *work)
2122
{
2223
pr_info("%s enter\n", __func__);
24+
complete(&busymod_work_started);
2325

2426
while (READ_ONCE(block_transition)) {
2527
/*
@@ -37,6 +39,12 @@ static int test_klp_callbacks_busy_init(void)
3739
pr_info("%s\n", __func__);
3840
schedule_work(&work);
3941

42+
/*
43+
* To synchronize kernel messages, hold the init function from
44+
* exiting until the work function's entry message has printed.
45+
*/
46+
wait_for_completion(&busymod_work_started);
47+
4048
if (!block_transition) {
4149
/*
4250
* Serialize output: print all messages from the work

0 commit comments

Comments
 (0)