From patchwork Sat Mar 18 00:54:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9631907 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 0790460132 for ; Sat, 18 Mar 2017 01:17:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAC8928506 for ; Sat, 18 Mar 2017 01:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEFDD28512; Sat, 18 Mar 2017 01:17:28 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A401128506 for ; Sat, 18 Mar 2017 01:17:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=K4DeckBbK93v6E4tqlJPRl8Kf57UTUGPzV7uJn4LTl8=; b=LKECKW1M7PNV2CXOiqI0dMqeKI zj+BjniKnVlwpo3/IODtHo2ohohdJrsP/ZHcC+BbOCdJJS/T8y7Jq65eAJ+KSNqGqoXFeC1j8bncr jPcVR6wGH4lMxmxzXNCxNd6Nb4xUkddcJd4jKCvIF3nRTXouN2hUT16+KYN9pgcaunxBVO3fNQJVB u5HryyQy0vpOnX0kMvKQyKI8ihyy4W1WXvihjf7n+O5VgT5ppdO/ZusbCiZONQd4LmV1qDfoGL/1/ A9KWDhRftKuY741t5DrZ2uTSSsK/q4DquYdZTUolXDwJuVvPvFvVAzZav10SAlR0XkWYDNYfUZJHB 9h0ngeFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cp2zZ-0001Qh-Sy; Sat, 18 Mar 2017 01:17:13 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cp2ui-0006bF-Il for linux-arm-kernel@bombadil.infradead.org; Sat, 18 Mar 2017 01:12:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pY1nCPUwcwkL0Mfe0n+kS4tU3JSST+QnOJCMegSdohE=; b=i58P9VDZW7CmRJVTiCH2AfSH5 bof22CgZT8xWaZj9et1iue8/BPLqdtEDwEPGro+UbIUGMbBrpHheoi0TbzwqEPLcIq4beFnmRV8/D ChiDs0cuMISAM1mbYAQ1GB4FViXKOBZqx7ENdupYKlB7oPWdN7zWjHbaNo0D5yBhMwnBCZPcZbms0 rqjNJ3mVIuilZI6TC9+kSSavmYinTrC3ChK5Izve3RSd2QbqeyYOYhPb7PNeE6jVQxfCMFf2oPEKp sJ1wE603MfRmDlFeth/qbMh1jR1G0qYJ9xAV+jtBXFM1wn/J2eW9wjZrIcvvYIEVL1O5Rqqk3OU8x yfQIHYmtg==; Received: from mail-qt0-f177.google.com ([209.85.216.177]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cp2fB-0008Vs-MP for linux-arm-kernel@lists.infradead.org; Sat, 18 Mar 2017 00:56:13 +0000 Received: by mail-qt0-f177.google.com with SMTP id n21so75243827qta.1 for ; Fri, 17 Mar 2017 17:55:47 -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=pY1nCPUwcwkL0Mfe0n+kS4tU3JSST+QnOJCMegSdohE=; b=VEudGOThpkM8wKF3HT+z9NY6xSlvxi+0+399d8DfNOTaXW7HMHIaDkF9FiFbrENLDJ 1Tr7UnRF6RPSfiadoYG/BpfXf9Vtc1dIfra0walsoRhFjfMujDkBK5D1COhIuiKZUMba IWsaKRuBAFL7xLgyViim48oTeRvweXiVBzX6iBf+ae9n4iXv6NKTLjUzFs9WgryXngQF rCO+bCTQo1Hi8HZsprV9f+sHWRT/D04cfTfWMEpSsDDzqf+fYV7kabaYFd02v9PaqOyR Le8d2gQIWjlqDB2NjbxSCl+ayTiXX3eGw7d4gkPUwb2orH1vqeaDqtwVpg1U8/Aw92iR Leww== X-Gm-Message-State: AFeK/H3uSe1eHRRCPrkD5PpeQvBh9hO5pUkAL/aIPJyQCGOjj5Ma3+FPyTsPrhe8LXBGYk4e X-Received: by 10.237.43.69 with SMTP id p63mr16148999qtd.68.1489798546435; Fri, 17 Mar 2017 17:55:46 -0700 (PDT) Received: from labbott-redhat-machine.redhat.com ([2601:602:9802:a8dc:1722:8a6b:a66c:79eb]) by smtp.gmail.com with ESMTPSA id e55sm7118568qte.52.2017.03.17.17.55.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 17:55:45 -0700 (PDT) From: Laura Abbott To: Sumit Semwal , Riley Andrews , arve@android.com Subject: [RFC PATCHv2 14/21] staging: android: ion: Stop butchering the DMA address Date: Fri, 17 Mar 2017 17:54:46 -0700 Message-Id: <1489798493-16600-15-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489798493-16600-1-git-send-email-labbott@redhat.com> References: <1489798493-16600-1-git-send-email-labbott@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170318_005609_865736_CA2185C8 X-CRM114-Status: GOOD ( 12.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, romlem@google.com, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, Mark Brown , Laurent Pinchart , Benjamin Gaignard , Daniel Vetter , Laura Abbott , Brian Starkey , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);