From patchwork Thu Jan 21 11:57:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jon Medhurst \(Tixy\)" X-Patchwork-Id: 60066 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3730627lbb; Thu, 21 Jan 2016 03:57:58 -0800 (PST) X-Received: by 10.66.234.200 with SMTP id ug8mr60596173pac.129.1453377478773; Thu, 21 Jan 2016 03:57:58 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yp7si1687184pab.66.2016.01.21.03.57.58; Thu, 21 Jan 2016 03:57:58 -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; 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 S1759432AbcAUL55 (ORCPT + 29 others); Thu, 21 Jan 2016 06:57:57 -0500 Received: from smarthost03d.mail.zen.net.uk ([212.23.1.23]:58090 "EHLO smarthost03d.mail.zen.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbcAUL5x (ORCPT ); Thu, 21 Jan 2016 06:57:53 -0500 Received: from [82.69.122.217] (helo=[192.168.2.110]) by smarthost03d.mail.zen.net.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1aMDs4-0003yP-7x; Thu, 21 Jan 2016 11:57:48 +0000 Message-ID: <1453377467.2858.14.camel@linaro.org> Subject: [PATCH] staging: android: ion: Set the length of the DMA sg entries in buffer From: "Jon Medhurst (Tixy)" To: Greg Kroah-Hartman , Arve =?ISO-8859-1?Q?Hj=F8nnev=E5g?= , Riley Andrews Cc: Liviu Dudau , Laura Abbott , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Thu, 21 Jan 2016 11:57:47 +0000 X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 X-Originating-smarthost03d-IP: [82.69.122.217] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liviu Dudau ion_buffer_create() will allocate a buffer and then create a DMA mapping for it, but it forgot to set the length of the page entries. Signed-off-by: Liviu Dudau Signed-off-by: Jon Medhurst --- drivers/staging/android/ion/ion.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index e237e9f..df56021 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -251,8 +251,10 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, * memory coming from the heaps is ready for dma, ie if it has a * cached mapping that mapping has been invalidated */ - for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) + for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) { sg_dma_address(sg) = sg_phys(sg); + sg_dma_len(sg) = sg->length; + } mutex_lock(&dev->buffer_lock); ion_buffer_add(dev, buffer); mutex_unlock(&dev->buffer_lock);