Commit 5c75bc5
committed
ASoC: SOF: sof-client-dma-trace: Add protection against file/module removal
Based on debugging the following issues were identified:
if the snd_sof_dma_trace module is removed while the sof-logger keeps the
trace file open:
The module's remove will block on the debugfs_remove() until the sof-logger
is stopped (w/ C-c).
The sof_dfsentry_trace_read() will return and the debugfs file is removed,
the module remove completes.
Then the debugfs file's release callback got called but the file itself was
already removed!
The second issue is that while the client driver is loaded and sof-logger
keeps the trace file open, the user can rmmod the parent driver for the
DSP itself which will removes the SOF client devices and the same chain of
events will happen.
With this patch we protect the debugfs file from removal with the
debugfs_file_get/put and we protect the parent device against removal while
the module is in active use (the debugfs file is open).
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>1 parent e8bab41 commit 5c75bc5
1 file changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
294 | 309 | | |
295 | 310 | | |
296 | 311 | | |
| |||
348 | 363 | | |
349 | 364 | | |
350 | 365 | | |
| 366 | + | |
351 | 367 | | |
352 | 368 | | |
353 | 369 | | |
354 | 370 | | |
355 | | - | |
| 371 | + | |
356 | 372 | | |
357 | 373 | | |
358 | 374 | | |
| |||
0 commit comments