Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3760286ybx; Mon, 4 Nov 2019 02:27:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwh4i2Ef4pb1cUSf5Xlkb2SbHT7coonVeL+JXcoMP1SngWeA8lQCYudJJTCkPT4bSrpoJwT X-Received: by 2002:a50:eb89:: with SMTP id y9mr28154869edr.15.1572863229444; Mon, 04 Nov 2019 02:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572863229; cv=none; d=google.com; s=arc-20160816; b=C9ULDCeyfUrNXOfAzuLr/BeqtH7nqjPwW/B8N9T+JG9IuNtupRYn6rpzZ90dDt3lCo ujGC1RB102QThAO+C8StAf0oWC2G203mPhjJss5Se8k4NtVhp+oa/UbOFbB4aRx25jVX ySxvhu6mFWAxzjKDyxYiy2zBoIckpMIsGColqAe6/8y2kaYnfcB4HpXf+8+PPo9HU71h 4NRa3Htf9DDTfHCbJNtA9Schmx5rIicFIzesVIj8A7pAGIrCR504HTOCdtI5G+GLmVJ5 YlrtEG0k3cQDIAj3m05ojoLXGBkON7mWbYKs3/wtcwvdQnlh5Opq+sjIfwcIsQKDGCRm nD4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=Hvkk7RONc9SrfQNrWrK3s3UYcl8AIEq79yP2mzZcaZA=; b=wLYCUH6Mh3XSomoJozZ+F4tA5HCXYaxZEZsWQ4W4HrPlj8fP5JIbLhaEjVIsj8PgoS o310n00wdjA+hHfydl/KjZg2gpl/wc2GdW9PeZ04WJsK2YYZqF67G8qNL004exl42jvB 51nrBq6bJFwP5CvofodhwWwZ6CNonQ72bzCKr2t0aFOkuVzzg/LKkdopm3ha0ofVvbJd QDXRISrhKAyv0tESDJQ8xjBAmUw8phVrFXxDGgykiww49At+VNeGAlpnQR68Yzv0yC+x Qnkw38N9/CPtraLqs4ieWZRbJH4+PX/5ZKLAjm7IrIb8iwbBGFfNlAmVvFvpJII2SAJA vFIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=eSNWnwv3; 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 o22si443575ejr.397.2019.11.04.02.26.45; Mon, 04 Nov 2019 02:27:09 -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=fail header.i=@ffwll.ch header.s=google header.b=eSNWnwv3; 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 S1728336AbfKDKYw (ORCPT + 99 others); Mon, 4 Nov 2019 05:24:52 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34701 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbfKDKYw (ORCPT ); Mon, 4 Nov 2019 05:24:52 -0500 Received: by mail-wr1-f67.google.com with SMTP id e6so14530279wrw.1 for ; Mon, 04 Nov 2019 02:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Hvkk7RONc9SrfQNrWrK3s3UYcl8AIEq79yP2mzZcaZA=; b=eSNWnwv3fB7Fj0a7kurApPAHHox5dFhx/NM3EAsFGjte7RLs9BE5V64dy8FlNtLzEW 6KxCKQQP9FfDdFQbjmXcpbvyWk+JY0eAuXm+Rq3ubuLbfl43Nx0vFV+MWOsHq//iw+ZO 0iYtdKt8PWGTGIndD4hc5wcMHW+maRs2aRUlc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Hvkk7RONc9SrfQNrWrK3s3UYcl8AIEq79yP2mzZcaZA=; b=VxgUUTjSLaJzYySc+T67D1OMJdWsHvE3VhHOrAuQtZULWYjua2CBUEv+/fCOgART9R 6trHXaqdQkKJvsFUu92y1CoZuhMujXWgS+M0vWWnJHGQvBV8LQI12TVvwEsFpiiJkA4s bOZ8GdPOfMeT1zZ5TDI6agslOG4oIXPArJZKEnknSRkahIsmKi+wXTN9Gi4n7Pc9e6F6 mV+F7d0qzrR8TEhLp6R/e/LrGOgcmjlwDJsnklUE8JldkY7XPt+d+51b4WcBkyys7SmB 9xyN4p32H6shoqbUJTObOS+rcMadPcTmeFXdbMdTS208f5fN0dGbQ+6FxBKlY4vfqDiM 2nLg== X-Gm-Message-State: APjAAAXF730+cH8A6I9xUEEcvzeMm0yKClVQ7bmePmdb3jwtn0bQCotp CtCci5bOkgytUxJ+ZACasYGiEw== X-Received: by 2002:adf:ebcb:: with SMTP id v11mr20907185wrn.24.1572863087835; Mon, 04 Nov 2019 02:24:47 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id v16sm17579034wrc.84.2019.11.04.02.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 02:24:47 -0800 (PST) Date: Mon, 4 Nov 2019 11:24:45 +0100 From: Daniel Vetter To: John Stultz Cc: lkml , Sandeep Patil , Mike Rapoport , Chenbo Feng , Alistair Strachan , Liam Mark , Yue Hu , dri-devel@lists.freedesktop.org, "Andrew F . Davis" , Hridya Valsaraju , Andrew Morton , Pratik Patel Subject: Re: [RFC][PATCH 2/2] dma-buf: heaps: Allow system & cma heaps to be configured as a modules Message-ID: <20191104102445.GE10326@phenom.ffwll.local> Mail-Followup-To: John Stultz , lkml , Sandeep Patil , Mike Rapoport , Chenbo Feng , Alistair Strachan , Liam Mark , Yue Hu , dri-devel@lists.freedesktop.org, "Andrew F . Davis" , Hridya Valsaraju , Andrew Morton , Pratik Patel References: <20191025234834.28214-1-john.stultz@linaro.org> <20191025234834.28214-3-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191025234834.28214-3-john.stultz@linaro.org> X-Operating-System: Linux phenom 5.2.0-3-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 25, 2019 at 11:48:34PM +0000, John Stultz wrote: > Allow loading system and cma heap as a module instead of just as > a statically built in heap. > > Since there isn't a good mechanism for dmabuf lifetime tracking > it isn't safe to allow the heap drivers to be unloaded, so these > drivers do not implement any module unloading functionality and > will show up in lsmod as "[permanent]". dma-buf itself has all the try_module_get we'll need ... why is this not possible? -Daniel > > This patch also exports key functions from dmabuf heaps core and > the heap helper functions so they can be accessed by the module. > > Cc: Laura Abbott > Cc: Benjamin Gaignard > Cc: Sumit Semwal > Cc: Liam Mark > Cc: Pratik Patel > Cc: Brian Starkey > Cc: Andrew F. Davis > Cc: Andrew Morton > Cc: Yue Hu > Cc: Mike Rapoport > Cc: Chenbo Feng > Cc: Alistair Strachan > Cc: Sandeep Patil > Cc: Hridya Valsaraju > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: John Stultz > --- > drivers/dma-buf/dma-heap.c | 2 ++ > drivers/dma-buf/heaps/Kconfig | 4 ++-- > drivers/dma-buf/heaps/heap-helpers.c | 2 ++ > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c > index 9a41b73e54b4..2c4ac71a715b 100644 > --- a/drivers/dma-buf/dma-heap.c > +++ b/drivers/dma-buf/dma-heap.c > @@ -161,6 +161,7 @@ void *dma_heap_get_drvdata(struct dma_heap *heap) > { > return heap->priv; > } > +EXPORT_SYMBOL_GPL(dma_heap_get_drvdata); > > struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) > { > @@ -243,6 +244,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) > kfree(heap); > return err_ret; > } > +EXPORT_SYMBOL_GPL(dma_heap_add); > > static char *dma_heap_devnode(struct device *dev, umode_t *mode) > { > diff --git a/drivers/dma-buf/heaps/Kconfig b/drivers/dma-buf/heaps/Kconfig > index a5eef06c4226..e273fb18feca 100644 > --- a/drivers/dma-buf/heaps/Kconfig > +++ b/drivers/dma-buf/heaps/Kconfig > @@ -1,12 +1,12 @@ > config DMABUF_HEAPS_SYSTEM > - bool "DMA-BUF System Heap" > + tristate "DMA-BUF System Heap" > depends on DMABUF_HEAPS > help > Choose this option to enable the system dmabuf heap. The system heap > is backed by pages from the buddy allocator. If in doubt, say Y. > > config DMABUF_HEAPS_CMA > - bool "DMA-BUF CMA Heap" > + tristate "DMA-BUF CMA Heap" > depends on DMABUF_HEAPS && DMA_CMA > help > Choose this option to enable dma-buf CMA heap. This heap is backed > diff --git a/drivers/dma-buf/heaps/heap-helpers.c b/drivers/dma-buf/heaps/heap-helpers.c > index 750bef4e902d..fb9835126893 100644 > --- a/drivers/dma-buf/heaps/heap-helpers.c > +++ b/drivers/dma-buf/heaps/heap-helpers.c > @@ -24,6 +24,7 @@ void init_heap_helper_buffer(struct heap_helper_buffer *buffer, > INIT_LIST_HEAD(&buffer->attachments); > buffer->free = free; > } > +EXPORT_SYMBOL_GPL(init_heap_helper_buffer); > > struct dma_buf *heap_helper_export_dmabuf(struct heap_helper_buffer *buffer, > int fd_flags) > @@ -37,6 +38,7 @@ struct dma_buf *heap_helper_export_dmabuf(struct heap_helper_buffer *buffer, > > return dma_buf_export(&exp_info); > } > +EXPORT_SYMBOL_GPL(heap_helper_export_dmabuf); > > static void *dma_heap_map_kernel(struct heap_helper_buffer *buffer) > { > -- > 2.17.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch