> -----Original Message----- > From: ndesaulniers via sendgmr > [mailto:ndesaulniers@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Nick > Desaulniers > Sent: Thursday, September 17, 2020 12:20 PM > To: Song Bao Hua (Barry Song) <song.bao.hua@xxxxxxxxxxxxx> > Cc: akpm@xxxxxxxxxxxxxxxxxxxx; guro@xxxxxx; > linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx; Linuxarm > <linuxarm@xxxxxxxxxx>; mike.kravetz@xxxxxxxxxx; sfr@xxxxxxxxxxxxxxxx; > will@xxxxxxxxxx; ardb@xxxxxxxxxx; clang-built-linux@xxxxxxxxxxxxxxxx > Subject: Re: arm64: mm: move dma_contiguous_reserve() to be after > paging_init() > > It looks like that change referenced may also break arm32 boots with today's > next? > > The following allows me to boot, but I have no idea if it's incorrect or not. > This is probably incorrect on arm32 as dma_contiguous_early_fixup() is done after dma_contiguous_remap() in paging_init(). That means dma_contiguous_remap() gets an empty list. For arm64, there isn't early_fixup() and remap(). > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > index 45f9d5ec2360..7118b98c1f5f 100644 > --- a/arch/arm/mm/init.c > +++ b/arch/arm/mm/init.c > @@ -226,9 +226,6 @@ void __init arm_memblock_init(const struct > machine_desc *mdesc) > early_init_fdt_reserve_self(); > early_init_fdt_scan_reserved_mem(); > > - /* reserve memory for DMA contiguous allocations */ > - dma_contiguous_reserve(arm_dma_limit); > - > arm_memblock_steal_permitted = false; > memblock_dump_all(); > } > @@ -248,6 +245,9 @@ void __init bootmem_init(void) > */ > sparse_init(); > > + /* reserve memory for DMA contiguous allocations */ > + dma_contiguous_reserve(arm_dma_limit); > + > /* > * Now free the memory - free_area_init needs > * the sparse mem_map arrays initialized by sparse_init() Thanks Barry