[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA+hA=SSeRrnBRGeqVxJ71Cv0uxydidWoKmG6b0bYzoEdcgqOQ@mail.gmail.com>
Date: Mon, 31 May 2021 17:21:51 +0800
From: Dong Aisheng <dongas86@...il.com>
To: Dong Aisheng <aisheng.dong@....com>
Cc: iommu@...ts.linux-foundation.org,
open list <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH 1/1] dma-contiguous: return early for dt case in dma_contiguous_reserve
On Tue, May 18, 2021 at 7:29 PM Dong Aisheng <aisheng.dong@....com> wrote:
>
> dma_contiguous_reserve() aims to support cmdline case for CMA memory
> reserve. But if users define reserved memory in DT,
> 'dma_contiguous_default_area' will not be 0, then it's meaningless
> to continue to run dma_contiguous_reserve(). So we return early
> if detect 'dma_contiguous_default_area' is unzero.
>
> Cc: Christoph Hellwig <hch@....de>
> Cc: Marek Szyprowski <m.szyprowski@...sung.com>
> Cc: Robin Murphy <robin.murphy@....com>
> Signed-off-by: Dong Aisheng <aisheng.dong@....com>
Gently ping
Regards
Aisheng
> ---
> kernel/dma/contiguous.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c
> index 3d63d91cba5c..ebade9f43eff 100644
> --- a/kernel/dma/contiguous.c
> +++ b/kernel/dma/contiguous.c
> @@ -171,6 +171,9 @@ void __init dma_contiguous_reserve(phys_addr_t limit)
> phys_addr_t selected_limit = limit;
> bool fixed = false;
>
> + if (dma_contiguous_default_area)
> + return;
> +
> pr_debug("%s(limit %08lx)\n", __func__, (unsigned long)limit);
>
> if (size_cmdline != -1) {
> @@ -191,7 +194,7 @@ void __init dma_contiguous_reserve(phys_addr_t limit)
> #endif
> }
>
> - if (selected_size && !dma_contiguous_default_area) {
> + if (selected_size) {
> pr_debug("%s: reserving %ld MiB for global area\n", __func__,
> (unsigned long)selected_size / SZ_1M);
>
> --
> 2.25.1
>
Powered by blists - more mailing lists