diff options
| author | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 15:24:07 +1000 |
|---|---|---|
| committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 15:24:07 +1000 |
| commit | c7f4371ec3a45c85e23bbfafdc35716d8a4ff24e (patch) | |
| tree | fadc2e0d2f17428b979f59e4a7e8378ae0cfd75c | |
| parent | 9f3da92161754e58475f831e4ff0ba909d7449a4 (diff) | |
| parent | df44b1ee72f4fa345d6749048878ed7ac1f785e8 (diff) | |
| download | linux-next-c7f4371ec3a45c85e23bbfafdc35716d8a4ff24e.tar.gz linux-next-c7f4371ec3a45c85e23bbfafdc35716d8a4ff24e.zip | |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
| -rw-r--r-- | lib/livepatch/test_klp_callbacks_busy.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/livepatch/test_klp_callbacks_busy.c b/lib/livepatch/test_klp_callbacks_busy.c index 7ac845f65be5..133929e0ce8f 100644 --- a/lib/livepatch/test_klp_callbacks_busy.c +++ b/lib/livepatch/test_klp_callbacks_busy.c @@ -16,10 +16,12 @@ MODULE_PARM_DESC(block_transition, "block_transition (default=false)"); static void busymod_work_func(struct work_struct *work); static DECLARE_WORK(work, busymod_work_func); +static DECLARE_COMPLETION(busymod_work_started); static void busymod_work_func(struct work_struct *work) { pr_info("%s enter\n", __func__); + complete(&busymod_work_started); while (READ_ONCE(block_transition)) { /* @@ -37,6 +39,12 @@ static int test_klp_callbacks_busy_init(void) pr_info("%s\n", __func__); schedule_work(&work); + /* + * To synchronize kernel messages, hold the init function from + * exiting until the work function's entry message has printed. + */ + wait_for_completion(&busymod_work_started); + if (!block_transition) { /* * Serialize output: print all messages from the work |
