Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp691647ybh; Tue, 21 Jul 2020 05:46:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3o1ykAqwLdaK9rxtNLZeXfeEpxjw5B8wmGTmPih+l/S9OFMgxHR5S+MJA9QomZC9vaAxA X-Received: by 2002:a17:906:3a04:: with SMTP id z4mr24538623eje.441.1595335574057; Tue, 21 Jul 2020 05:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595335574; cv=none; d=google.com; s=arc-20160816; b=TASl7Bv8lzzP4KVMruFTrMr0xJ9qFdoiAk4yIbM/nTqYgR4bMOX4bYzqgWmt5jiUOS IynGpFB4QBjpM/KKOBQh230EwbPIzE6SpNnbPxRaTHMr8uYXqgm6039mo4LLPFZdo68P BaS+955kYRio/DakEWMgXaZC9nZoI8Zo2iLiXqnKx6rOFFSXbMx2BbSqH59oM4srPIq1 CwWDEuAkLUIuNd90opLHa0HzEkuckQwGfD+60VpU6e4E/S88KC2gNkMfepmBSKLMTZxJ ff/2HSTkKbvQUHCV/SGlA1nD4kA7GKh3OPx2gd8++7wqutD0nW7Qr050WpxGzIFsNcJT Blpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=mNFwwd0FaTfC4bElszs/pZ8tJMZm2aEWI2UXDptdBG0=; b=x7rKiwrouF72mJpeWGEYOisZzybryrLsffHS/P/bNnF59qokyiIzz40ESMrHtkPoBE aaDiCXFiU0EOL7a9a9+eblUh/vX7ycU03bdTVBAuGW5w1afa6my8Rq5v151qR5BG/iMM f577mrXANI9y4pF+bqh7t02+m99LGqr4KruvNqz1EO73mAmU7OM7zN8PAlFwj2ciX5DV 9kEIa3py1hCcqGtZFH07OqPrI8NrTNvqtun38SVj1eEcDVqwtHv9jPVv9WAzI9Dvfw9i Xe6zDjLgzLvQ0wQpJUTVG5xejGzB9Pf/VPmoYtjFKFScfyOJErcWQNo3ueCfwgswLHpN Etjg== 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 cx13si11422433edb.280.2020.07.21.05.45.50; Tue, 21 Jul 2020 05:46:14 -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 S1728296AbgGUMpL (ORCPT + 99 others); Tue, 21 Jul 2020 08:45:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:53624 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727978AbgGUMpL (ORCPT ); Tue, 21 Jul 2020 08:45:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 32595AB7A; Tue, 21 Jul 2020 12:45:16 +0000 (UTC) Message-ID: <01831596e4a2a6c9c066138b23bd30435f8e5569.camel@suse.de> Subject: Re: [PATCH] dma-pool: Do not allocate pool memory from CMA From: Nicolas Saenz Julienne To: Amit Pundir 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 Date: Tue, 21 Jul 2020 14:45:07 +0200 In-Reply-To: References: <20200708164936.9340-1-nsaenzjulienne@suse.de> <550b30a86c0785049d24c945e2c6628d491cee3a.camel@suse.de> <011994f8a717a00dcd9ed7682a1ddeb421c2c43f.camel@suse.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-07-21 at 17:45 +0530, Amit Pundir wrote: > On Tue, 21 Jul 2020 at 16:45, Nicolas Saenz Julienne > wrote: > > On Tue, 2020-07-21 at 14:24 +0530, Amit Pundir wrote: > > > On Tue, 21 Jul 2020 at 14:09, Nicolas Saenz Julienne > > > wrote: > > > > Hi Amit, > > > > > Hi Nicolas, > > > > > > > > > > I see a boot regression with this commit d9765e41d8e9 "dma- > > > > > pool: > > > > > Do not allocate pool memory from CMA" on my Xiaomi Poco F1 > > > > > (Qcom sdm845) phone running v5.8-rc6. I can't boot past the > > > > > bootloader splash screen with this patch. > > > > > > > > > > Phone boots fine if I revert this patch. I carry only one out > > > > > of > > > > > tree > > > > > dts patch https://lkml.org/lkml/2020/6/25/52. And since this > > > > > is a > > > > > stock > > > > > phone, I don't have access to serial/dmesg logs until I boot > > > > > to > > > > > AOSP > > > > > (adb) shell. > > > > > > > > > > Any thoughts as to what might be going wrong here? I'd be > > > > > happy > > > > > to > > > > > help debug things. For what it's worth, I don't see this > > > > > regression > > > > > on > > > > > other two sdm845 devices (db845c and Pixel 3) I tested on. > > > > > > > > Can you provide a boot log (even if without my patch) and the > > > > device- > > > > tree files? It'd help a lot figuring things out. > > > > > > Thank you for the prompt reply Nicolas. > > > > > > Here is the boot log with the reverted patch > > > https://pastebin.ubuntu.com/p/BrhPf83nKF/ > > > > > > Here is my phone's dts > > > https://github.com/pundiramit/linux/commit/2a394c199deeaf4c91e0e008e8fba2a72f494d8c > > > > I'm at loss at what could be failing here. Your device should be > > able > > to address the whole 8GB memory space, which AFAIK is the max > > available > > on that smartphone family. But maybe the device-tree is lying, who > > knows... > > If it helps, my phone has 6GB memory space. > > > 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. 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>; }; Regards, Nicolas > Regards, > Amit Pundir > > > Regards, > > Nicolas > > > > And here is my kernel tree just in case > > > https://github.com/pundiramit/linux/commits/beryllium-mainline > > > > > > Regards, > > > Amit Pundir > > > > > > > > > > Regards, > > > > Nicolas > > > > > > > > > Regards, > > > > > Amit Pundir > > > > > > > > > > > Reported-by: Jeremy Linton > > > > > > Signed-off-by: Nicolas Saenz Julienne < > > > > > > nsaenzjulienne@suse.de> > > > > > > --- > > > > > > > > > > > > An more costly alternative would be adding an option to > > > > > > dma_alloc_from_contiguous() so it fails when the allocation > > > > > > doesn't > > > > > > fall > > > > > > in a specific zone. > > > > > > > > > > > > kernel/dma/pool.c | 11 ++---------