Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp915107ybp; Fri, 4 Oct 2019 07:00:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyANQbxOGaFskaBSgZDdzUrNMlIPTYtBJPg5xjBY4vrHkQPzKmxRv24dod/6/tzDTx5HTxS X-Received: by 2002:a17:906:c7d4:: with SMTP id dc20mr12567435ejb.235.1570197643516; Fri, 04 Oct 2019 07:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570197643; cv=none; d=google.com; s=arc-20160816; b=p6XTTv4J0fB+esI0i+eHnmZyoqBpyAghXyYvHR+BYr2hdwU5AMHhPbX3Ax5n7Ykvoq 2Cy1WA1EbdjEd/icEEzd7f06+APUu8Ke/RHDHLXH+ESeKMghu8lFRfcCYzz+7s5iH6LO 7IfLKBAByRSIxXd9ysMAa3aYoN3XrDAIfgRD+wpdF2nEP5OYeGu7xwyexqZIGhG1LlXU 0eFocalPr2adtC1TOX4AfNFGgo+D3LvtKd5c/2+vk8euNF/B1E161G3QrB6XFuq4NSzc OgvVF7ckD5TAzP8XQHRF1Bhqytx7xKQ57YlyRGceHXL71Fp1rVrgntBSVPX1VTjUFRuz I+SA== 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=tEWV9BhBdurpPqvh7FtS6h4jnWtzbMLEuK0kv71xj8c=; b=TyLFveZe96zr+H81Vk6WiMyN1MLoPrTUF2i9ldbk69GupH8qbfp+mPbfq9hob45aN6 yAXmrNnGE1wNRVxIUJ7DnAv6qU1wg0QcUCXaYujkKTMx73t8aRbf5R+j4SAUZ3LBrp6+ Fi7b48Gc1K1jGMQymIOEtJYjW1DruIddz/YkJicraHKrl3V+BsDj5kRNNGk2xugXo474 2i9gl9hbqxS8YxQAwK2D9RAacj+va92ELdwv2Nlc9u67kfIRl2C1dCaRqBQJFzmp+/6U x3Ovu1RjuYJPQ2nlTuaTNZeagHrLwcOUVRMdRkulcovtYESgO7+cCqu+/B2snkPtqTPZ A5kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aJiWydjK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p43si3404532edc.368.2019.10.04.07.00.17; Fri, 04 Oct 2019 07:00:43 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aJiWydjK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388920AbfJDN7G (ORCPT + 99 others); Fri, 4 Oct 2019 09:59:06 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:36129 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388333AbfJDN7F (ORCPT ); Fri, 4 Oct 2019 09:59:05 -0400 Received: by mail-io1-f68.google.com with SMTP id b136so13745353iof.3 for ; Fri, 04 Oct 2019 06:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tEWV9BhBdurpPqvh7FtS6h4jnWtzbMLEuK0kv71xj8c=; b=aJiWydjKnntivyzs2i2J3vj6LJmpwv4UabJT55mvn74jjjR/yXPzbUnTg+M1rbIM7m Ut//ecuCcDZiLZSr141Qhu22YtpFN/0/THkYoffjgnUxUKsQ6a2H0HKnWiddV1wlO/Ga eavLiC9O5RfnvzaBH367+z8FYp5XWsG1xi20xXCJaMYeDTylPW9vGJnQhYNcXjwtASjX jCXTK0gyKIoQpkN0j57KIMdSWJjGTr1yW67an3hYju7XMl+EGY/ADHcI/orgHGs8Llp7 cDwIzSMGhHbYRHSU2p/n1FP2dYKFX5FaLgTa5QmHY7s8cgDlqMigbnII4hV8c3sfgSkR CbEw== 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=tEWV9BhBdurpPqvh7FtS6h4jnWtzbMLEuK0kv71xj8c=; b=t8FQf+rH4OW9q3AJ9MPLpxSRUjnQiEY2kszzWeEm/yNEz23MGWWQKoAtIrAEmtzRVH kuxKaLG2Ux1Kml/8HvyaM2eI76InIgFmCs004CYDjARJN7+OjcZBsdJx16QAOsM3McwS BxulOW1pvWRwpHecSXc6Og+8VpaI1EMgYJCZTOuoHdQFqNA0D2j3Ncy7hJOnQHeJMe7m 7nKszaoCNUsVsoF0Q1zSpzkA0Y77wFhfzl4OugwnXfgoIJpyqZo8a08e0jgczE0PxtrM NGdtJs5ZHpbfgUDOTAmWuVcMA/aZoZYfgdwEZqUSov7jizkVNJaofqh4yrV7kDN/V/Ap Jkiw== X-Gm-Message-State: APjAAAXbqhEhSrATgl+rrqvgFriBIG2DbVh/PnEv+rH7MuQuwp9NMLpg OLnzl5w5zw52s6uiODl53jXPPtKyqAtLNOcJcv4= X-Received: by 2002:a92:3314:: with SMTP id a20mr15204996ilf.276.1570197544161; Fri, 04 Oct 2019 06:59:04 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Adam Ford Date: Fri, 4 Oct 2019 08:58:52 -0500 Message-ID: Subject: Re: [PATCH v2 00/21] Refine memblock API To: Lucas Stach Cc: Russell King - ARM Linux admin , Mike Rapoport , Fabio Estevam , Catalin Marinas , Linux Kernel Mailing List , Christoph Hellwig , The etnaviv authors , arm-soc , Linux Memory Management List , Andrew Morton 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 On Fri, Oct 4, 2019 at 8:23 AM Lucas Stach wrote: > > 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. If you CC me, I will test it and report my findings. adam > > Regards, > Lucas >