From patchwork Thu Aug 8 09:37:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 2840901 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 3B50B9F493 for ; Thu, 8 Aug 2013 09:38:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4856B203F7 for ; Thu, 8 Aug 2013 09:38:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E286203F8 for ; Thu, 8 Aug 2013 09:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964840Ab3HHJhw (ORCPT ); Thu, 8 Aug 2013 05:37:52 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:54369 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934210Ab3HHJht (ORCPT ); Thu, 8 Aug 2013 05:37:49 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MR700BVIHECWW90@mailout1.samsung.com>; Thu, 08 Aug 2013 18:37:35 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 68.15.03969.FD663025; Thu, 08 Aug 2013 18:37:35 +0900 (KST) X-AuditID: cbfee68f-b7f436d000000f81-24-520366df687d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4C.0D.31505.ED663025; Thu, 08 Aug 2013 18:37:35 +0900 (KST) Received: from DOPULLIPCHO07 ([12.23.118.94]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MR7002ZQHEMH140@mmp1.samsung.com>; Thu, 08 Aug 2013 18:37:34 +0900 (KST) From: Cho KyongHo To: 'Linux ARM Kernel' , 'Linux IOMMU' , 'Linux Kernel' , 'Linux Samsung SOC' , devicetree@vger.kernel.org Cc: 'Joerg Roedel' , 'Kukjin Kim' , 'Prathyush' , 'Rahul Sharma' , 'Subash Patel' , 'Grant Grundler' , 'Antonios Motakis' , kvmarm@lists.cs.columbia.edu, 'Sachin Kamat' Subject: [PATCH v9 02/16] iommu/exynos: add missing cache flush for removed page table entries Date: Thu, 08 Aug 2013 18:37:34 +0900 Message-id: <002601ce941a$e987ba50$bc972ef0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac6UF1PC6SL3HdCxRB+a1f/jcy5kvg== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42I5/e+Zke79NOYgg8U9rBZ37p5jtZh/BEi8 OvKDyWLBfmuLztkb2C16F1xls/h46ji7xabH11gtLu+aw2Yx4/w+JosLKzayW0xZdJjV4uSf XkaLluu9TA58Hk8OzmPymN1wkcXjzrU9bB7nN61h9ti8pN5j8o3ljB59W1YxenzeJOdx5egZ pgDOKC6blNSczLLUIn27BK6MzltP2QsWclZMmHuCtYHxJnsXIweHhICJxKrDZl2MnECmmMSF e+vZuhi5OIQEljFK7L//hBUiYSJx5PpKFojEIkaJ3p41TBDOX0aJR1OvMYNUsQloSayee5wR JCEi8JtR4tazOawgDrPAfyaJrbeb2EGqhAUSJGZcW8IGYrMIqErsOPidCcTmFbCU2LW7kw3C FpT4MfkeC4jNDDR1/c7jTBC2vMTmNW+ZIW5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FiQXFCel5xrpFSfmFpfmpesl5+duYgSnlmfSOxhXNVgc YhTgYFTi4V3oxhwkxJpYVlyZe4hRgoNZSYT3YjFTkBBvSmJlVWpRfnxRaU5q8SHGZKBPJzJL iSbnA9NeXkm8obGJmZGlkZmFkYm5OWnCSuK8B1utA4UE0hNLUrNTUwtSi2C2MHFwSjUwruC8 W3ksrmPKfNEJLYLydlvEpM4UL90XPSXBzEf+m+C6+0WLLnbcv/bz2bSAEMcnPS91K/LzNSMn FEzff0v8+Sefy+r/GflDv5b12dVejrzZu9z62dQl1etfO92YFXSbvTzcxrv4zrMVAXlMp8P0 9TgqJFZIx9b3LRC7kCBwIPG1sckntt9mSizFGYmGWsxFxYkAjvTXL3EDAAA= 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=-5.1 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, 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. Tested-by: Grant Grundler Signed-off-by: Cho KyongHo Reviewed-by: Tomasz Figa --- drivers/iommu/exynos-iommu.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 233f382..d545a25 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1002,6 +1002,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; } @@ -1010,6 +1011,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;