Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp879023ybp; Fri, 4 Oct 2019 06:26:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqy68r5iaIJzzMJ84VLX59doQohM30f2yn0zlu5250guOeMz00d1GOSi9HP+CvIiHSRd7IAi X-Received: by 2002:a17:906:1f57:: with SMTP id d23mr12660498ejk.103.1570195619402; Fri, 04 Oct 2019 06:26:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570195619; cv=none; d=google.com; s=arc-20160816; b=ASzo2pMx/mgowU6AMzGZr/aJpso7+pkp2Vw1QeZtOwUz/pqZzpkGWzWwcMgjp1f0cT I85zUAicH7nFNSqjaNy4mk/Fy6W/ARRaDKD+XmihfO9yeqlJf7hQ53A2SMKhelxY4mJl ARFMO59NDz08zixPIETBflQkVaO01dqnj3SHbx44MLRh+JutKS/gDppROzPWG7zj8eBs XOVyqGI+CdB086SgyFQ/pZOM8pKBgeLSQUxcqmC6dUiqFoanGt+Pp6a7LV6XFdk6wHZB cSmCch7FA+A5hV0enbnzUxtzQNjs8pPQvSkPNB+LQ/4mcHPMhJqru8oJVjVdoK1okmwV gtfw== 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=qLJb2E4+T8k4ZNGEJMsYz2N2NesQKtR1hUq+LrxKWPk=; b=jHQjwDwP/SEkFgaLXgTYdkjcVcUGSpVAgvY8kW0nVAbXTzrPgSXoLj3X6ADxuHb/Z4 +S1kp2UMT4zrKoiWirVpQxfEM15BeVh3ePpfIdPcmt/BMB3MeNH0IQ6BNbD1x7JkAlhs LO7MaLTLB6f3TR3T4o3/nkbHXMRb3dfpeJlofM7CjcCb+Vn7PtnZW4XNt8vNGIm7NZJZ J13MM8vw2shcHutJWRAua8spSH7mm4oFNG188gHxgGFI0kcJBWUD6A6BI50Pncmb14LA g4QEbBbA5Jeu98IKQNQP6iMXXPKEZaNl48LKxQ04IUMRydClD4Po7qoTp+9Yku1jp0wi 0fcQ== 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 p28si3039393ejn.88.2019.10.04.06.26.34; Fri, 04 Oct 2019 06:26:59 -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 S2388489AbfJDNXZ (ORCPT + 99 others); Fri, 4 Oct 2019 09:23:25 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:46727 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387952AbfJDNXZ (ORCPT ); Fri, 4 Oct 2019 09:23:25 -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 1iGNWS-0001sz-5V; Fri, 04 Oct 2019 15:21:28 +0200 Message-ID: Subject: Re: [PATCH v2 00/21] Refine memblock API From: Lucas Stach To: Russell King - ARM Linux admin , Mike Rapoport 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: Fri, 04 Oct 2019 15:21:03 +0200 In-Reply-To: <20191004092727.GX25745@shell.armlinux.org.uk> 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> <20191004092727.GX25745@shell.armlinux.org.uk> 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 Freitag, den 04.10.2019, 10:27 +0100 schrieb Russell King - ARM Linux admin: > On Thu, Oct 03, 2019 at 02:30:10PM +0300, Mike Rapoport wrote: > > 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 < > > > > > rppt@linux.ibm.com> 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/ > > Sorry, yes, you're right. Still, I've reported this same regression > a while back, and it's never gone away. > > > > > BTW, the code that complained about "command buffer outside > > > > valid memory > > > > window" has been removed by the commit 17e4660ae3d7 > > > > ("drm/etnaviv: > > > > implement per-process address spaces on MMUv2"). > > > > > > > > Could be that recent changes to MMU management of etnaviv > > > > resolve the > > > > issue? > > > > > > The iMX6 does not have MMUv2 hardware, it has MMUv1. With MMUv1 > > > hardware requires command buffers within the first 2GiB of > > > physical > > > RAM. > > > > I've mentioned that patch because it removed the check for cmdbuf > > address > > for MMUv1: > > > > @@ -785,15 +768,7 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu) > > PAGE_SIZE); > > if (ret) { > > dev_err(gpu->dev, "could not create command > > buffer\n"); > > - goto unmap_suballoc; > > - } > > - > > - if (!(gpu->identity.minor_features1 & > > chipMinorFeatures1_MMU_VERSION) && > > - etnaviv_cmdbuf_get_va(&gpu->buffer, &gpu- > > >cmdbuf_mapping) > 0x80000000) { > > - ret = -EINVAL; > > - dev_err(gpu->dev, > > - "command buffer outside valid memory > > window\n"); > > - goto free_buffer; > > + goto fail; > > } > > > > /* Setup event management */ > > > > > > I really don't know how etnaviv works, so I hoped that people who > > understand it would help. > > From what I can see, removing that check is a completely insane thing > to do, and I note that these changes are _not_ described in the > commit > message. The problem was known about _before_ (June 22) the patch > was > created (July 5). > > Lucas, please can you explain why removing the above check, which is > well known to correctly trigger on various platforms to prevent > incorrect GPU behaviour, is safe? It isn't. It's a pretty big oversight in this commit to remove this check. It can't be done at the same spot in the code anymore, as we don't have a mapping context at this time anymore, but it should have moved into etnaviv_iommu_context_init(). I'll send a patch to fix this up. Regards, Lucas