Re: [PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread John Stultz
On Wed, Jul 3, 2019 at 4:32 AM Laura Abbott  wrote:
>
> On 7/3/19 5:50 AM, Daniel Vetter wrote:
> > On Wed, Jul 3, 2019 at 10:37 AM Greg KH  wrote:
> >>
> >> On Wed, Jul 03, 2019 at 01:48:41PM +0530, Nishka Dasgupta wrote:
> >>> Remove file ion_carveout_heap.c as its functions and definitions are not
> >>> used anywhere.
> >>> Issue found with Coccinelle.
> >>>
> >>> Signed-off-by: Nishka Dasgupta 
> >>> ---
> >>>   drivers/staging/android/ion/Kconfig   |   9 --
> >>>   drivers/staging/android/ion/Makefile  |   1 -
> >>>   .../staging/android/ion/ion_carveout_heap.c   | 133 --
> >>
> >> I keep trying to do this, but others point out that the ion code is
> >> "going to be fixed up soon" and that people rely on this interface now.
> >> Well, "code outside of the kernel tree" relies on this, which is not ok,
> >> but the "soon" people keep insisting on it...
> >>
> >> Odds are I should just delete all of ION, as there hasn't been any
> >> forward progress on it in a long time.
> >>
> >> Hopefully that wakes some people up...
> >
> > John Stultz has done a steady stream on ion destaging patch series
> > past few months, und the heading of "DMA-BUF Heaps", targeting
> > drivers/dma-buf. I'm not following the details, and it seems a bit a
> > crawl, but there's definitely work going on ... Just probably not
> > in-place in staging I think.
> > -Daniel
> >
>
>
> https://lists.freedesktop.org/archives/dri-devel/2019-June/223705.html
>
> It is making slow and steady progress. Part of this is trying to
> make sure we actually get this right before moving anything
> out of staging.

Hopefully not too much longer. The review feedback has gotten quiet
recently so hopefully everyone is nodding.

Note, I'd also find it useful to *not* eject ION immediately after
dmabuf heaps land, since being able to do A/B validation on the same
kernel is useful if folks run into any new perf regressions. But
hopefully that transition time is fairly small.

> That said, I think we're at the point where nobody wants the
> carveout and chunk heaps so I'd actually be okay with removing
> those files. Just to be explicit:
>
> Acked-by: Laura Abbott 

Agreed. I think there are some out of tree uses by ARM and others for
the carveout heaps, but I don't know if anyone is using those
unmodified anyway.  So no objection from me, as there is no way to use
them upstream.

thanks
-john
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread Greg KH
On Wed, Jul 03, 2019 at 07:32:27AM -0400, Laura Abbott wrote:
> On 7/3/19 5:50 AM, Daniel Vetter wrote:
> > On Wed, Jul 3, 2019 at 10:37 AM Greg KH  wrote:
> > > 
> > > On Wed, Jul 03, 2019 at 01:48:41PM +0530, Nishka Dasgupta wrote:
> > > > Remove file ion_carveout_heap.c as its functions and definitions are not
> > > > used anywhere.
> > > > Issue found with Coccinelle.
> > > > 
> > > > Signed-off-by: Nishka Dasgupta 
> > > > ---
> > > >   drivers/staging/android/ion/Kconfig   |   9 --
> > > >   drivers/staging/android/ion/Makefile  |   1 -
> > > >   .../staging/android/ion/ion_carveout_heap.c   | 133 --
> > > 
> > > I keep trying to do this, but others point out that the ion code is
> > > "going to be fixed up soon" and that people rely on this interface now.
> > > Well, "code outside of the kernel tree" relies on this, which is not ok,
> > > but the "soon" people keep insisting on it...
> > > 
> > > Odds are I should just delete all of ION, as there hasn't been any
> > > forward progress on it in a long time.
> > > 
> > > Hopefully that wakes some people up...
> > 
> > John Stultz has done a steady stream on ion destaging patch series
> > past few months, und the heading of "DMA-BUF Heaps", targeting
> > drivers/dma-buf. I'm not following the details, and it seems a bit a
> > crawl, but there's definitely work going on ... Just probably not
> > in-place in staging I think.
> > -Daniel
> > 
> 
> 
> https://lists.freedesktop.org/archives/dri-devel/2019-June/223705.html
> 
> It is making slow and steady progress. Part of this is trying to
> make sure we actually get this right before moving anything
> out of staging.
> 
> That said, I think we're at the point where nobody wants the
> carveout and chunk heaps so I'd actually be okay with removing
> those files. Just to be explicit:
> 
> Acked-by: Laura Abbott 

Hey, if you agree to delete these, I'll not object at all!

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread Laura Abbott

On 7/3/19 5:50 AM, Daniel Vetter wrote:

On Wed, Jul 3, 2019 at 10:37 AM Greg KH  wrote:


On Wed, Jul 03, 2019 at 01:48:41PM +0530, Nishka Dasgupta wrote:

Remove file ion_carveout_heap.c as its functions and definitions are not
used anywhere.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta 
---
  drivers/staging/android/ion/Kconfig   |   9 --
  drivers/staging/android/ion/Makefile  |   1 -
  .../staging/android/ion/ion_carveout_heap.c   | 133 --


I keep trying to do this, but others point out that the ion code is
"going to be fixed up soon" and that people rely on this interface now.
Well, "code outside of the kernel tree" relies on this, which is not ok,
but the "soon" people keep insisting on it...

Odds are I should just delete all of ION, as there hasn't been any
forward progress on it in a long time.

Hopefully that wakes some people up...


John Stultz has done a steady stream on ion destaging patch series
past few months, und the heading of "DMA-BUF Heaps", targeting
drivers/dma-buf. I'm not following the details, and it seems a bit a
crawl, but there's definitely work going on ... Just probably not
in-place in staging I think.
-Daniel




https://lists.freedesktop.org/archives/dri-devel/2019-June/223705.html

It is making slow and steady progress. Part of this is trying to
make sure we actually get this right before moving anything
out of staging.

That said, I think we're at the point where nobody wants the
carveout and chunk heaps so I'd actually be okay with removing
those files. Just to be explicit:

Acked-by: Laura Abbott 

Thanks,
Laura
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread Daniel Vetter
On Wed, Jul 3, 2019 at 10:37 AM Greg KH  wrote:
>
> On Wed, Jul 03, 2019 at 01:48:41PM +0530, Nishka Dasgupta wrote:
> > Remove file ion_carveout_heap.c as its functions and definitions are not
> > used anywhere.
> > Issue found with Coccinelle.
> >
> > Signed-off-by: Nishka Dasgupta 
> > ---
> >  drivers/staging/android/ion/Kconfig   |   9 --
> >  drivers/staging/android/ion/Makefile  |   1 -
> >  .../staging/android/ion/ion_carveout_heap.c   | 133 --
>
> I keep trying to do this, but others point out that the ion code is
> "going to be fixed up soon" and that people rely on this interface now.
> Well, "code outside of the kernel tree" relies on this, which is not ok,
> but the "soon" people keep insisting on it...
>
> Odds are I should just delete all of ION, as there hasn't been any
> forward progress on it in a long time.
>
> Hopefully that wakes some people up...

John Stultz has done a steady stream on ion destaging patch series
past few months, und the heading of "DMA-BUF Heaps", targeting
drivers/dma-buf. I'm not following the details, and it seems a bit a
crawl, but there's definitely work going on ... Just probably not
in-place in staging I think.
-Daniel

>
> thanks,
>
> greg k-h
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread Greg KH
On Wed, Jul 03, 2019 at 02:14:21PM +0530, Nishka Dasgupta wrote:
> On 03/07/19 2:07 PM, Greg KH wrote:
> > On Wed, Jul 03, 2019 at 01:48:41PM +0530, Nishka Dasgupta wrote:
> > > Remove file ion_carveout_heap.c as its functions and definitions are not
> > > used anywhere.
> > > Issue found with Coccinelle.
> > > 
> > > Signed-off-by: Nishka Dasgupta 
> > > ---
> > >   drivers/staging/android/ion/Kconfig   |   9 --
> > >   drivers/staging/android/ion/Makefile  |   1 -
> > >   .../staging/android/ion/ion_carveout_heap.c   | 133 --
> > 
> > I keep trying to do this, but others point out that the ion code is
> > "going to be fixed up soon" and that people rely on this interface now.
> > Well, "code outside of the kernel tree" relies on this, which is not ok,
> > but the "soon" people keep insisting on it...
> > 
> > Odds are I should just delete all of ION, as there hasn't been any
> > forward progress on it in a long time.
> 
> I'm sorry, I don't think I understand. Should I drop these patches from my
> tree then?

What "tree"?  Let's see what the ION maintainer and developers say
before rushing to anything.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread Nishka Dasgupta

On 03/07/19 2:07 PM, Greg KH wrote:

On Wed, Jul 03, 2019 at 01:48:41PM +0530, Nishka Dasgupta wrote:

Remove file ion_carveout_heap.c as its functions and definitions are not
used anywhere.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta 
---
  drivers/staging/android/ion/Kconfig   |   9 --
  drivers/staging/android/ion/Makefile  |   1 -
  .../staging/android/ion/ion_carveout_heap.c   | 133 --


I keep trying to do this, but others point out that the ion code is
"going to be fixed up soon" and that people rely on this interface now.
Well, "code outside of the kernel tree" relies on this, which is not ok,
but the "soon" people keep insisting on it...

Odds are I should just delete all of ION, as there hasn't been any
forward progress on it in a long time.


I'm sorry, I don't think I understand. Should I drop these patches from 
my tree then?


Thanking you,
Nishka


Hopefully that wakes some people up...

thanks,

greg k-h



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread Greg KH
On Wed, Jul 03, 2019 at 01:48:41PM +0530, Nishka Dasgupta wrote:
> Remove file ion_carveout_heap.c as its functions and definitions are not
> used anywhere.
> Issue found with Coccinelle.
> 
> Signed-off-by: Nishka Dasgupta 
> ---
>  drivers/staging/android/ion/Kconfig   |   9 --
>  drivers/staging/android/ion/Makefile  |   1 -
>  .../staging/android/ion/ion_carveout_heap.c   | 133 --

I keep trying to do this, but others point out that the ion code is
"going to be fixed up soon" and that people rely on this interface now.
Well, "code outside of the kernel tree" relies on this, which is not ok,
but the "soon" people keep insisting on it...

Odds are I should just delete all of ION, as there hasn't been any
forward progress on it in a long time.

Hopefully that wakes some people up...

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: android: ion: Remove file ion_carveout_heap.c

2019-07-03 Thread Nishka Dasgupta
Remove file ion_carveout_heap.c as its functions and definitions are not
used anywhere.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta 
---
 drivers/staging/android/ion/Kconfig   |   9 --
 drivers/staging/android/ion/Makefile  |   1 -
 .../staging/android/ion/ion_carveout_heap.c   | 133 --
 3 files changed, 143 deletions(-)
 delete mode 100644 drivers/staging/android/ion/ion_carveout_heap.c

diff --git a/drivers/staging/android/ion/Kconfig 
b/drivers/staging/android/ion/Kconfig
index 178df581a8fc..dff641451a89 100644
--- a/drivers/staging/android/ion/Kconfig
+++ b/drivers/staging/android/ion/Kconfig
@@ -18,15 +18,6 @@ config ION_SYSTEM_HEAP
  Choose this option to enable the Ion system heap. The system heap
  is backed by pages from the buddy allocator. If in doubt, say Y.
 
-config ION_CARVEOUT_HEAP
-   bool "Ion carveout heap support"
-   depends on ION
-   help
- Choose this option to enable carveout heaps with Ion. Carveout heaps
- are backed by memory reserved from the system. Allocation times are
- typically faster at the cost of memory not being used. Unless you
- know your system has these regions, you should say N here.
-
 config ION_CHUNK_HEAP
bool "Ion chunk heap support"
depends on ION
diff --git a/drivers/staging/android/ion/Makefile 
b/drivers/staging/android/ion/Makefile
index 17f3a7569e3d..0ac5465e2841 100644
--- a/drivers/staging/android/ion/Makefile
+++ b/drivers/staging/android/ion/Makefile
@@ -1,6 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_ION) += ion.o ion_heap.o
 obj-$(CONFIG_ION_SYSTEM_HEAP) += ion_system_heap.o ion_page_pool.o
