From patchwork Mon Jul 27 12:29:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 6873521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7A4BFC05AC for ; Mon, 27 Jul 2015 12:38:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A97B520612 for ; Mon, 27 Jul 2015 12:38:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D89C22060A for ; Mon, 27 Jul 2015 12:38:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZJheK-0003ZH-OV; Mon, 27 Jul 2015 12:36:56 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZJha3-00056r-6W for linux-arm-kernel@lists.infradead.org; Mon, 27 Jul 2015 12:32:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References:In-Reply-To; bh=lqMdHlCkChQ1CgiSFgNhvSa6tS3XJZ9EaLlcX22c/uQ=; b=N3yK3BcThWskMY40Ci/dXSlnaWiw2Rb+svCPG5riGBEROR9GAyq6Psn0uBCJD5oct7Y3Cmj3eWXsYp0LVMK+G8VDb9fr9JDmm8obd0JLzYF+nfkLrN2WbbLPqRfIpcZ+CD5FUzc775UK3WcscZY4CZ53WfOlNty9JBmKOXVxUkA=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:54191 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZJhXX-00070x-Op; Mon, 27 Jul 2015 13:29:55 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZJhXO-000489-TI; Mon, 27 Jul 2015 13:29:46 +0100 In-Reply-To: <20150727122824.GH7557@n2100.arm.linux.org.uk> References: <20150727122824.GH7557@n2100.arm.linux.org.uk> From: Russell King To: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 12/18] iommu: tegra-smmu: smmu_flush_ptc() wants device address MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 27 Jul 2015 13:29:46 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150727_053232_318147_19BA6236 X-CRM114-Status: GOOD ( 10.24 ) X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Courbot , Joerg Roedel , Stephen Warren , Thierry Reding , Hiroshi Doyu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Pass smmu_flush_ptc() the device address rather than struct page poiner. Signed-off-by: Russell King --- drivers/iommu/tegra-smmu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 89e7961f4848..c54b0afda475 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -164,10 +164,9 @@ static void smmu_flush_ptc_all(struct tegra_smmu *smmu) smmu_writel(smmu, SMMU_PTC_FLUSH_TYPE_ALL, SMMU_PTC_FLUSH); } -static inline void smmu_flush_ptc(struct tegra_smmu *smmu, struct page *page, +static inline void smmu_flush_ptc(struct tegra_smmu *smmu, phys_addr_t phys, unsigned long offset) { - phys_addr_t phys = page_to_phys(page); u32 value; offset &= ~(smmu->mc->soc->atom_size - 1); @@ -407,7 +406,7 @@ static int tegra_smmu_as_prepare(struct tegra_smmu *smmu, return err; smmu_flush_dcache(as->pd, 0, SMMU_SIZE_PD); - smmu_flush_ptc(smmu, as->pd, 0); + smmu_flush_ptc(smmu, page_to_phys(as->pd), 0); smmu_flush_tlb_asid(smmu, as->id); smmu_writel(smmu, as->id & 0x7f, SMMU_PTB_ASID); @@ -540,7 +539,7 @@ static u32 *as_get_pte(struct tegra_smmu_as *as, dma_addr_t iova, pd[pde] = SMMU_MK_PDE(page, SMMU_PDE_ATTR | SMMU_PDE_NEXT); smmu_flush_dcache(as->pd, pde << 2, 4); - smmu_flush_ptc(smmu, as->pd, pde << 2); + smmu_flush_ptc(smmu, page_to_phys(as->pd), pde << 2); smmu_flush_tlb_section(smmu, as->id, iova); smmu_flush(smmu); } else { @@ -577,7 +576,7 @@ static void tegra_smmu_pte_put_use(struct tegra_smmu_as *as, unsigned long iova) /* Flush the page directory entry */ smmu_flush_dcache(as->pd, offset, sizeof(*pd)); - smmu_flush_ptc(smmu, as->pd, offset); + smmu_flush_ptc(smmu, page_to_phys(as->pd), offset); smmu_flush_tlb_section(smmu, as->id, iova); smmu_flush(smmu); @@ -597,7 +596,7 @@ static void tegra_smmu_set_pte(struct tegra_smmu_as *as, unsigned long iova, *pte = val; smmu_flush_dcache(pte_page, offset, 4); - smmu_flush_ptc(smmu, pte_page, offset); + smmu_flush_ptc(smmu, page_to_phys(pte_page), offset); smmu_flush_tlb_group(smmu, as->id, iova); smmu_flush(smmu); }