From patchwork Mon May 23 09:30:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 68344 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1119817qge; Mon, 23 May 2016 02:30:28 -0700 (PDT) X-Received: by 10.98.95.71 with SMTP id t68mr25335023pfb.158.1463995828579; Mon, 23 May 2016 02:30:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si50560446par.183.2016.05.23.02.30.28; Mon, 23 May 2016 02:30:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750975AbcEWJaZ (ORCPT + 4 others); Mon, 23 May 2016 05:30:25 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:8876 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753229AbcEWJaU (ORCPT ); Mon, 23 May 2016 05:30:20 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O7M00J99IEG3A70@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Mon, 23 May 2016 10:30:16 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-b3-5742cda8337c Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 77.73.05254.8ADC2475; Mon, 23 May 2016 10:30:16 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O7M00M2SIECIH30@eusync4.samsung.com>; Mon, 23 May 2016 10:30:16 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Joerg Roedel , Inki Dae , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 2/3] iommu/exynos: Fix master clock management for inactive SYSMMU Date: Mon, 23 May 2016 11:30:08 +0200 Message-id: <1463995809-26862-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1463995809-26862-1-git-send-email-m.szyprowski@samsung.com> References: <1463995809-26862-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t/xa7orzjqFG5y6r22xccZ6VotJ9yew WCzYb23ROXsDu8XrF4YW/Y9fM1tsenyN1WLG+X1MFmuP3GV34PR4cnAek8emVZ1sHpuX1HtM vrGc0aNvyypGj8+b5ALYorhsUlJzMstSi/TtErgyNn88xFzwi7Ni/5a9bA2MOzm6GDk5JARM JCb0n2WHsMUkLtxbz9bFyMUhJLCUUeJE9w4op4lJ4v2//2wgVWwChhJdb7vAbBGBfIkXe/+y gBQxC/xilDjX2c4EkhAWCJFYvXkj2FgWAVWJGaeWg9m8Ah4SD0+0sEKsk5P4/3IFWD2ngKfE w2V3wYYKAdXMvzCFaQIj7wJGhlWMoqmlyQXFSem5hnrFibnFpXnpesn5uZsYIQH3ZQfj4mNW hxgFOBiVeHg3MDqFC7EmlhVX5h5ilOBgVhLhzTwNFOJNSaysSi3Kjy8qzUktPsQozcGiJM47 d9f7ECGB9MSS1OzU1ILUIpgsEwenVAPjyiv/N+ypZZfwLLqhdkfswNV3p684XX7xvWPq13Sb xamO26ImF1vNS2EyT58cMH/+jlOv3jlyLlq/nkn4eW97lumhlqc7jX5WxvJNV2PuNX+mtpvR s3ypXFTt6aTNSYtYJR67ums95Lj5aYbSxuw+p32MIT81Z7D9TQqcM6ugOIR/bfZCltUxSizF GYmGWsxFxYkAeneesTQCAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org If SYSMMU controller is not active, there is no point in enabling master's clock just for doing the the of internal state. This patch moves enabling that clock to the block which actually does the register access. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 1.9.2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 989365682d14..018bcd5d5edc 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -524,16 +524,15 @@ static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, { unsigned long flags; - clk_enable(data->clk_master); spin_lock_irqsave(&data->lock, flags); - if (is_sysmmu_active(data)) { - if (data->version >= MAKE_MMU_VER(3, 3)) - __sysmmu_tlb_invalidate_entry(data, iova, 1); + if (is_sysmmu_active(data) && data->version >= MAKE_MMU_VER(3, 3)) { + clk_enable(data->clk_master); + __sysmmu_tlb_invalidate_entry(data, iova, 1); + clk_disable(data->clk_master); } spin_unlock_irqrestore(&data->lock, flags); - clk_disable(data->clk_master); } static void sysmmu_tlb_invalidate_entry(struct sysmmu_drvdata *data,