Commit ba43359
committed
ipc: do not hold a spinlock when calling schedule_ipc_worker()
Calling schedule_ipc_worker() with spinlock held is not stricly
required. schedule_ipc_worker() calls k_work_schedule_for_queue()
and the Zephyr workqueue has an internal lock protecting
the workqueue structures. Keeping spinlock held during the call
does lead to complex scenarios to debug and verify as schedule_ipc_worker()
itself is dispatched from a work queue.
Simplify the flow and release spinlock before rescheduling the worker.
In ipc_work_handler(), this leaves a small window where the message is
just sent after we release the spinlock, and before we call
schedule_ipc_worker(). This is however harmless, as in worst case the
IPC worker is woken up one extra time.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>1 parent 172589b commit ba43359
1 file changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | 257 | | |
| 258 | + | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
274 | | - | |
| 275 | + | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
277 | 287 | | |
278 | 288 | | |
279 | 289 | | |
| |||
0 commit comments