From patchwork Tue Apr 18 18:27:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9686035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AF29601C2 for ; Tue, 18 Apr 2017 18:30:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E95124DA2 for ; Tue, 18 Apr 2017 18:30:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0323C2838E; Tue, 18 Apr 2017 18:30:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7C0524DA2 for ; Tue, 18 Apr 2017 18:30:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757309AbdDRS1j (ORCPT ); Tue, 18 Apr 2017 14:27:39 -0400 Received: from mail-qk0-f176.google.com ([209.85.220.176]:35629 "EHLO mail-qk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757216AbdDRS1f (ORCPT ); Tue, 18 Apr 2017 14:27:35 -0400 Received: by mail-qk0-f176.google.com with SMTP id f133so1186378qke.2 for ; Tue, 18 Apr 2017 11:27:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qa5J8Onn46QYz4K+JMqARf0jTKn36PZpsQ2st8ADBPs=; b=o9GHK1r3wf2gBgiWxtpLeyi8ZccSwiwxM+o3iZX1qq/ci9Uj07TY23C9aQxLdH79Ob YxXGAOGZKXbNu97lT3GcRIv3ipIw5QeiaRows7pefeBDfC2DFmeqhM5GwJWo6U3NqRFI nIm0DG+ndiPTb5VXJ+RboX2W5mzbB4o6kd5cAz/L0X8W8saZZoSfWkGZW6vvpkDCk2l2 GZs5+4fQhRFyBdti7KWBK4k0LNAE8bkVPpJO6as7kDwXtSYBKpnDf/zDV6mpN5zjgTsk /8nF8EitiowSJmvt9fLRPIQhNbEwFqp8X7IQQMxIek1eVNpP+vBgsNtzn6WEP7sNVFPs zK4A== X-Gm-Message-State: AN3rC/4PSY5mU5O3xWHDGmp8wZ7SI2675fGviTmQNHKZAQ5fDWl0i2l2 019uC8ZY1oaIcxzB X-Received: by 10.55.220.3 with SMTP id v3mr11515491qki.284.1492540054006; Tue, 18 Apr 2017 11:27:34 -0700 (PDT) Received: from labbott-redhat-machine.redhat.com ([2601:602:9802:a8dc::159c]) by smtp.gmail.com with ESMTPSA id q66sm10142381qkd.69.2017.04.18.11.27.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 11:27:32 -0700 (PDT) From: Laura Abbott To: Sumit Semwal , Riley Andrews , arve@android.com, Greg Kroah-Hartman Cc: Laura Abbott , romlem@google.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Brian Starkey , Daniel Vetter , Mark Brown , Benjamin Gaignard , linux-mm@kvack.org, Laurent Pinchart Subject: [PATCHv4 04/12] staging: android: ion: Stop butchering the DMA address Date: Tue, 18 Apr 2017 11:27:06 -0700 Message-Id: <1492540034-5466-5-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492540034-5466-1-git-send-email-labbott@redhat.com> References: <1492540034-5466-1-git-send-email-labbott@redhat.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have proper caching, stop setting the DMA address manually. It should be set after properly calling dma_map. Signed-off-by: Laura Abbott --- drivers/staging/android/ion/ion.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 3d979ef5..65638f5 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -81,8 +81,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, { struct ion_buffer *buffer; struct sg_table *table; - struct scatterlist *sg; - int i, ret; + int ret; buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); if (!buffer) @@ -119,20 +118,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, INIT_LIST_HEAD(&buffer->vmas); INIT_LIST_HEAD(&buffer->attachments); mutex_init(&buffer->lock); - /* - * this will set up dma addresses for the sglist -- it is not - * technically correct as per the dma api -- a specific - * device isn't really taking ownership here. However, in practice on - * our systems the only dma_address space is physical addresses. - * Additionally, we can't afford the overhead of invalidating every - * allocation via dma_map_sg. The implicit contract here is that - * 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) { - 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);