From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751084AbdLNHWw (ORCPT ); Thu, 14 Dec 2017 02:22:52 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54728 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825AbdLNHWv (ORCPT ); Thu, 14 Dec 2017 02:22:51 -0500 Date: Thu, 14 Dec 2017 08:22:55 +0100 From: Greg KH To: John Stultz Cc: lkml , Laura Abbott , Sumit Semwal , Benjamin Gaignard , Archit Taneja , Daniel Vetter , Dmitry Shmidt , Todd Kjos , Amit Pundir Subject: Re: [PATCH v2] staging: ion: Fix ion_cma_heap allocations Message-ID: <20171214072255.GB27027@kroah.com> References: <1513200364-19523-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1513200364-19523-1-git-send-email-john.stultz@linaro.org> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Sumit Semwal > Cc: Benjamin Gaignard > Cc: Archit Taneja > Cc: Greg KH > Cc: Daniel Vetter > Cc: Dmitry Shmidt > Cc: Todd Kjos > Cc: Amit Pundir > Fixes: 204f672255c2 ("staging: android: ion: Use CMA APIs directly") > Acked-by: Laura Abbott > Signed-off-by: John Stultz > --- > v2: Fix build errors when CONFIG_CMA_ALIGNMENT isn't defined Wait, why would CONFIG_CMA_ALIGNMENT not be defined if we are using the cma code? Is that a Kconfig issue somehow? thanks, greg k-h