From patchwork Mon Sep 18 00:40:31 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: 112862 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3116897qgf; Sun, 17 Sep 2017 17:41:55 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6hxpGn+9voTYPqnoCeVQpsdWtXyP+dLhe4f7JmQFQ4G7kE73y5E1ttUqCAn3RfbUHlMsuo X-Received: by 10.98.178.66 with SMTP id x63mr30620488pfe.332.1505695315249; Sun, 17 Sep 2017 17:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505695315; cv=none; d=google.com; s=arc-20160816; b=XlnI4wNEiMPOGKlgCwSrSVwonTkZafIXpcZe02osOL8x/8ftXk1C/ZAa8kcLNMBcEF mATom2pwT50M4duiBS050bdI/pphtUC9+rfCtPcSv+dJ2s6zl6IxqYCYNQ8U+MaxMt3P oms/ibaiUwFZKAcnp8IlDXJNGV0Aeji+y2C73TlnB18vGz9n/E76W1yNe+w9gJAe2AnN lDbRjjuSOTBNKkoAJony39oMt+x8D0imVPna6x9Izqq1L2Y2p0cHX/gkduB73Snh64xP uM3zjiiRFwFHSkgt12ovPCDEjBhnwIEwBkF95rxd5Mdo25Zk9Q4zUDCO9mwppFN5/LsN k23A== 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:message-id:date:thread-index :thread-topic:subject:to:dkim-signature:dkim-signature:cc:from :dkim-signature:arc-authentication-results; bh=Cy6lkurG17p5ZdUVDSOXD8IwyZY8zVWdogT4o0/7UpE=; b=R1clgmbwUjRVeaUd5ppKoXVzZ5IB2489PUCAx9Ms+rruub0RwEtFoNR1+hRiPWDwku jPuw+OLUrvqmTVRf+Qz+QaQUFx7BGsmN12YXNn/Sb6Ahxp3h9gUEOy0fZOpgIt55d60u c8DxCSTxHhtw/B01hTBFYGVKda3yjqg8MqQ6dUvAemHuTGXDnTOpNR/cPRBQUvWFXj5c JNz4sx8Z86em1k6IKTW+v3sw1cH+3IHCC1MVUkr2oCzkBbbvMiYhabimAVPm/QNoQSNP q3WUVYXL/JatjARDt7q8cDD8uu7/Q9MuKDrIRInjif0egWoHb878jIA+WWqKDUkUBj/Y ozYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=FMNkQqfm; dkim=fail header.i=@verizon.com header.s=corp header.b=R/RGLo9V; dkim=fail header.i=@verizon.com header.s=corp header.b=R/RGLo9V; 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=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si3861993pgq.494.2017.09.17.17.41.55; Sun, 17 Sep 2017 17:41:55 -0700 (PDT) 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=@verizon.com header.s=corp header.b=FMNkQqfm; dkim=fail header.i=@verizon.com header.s=corp header.b=R/RGLo9V; dkim=fail header.i=@verizon.com header.s=corp header.b=R/RGLo9V; 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=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbdIRAlY (ORCPT + 26 others); Sun, 17 Sep 2017 20:41:24 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:65051 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752067AbdIRAlT (ORCPT ); Sun, 17 Sep 2017 20:41:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505695280; x=1537231280; h=from:cc:to:subject:date:message-id: content-transfer-encoding:mime-version; bh=LYBvtNqG2qqSXTZTDqchxspPJ3mXKcWzhl9VcDjwCYg=; b=FMNkQqfmlTAxXwVYmHePpJYuZwOLHS8QtkNussBqCyHigvFT+yEltF7O JXRbntbbYjvSrCEpRGQiFggj6ecJ2y2I7BR37KEs0t2q2J5Txhl78g6KY p7AGhbb3+jPAKdQhDa/8JaBj40EVpaQUAPlms1a5fv/Tl8tArRBtbrGRw 4=; Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 18 Sep 2017 00:41:18 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Marek Szyprowski , Joerg Roedel , "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; 18 Sep 2017 00:40:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505695235; x=1537231235; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=LYBvtNqG2qqSXTZTDqchxspPJ3mXKcWzhl9VcDjwCYg=; b=R/RGLo9ViHgdkXFGzGriwrNPi9LsGmgsMxQAYNXQxmmXBS8yMwlBxKxH BEj+ZEN0FhO0mC50Ujpi4+0Trwu6j/ShI6pd6sNfF4sRW/KFyOJ+YlWpr +BV7kdKKIE6eh6gY5jIrd9NioMdghZUwrfLSWKhiae/5Gm0nhcD9g+HYZ w=; Received: from discovery.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.25]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Sep 2017 20:40:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505695235; x=1537231235; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=LYBvtNqG2qqSXTZTDqchxspPJ3mXKcWzhl9VcDjwCYg=; b=R/RGLo9ViHgdkXFGzGriwrNPi9LsGmgsMxQAYNXQxmmXBS8yMwlBxKxH BEj+ZEN0FhO0mC50Ujpi4+0Trwu6j/ShI6pd6sNfF4sRW/KFyOJ+YlWpr +BV7kdKKIE6eh6gY5jIrd9NioMdghZUwrfLSWKhiae/5Gm0nhcD9g+HYZ w=; X-Host: discovery.odc.vzwcorp.com Received: from casac1exh001.uswin.ad.vzwcorp.com ([10.11.218.43]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 18 Sep 2017 00:40:34 +0000 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 17 Sep 2017 17:40:34 -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, 17 Sep 2017 19:40:31 -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, 17 Sep 2017 19:40:31 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH for 4.9 18/39] iommu/exynos: Block SYSMMU while invalidating FLPD cache Thread-Topic: [PATCH for 4.9 18/39] iommu/exynos: Block SYSMMU while invalidating FLPD cache Thread-Index: AQHTMBa75/gsIxmPxk+eqMiLRg1asA== Date: Mon, 18 Sep 2017 00:40:31 +0000 Message-ID: <20170918004024.7247-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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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") 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);