Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2448760pxj; Mon, 31 May 2021 02:24:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8tybkW5LJMg/dogpJxWENU0WchuMreQmVhlRqx61Vbt0ygwVdEHzOTC6RC9weHmpaMGwn X-Received: by 2002:a05:6e02:12ac:: with SMTP id f12mr4573923ilr.207.1622453096755; Mon, 31 May 2021 02:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622453096; cv=none; d=google.com; s=arc-20160816; b=jH6X9PlCrqXPn1f8txea9kpuM6hoc+RwiAFaOyVUVKJRULRmIrcSTvZXTaDzUNxKb+ iNRQTjZzm6zB0yIETe31lG7ZbTzG8BT7dqklilalwPdw4K0e2q8otsMQcxKCj/VwbQlp L/MmiynEdjdgzo9CoQ0gqnOd0WYSzJGbSsfpgTP87MIHokiQ1eaN15BNJen49jZC8mJA wsArfHQufgGfe1vTt29DF0z98uMj15gUyJ3Xbndz6S07jm+NbBj8n/nKTdd80J7fyXIn fnVUXkqQ7Xk3Hg9WOEBasjI0wZd2fUmMT7IgV4L6MYZIiqKbAYtyqmWeUou3qxOnjfUR c79w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jY9BuK9FNLMjbPTJtB8IDmbrG3t6+tuv/+gLi9Ppjao=; b=cdADQnxKa2bms86lVyOIyqea3F4P8wz87CAQK7ISyNJHzNGyj3dvC/lv1HmJVBMCXI aFxOhRNcXeBDoP/lzc1EBaxLdwTyfCUcjkHVo8HXTdq+uU2qnpgGCYoHHULVmxYIWFJU FYrKaYE+77WPaLO62/t+IlRdFGBpwK8QX9k7+2eyB2G0pXdrrfR6Rvw4l4VfSfCkb0u5 hW7IxqB45up2ewdZsVP4AJZqHmnuyJyL3iib/6SJoIURvjGLOVBWnS8IV9MNSbO0pHOg Nz1OAMeOC6soTPMFjk6fV+3wxYkOhQcmbdgCvrMGX1HeeDaHyA3pEv4RFxoQnehe4yoc zayw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=srDlNUPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si15619795jad.12.2021.05.31.02.24.43; Mon, 31 May 2021 02:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=srDlNUPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbhEaJYo (ORCPT + 99 others); Mon, 31 May 2021 05:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbhEaJYm (ORCPT ); Mon, 31 May 2021 05:24:42 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3CAFC061574 for ; Mon, 31 May 2021 02:23:01 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id m15-20020a4ae3cf0000b029024598c3e273so627826oov.13 for ; Mon, 31 May 2021 02:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jY9BuK9FNLMjbPTJtB8IDmbrG3t6+tuv/+gLi9Ppjao=; b=srDlNUPWE+qZTl9DnNgSplvRBy+lMllJN9jvZUo8wu6+fXy1o8QVoCdZ9Bzjdw3RtP sYG7+z4CdNRzG6esqaZ9KededzACmzQGmkz/1KAcKpaCmkEqKYiMNA34dbzHdPDAhwnV SMpqCaitIPYFnyllogzeOZtuTFGcCynkf15AC5uuOlISQNvZUIPwRq2vP1DujF21RICR DBqzjZlP0AJHP+B1ipPRZZUf5Ld0CZxsuIy+Q89PpfTmxjsDcvGWme/POK7x93vqXR4k AR/nY0sP+lroh8F2TX/GoedgEeNahMizurg8mipwioS6m0kFDfu/n2rTnQqd8wad8UuK WfHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jY9BuK9FNLMjbPTJtB8IDmbrG3t6+tuv/+gLi9Ppjao=; b=Zzh8vWQHnmHGHokUbRjuwZstLst1NRCt9gQOsL2AqoRx4nJMGFhzgZa5e+mpiCzXUF x/43ZcXuZW5okcUE+3BYeQVTGZlcvJsJmD3hIi6+o6z913EEodE+OGbc1NDt9+TBJy33 KTt6N5v7vgRl6uJp4e/UUfDCoGcChowkm4ta7SVolVAMPXvQZ7U8n9iK/iRa5eIdWX29 seUare05q8NUUo8Pj47ILYspfq2uje1wZZ6iGU2ABgfQdjfxqVhT6Ruh5+vUWyb4kU6h +Mh9BYDSvBiWnI6A8DI2cgRM6IVeg5q2k1aFDVXxeZX8g9jglJzCOYoD4qUC7Ap4WZAV m/9g== X-Gm-Message-State: AOAM530TtxFlGW32frkoMt5hIwG0vvK+K8l6D/yweFvVvtqBROSnUEmi nnAlpoBELxlat7y3MlooYY2KX2JwxE4avYGmTzQ= X-Received: by 2002:a4a:d89a:: with SMTP id b26mr15783705oov.11.1622452981041; Mon, 31 May 2021 02:23:01 -0700 (PDT) MIME-Version: 1.0 References: <20210518112857.1198415-1-aisheng.dong@nxp.com> In-Reply-To: <20210518112857.1198415-1-aisheng.dong@nxp.com> From: Dong Aisheng Date: Mon, 31 May 2021 17:21:51 +0800 Message-ID: Subject: Re: [PATCH 1/1] dma-contiguous: return early for dt case in dma_contiguous_reserve To: Dong Aisheng Cc: iommu@lists.linux-foundation.org, open list , Christoph Hellwig , Marek Szyprowski , Robin Murphy Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021 at 7:29 PM Dong Aisheng 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 > Cc: Marek Szyprowski > Cc: Robin Murphy > Signed-off-by: Dong Aisheng 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 >