Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1960150pxa; Thu, 6 Aug 2020 22:24:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4tqRmw1FPFh5hoSAgBlIbD5NIG0sFwpOhNMk6JsaHVYfkvAOUhkWYQFGOqFSo5Xr6lFmX X-Received: by 2002:a17:906:2f17:: with SMTP id v23mr7466132eji.343.1596777861454; Thu, 06 Aug 2020 22:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596777861; cv=none; d=google.com; s=arc-20160816; b=XtJzIWYPsMsLSSC2MSuxpWSu2QOUEyMyNwq6+VsBdr3MMC/Ky9yAv4mTn7wRFFMP9z aREqj6rsv/XsO5c9egEYcspyMVyQML+HGa/6tGkkHFJ3YCMLDgsA6pQxdwQLpkv1U5Ir 7t8PYTHwiWVxxX5vTnHU+LoWsXfHST6bhFs2BYctlh/Z/Xd1utLJdhMzGN4MatXX0Pmp Yzm5R88Y9K80zeZObbtES9W49aPgq3uT/Hs3gkZNwo0d+bciP2BcfbV+u1Hp1TDD6e1T RPDerGTAdj+JgMZWCnaE+dy8rIxbjbBvx+mDJ43DBvWqr7xCP6785u8MLozgsQwaKFUL Eibw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=J6bi7Pg+DMHe7NZZgFKgT1aZvEyJrPtGcxfxJoUtQsQ=; b=V2Zzb2ZI74HC+FK0llSbHvmVAjkt1RTN4L2jciKtETfzV+27kAIJcajM6tHWcBsPfm NRar6tRw1SJ36buDBjFpApgvuSeN3EI52VoOLDOEFGllwF+1kT/Rq+cKe26QvtBQH4Nq 6FC1k5UtcIX8C5lduNZVs6zfEYUboJwVAk85IFgY/W2l3wvsfC0j2Eh8jyGkAH4/oeZR 1VcmG9R7jTY3PvOts2Au1AcqfA6b6jWzwMy8wojDcJSO/Ug7EATqZZBfL50cbwvLyTiI M5w9oQ3c/kuTM4rnpRQv05IQXhpuGPeSt3KsoDPcCJXOW8vUXW/ieZ0s04NIx/XDi0Ml 5STQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si4053029edv.36.2020.08.06.22.23.58; Thu, 06 Aug 2020 22:24:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726038AbgHGFVU (ORCPT + 99 others); Fri, 7 Aug 2020 01:21:20 -0400 Received: from verein.lst.de ([213.95.11.211]:52550 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725805AbgHGFVU (ORCPT ); Fri, 7 Aug 2020 01:21:20 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 6374768D0E; Fri, 7 Aug 2020 07:21:16 +0200 (CEST) Date: Fri, 7 Aug 2020 07:21:16 +0200 From: Christoph Hellwig To: Nicolas Saenz Julienne Cc: amit.pundir@linaro.org, hch@lst.de, linux-kernel@vger.kernel.org, Marek Szyprowski , Robin Murphy , rientjes@google.com, jeremy.linton@arm.com, linux-rpi-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH v3 2/2] dma-pool: Only allocate from CMA when in same memory zone Message-ID: <20200807052116.GA584@lst.de> References: <20200806184756.32075-1-nsaenzjulienne@suse.de> <20200806184756.32075-3-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200806184756.32075-3-nsaenzjulienne@suse.de> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 06, 2020 at 08:47:55PM +0200, Nicolas Saenz Julienne wrote: > There is no guarantee to CMA's placement, so allocating a zone specific > atomic pool from CMA might return memory from a completely different > memory zone. To get around this double check CMA's placement before > allocating from it. As the builtbot pointed out, memblock_start_of_DRAM can't be used from non-__init code. But lookig at it I think throwing that in is bogus anyway, as cma_get_base returns a proper physical address already.