# Re: \[PATCH 18/19\] LoongArch: Add Non-Uniform Memory Access (NUMA) support

- From: Huacai Chen \<hidden\>
- Date: 2021-08-12 11:46:36 
- List: linux-arch
- Page: https://ratatoskr.run/linux-arch/2021/08/13337209
- Thread: https://ratatoskr.run/linux-arch/2021/07/13337006/t/2.md

```text
Hi, Arnd,

On Tue, Jul 6, 2021 at 6:18 PM Arnd Bergmann [ref] wrote:
>
> On Tue, Jul 6, 2021 at 6:18 AM Huacai Chen [ref] wrote:
>
> > +#ifdef CONFIG_SWIOTLB
> > +/*
> > + * Optional platform hook to call swiotlb_setup().
> > + */
> > +extern void plat_swiotlb_setup(void);
> > +
> > +#else
> > +
> > +static inline void plat_swiotlb_setup(void) {}
> > +
> > +#endif /* CONFIG_SWIOTLB */
>
> I guess this accidentally slipped into the wrong patch? It doesn't appear to be
> NUMA related.
This need to be improved.

>
> > diff --git a/arch/loongarch/loongson64/dma.c b/arch/loongarch/loongson64/dma.c
> > new file mode 100644
> > index 000000000000..f259f70c75fa
> > --- /dev/null
> > +++ b/arch/loongarch/loongson64/dma.c
> > @@ -0,0 +1,59 @@
> > +// SPDX-License-Identifier: GPL-2.0
>
> Same for this file.
We only need a custom dma.c in the NUMA case, because we need
phys_to_dma()/dma_to_phys() to convert between 48bit physical address
and 40bit DMA address. Without NUMA there is only one node, and its
physical address will not exceed 40bit.

Huacai
>
>
>          Arnd
```
