Commit d3db1ce
HID: debug: Use the __set_current_state()
When detecting an invalid list->hdev, the process needs to manually set
its state to TASK_RUNNING and exit. In the original code,
set_current_state() (which includes a memory barrier) is used here, but
it is immediately followed by a mutex_unlock() call. Since
mutex_unlock() internally includes a memory barrier, this ensures that
all modifications within the critical section (including the process
state) are visible to other CPUs. Therefore, replacing it with
__set_current_state() (without an implicit barrier) avoids redundant
memory barriers.
Signed-off-by: Zihuan Zhang <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>1 parent 2043ae9 commit d3db1ce
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3726 | 3726 | | |
3727 | 3727 | | |
3728 | 3728 | | |
3729 | | - | |
| 3729 | + | |
3730 | 3730 | | |
3731 | 3731 | | |
3732 | 3732 | | |
| |||
0 commit comments