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: 12694772 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 DA115C433F5 for ; Sat, 4 Dec 2021 15:26:31 +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=6TtdblrXaUA78TSvNJWnBekAMZQeErTDUIcnXo1SZR4=; b=wxoaWhpOgvdy4K 3EbTbHgnyuSDzQhQdp3WV/r28D0IJpkXcQ7tCVJhPxnQu/HFvpDYa2MuqKPK9RlrF8foRNfPssD+V eXMtaXJimUeHAUhpqiyj10Od5Yx5YZh5Z6h/yMpF/anAdN6nAJInneZS/XALi4IlNq4lhuNI/scJ2 ErCqNtn/SxXJ9CLGjFiwhdVAkSr3fG+ESd068kgndogDBEBAG9a6TIiubyNw1OZWkTDT/Ohn8mS8z ZDwuB8Nr3o+05ov/dYt0GP7tZ0zPxXFtJ227lRARotqyIyWo8KZA7TrpXcdNyXRaSFV29PaO1GQ5/ lTgZkCfbmK2gPzdKLGPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWuV-000SUb-JP; Sat, 04 Dec 2021 15:25:11 +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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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: 12694771 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 151B2C433EF for ; Sat, 4 Dec 2021 15:26:31 +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=TIXBVDhQl9vbG8Z+NSds4sazWWMAQxWiY69lP9Fa9Sk=; b=kaIxSxt6MI7VyQ BismjEHgHvaXIS5BZ4To820nyr00VrVREP8ycr8VFBAHQ4J9Khl80K7w1cKlz9HfWz7XKZYN5hgAR JjJMoeVvhx6HMGwdOvLED42sexfDgSSKjW5hLRlpBXlQNYNlOl7xYaa1CyemPpJVGytQAGIUZGbNY m5hcMEO+5R54aBYk7rjW7RvZok4aKegSKkEXNHvM260qoo1nDFbzsQWRlHiW/sSP/fRk2ON8+TJV6 qZWlka7cHgPZ8kqEu3IQXeMNLlhpipM9uP/yCkf7G3gohvEBpWZbU69o6l4WqmBu5eh7C4d4Rj2vc B1KLlCvJqyvbbt3wVBFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWuK-000ST2-RM; Sat, 04 Dec 2021 15:25:00 +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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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: 12694774 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 81B3FC433EF for ; Sat, 4 Dec 2021 15:26:46 +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=g+8OHu7HdIOn1leOMwbNBBQSddHnn3MxWmmLfNvx59E=; b=1g1pNxB8eljNyM GCpIHbkBW3rJZZurTRLHfplIoMtV6bFG8Fcllcr3fsG3yBij62pqEN007V0dTglqQ18mFlAYCkqWK UByE1h4PtJS5nUMNtnBjPH1m/MNYcf+aWA7w8AzhOkLCk+01o5WhQgUJDzsH83L9IWj3bwHngp9KN 0gXlq/6nzsNqanRYFlmRHSQvbBFSp6sV4NOnr4brQcBClEXt6jdwUQdaz70Gl3do/TKtHR9QZW1ma wgI+/ZLRMuKasgUivRFXVEyWn5/NChwudJsBfl0HxLQ1Tckf2rxgSnZoBrTBYAd1tC+QdiNRNNAma FzrGSUVTf07m08QQW1kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWug-000SXS-Ba; Sat, 04 Dec 2021 15:25:22 +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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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: 12694773 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 6261AC433EF for ; Sat, 4 Dec 2021 15:26:33 +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=HKnv4VQswhpguzxerPCjDJAO7txp87Tfa6lMIIPFves=; b=MTLfRX2pxkotAC leBeiMEDRo0/ReQ8gRBBPQYRluOSyhNYNDGB9SWqe1tVge2kaQUT/u4ydVet4HOLhWr3BC4F9SG3c hOhN7OtiB9lqqKbBLVsdTI9+oseJlOEd+1/PP6hYb2TVkBPV3QkQXGdpshkOdVrV//K6TefM7S/lF XIYzmXpWuXbGHTj6ax1DzWrGufm86j7LEi6K0ZocwoJBCFEhM0N+ncotmuYqSQpyAAs1U30H144u3 BmL7PG2k0/yg7PE04BN4ilmZcL7lxRD7fhhXQrlTA2M6QwlzTQ3dyqWcsfFuqejP7zH1sFeor1EOZ 8WrZUdzZtPlfgMEWCpNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWuB-000SRL-1b; Sat, 04 Dec 2021 15:24:51 +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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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)) {