Re: [PATCH v2] staging: ion: Fix ion_cma_heap allocations

From: Greg KH
Date: Thu Dec 14 2017 - 02:22:02 EST


On Wed, Dec 13, 2017 at 01:26:04PM -0800, John Stultz wrote:
> In trying to add support for drm_hwcomposer to HiKey,
> I've needed to utilize the ION CMA heap, and I've noticed
> problems with allocations on newer kernels failing.
>
> It seems back with 204f672255c2 ("ion: Use CMA APIs directly"),
> the ion_cma_heap code was modified to use the CMA API, but
> kept the arguments as buffer lengths rather then number of pages.
>
> This results in errors as we don't have enough pages in CMA to
> satisfy the exaggerated requests.
>
> This patch converts the ion_cma_heap CMA API usage to properly
> request pages.
>
> It also fixes a minor issue in the allocation where in the error
> path, the cma_release is called with the buffer->size value which
> hasn't yet been set.
>
> Cc: Laura Abbott <labbott@xxxxxxxxxx>
> Cc: Sumit Semwal <sumit.semwal@xxxxxxxxxx>
> Cc: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxx>
> Cc: Archit Taneja <architt@xxxxxxxxxxxxxx>
> Cc: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: Dmitry Shmidt <dimitrysh@xxxxxxxxxx>
> Cc: Todd Kjos <tkjos@xxxxxxxxxx>
> Cc: Amit Pundir <amit.pundir@xxxxxxxxxx>
> Fixes: 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
> Acked-by: Laura Abbott <labbott@xxxxxxxxxx>
> Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
> ---
> v2: Fix build errors when CONFIG_CMA_ALIGNMENT isn't defined

As v1 is already in my tree, can you send me the diff so I can just
apply that instead of me having to revert the original and then add this
one?

thanks,

greg k-h