Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752481AbdLHBVk (ORCPT ); Thu, 7 Dec 2017 20:21:40 -0500 Received: from mail-wr0-f177.google.com ([209.85.128.177]:43184 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751904AbdLHBVj (ORCPT ); Thu, 7 Dec 2017 20:21:39 -0500 X-Google-Smtp-Source: AGs4zMbC3sR74W8N94ZINyhsBUiEzWZy3N+3J8XsXyLeFt4qBD960oxGlnCMbSaioDVvMmjK71cX0zGgKp1syW3m1as= MIME-Version: 1.0 In-Reply-To: References: <1512690169-27217-1-git-send-email-john.stultz@linaro.org> From: John Stultz Date: Thu, 7 Dec 2017 17:21:37 -0800 Message-ID: Subject: Re: [RFC][PATCH] staging: ion: Fix ion_cma_heap allocations To: Laura Abbott Cc: lkml , Sumit Semwal , Benjamin Gaignard , Archit Taneja , Greg KH , Daniel Vetter , Dmitry Shmidt , Todd Kjos , Amit Pundir Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1173 Lines: 36 On Thu, Dec 7, 2017 at 4:55 PM, Laura Abbott wrote: > On 12/07/2017 03:42 PM, 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 204f672255c22 ("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. >> >> I'm no memory expert so close review would be appreciated! >> > > Yup. > > Acked-by: Laura Abbott Thanks for that! I realized right after sending that there's a checkpatch issue to be fixed up, so I'll resend tomorrow (including your ack) if there aren't any other objections. thanks -john