From patchwork Sat Dec 4 15:24:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 12656629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1C28C433F5 for ; Sat, 4 Dec 2021 15:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RC0lZKMGbfTMyV8mw50nTy1DiWy4A2aZiwu7+nkTix8=; b=KRXuTs7j+yIfaS 1Z9BpAKaZ1hGJ7LguQqFC42hOH3LuFh/VQFx4KCgFzEJUwfLo+4K1ZY0dCXpAEBW2ZP1vAFQ53EB4 ZBNnekl07raQeId+C0d/9tqR9e2XIn9Qv6WgoTOome8ArUsTHx93QfeV5o3RLJmIJlkmznZzbGlBu 95c9D2PBh2WyN6IDKb2jTX4M7VsnKry7M0KKgryqUaVh6F/l+jBlHypcogG4y28zQMwpYobaIaXte Ve4BvXQI9ozx43LfRHINX8uMl5u3BUMxA7cVCamcftQvtOZp1PNbmivKOn3TGlB+dN4e4tnB788pH a8e4hpH/7Q194+NSBHrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWue-000SXM-RJ; Sat, 04 Dec 2021 15:25:20 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWu7-000SPs-7C; Sat, 04 Dec 2021 15:24:49 +0000 Received: from localhost.localdomain (unknown [IPv6:2a00:c281:1409:4a00:6988:6ac4:851c:3f63]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id DD8B01F45BF3; Sat, 4 Dec 2021 15:24:40 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=collabora.com; s=mail; t=1638631481; bh=1E+wYaMVZBLQy1MDTb6xEPfgm8aPG7uh2L3Go1Tg6oI=; h=From:To:Cc:Subject:Date:From; b=Tx+RJ08t1neArUXh2vBRPECZ1q2onTyXQrBcW7IiTAAHIGfE2FhTPvWPyIF4gEWl2 g8RxGzGwOFpegsuE1s4hfSAD3NjKZ6C5uQLAdJTEb7pYHJsecj0hwRkFPnooE5/LCR PKHDhZ5QCW0co94RMSGORYs69+LTL/B8gBqzKhLECZjfdl7VFqNiUdybyYU7rnIUKV 5UJ6sxz1m1trs3GVRlTZk2dRhe/XlP2DrjhKzpMIukvRVJ14skngYAzrdYfMicu+9k pcRXpR74sFBARdk9kpIYlilOnNa2L0vsCcTAFX2evBE0BgwSqGp/1UgLrDZA+hZUTB GUf+CcVfCEowA== From: Dafna Hirschfeld To: iommu@lists.linux-foundation.org Cc: Dafna Hirschfeld , Joerg Roedel , Will Deacon , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support), kernel@collabora.com Subject: [PATCH 1/4] iommu/rockchip: replace 4 with sizeof(u32) Date: Sat, 4 Dec 2021 17:24:25 +0200 Message-Id: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211204_072447_418550_EA6C37EB X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org In log_iova, multiply by 4 is used to calculate the addresses. In other places in this driver, sizeof(u3) is used. So replace 4 with sizeof(u32) for consistency Signed-off-by: Dafna Hirschfeld --- drivers/iommu/rockchip-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 5cb260820eda..bd22d0a6eaf0 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -580,14 +580,14 @@ static void log_iova(struct rk_iommu *iommu, int index, dma_addr_t iova) mmu_dte_addr = rk_iommu_read(base, RK_MMU_DTE_ADDR); mmu_dte_addr_phys = rk_ops->dte_addr_phys(mmu_dte_addr); - dte_addr_phys = mmu_dte_addr_phys + (4 * dte_index); + dte_addr_phys = mmu_dte_addr_phys + sizeof(u32) * dte_index; dte_addr = phys_to_virt(dte_addr_phys); dte = *dte_addr; if (!rk_dte_is_pt_valid(dte)) goto print_it; - pte_addr_phys = rk_ops->pt_address(dte) + (pte_index * 4); + pte_addr_phys = rk_ops->pt_address(dte) + pte_index * sizeof(u32); pte_addr = phys_to_virt(pte_addr_phys); pte = *pte_addr; From patchwork Sat Dec 4 15:24:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 12656627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0FF3C433F5 for ; Sat, 4 Dec 2021 15:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oS4GPuB5v9GwZe/nUDQW5cqi3aSGwUWiTTn2PJclzTo=; b=NddLt/2lns6m+s vyXlIoY5cPxOgPEPB0QXS5ll2sCh4Cgu/8ntKB2eNmgtcjtGDAHRdrypFsjeHQqGGdRR+eaWnNexO paLvrlNZfXx8dD2Ee0z/T4TxC89YABBbmhLGFZotsm9ebBOUONlmBHJO64RO54v7sLCTZHz5R2rzU rwLolAIwdgWsjmKTN2lOrVkeFLMKiBs32Y6amAcl2czGqRLWNJf302yzyaj0r9juv5eL6bo1REjJr 2u0J+BgJuszqpEyieKJI2Jo0tlWX5JrRyByGqEIbZO45JMB5PJb3JApjiF/upPOCydJ9A6hiaMsRm TZbVwQG6R4K0ODIjA8Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWuU-000SUT-5H; Sat, 04 Dec 2021 15:25:10 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWu7-000SPt-40; Sat, 04 Dec 2021 15:24:48 +0000 Received: from localhost.localdomain (unknown [IPv6:2a00:c281:1409:4a00:6988:6ac4:851c:3f63]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 14BE31F45C02; Sat, 4 Dec 2021 15:24:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=collabora.com; s=mail; t=1638631483; bh=H8N9l6Mnl7wSw3Je5KLmnGKYDyH1sMJryKMaYLsbsV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OgiDW9mVSLkthGLSK+4bwSG829/yDcX9wj4K+eMdI6ExJeOYXGBTyhs/1ovr4/ETN 1DcL7rqArlDUVFNnT4dl0WKKATfhyZ3dQqMToJC+a7TgO1N/nDdafoF94EuzEt6cZf 9ADZDh9GSPDdlcxy5tL9NbAR8qPRfLsrAu3tVEtJ/eX2XO1g83HZiXgAU1jxOPvBJC ZJpc2K1Fb8F+1l4jOEAKX2nOgXGc0KKILfA2MGyH9jiG3ImayEEfMi5yWLm9DoEDcE wl/o+yCZyzTQ+9d5ARVm+CqYCG4gkrGYRtFv5taTH+G2gGjmWnsTcLr90D/EkHjlGs e4Aqij+/jjYqw== From: Dafna Hirschfeld To: iommu@lists.linux-foundation.org Cc: Dafna Hirschfeld , Joerg Roedel , Will Deacon , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support), kernel@collabora.com Subject: [PATCH 2/4] iommu/rockchip: remove redundant var dte_addr Date: Sat, 4 Dec 2021 17:24:26 +0200 Message-Id: <20211204152428.13899-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> References: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211204_072447_340015_E2BDC34F X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Using dte_addr as local var is redundant. Instead acces rk_domain->dt[dte_index] directly. Signed-off-by: Dafna Hirschfeld --- drivers/iommu/rockchip-iommu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index bd22d0a6eaf0..bd73cf9c54f5 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -744,7 +744,7 @@ static void rk_iommu_zap_iova_first_last(struct rk_iommu_domain *rk_domain, static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain, dma_addr_t iova) { - u32 *page_table, *dte_addr; + u32 *page_table; u32 dte_index, dte; phys_addr_t pt_phys; dma_addr_t pt_dma; @@ -752,8 +752,8 @@ static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain, assert_spin_locked(&rk_domain->dt_lock); dte_index = rk_iova_dte_index(iova); - dte_addr = &rk_domain->dt[dte_index]; - dte = *dte_addr; + dte = rk_domain->dt[dte_index]; + if (rk_dte_is_pt_valid(dte)) goto done; @@ -769,7 +769,7 @@ static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain, } dte = rk_ops->mk_dtentries(pt_dma); - *dte_addr = dte; + rk_domain->dt[dte_index] = dte; rk_table_flush(rk_domain, rk_domain->dt_dma + dte_index * sizeof(u32), 1); From patchwork Sat Dec 4 15:24:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 12656631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CCA2C433EF for ; Sat, 4 Dec 2021 15:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B8Co3WWSh5KCN3QKQRINbA+rKJ1hR921Ds2oG36ET0k=; b=hkb4SM74yPFBir 5Y8i5h8YFqRioTf8zagKpJlY5+QGim0UpfqSUM3sgJTuDSBvA99tLc2RQt9kOylFycOU5bYGrhohe D1rAJ63dhYlzx9GjGjqEsTUV8Uucauh6eKCLAw5cHbhzUSNlk7VA/PNe1NdogLwuPZYK+B6QOrYwV Ec04oDnIV8hlkMUQvrT9BVNeJBtpdolkk0yImEZIUjdNhGcdH4Bw7JflMaAucgZCvuODZJ0P63SpK netgpahimWZHiW35ImYotVbliSCPJZNsC1XYJilUnfeGPk2TquNv/e8xTa8xb0JJnHL5LHvFL4DUy Pe/O1cpTce1qlQL6nrRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWuq-000ScE-Hz; Sat, 04 Dec 2021 15:25:32 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWu7-000SPu-N4; Sat, 04 Dec 2021 15:24:49 +0000 Received: from localhost.localdomain (unknown [IPv6:2a00:c281:1409:4a00:6988:6ac4:851c:3f63]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 307051F45C0C; Sat, 4 Dec 2021 15:24:44 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=collabora.com; s=mail; t=1638631485; bh=9ICs/y4HUDZ5NV8MZBtkV53PWQ6+UIINUtCdzKskXtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4+QEALCIB7I8isBb8M+sZZTnmXTzAEHomEidsXLEP7XLjEkZVVeHjIEFa2ki6zRC hRajHtxBZJ8ON4fKVx/IW7W8vayTMySQO5nfl1Q4J0/HJoH3zurAE/aRZrf+KSG+jn KUIFloASV69am+tAedU114mhAu4PpaEqpVoxByO3hAk4vdKbLiT0MS5Jq6tNtcSdF0 h2E7h/cI3vN4g/XGN2vFHbxbIAONMYIeSCZEpNPu6YszHXlzG3THlu5mBqIQFd1OeC 9eqmmabmZZMOEB+JqhBsQ6VdWPacG7MpQSo7IxvzlWn2ZED4v567A+KBr+i1feMKtk PQ42R1SZFtZmA== From: Dafna Hirschfeld To: iommu@lists.linux-foundation.org Cc: Dafna Hirschfeld , Joerg Roedel , Will Deacon , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support), kernel@collabora.com Subject: [PATCH 3/4] iommu/rockchip: rename dte_index to dte Date: Sat, 4 Dec 2021 17:24:27 +0200 Message-Id: <20211204152428.13899-3-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> References: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211204_072447_921446_F08AADB9 X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org In rk_iommu_map, the var dte_index is actually set to the dte and not to the dte index. Rename it. Signed-off-by: Dafna Hirschfeld --- drivers/iommu/rockchip-iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index bd73cf9c54f5..ba60f0faafcc 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -852,7 +852,7 @@ static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova, unsigned long flags; dma_addr_t pte_dma, iova = (dma_addr_t)_iova; u32 *page_table, *pte_addr; - u32 dte_index, pte_index; + u32 dte, pte_index; int ret; spin_lock_irqsave(&rk_domain->dt_lock, flags); @@ -870,11 +870,11 @@ static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova, return PTR_ERR(page_table); } - dte_index = rk_domain->dt[rk_iova_dte_index(iova)]; + dte = rk_domain->dt[rk_iova_dte_index(iova)]; pte_index = rk_iova_pte_index(iova); pte_addr = &page_table[pte_index]; - pte_dma = rk_ops->pt_address(dte_index) + pte_index * sizeof(u32); + pte_dma = rk_ops->pt_address(dte) + pte_index * sizeof(u32); ret = rk_iommu_map_iova(rk_domain, pte_addr, pte_dma, iova, paddr, size, prot); From patchwork Sat Dec 4 15:24:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 12656625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7ED1EC433EF for ; Sat, 4 Dec 2021 15:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KMx6l34i0bv/Koj1PKbIcR3AfGVpT48YpzbcW93S1P0=; b=MvVb8jEsKS6HW4 JuQdYBNenMVJUuJ8Q7PqIV+tBgWPeM2kRNsdhVsNHjgRV7dz5tR8YkzG3NGVphQ+H1GxgAkU9dc7M z7rvY+G2ab6+DwZLcRWGsuYmlbI4GqD2Vlxk+aQBQvTo0XslV6+lUIujTIJ0CB2Zh3e1t1uEtNcA5 xZVpXmVR4Kjv7VHMGFwtFZvuj58OPjYaCI6mvBM1vZwcWGCuAigA0UGl5Q2hWrDgclZCyX3W4DsYS XO5VwRwGMXu/f0UzYL/U680GnfjeU33lu+nuyr6aUbzV66rW6iPlWHQyytw0upy7sxODLUCP2n8dG j1NfDch20rzfVQVC+toA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWuT-000SUO-Kn; Sat, 04 Dec 2021 15:25:09 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWu7-000SPv-6T; Sat, 04 Dec 2021 15:24:48 +0000 Received: from localhost.localdomain (unknown [IPv6:2a00:c281:1409:4a00:6988:6ac4:851c:3f63]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 460EA1F45C18; Sat, 4 Dec 2021 15:24:45 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=collabora.com; s=mail; t=1638631486; bh=TJgzJWHgw20tjqwBYUENEs/cvyV4mlypJvEi9jBKaRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e067vp0TClN94lPv74YYkPxc3aJT8AuIVEJcLUyrKR3Uo2YPLVtDyr/L3fwFknt4D AeqlioS5PIbkAAhpQ7mKZbUMc26C1r9PUxQnqsAvUX67T2zoKO9lcsgWdc4PFaja28 75VlAx2/R0Z9Tg3s9wHv7eNCVtDoGtM8Ill7VlDnzlkAB3EFB5rUUZjAj8s+lMXHM/ 5/ovMpVlhmIPIT9HyKBSWmNLtyV6Oo5e4EWjSSTCw2oPVjQpFkEAzZidZT5X8utAy2 WB1yZN6kQxBY3uZwgGmug84KoEN49gkPdMIDu6kjThfc+1N3bV5b9Q5ShQpRs/Rpx8 zZ93RcUzgB+ow== From: Dafna Hirschfeld To: iommu@lists.linux-foundation.org Cc: Dafna Hirschfeld , Joerg Roedel , Will Deacon , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support), kernel@collabora.com Subject: [PATCH 4/4] iommu/rockchip: replace pt_address cb with dma_addr_dte when setting dt addr Date: Sat, 4 Dec 2021 17:24:28 +0200 Message-Id: <20211204152428.13899-4-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> References: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211204_072447_391279_91487C64 X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The dt address is calculated using the dma_addr_dte cb. So when setting the dt address to the DTE_ADDR_DUMMY that cb should be used instead of pt_address. Signed-off-by: Dafna Hirschfeld --- drivers/iommu/rockchip-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index ba60f0faafcc..013f7608a2e6 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -510,7 +510,7 @@ static int rk_iommu_force_reset(struct rk_iommu *iommu) * and verifying that upper 5 nybbles are read back. */ for (i = 0; i < iommu->num_mmu; i++) { - dte_addr = rk_ops->pt_address(DTE_ADDR_DUMMY); + dte_addr = rk_ops->dma_addr_dte(DTE_ADDR_DUMMY); rk_iommu_write(iommu->bases[i], RK_MMU_DTE_ADDR, dte_addr); if (dte_addr != rk_iommu_read(iommu->bases[i], RK_MMU_DTE_ADDR)) {