diff options
| author | Donggeun Yoo <donggeunyoo.kernel@gmail.com> | 2026-09-05 16:47:27 +0900 |
|---|---|---|
| committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2026-09-09 08:30:35 +0200 |
| commit | 504981db4f69bdd28054fb98c96a3a67f7248dde (patch) | |
| tree | 698cb747d59b8b1e876cf163e2ca76f04f9fd3eb /scripts/Makefile.thinlto | |
| parent | cee9395acd8043be0644b25c34bfa86623f2b935 (diff) | |
| download | linux-stable-504981db4f69bdd28054fb98c96a3a67f7248dde.tar.gz linux-stable-504981db4f69bdd28054fb98c96a3a67f7248dde.zip | |
dma-coherent: report a failed reserved memory assignment
rmem_dma_device_init() drops the return value of
dma_assign_coherent_memory() and always reports success. That call fails
with -EBUSY when the device already has a coherent pool, and the file
allows only "*one* such region of memory" per device.
of_reserved_mem_device_init_by_idx() reads the zero as success. It logs
"assigned reserved memory node" for a region that was not assigned and
records the pairing, so of_reserved_mem_device_release() later runs
rmem_dma_device_release() for it. That clears dev->dma_mem without
looking at which region it was called for, dropping the pool the device
did get and leaving it on ordinary memory.
dma_declare_coherent_memory() checks the same call and releases the
memory on failure, and rmem_swiotlb_device_init() propagates its own
errors. Return the error here as well, so a device tree that assigns two
pools to one device fails the probe instead of half working.
Fixes: 7bfa5ab6fa1b ("drivers: dma-coherent: add initialization from device tree")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Link: https://lore.kernel.org/r/20260905074727.108029-1-donggeunyoo.kernel@gmail.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
