Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp460148ybn; Thu, 3 Oct 2019 07:32:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8WWtFvGCAPpn+hPw+OlqfY/ixGR3eVJTSKYyNbYADHRMrKYufMdmbGOl0E3Dm8jnYpCsb X-Received: by 2002:a50:8b61:: with SMTP id l88mr583481edl.244.1570113173183; Thu, 03 Oct 2019 07:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570113173; cv=none; d=google.com; s=arc-20160816; b=SeFDDYZqtcZtF2gJay2HB3o/s466fN1ntqPeA2O3jSkQYuAUqHNibfGrImgLSgyzad eWRKEKSybhHmWcEfwpKv87B4UMfVWeQDKi9U2yR2SvSbaPxglsumP4hkoK5PASC1tCB5 VQK2G6sUtoCLnlxeFv8kHFCTazXWgZ2yEWWI5mvLyqKmOy/aevIlI4ABRCFuNUcSrhIy 9Y219U/TvUAXRUCNaGcxGniT3IZKC0WzC93dtum5DcJl3Z5jb7fd71sVAseEx9zWM3H+ M3hFrQGlI++QMRPti+mihnm8JO/rWdSDeThtx1QKyexlf2F2q94hMo/6CNv9+GuT7kB/ Hhlw== 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=2W51RNPLmysStNLzHdxd7SSguqqniGF/KHaqLKkBdiA=; b=wVNU14sWUMtKQZ/MXQivDMw0N7aanAznX24i1NQjJV+aQfn5I0glqXdHo4I+WqDKhA Jppj1bPvxP+nmz0UmIVVyEL3RFJUOarrZLPPMxOq0aOyGTR+1CBkshacho8hPTWvP0xv HHmUO0k9bJ5S4J9TMMwe9e+FI2ShkIMv1KOuE7MWYEKJsjJwJQ7mEAjZYrAVhfnPHlin accqjAfe2ZMGAvvbnEXJtDdWl43WDKo/hN6Uk8Wyb9q7Hdho7jFQGAhTu2/Ng9Pu+266 iLqWS255d4LER1GSzyCidFfmDhAaLZSGnEE2SP/muygpH922xmAmckjLHeAoO8UPjaQ5 DyCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si1463983edq.65.2019.10.03.07.32.28; Thu, 03 Oct 2019 07:32:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730363AbfJCNR7 (ORCPT + 99 others); Thu, 3 Oct 2019 09:17:59 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:35835 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726978AbfJCNR7 (ORCPT ); Thu, 3 Oct 2019 09:17:59 -0400 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=localhost) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iG0zJ-0006F9-Ty; Thu, 03 Oct 2019 15:17:46 +0200 Message-ID: <662abbc0298ebab59919490ccc3d5c093ae35cf7.camel@pengutronix.de> Subject: Re: [PATCH v2 00/21] Refine memblock API From: Lucas Stach To: Mike Rapoport , Russell King - ARM Linux admin Cc: Adam Ford , Fabio Estevam , Catalin Marinas , Linux Kernel Mailing List , Christoph Hellwig , The etnaviv authors , arm-soc , Linux Memory Management List , Andrew Morton Date: Thu, 03 Oct 2019 15:17:36 +0200 In-Reply-To: <20191003113010.GC23397@linux.ibm.com> References: <20190926160433.GD32311@linux.ibm.com> <20190928073331.GA5269@linux.ibm.com> <20191002073605.GA30433@linux.ibm.com> <20191003053451.GA23397@linux.ibm.com> <20191003084914.GV25745@shell.armlinux.org.uk> <20191003113010.GC23397@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, den 03.10.2019, 14:30 +0300 schrieb Mike Rapoport: > On Thu, Oct 03, 2019 at 09:49:14AM +0100, Russell King - ARM Linux admin wrote: > > On Thu, Oct 03, 2019 at 08:34:52AM +0300, Mike Rapoport wrote: > > > (trimmed the CC) > > > > > > On Wed, Oct 02, 2019 at 06:14:11AM -0500, Adam Ford wrote: > > > > On Wed, Oct 2, 2019 at 2:36 AM Mike Rapoport wrote: > > > > > > > > Before the patch: > > > > > > > > # cat /sys/kernel/debug/memblock/memory > > > > 0: 0x10000000..0x8fffffff > > > > # cat /sys/kernel/debug/memblock/reserved > > > > 0: 0x10004000..0x10007fff > > > > 34: 0x2fffff88..0x3fffffff > > > > > > > > > > > > After the patch: > > > > # cat /sys/kernel/debug/memblock/memory > > > > 0: 0x10000000..0x8fffffff > > > > # cat /sys/kernel/debug/memblock/reserved > > > > 0: 0x10004000..0x10007fff > > > > 36: 0x80000000..0x8fffffff > > > > > > I'm still not convinced that the memblock refactoring didn't uncovered an > > > issue in etnaviv driver. > > > > > > Why moving the CMA area from 0x80000000 to 0x30000000 makes it fail? > > > > I think you have that the wrong way round. > > I'm relying on Adam's reports of working and non-working versions. > According to that etnaviv works when CMA area is at 0x80000000 and does not > work when it is at 0x30000000. > > He also sent logs a few days ago [1], they also confirm that. > > [1] https://lore.kernel.org/linux-mm/CAHCN7xJEvS2Si=M+BYtz+kY0M4NxmqDjiX9Nwq6_3GGBh3yg=w@mail.gmail.com/ To clarify: Etnaviv needs to know where the CMA area is in order to move a aperture window to cover the CMA area so the command buffers allocated in contig memory can be mapped through this aperture. Now the issue is that there is currently there is no good API for a driver to know where the CMA area is located, so we are trying to infer this from dma_get_required_mask. Unfortunately this can overshoot the real DRAM area by a bit, so combined with the fixed 2GB size of the GPU aperture this means we are no longer able to map the command buffers through the required aperture if the CMA area moves too far down in the physical memory. It's really a bad interaction between etnaviv and CMA area placement, due to insufficient APIs to communicate some crucial information. There is nothing in the etnaviv driver or the hardware which requires the CMA area to be at a certain place, we just need to know where it is located exactly. So my try at fixing this [1] was by adding a API to get the required information, but the first attempt was shot down and I hadn't had time to follow up on this yet. Regards, Lucas [1] https://patchwork.kernel.org/patch/10966767/