Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1058021ybh; Wed, 22 Jul 2020 22:16:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys7escDIWbz/89hXURoaNLKH5QkU0gMGhGxU+dPAI+xZcUREq7sBvSK5WTnzYm1HAcaJeV X-Received: by 2002:a17:906:a44:: with SMTP id x4mr2839855ejf.193.1595481400792; Wed, 22 Jul 2020 22:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595481400; cv=none; d=google.com; s=arc-20160816; b=PxUOD+MhtPabr+4UACmqxUgk+NLkRf99BTkhZIiT3255RN5n2mgC48P1YDSIDodKPy 0QIvqLn1bRvX7uVhg5zWZnFcs9k4u1dUPDmZvu8VIuFdjiPjiWf2nro1uB4mtRdqKwcQ CHVhE/EB7Jghgjo+WG2zxrR3E6kuIJNo6ywQBez4DPHgunuAbKg7wOkBjHSDnbeD8N+g TcWRxlq50sg26cv6hwYK3CuUAEpL/7hYjKSnTQEaC6bV4NBsZaiaqBUtJnu6d4SuUGwN w6hKK9KTV1XkIuystmY0sLZAK1of8GZYwdoQHfWMYc7GdrtVCi5FTSJa9qgKLMgIA//Y BwZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bX4hF15fb4QpI7ClXOhtVIgAOWzu+DtBaB8S3WsGu9Y=; b=sypXlMEEVRGNKC4cVApf5NjK+4JT1tTqUbY9NBjga7K71/xivaic2Ge+/8mVnAQ/MY sc4+N9Qiu6nr7j7+p645Fu94dvPcGKlKhyFuZnyn1ASwlWUkLsp7jhGESOC7F7jNVpHN iszsamfndSR7DsOZs6X4xSZ9HrkEjb+UeQVhnVwYaY+HlWYFh604jvb3ub7be/rElvSf 7mNtd5F/LMKkWHmFYMHDVIXeAKwwUAx2Vj9U60SVqiLb3rCDmd7/N2HQDp4zm5/wgUbf gVlN5voGhBAC8JBAH1egjPKEOGdOhjkqncTltam4ntCGG4jGMXfAa+//L3QAC2A342NN Fp8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FPZoKCnc; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si1364304edq.192.2020.07.22.22.16.18; Wed, 22 Jul 2020 22:16:40 -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=@linaro.org header.s=google header.b=FPZoKCnc; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726068AbgGWFPg (ORCPT + 99 others); Thu, 23 Jul 2020 01:15:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbgGWFPg (ORCPT ); Thu, 23 Jul 2020 01:15:36 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41D91C0619DC for ; Wed, 22 Jul 2020 22:15:36 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id f139so3977522wmf.5 for ; Wed, 22 Jul 2020 22:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bX4hF15fb4QpI7ClXOhtVIgAOWzu+DtBaB8S3WsGu9Y=; b=FPZoKCncFCCOJIrOpOgeYJ4kwY9n/6s988T1EfCLMfwVfkXTc1B/+umcAHDY9RbS5v n0yR1Psi9ZEBb94v+PLNbqE0Z/x11MuCmKkzCx04Lqx+I43COT0M9YuPsODgB1VWTUbv 4max/Y3eQAsiiTUnHHr2ha0hg+Y15p3TrX+6OHrE4ZA2eRkdkwKO77G2fVxY/m2V6zQi R7ZZYOAoP2ROJd/cMz7m6/WeGFlzS9BgdTAhTL868K5xaXmzLzU1PupiMH3bSNQlb6mw 4deqkHRoCPfmT7cY5c/ZgnJrWgqJXZu16pSRLn3Ul7kcu4TfMowa1z4aB5RIfUBsZ/QL IUpA== 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=bX4hF15fb4QpI7ClXOhtVIgAOWzu+DtBaB8S3WsGu9Y=; b=Vk+DOTbcEJmlKbhjF0MJYsmmFg3b772xOwrXT+pOZxKhZTDkVK9QjRqa1fZLp3lnWR Q3/qx1nTlPg9+bE5Hgf2ijpnZGmSSIFCp8G8odaE0iXFWQXpaGXBWXZv6mH3oBoYamQ8 3IRrjhsXI5r6fuxArgdCrMOESNNOTk31s9CePSSJGxr1eB0fz/P+WGdvHDAyotGPz6V8 5PvnIV84KcQjmW6N0TagNZPUeHaGjjQuypoJYipo5kKG1Mwykdm+PU0JaexRTt6dTvqX C/AYoqXANF02xXnu4sBclzjtOSrLYwJ61C3uYokki220fGqEOl3p1vcBArwUKp5DzP20 FgPw== X-Gm-Message-State: AOAM530yppajMDJjeT2cryqwYf5rhCNx0MYhx4hBcq+VtBEGQ32iiKXv GfD+GhQjGc+hLJedx/Tx0AWVgXGtFmbpG+CdNbmY3w== X-Received: by 2002:a05:600c:2209:: with SMTP id z9mr2452342wml.70.1595481334259; Wed, 22 Jul 2020 22:15:34 -0700 (PDT) MIME-Version: 1.0 References: <20200708164936.9340-1-nsaenzjulienne@suse.de> <550b30a86c0785049d24c945e2c6628d491cee3a.camel@suse.de> <011994f8a717a00dcd9ed7682a1ddeb421c2c43f.camel@suse.de> <01831596e4a2a6c9c066138b23bd30435f8e5569.camel@suse.de> <6db722947546221ed99d3f473f78e1a6de65d7d6.camel@suse.de> In-Reply-To: <6db722947546221ed99d3f473f78e1a6de65d7d6.camel@suse.de> From: Amit Pundir Date: Thu, 23 Jul 2020 10:44:58 +0530 Message-ID: Subject: Re: [PATCH] dma-pool: Do not allocate pool memory from CMA To: Nicolas Saenz Julienne Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , David Rientjes , linux-rpi-kernel@lists.infradead.org, jeremy.linton@arm.com, iommu@lists.linux-foundation.org, lkml , John Stultz , Sumit Semwal Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nicolas, Sorry I got stuck on other things yesterday. On Tue, 21 Jul 2020 at 21:57, Nicolas Saenz Julienne wrote: > > On Tue, 2020-07-21 at 20:52 +0530, Amit Pundir wrote: > > [...] > > > > > > Can you try booting *without* my patch and this in the kernel > > > > > command > > > > > line: "cma=16M@0x100000000-0x200000000". > > > > > > > > It doesn't boot with this added kernel command line. > > > > > > For the record, this placed the CMA in the [4GB, 8GB] address space > > > instead of you setup's default: [3GB, 4GB]. All atomic pools fall > > > in > > > that memory area without my patch, which makes me think some of the > > > devices on your board might not like higher addresses. > > > > > > > Thank you Nicolas for the details. Though we don't set the CMA > > alloc-ranges explicitly in upstream sdm845 dts, but I dug around and > > found that CMA alloc-ranges in the downstream kernel are indeed in > > lower address space. > > https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/dipper-q-oss/arch/arm64/boot/dts/qcom/sdm845.dtsi#L662 > > > > /* global autoconfigured region for contiguous allocations */ > > linux,cma { > > compatible = "shared-dma-pool"; > > alloc-ranges = <0 0x00000000 0 0xffffffff>; > > reusable; > > alignment = <0 0x400000>; > > size = <0 0x2000000>; > > linux,cma-default; > > }; > > Pretty standard, and similar to what it's being used upstream by > default. > > > > > > What happens if you boot with my troublesome patch with this in > > > your > > > device tree? (insert it at the bottom of sdm845-beryllium.dts) > > > > > > &soc { > > > dma-ranges = <0 0 0 0 0x1 0>; > > > }; > > > > > > > Device still doesn't boot up to adb shell. > > Let's get a bigger hammer, I'm just looking for clues here. Can you > apply this and provide the dmesg output. > > diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c > index 6bc74a2d5127..2160676bf488 100644 > --- a/kernel/dma/pool.c > +++ b/kernel/dma/pool.c > @@ -268,6 +268,8 @@ void *dma_alloc_from_pool(struct device *dev, size_t size, > schedule_work(&atomic_pool_work); > } > > + dev_info(dev, "%s: size %lx, phys addr %llx, flags 0x%x\n", __func__, size, phys, flags); > + > return ptr; > } I never made it to dma_alloc_from_pool() call from dma_direct_alloc_pages(), dma_should_alloc_from_pool() returns False from gfpflags_allow_blocking() block. Regards, Amit Pundir > > > Regards, > Nicolas >