-obj-$(CONFIG_ION_CARVEOUT_HEAP) += ion_carveout_heap.o
 obj-$(CONFIG_ION_CHUNK_HEAP) += ion_chunk_heap.o
 obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o
diff --git a/drivers/staging/android/ion/ion_carveout_heap.c 
b/drivers/staging/android/ion/ion_carveout_heap.c
deleted file mode 100644
index bb9d614767a2..
--- a/drivers/staging/android/ion/ion_carveout_heap.c
+++ /dev/null
@@ -1,133 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * ION Memory Allocator carveout heap helper
- *
- * Copyright (C) 2011 Google, Inc.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "ion.h"
-
-#define ION_CARVEOUT_ALLOCATE_FAIL -1
-
-struct ion_carveout_heap {
-   struct ion_heap heap;
-   struct gen_pool *pool;
-};
-
-static phys_addr_t ion_carveout_allocate(struct ion_heap *heap,
-unsigned long size)
-{
-   struct ion_carveout_heap *carveout_heap =
-   container_of(heap, struct ion_carveout_heap, heap);
-   unsigned long offset = gen_pool_alloc(carveout_heap->pool, size);
-
-   if (!offset)
-   return ION_CARVEOUT_ALLOCATE_FAIL;
-
-   return offset;
-}
-
-static void ion_carveout_free(struct ion_heap *heap, phys_addr_t addr,
- unsigned long size)
-{
-   struct ion_carveout_heap *carveout_heap =
-   container_of(heap, struct ion_carveout_heap, heap);
-
-   if (addr == ION_CARVEOUT_ALLOCATE_FAIL)
-   return;
-
-   gen_pool_free(carveout_heap->pool, addr, size);
-}
-
-static int ion_carveout_heap_allocate(struct ion_heap *heap,
- struct ion_buffer *buffer,
- unsigned long size,
- unsigned long flags)
-{
-   struct sg_table *table;
-   phys_addr_t paddr;
-   int ret;
-
-   table = kmalloc(sizeof(*table), GFP_KERNEL);
-   if (!table)
-   return -ENOMEM;
-   ret = sg_alloc_table(table, 1, GFP_KERNEL);
-   if (ret)
-   goto err_free;
-
-   paddr = ion_carveout_allocate(heap, size);
-   if (paddr == ION_CARVEOUT_ALLOCATE_FAIL) {
-   ret = -ENOMEM;
-   goto err_free_table;
-   }
-
-   sg_set_page(table->sgl, pfn_to_page(PFN_DOWN(paddr)), size, 0);
-   buffer->sg_table = table;
-
-   return 0;
-
-err_free_table:
-   sg_free_table(table);
-err_free:
-   kfree(table);
-   return ret;
-}
-
-static void ion_carveout_heap_free(struct ion_buffer *buffer)
-{
-   struct ion_heap *heap = buffer->heap;
-   struct sg_table *table = buffer->sg_table;
-   struct page *page = sg_page(table->sgl);
-   phys_addr_t paddr = PFN_PHYS(page_to_pfn(page));
-
-   ion_heap_buffer_zero(buffer);
-
-   ion_carveout_free(heap, paddr, buffer->size);
-   sg_free_table(table);
-   kfree(table);
-}
-
-static struct ion_heap_ops carveout_heap_ops = {
-   .allocate = ion_carveout_heap_allocate,
-   .free = ion_carveout_heap_free,
-   .map_user = ion_heap_map_user,
-   .map_kernel = ion_heap_map_kernel,
-   .unmap_kernel = ion_heap_unmap_kernel,
-};
-
-struct ion_heap *ion_carveout_heap_create(phys_addr_t ba