From patchwork Sun Sep 24 18:41:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 114139 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1806394qgf; Sun, 24 Sep 2017 11:43:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCmah1GM2HALV0krSwXRMwqXGUe9Q9CFJLxmPfEyLSDGdGlV0ZJofuoujLmrf0dL8ahXW5M X-Received: by 10.99.117.30 with SMTP id q30mr5513824pgc.106.1506278622607; Sun, 24 Sep 2017 11:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278622; cv=none; d=google.com; s=arc-20160816; b=ADx4nv+ahFunzjT93kLqtuZKxlhFXx4MlosoOFyzQLf4r6EvCtXK1AMYzO0A2FaYL1 y6shWhH+7InEu4fHqwfLeq9Voy0Z+ueqe4ATiw9WG6cIOhqzQ6drFqRkDBI/NrXmZcsL tIgFjOBrTrh3YIp36HbF6WuzKnYxS1muCZId03ZpMmgqJAUDOSf9K1VFmWcbHQ4BpNDT 7MGN6I6EL48qXZCGFGBCi/6kt+oq3EXoVQenp6OwuU8Al4Nw3VRdU5r9nNGH1LqK2zq+ 7JfBb0eHmYyuwYlzI6qKDqZoR87pfqUOe1aLGE4/ba1L2yDu+o0KEbbY4eYyPZ6weq68 /fPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:dkim-signature :dkim-signature:from:dkim-signature:arc-authentication-results; bh=+XPnKNbdsXMP7jSb+NQlHpY4rcUh7JcfYhCM+kui+yc=; b=HXzump75B5G+6ZoN9cK8KcU1jqNMH8lW91+8olnyY9iLAIdaBjF0Pyzud1cImpweFv ohXzvgOzM2bLK5iqRxp/ezlloa/O8dzTkMeFDXMkt+TblIODL2ZfSWjfk39CgOdlbeDB X2+bMvzxzyx+u4RbnBj6ps9jqJAvwtY5bf5QLwFdI/qtyudE1bSPndifAVatu+Y1zk1j BBReeapvjI0DIS+G0RVJ+MPv509HxPNXzNGEQBWlWGYLzL5/BPFhuPCxbOsstRxq3nBA V2mvAdnYAaS3Nr7U36Gswve6Lda8gdzeOR9THvhNit1IXR5onmfJCKUJ5CtQxVBU6Rxv VBoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=j1Ew41nB; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si3003187pgs.34.2017.09.24.11.43.42; Sun, 24 Sep 2017 11:43:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@verizon.com header.s=corp header.b=j1Ew41nB; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752925AbdIXSnl (ORCPT + 8 others); Sun, 24 Sep 2017 14:43:41 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:4427 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbdIXSnh (ORCPT ); Sun, 24 Sep 2017 14:43:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278617; x=1537814617; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p6DzerX/AbFBvat85smsisxrauDZIeOg/7oWXsJZr50=; b=j1Ew41nBIP9YfRy+9QM8h02DIFFjV0S8xV88jzke5m3p9m/TiWTP3IsX TS2LPCjFNP+XUTUaLbZvuLN29U1MoYM1/w5zGo2PzrQmysAWz4NYlmOhv GwhV3sJQQ/ynm5P2Fw1Y6Qkse82F4/y2x8mkMGxnnBbcn0QC2FPE3nybb I=; Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 24 Sep 2017 18:43:31 +0000 From: "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:43:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278607; x=1537814607; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p6DzerX/AbFBvat85smsisxrauDZIeOg/7oWXsJZr50=; b=F/BvllTxdgbzMQzxcuG71ecPHwUMg3sWO9RQExj4xUNsFArrym8NQaME dPpZi8xVb60cdy2hWhNt0KQV4LoxSR0Zs7b5mDyUkkPXYQYD/WdQt5EDA 2rnUDUAZkpoNAyAoR2YizoEBL833+QsIDVJcsfELGkro0arYE73QNRE8x w=; Received: from viking.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.26]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:43:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278607; x=1537814607; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p6DzerX/AbFBvat85smsisxrauDZIeOg/7oWXsJZr50=; b=F/BvllTxdgbzMQzxcuG71ecPHwUMg3sWO9RQExj4xUNsFArrym8NQaME dPpZi8xVb60cdy2hWhNt0KQV4LoxSR0Zs7b5mDyUkkPXYQYD/WdQt5EDA 2rnUDUAZkpoNAyAoR2YizoEBL833+QsIDVJcsfELGkro0arYE73QNRE8x w=; X-Host: viking.odc.vzwcorp.com Received: from casac1exh001.uswin.ad.vzwcorp.com ([10.11.218.43]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 24 Sep 2017 18:43:27 +0000 Received: from scwexch17apd.uswin.ad.vzwcorp.com (153.114.130.36) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 24 Sep 2017 11:43:26 -0700 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by scwexch17apd.uswin.ad.vzwcorp.com (153.114.130.36) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:43:25 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 13:43:24 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sun, 24 Sep 2017 13:43:24 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.9 75/96] iommu/exynos: Block SYSMMU while invalidating FLPD cache Thread-Topic: [GIT PULL for-4.9 75/96] iommu/exynos: Block SYSMMU while invalidating FLPD cache Thread-Index: AQHTNWTLJiIQJQQP3UKjVt6YRFvxCw== Date: Sun, 24 Sep 2017 18:41:55 +0000 Message-ID: <20170924184130.29445-76-alexander.levin@verizon.com> References: <20170924184130.29445-1-alexander.levin@verizon.com> In-Reply-To: <20170924184130.29445-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marek Szyprowski [ Upstream commit 7d2aa6b814476a2e2794960f844344519246df72 ] 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 Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/exynos-iommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 30808e91b775..c7820b3ea80e 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -542,7 +542,10 @@ static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, spin_lock_irqsave(&data->lock, flags); if (is_sysmmu_active(data) && 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);