Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp996755imu; Fri, 11 Jan 2019 12:59:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN6WSXxDAHIGvBXfu5xHaB+WY7+s0LI+Yz96FcnT7a0zrz4Py8Xf3M+BAFGckiq1ZxQKcpLI X-Received: by 2002:a63:f241:: with SMTP id d1mr14819134pgk.2.1547240346796; Fri, 11 Jan 2019 12:59:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547240346; cv=none; d=google.com; s=arc-20160816; b=x+YtLREtYHmWS0wZkRSuuFNHURAhfM/6MA3eBHIGsiQEPMvGJ4muHcLRrrG+1d39Sw v7+RJkbDLtL/5U8dI71khf5yn0fZtBuAhQFwvGFsN6U5HM7l6rIquZsGanOgHJYG+sDA 5QEFyynBlw5bn39h571Z068SkxlFVw17C6z01U3o0TlZSjB7D9oJI8Me5kg/YI7fETKI G9DvCs0/kgVnnd3yyprWxsNoNc9457lNM54UG1VaJAScYoM1f2npYi45u1FUaGwX7f6n XYiylPK4tJpXDqL7Ft4/FI2Yf90XniS4eoEaDTWviNjr976was2ftxCSK3yB8C0DzbGQ 3niQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h4p+f2tE8z6QOYqBFk+UP7b77atrn7b1IYD8CRImi3k=; b=MOvPxewFMh0wtxiBcK/SnFfN84w4S0qyrUQtXAoBjJ6s/HnQKTOCBf01tSPMJiBZ0K ggwEvC5Gqx0XuJudxmO9LtNvbKNUDbtBHhKLpQ9b3Jr3N+sUaelpdYsJQvS8HBQx82dH MGzF1YjviUCJEesOxOIsoGqcrc6kfZw8yeP1jRH9JVh2KbOYGA0qkshceeLqxT+wFlQn b5fA5o1pytHmaBnok9CZJLopfyjNPAuKcGAhwBD4YO4LyK53HmJBX/2jUxUHZQ08LepT /6TSkUOZsBBOiLu0B/A1TGmKbDkbg+EGxLyZ74OkDsy3jutBr9xiFZcmMYspmPvF47y2 y8lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qpZvNzkp; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si1195924plz.96.2019.01.11.12.58.51; Fri, 11 Jan 2019 12:59:06 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qpZvNzkp; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389719AbfAKSGD (ORCPT + 99 others); Fri, 11 Jan 2019 13:06:03 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:42048 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387681AbfAKSFm (ORCPT ); Fri, 11 Jan 2019 13:05:42 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0BI5aTc058958; Fri, 11 Jan 2019 12:05:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547229936; bh=h4p+f2tE8z6QOYqBFk+UP7b77atrn7b1IYD8CRImi3k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qpZvNzkpo/FkIm2vouYZH5xGhfYxNSGTHjKlBYfY4TsHEsyExa6d5643CXtYB2Z4Q 1uMmlxWP89JupJ5scOKi6HoG7ydl8Cd5iQDQKcR5gdoao/UxDCAe4id3N87rdbAsy1 HSirT93Itn1cBLAkkOK5XvCfDfWCOAgMeco7iy/o= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0BI5aMs009158 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Jan 2019 12:05:36 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 11 Jan 2019 12:05:35 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 11 Jan 2019 12:05:35 -0600 Received: from legion.dal.desgin.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0BI5ZiQ006491; Fri, 11 Jan 2019 12:05:35 -0600 Received: from localhost (uda0226330.dhcp.ti.com [172.22.109.196]) by legion.dal.desgin.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id x0BI5ZU07768; Fri, 11 Jan 2019 12:05:35 -0600 (CST) From: "Andrew F. Davis" To: Laura Abbott , Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= CC: , , , "Andrew F . Davis" Subject: [PATCH 13/14] staging: android: ion: Do not sync CPU cache on map/unmap Date: Fri, 11 Jan 2019 12:05:22 -0600 Message-ID: <20190111180523.27862-14-afd@ti.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190111180523.27862-1-afd@ti.com> References: <20190111180523.27862-1-afd@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Buffers may not be mapped from the CPU so skip cache maintenance here. Accesses from the CPU to a cached heap should be bracketed with {begin,end}_cpu_access calls so maintenance should not be needed anyway. Signed-off-by: Andrew F. Davis --- drivers/staging/android/ion/ion.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 14e48f6eb734..09cb5a8e2b09 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -261,8 +261,8 @@ static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment, table = a->table; - if (!dma_map_sg(attachment->dev, table->sgl, table->nents, - direction)) + if (!dma_map_sg_attrs(attachment->dev, table->sgl, table->nents, + direction, DMA_ATTR_SKIP_CPU_SYNC)) return ERR_PTR(-ENOMEM); return table; @@ -272,7 +272,8 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment, struct sg_table *table, enum dma_data_direction direction) { - dma_unmap_sg(attachment->dev, table->sgl, table->nents, direction); + dma_unmap_sg_attrs(attachment->dev, table->sgl, table->nents, + direction, DMA_ATTR_SKIP_CPU_SYNC); } static int ion_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) -- 2.19.1