From patchwork Fri Mar 14 05:02:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 3830161 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D24589F2BB for ; Fri, 14 Mar 2014 05:02:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1B74202BE for ; Fri, 14 Mar 2014 05:02:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 157A7202A7 for ; Fri, 14 Mar 2014 05:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752104AbaCNFCh (ORCPT ); Fri, 14 Mar 2014 01:02:37 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50578 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbaCNFCf (ORCPT ); Fri, 14 Mar 2014 01:02:35 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2E00E9JU0A4M30@mailout3.samsung.com>; Fri, 14 Mar 2014 14:02:35 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id A8.A9.10364.A6D82235; Fri, 14 Mar 2014 14:02:34 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-7f-53228d6a2ac4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id CE.E0.28157.A6D82235; Fri, 14 Mar 2014 14:02:34 +0900 (KST) Received: from DO-PULLIP-CHO07.dsn.sec.samsung.com ([12.36.165.149]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2E00EXMU0AWK50@mmp2.samsung.com>; Fri, 14 Mar 2014 14:02:34 +0900 (KST) Date: Fri, 14 Mar 2014 14:02:34 +0900 From: Cho KyongHo To: Linux ARM Kernel , Linux DeviceTree , Linux IOMMU , Linux Kernel , Linux Samsung SOC Cc: Antonios Motakis , Grant Grundler , Joerg Roedel , Kukjin Kim , Prathyush , Rahul Sharma , Sachin Kamat , Varun Sethi , Sylwester Nawrocki , Tomasz Figa Subject: [PATCH v11 02/27] iommu/exynos: add missing cache flush for removed page table entries Message-id: <20140314140234.c972b52a96a4fe39acd09fe0@samsung.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.10.14; i686-pc-mingw32) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMIsWRmVeSWpSXmKPExsVy+t8zI92sXqVgg2O3TSzu3D3HajH/CJB4 deQHk8WC/dYWnbM3sFv0LrjKZrHp8TVWi8u75rBZzDi/j8niwoqN7BZTFh1mtTj8pp3V4uSf XkaL9TNes1jMvLWGxYHf48nBeUwesxsusnj8O9zP5HHn2h42j81L6j0m31jO6NG3ZRWjx+dN ch5Xjp5hCuCM4rJJSc3JLEst0rdL4MpYNus5e8FOzoq+zyfYGhg/sHcxcnJICJhI/GuaCWWL SVy4t56ti5GLQ0hgGaPEkoNHWWGKpn44wAKRmM4ocbvpEVTVZCaJJYsOMYJUsQioSizb3QQ2 ik1AS2L13OOMIEUiAm1MEl8bD4G1MwvMZZZ4tvYp2FxhgUSJo18aWEBsXgFHiXf/XrBA7LOQ uNDUwQ4RF5T4MfkeWJwZaOrmbU2sELa8xOY1b5lBhkoIdHJIPNk5lxX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7OSCG9VhFKwEG9KYmVValF+fFFpTmrxIcZkoL8nMkuJJucDU1deSbyhsYmZkaWRmYWR ibk5acJK4rwHW60DhQTSE0tSs1NTC1KLYLYwcXBKNTCKJvofk7G6v4AlKPOYrd/JtX5WX/nf 3VWcyJT7e57PzxaLzJW17xffXaEQ4dquFHVXJF056NOhq8/8+HXCPv0XzzZI7vgwJ0suNtqv VIxr1oflJySzN3xz0L1wu6bW6GH51s/7Go+6bu5QeuUnZr9Hqm26cVq89lyn803HJx/y6ZH4 qvJzt4wSS3FGoqEWc1FxIgBg3jW4UwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit adds cache flush for removed small and large page entries in exynos_iommu_unmap(). Missing cache flush of removed page table entries can cause missing page fault interrupt when a master IP accesses an unmapped area. Reviewed-by: Tomasz Figa Tested-by: Grant Grundler Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 4876d35..1c3a397 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -958,6 +958,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, if (lv2ent_small(ent)) { *ent = 0; size = SPAGE_SIZE; + pgtable_flush(ent, ent + 1); priv->lv2entcnt[lv1ent_offset(iova)] += 1; goto done; } @@ -966,6 +967,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, BUG_ON(size < LPAGE_SIZE); memset(ent, 0, sizeof(*ent) * SPAGES_PER_LPAGE); + pgtable_flush(ent, ent + SPAGES_PER_LPAGE); size = LPAGE_SIZE; priv->lv2entcnt[lv1ent_offset(iova)] += SPAGES_PER_LPAGE;