From patchwork Fri Dec 13 22:24:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22424 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7D9C423FBA for ; Fri, 13 Dec 2013 22:27:41 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id jw12sf4831193veb.11 for ; Fri, 13 Dec 2013 14:27:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=JT2th+fS7cL0FEm1DC66FhdTtB3ofNa/8o4oC278zGU=; b=akCa2gTkVKL6RUliVBZSP3fR5SLG9BRxJW7UuLxk4dr3neA2cKSxfncYa/adYtkq+j HwLBMzewTBvz67wMECuLMCdY4aTQXRhtkAwj2so1H9pyK4tN+311/PiothJOAxhc2V3z +W+fs0w5LZgfFzlSWJLX/eATMTzogb57r8C0j3LI5rM2wT1CM1aTp03s+Ei9RP+zpR4/ 6+vqbLHQ6dcDwqOfnUleEGk6/uurRucRzDzhy6njzZAx5v2u117jhlhnZ28YPxYze4jZ wYtGEZG5cR1sveWa0OMoccpmyLQnBetqeymZlWyTCr1BS9PsL8UWcembuZbxFWscp8iL 3bqA== X-Gm-Message-State: ALoCoQmO5vEItTliTwptoT8KTXUC+vuFVIyPDulRJEUarde19jKFVwREMNDIGNlo6uXjS5+84U0G X-Received: by 10.236.121.4 with SMTP id q4mr1711688yhh.34.1386973661338; Fri, 13 Dec 2013 14:27:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.76.72 with SMTP id i8ls1112867qew.59.gmail; Fri, 13 Dec 2013 14:27:41 -0800 (PST) X-Received: by 10.52.28.6 with SMTP id x6mr1866239vdg.3.1386973661230; Fri, 13 Dec 2013 14:27:41 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id fr13si1195633vec.87.2013.12.13.14.27.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:41 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so1792794veb.25 for ; Fri, 13 Dec 2013 14:27:41 -0800 (PST) X-Received: by 10.52.35.41 with SMTP id e9mr920232vdj.79.1386973661165; Fri, 13 Dec 2013 14:27:41 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp73567vcz; Fri, 13 Dec 2013 14:27:40 -0800 (PST) X-Received: by 10.66.139.130 with SMTP id qy2mr5962912pab.73.1386973660490; Fri, 13 Dec 2013 14:27:40 -0800 (PST) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx.google.com with ESMTPS id 8si2496654pbe.220.2013.12.13.14.27.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.175 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.175; Received: by mail-pd0-f175.google.com with SMTP id w10so3021183pde.34 for ; Fri, 13 Dec 2013 14:27:40 -0800 (PST) X-Received: by 10.68.225.9 with SMTP id rg9mr6160606pbc.122.1386973660129; Fri, 13 Dec 2013 14:27:40 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id qz9sm7457908pbc.3.2013.12.13.14.27.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:39 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , Rebecca Schultz Zavin , John Stultz Subject: [PATCH 059/115] gpu: ion: Only flush buffers in the chunk heap if they were used cached Date: Fri, 13 Dec 2013 14:24:33 -0800 Message-Id: <1386973529-4884-60-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Rebecca Schultz Zavin Signed-off-by: Rebecca Schultz Zavin [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_chunk_heap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 5582909..60cd91c 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -104,8 +104,9 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer) ion_heap_buffer_zero(buffer); for_each_sg(table->sgl, sg, table->nents, i) { - __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), - DMA_BIDIRECTIONAL); + if (ion_buffer_cached(buffer)) + __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), + DMA_BIDIRECTIONAL); gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), sg_dma_len(sg)); }