Commit fe32a27
committed
ASoC: SOF: llext_load: fix single-shot write and add noop_llseek
The sof_llext_dfs_write handler requires the complete library binary
delivered in a single write() syscall (it returns -EINVAL if *ppos != 0
on entry). The 'cat' command splits files larger than ~16 KB into
BUFSIZ-sized chunks, so the first chunk triggered a truncated IPC4
LOAD_LIBRARY with only a partial payload, causing the DSP DMA to time
out waiting for the remaining bytes.
Two fixes:
1. Add .llseek = noop_llseek to sof_llext_load_fops so that tools like
'dd' that call lseek(SEEK_CUR) to determine the current position do
not get ESPIPE and abort before writing anything.
2. Improve the -EINVAL error message when a non-zero *ppos write is
rejected to tell the user to use 'dd bs=<size> count=1' instead of
'cat'.
Users and scripts should write the module binary with:
dd if=<module.ri> of=/sys/kernel/debug/sof/llext_load \
bs=$(stat -c%s <module.ri>) count=1
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>1 parent 37ccb6b commit fe32a27
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| |||
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
| 225 | + | |
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| |||
0 commit comments