From patchwork Mon Mar 20 09:17:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9633415 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 3E58D602D6 for ; Mon, 20 Mar 2017 09:18:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AA161FFB7 for ; Mon, 20 Mar 2017 09:18:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DC982810E; Mon, 20 Mar 2017 09:18:30 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 268BD1FFB7 for ; Mon, 20 Mar 2017 09:18:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202AbdCTJS2 (ORCPT ); Mon, 20 Mar 2017 05:18:28 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:28732 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753201AbdCTJSZ (ORCPT ); Mon, 20 Mar 2017 05:18:25 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON30017UWIMQI90@mailout1.w1.samsung.com>; Mon, 20 Mar 2017 09:18:22 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320091821eucas1p1d9026a2811352bbb2d2c35c37ff00c10~tjHiq9KAU3270332703eucas1p1z; Mon, 20 Mar 2017 09:18:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 65.F7.30614.D5E9FC85; Mon, 20 Mar 2017 09:18:21 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320091820eucas1p22b62f2d7e089cd997aecc62a4c5b7730~tjHh_rSmb2630226302eucas1p2u; Mon, 20 Mar 2017 09:18:20 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-b3-58cf9e5d9d7a Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A3.4A.10233.B6E9FC85; Mon, 20 Mar 2017 09:18:35 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON300FS3WICYHA0@eusync4.samsung.com>; Mon, 20 Mar 2017 09:18:20 +0000 (GMT) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Joerg Roedel , Krzysztof Kozlowski , Andrzej Hajda , Bartlomiej Zolnierkiewicz , stable@vger.kernel.org Subject: [PATCH 1/2] iommu/exynos: Block SYSMMU while invalidating FLPD cache Date: Mon, 20 Mar 2017 10:17:56 +0100 Message-id: <1490001484-18890-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHIsWRmVeSWpSXmKPExsWy7djP87qx885HGMx5IGpxa905VouNM9az WizYb23ROXsDu8X580Bixvl9TBZrj9xlt1iw8RGjA4fHk4PzmDw2repk85h8YzmjR9+WVY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FxuILSLgLnH9z3MWkCJmgfeMEjcW7GcBSQgL+Ers //YMrIFFQFWi889yZhCbV8BD4kprEzPEOjmJk8cms05g5F7AyLCKUSS1tDg3PbfYSK84Mbe4 NC9dLzk/dxMjMEi3Hfu5ZQdj17vgQ4wCHIxKPLwGV89FCLEmlhVX5h5ilOBgVhLh3ZFwPkKI NyWxsiq1KD++qDQntfgQoynQ8onMUqLJ+cAIyiuJNzQxNLc0NDK2sDA3MlIS55364Uq4kEB6 YklqdmpqQWoRTB8TB6dUA+PFpE/pp4r1vSd+flSrpHm84MORBzmMlzk/fdsg1fwh7rymk2zV PC2na8Gvz/bu3Ru53Utat+NKm0TqqfcGczN3i0/Tn7Tz1IkYq82SWWx/joSJsf9fyczNsujI xKci+1+7VZz7UHS4Ndp3feduxoTJqxjaUqpKGkym2jqc/Zlw6vf0rh13Z25XYinOSDTUYi4q TgQAgH2GTWgCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320091820eucas1p22b62f2d7e089cd997aecc62a4c5b7730 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320091820eucas1p22b62f2d7e089cd997aecc62a4c5b7730 X-RootMTR: 20170320091820eucas1p22b62f2d7e089cd997aecc62a4c5b7730 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Documentation specifies that SYSMMU should be in blocked state while performing TLB/FLPD cache invalidation, so add needed calls to sysmmu_block/unblock. Fixes: 66a7ed84b345d ("iommu/exynos: Apply workaround of caching fault page table entries") CC: stable@vger.kernel.org # v4.10+ Signed-off-by: Marek Szyprowski --- This issue has been introduced long time ago, but this fix applies only for v4.10+ kernels due to other changes in the surrounding code. --- drivers/iommu/exynos-iommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index a7e0821c9967..32d43f1994e4 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -512,7 +512,10 @@ static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, spin_lock_irqsave(&data->lock, flags); if (data->active && data->version >= MAKE_MMU_VER(3, 3)) { clk_enable(data->clk_master); - __sysmmu_tlb_invalidate_entry(data, iova, 1); + if (sysmmu_block(data)) { + __sysmmu_tlb_invalidate_entry(data, iova, 1); + sysmmu_unblock(data); + } clk_disable(data->clk_master); } spin_unlock_irqrestore(&data->lock, flags);