Skip to content

[PW_SID:964436] mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()#426

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw964436
Closed

[PW_SID:964436] mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()#426
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw964436

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 964436 applied to workflow__riscv__fixes

Name: mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=964436
Version: 1

…ge_read()

The following warning was observed when calling mbox_test_message_read()
for the first time:

[   69.246375] do not call blocking ops when !TASK_RUNNING; state=1 set at [<(____ptrval____)>] mbox_test_message_read+0xba/0x23e
[   69.258608] WARNING: CPU: 0 PID: 62 at kernel/sched/core.c:8741 __might_sleep+0x62/0x66

This is triggered because simple_read_from_buffer() called in
mbox_test_message_read() may sleep. As a result, the kernel warns about
blocking operations when the task state is not TASK_RUNNING.

Fix this by ensuring __set_current_state(TASK_RUNNING) is called before
executing code paths that may sleep.

Fixes: d597580 ("generic ...copy_..._user primitives")
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 110.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 966.74 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1264.16 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.37 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.43 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.74 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 68.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.37 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "mailbox: mailbox-test: Fix __might_sleep() warning in mbox_test_message_read()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.40 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw964436 branch May 28, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants