Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1248106ybv; Thu, 20 Feb 2020 16:20:21 -0800 (PST) X-Google-Smtp-Source: APXvYqx8XKYmJVN0qlBidE/3WF0HfwvvsLcjAQUFMdQvRlr+l0ACtw5SSFkCvtLLhvMjMCGoJAoQ X-Received: by 2002:a9d:6e15:: with SMTP id e21mr12106209otr.289.1582244421622; Thu, 20 Feb 2020 16:20:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582244421; cv=none; d=google.com; s=arc-20160816; b=e8A2JoOLRMy1x0eotyrTfKazfLs9E6D80kpyCqLADzgDiKfLrS8HBFq6qGHAjDjjsQ U6wo9k3YjgZEFrRn6LjYzkoGHfF92dIWSdvWDJozqM4tW/5hlH6odGnfRamtFJkEqNaS qpzzbmQsTBVIVW+ql8/ldf/llFzxZP+W/3JLBz6LhoRWotRGEd5CeoY6d91H7ckNE3xO OsqJyltx6izRfnA+ix332TS6Ruo1miN9im7TbHur/NVYVsgmAftWqMRHH91RXRX9kEal YjHI7QThpK10zoArkAtXmfDeZgvcqjB+rBQjgxdHTeCWQnTE96/jhwDN92cjmjCYieoR WYDg== 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=IHr5qo3B7v5uxs0wZA0fZW6J9zqGy3IdsKd+NBLqxdQ=; b=dFBw8b7/SZ404iVFw/ivxn/rRLIiWA1Kluq+yQzIcWcUyKTg5F93EvzrSqbt7e0rIj jK8OYVr7hy2CtaxkYhPzlcYJe6Qu2AsH8NP5W7H1pnDNL4Pwymb/BFIt+fZNj8I2rHsk nZIAhH/jWbnF2JXG77xkjcRegPKtSmcpPDGmUVy6KIsNfQRORa46DcSYfd3vJjSeN5i+ FvWGCdXVYfVGyOztB+0CRxgc7zRDIsSZEka5ojHOwkZe9fNqsvZPoqy0v+8veVZ0jJVG a6DDQOgZRqI/yFIXEccyOuLAj1uNWUzXeM7kXDbV7zbmpIghjC9EVPEkXBtA+92H8e9o nydA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hz3Wvel0; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i23si534356oto.206.2020.02.20.16.20.09; Thu, 20 Feb 2020 16:20:21 -0800 (PST) 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=@linaro.org header.s=google header.b=Hz3Wvel0; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729464AbgBUAUA (ORCPT + 99 others); Thu, 20 Feb 2020 19:20:00 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:36763 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729397AbgBUAT7 (ORCPT ); Thu, 20 Feb 2020 19:19:59 -0500 Received: by mail-oi1-f196.google.com with SMTP id c16so300489oic.3 for ; Thu, 20 Feb 2020 16:19:59 -0800 (PST) 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=IHr5qo3B7v5uxs0wZA0fZW6J9zqGy3IdsKd+NBLqxdQ=; b=Hz3Wvel0TrnLWu2KOGBLM37xIzOel8u9Z3LL3LKWhQ5uDvm2hmCI+8lAaq9dDcnzK0 mmF29yC6bk6kCEp7Rp8Xphv7SaNuWSCpytm5t0gbTsUTgWYqT1kGf0Uk4snguMx7ktEB CUaU4UXvlG8DiQPZ0fLoxZ7q8pzZGa6twCkjkNgfUTBep5MTIzKNPNNZmjXvVmIuajDT x1oGn/KBMPVd010kg/4IBE9Z7pYnop4ImXcsjGIsjF1rqOEZh0XzY3XCKZGRIyEUPwgM dnOCLimGwLQYnIXwqYXRG3zAdpZoXpkT5LDSWOlqz/mbvst5M1heaxiNSpmi3QJ6N3pL qeqg== 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=IHr5qo3B7v5uxs0wZA0fZW6J9zqGy3IdsKd+NBLqxdQ=; b=G/In1azAjMWjhIwdlGY8tPjo0bx7Y58kViTyB+guJ/4hS8KMbXMqNKTuQkIriG/9UB p/PLJrSHpxglDkdXwey31t90bsJT2JZ8LKjZod+6/XoEPHV7V6PPDnKkmayZmk22n60q GIcpsqhLVQeruy/ohVhnI9TGI0F3SRGAglcDGXTi8nfLv8Z/U6/HAhVxqv1UVTuvAtY9 xcihEtbUMGm/OAL/fiDrkhdXMY3nL+cHVfv6N3ccLQ26yq14CWbLjhJkP0AJ3YDlXa/l M5RWEUiN5qhnrjL4JtatfgLOXqMleE3Zi/b4n1BfWnh4NSiFyAQ//P8VKoRlUZFF4Th3 jCKA== X-Gm-Message-State: APjAAAWjcpnq1RZmroPXKTWucHED2Pvmyznam97GCnEGiOanBuBB2GVF lDtbZUO9N1mZIHqI1ymhkBxR7a0d5IZKiYv1xH7/vw== X-Received: by 2002:aca:c0c5:: with SMTP id q188mr3935454oif.169.1582244398771; Thu, 20 Feb 2020 16:19:58 -0800 (PST) MIME-Version: 1.0 References: <1582223216-23459-1-git-send-email-jcrouse@codeaurora.org> In-Reply-To: <1582223216-23459-1-git-send-email-jcrouse@codeaurora.org> From: John Stultz Date: Thu, 20 Feb 2020 16:19:46 -0800 Message-ID: Subject: Re: [PATCH v2 0/4] msm/gpu/a6xx: use the DMA-API for GMU memory allocations To: Jordan Crouse Cc: linux-arm-msm@vger.kernel.org, Sharat Masetty , Bjorn Andersson , Sean Paul , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Stephen Boyd , Douglas Anderson , lkml , dri-devel , Rob Herring , Rob Clark , David Airlie , Andy Gross , Mark Rutland , freedreno@lists.freedesktop.org, Daniel Vetter 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 Thu, Feb 20, 2020 at 10:27 AM Jordan Crouse wrote: > When CONFIG_INIT_ON_ALLOC_DEFAULT_ON the GMU memory allocator runs afoul of > cache coherency issues because it is mapped as write-combine without clearing > the cache after it was zeroed. > > Rather than duplicate the hacky workaround we use in the GEM allocator for the > same reason it turns out that we don't need to have a bespoke memory allocator > for the GMU anyway. It uses a flat, global address space and there are only > two relatively minor allocations anyway. In short, this is essentially what the > DMA API was created for so replace a bunch of memory management code with two > calls to allocate and free DMA memory and we're fine. > > The only wrinkle is that the memory allocations need to be in a very specific > location in the GMU virtual address space so in order to get the iova allocator > to do the right thing we need to specify the dma-ranges property in the device > tree for the GMU node. Since we've not yet converted the GMU bindings over to > YAML two patches quickly turn into four but at the end of it we have at least > one bindings file converted to YAML and 99 less lines of code to worry about. > > v2: Fix the example bindings for dma-ranges - the third item is the size > Pass false to of_dma_configure so that it fails probe if the DMA region is not > set up. This set still works for me as well. Thanks so much! Tested-by: John Stultz thanks -john