Re: [PATCH v3 0/7] Refactor reserved memory regions handling code
From: Marek Szyprowski
Date: Thu Mar 26 2026 - 06:21:37 EST
Hi Rob
On 25.03.2026 15:16, Rob Herring wrote:
> On Wed, Mar 25, 2026 at 10:00:16AM +0100, Marek Szyprowski wrote:
>> The reserved memory regions handling code was reworked to handle
>> unlimited so called "static" memory nodes in commit 00c9a452a235 ("of:
>> reserved_mem: Add code to dynamically allocate reserved_mem array").
>>
>> The side effect of this rework was a set of bugs fixed later by commits
>> 0fd17e598333 ("of: reserved_mem: Allow reserved_mem framework detect
>> "cma=" kernel param") and 2c223f7239f3 ("of: reserved_mem: Restructure
>> call site for dma_contiguous_early_fixup()"). As a result, the code in
>> drivers/of/of_reserved_mem.c became a mix of generic code and CMA
>> specific fixups.
>>
>> In this patchset I try to untangle this spaghetti and perform some code
>> cleanup. I hope nothing breaks this time.
>>
>> Best regards
>> Marek Szyprowski, PhD
>> Samsung R&D Institute Poland
>>
>>
>> Changelog:
>>
>> v3:
>> - fixed more issues pointed by Sashiko in
>> https://protect2.fireeye.com/v1/url?k=c0975fdb-a11c4aed-c096d494-74fe485cbff1-5d0a8d4ece172e7b&q=1&e=abd3a151-11c5-430e-a6ac-b04cc3b34ab7&u=https%3A%2F%2Fsashiko.dev%2F%23%2Fpatchset%2F20260323100901.4079171-1-m.szyprowski%40samsung.com
>> (restored use of _OF_DECLARE macro, extended some comments and commit
>> descriptions, the remaining items I consider not relevant)
>>
>> v2: https://lore.kernel.org/all/20260323100901.4079171-1-m.szyprowski@xxxxxxxxxxx/
>> - added missing ops assignment removal in tegra210-emc-table and swiotlb
>> drivers
>> - fixed issues pointed by kernel test robot and Sashiko: removed typos,
>> improved comments
>> - fixed incorrect node passed to fdt_validate_reserved_mem_node() in
>> fdt_scan_reserved_mem_reg_nodes()
>>
>> v1: https://lore.kernel.org/all/20260313150802.1121442-1-m.szyprowski@xxxxxxxxxxx/
>> - initial version
>>
>>
>> Patch summary:
>>
>> Marek Szyprowski (7):
>> of: reserved_mem: remove fdt node from the structure
>> of: reserved_mem: use -ENODEV instead of -ENOENT
>> of: reserved_mem: switch to ops based OF_DECLARE()
>> of: reserved_mem: replace CMA quirks by generic methods
>> of: reserved_mem: rearrange code a bit
>> of: reserved_mem: clarify fdt_scan_reserved_mem*() functions
>> of: reserved_mem: rework fdt_init_reserved_mem_node()
> I've applied the series, thanks!
I forgot to mention this earlier. There are other pending changes
tokernel/dma/contiguous.c like
https://lore.kernel.org/all/20260303-dma-buf-heaps-as-modules-v3-0-24344812c707@xxxxxxxxxx/
which I would like to merge to -next. This conflicts with this patchset.
Could You provide a stable branch with those changes to let me resolve
conflicts in kernel/dma/contiguous.c on top of it?
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland