Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4295618ybx; Mon, 4 Nov 2019 10:59:26 -0800 (PST) X-Google-Smtp-Source: APXvYqzOx+hXMsM1ySTLqIH8UlVtyl9/PFYVARyOJ7+Sq6RYtqrjM9G+5BqNfzKpA8mtPybgWNrE X-Received: by 2002:a17:906:245b:: with SMTP id a27mr25849873ejb.192.1572893966366; Mon, 04 Nov 2019 10:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572893966; cv=none; d=google.com; s=arc-20160816; b=UKPW4w0ad0zcTdbyYN+9EWNBt1c70lNvYVvMXskEpcxK7gSFYuIp6CQOk3QKoiOrIa 5KUsFLaDdvoIyiTcummCz3ja0Xtf6Zzdt8VYLRo1vcGFii0reAneuNu9azCp4AKhXuvW 5oQHurlV4fr1Nvr2hLChK7G2Ym6nOjSuw84CsXTwlZ5FVM/6g6DKj4XQu1Ab6A0VLMbJ 2y3zH0KY6aIJTnJBmtdQJH4FgTOwNqlN+Nhizs7/o5P0fP+I6o43Rm1KqGRzBzsrfOBt zymZUeDqoTUA+R7W+7YtYVff/C9TdhHT9/twTnsAeCKAJEu3dMixk8bO3XhP7IrbquXo q5bQ== 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=z3NXmbQZe9ZnT7fbe+EIvkpInJMLKjVbW03x8y81A38=; b=LR0tqpqXCgrjMIDC6nn7IRukThxe1K6Ja2+0MiBNhxcZorm1ISrwrf2r7BkLIMBP5X N2vsAHpqNpMMgHbnbNtVvwQt1nB2Ynvfb6z9et5Li9zdVhkpPKj+d1oi0pG5TJUN4ywV mdX+eXmklo0SgYMCDr+ov6wbqrdsDfw3YZRu4MpTPrfpx7hW3oZ27nB+cJPyZ/ea3X6r moDOT9TJNS3ZT2708VBfeLveMBszXiRI9dCcl6K/7O3bihXZMEh77nnkswOKUvViGHWT ddF6vZMqjzSu2lLm6jYSwEIBjiYRyat30sm3BbfIRjVikCJxcAKTkVvEN+Sm5Vr9L6FY KSYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fFfD5MFP; 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 c10si7455700eda.284.2019.11.04.10.59.03; Mon, 04 Nov 2019 10:59:26 -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=fFfD5MFP; 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 S1729443AbfKDS55 (ORCPT + 99 others); Mon, 4 Nov 2019 13:57:57 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:43140 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728332AbfKDS54 (ORCPT ); Mon, 4 Nov 2019 13:57:56 -0500 Received: by mail-ot1-f68.google.com with SMTP id l14so1018753oti.10 for ; Mon, 04 Nov 2019 10:57:56 -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=z3NXmbQZe9ZnT7fbe+EIvkpInJMLKjVbW03x8y81A38=; b=fFfD5MFPiJ1kIysRVmZVrDEnc3iHR5WePrk035gRLGZj4EECNcsralgOCLF45h65vB zenyoBMjR85Vqj/x36CUNK59ZtiTlUDkITY/CzP1ZxrbI2sdcj5VZxH1Ya8f7y2/oRMU 04v6lxIY4znf+l+FSL39uRNT+VCYMGLoV4IJWITuemgu0AOvHpJ00pkatCucMRC4FUzE BNujdNj2j/A6MvTohDixsW5gE1mGAsAqbwSkfhATzBtYiaSmed2IpcJMFzTXOb9qzd8w CO73Iet24BAdstCgmFamT2zFZemCUpQlyCiE1E2zt4+1yTYhn8JvFB20wFSLRl7NL0Jf U8vg== 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=z3NXmbQZe9ZnT7fbe+EIvkpInJMLKjVbW03x8y81A38=; b=NG3bg13hP7nPidUwyi08rY8b5+4RcEa6EN7VQusYEqzhYIb0F4EcHr8eXRko5lFvZO j/nRUmaTQfIx4HZe08VusN13ZlTVBz8mlZUv6H20EXOpWmE/6C0YWIGWjd4U+jfOBtL5 nX7K05uw9p85GHnniulIUmuhVrP83toQwfwcPytVGYwjwxWTdfEwOAjYOz7IYvTVGwxY ukMONCzbxdldu6wYaG24VuyNlP/eAoTeue41Eaq2VEdI4b99Ln4jHAKWenFhLwganoFk arBkRUVhV+HPwQwkYnmJomOe6IAY7uFVuBYBy39rMLDGGTJUvBEmnEXRNR58m9FFkf5f uYcg== X-Gm-Message-State: APjAAAV5mUsvi4u+vzdJhPhdMfAL8L4gkjwK3TLcS+UtbqvbsPUNC/mV CP+cCIK+wlSvo/tu6Dor2boatRa0Oim39qvVaRoelQ== X-Received: by 2002:a9d:630c:: with SMTP id q12mr19353256otk.332.1572893875375; Mon, 04 Nov 2019 10:57:55 -0800 (PST) MIME-Version: 1.0 References: <20191025234834.28214-1-john.stultz@linaro.org> <20191104095823.GD10326@phenom.ffwll.local> In-Reply-To: <20191104095823.GD10326@phenom.ffwll.local> From: John Stultz Date: Mon, 4 Nov 2019 10:57:44 -0800 Message-ID: Subject: Re: [RFC][PATCH 0/2] Allow DMA BUF heaps to be loaded as modules To: Daniel Vetter Cc: lkml , Sandeep Patil , Mike Rapoport , Chenbo Feng , Alistair Strachan , Liam Mark , Yue Hu , dri-devel , "Andrew F . Davis" , Hridya Valsaraju , Andrew Morton , Pratik Patel 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 Mon, Nov 4, 2019 at 1:58 AM Daniel Vetter wrote: > On Fri, Oct 25, 2019 at 11:48:32PM +0000, John Stultz wrote: > > Now that the DMA BUF heaps core code has been queued, I wanted > > to send out some of the pending changes that I've been working > > on. > > > > For use with Android and their GKI effort, it is desired that > > DMA BUF heaps are able to be loaded as modules. This is required > > for migrating vendors off of ION which was also recently changed > > to support modules. > > > > So this patch series simply provides the necessary exported > > symbols and allows the system and CMA drivers to be built > > as modules. > > > > Due to the fact that dmabuf's allocated from a heap may > > be in use for quite some time, there isn't a way to safely > > unload the driver once it has been loaded. Thus these > > drivers do no implement module_exit() functions and will > > show up in lsmod as "[permanent]" > > > > Feedback and thoughts on this would be greatly appreciated! > > Do we actually want this? I guess that always depends on the definition of "we" :) > I figured if we just state that vendors should set up all the right > dma-buf heaps in dt, is that not enough? So even if the heaps are configured via DT (which at the moment there is no such binding, so that's not really a valid method yet), there's still the question of if the heap is necessary/makes sense on the device. And the DT would only control the availability of the heap interface, not if the heap driver is loaded or not. On the HiKey/HiKey960 boards, we have to allocate contiguous buffers for the display framebuffer. So gralloc uses ION to allocate from the CMA heap. However on the db845c, it has no such restrictions, so the CMA heap isn't necessary. With Android's GKI effort, there needs to be one kernel that works on all the devices, and they are using modules to try to minimize the amount of memory spent on functionality that isn't universally needed. So on devices that don't need the CMA heap, they'd probably prefer not to load the CMA dmabuf heap driver, so it would be best if it could be built as a module. If we want to build the CMA heap as a module, the symbols it uses need to be exported. > Exporting symbols for no real in-tree users feels fishy. I'm submitting an in-tree user here. So I'm not sure what you mean? I suspect you're thinking there is some hidden/nefarious plan here, but really there isn't. thanks -john