From mboxrd@z Thu Jan 1 00:00:00 1970 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 638A1C6FD1C for ; Wed, 22 Mar 2023 09:03:13 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tH8PKrghcFqZ3NO/RJ/4TjcHi09lEtT+jr16qzkQJUw=; b=djKEkAboJIPVtW 0d+BXuza9PCmy0ZClxZYyZa+ZJCSpdFa5XWIqk10U6zFBP8f1Km1cmX1N2gIhbODHzm6E+okC0MXE s519uxzpNxTwvNyi3PQ6jR2NqqaF66TSDCl2AcW/hJWD9FZzr0HofBetg2/1gasshDodcVJUdCp9j fICI8F5oBvLKZGaTHtBJKTpxOioUPuaWyLS7oIwYg5q5eokCevorMTrmcYycpRZahPH8nV13ygTqF diittKbMUsyp/VsqaaFNON42UmMgaLQKr2Zg5Of26t433Ai1Yj6EZOxVWKK2iZnqLsIFHpKm/ez59 8wsOWVJTUkAMp/mRXXkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peuMy-00FHc4-1V; Wed, 22 Mar 2023 09:02:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peuMu-00FHZa-0O; Wed, 22 Mar 2023 09:02:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 35B324B3; Wed, 22 Mar 2023 02:03:30 -0700 (PDT) Received: from [10.57.53.137] (unknown [10.57.53.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 40A923F6C4; Wed, 22 Mar 2023 02:02:44 -0700 (PDT) Message-ID: <85607806-b888-2d5e-67a4-e9d63ebd1976@arm.com> Date: Wed, 22 Mar 2023 09:02:41 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] iommu/rockchip: Add missing set_platform_dma_ops callback To: Jason Gunthorpe Cc: Heiko Stuebner , Joerg Roedel , Will Deacon , Robin Murphy , iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Lu Baolu References: <20230315164152.333251-1-steven.price@arm.com> Content-Language: en-GB From: Steven Price In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230322_020252_206838_41F99412 X-CRM114-Status: GOOD ( 14.76 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 21/03/2023 14:38, Jason Gunthorpe wrote: > On Wed, Mar 15, 2023 at 04:41:52PM +0000, Steven Price wrote: >> Similar to exynos, we need a set_platform_dma_ops() callback for proper >> operation on ARM 32 bit after recent changes in the IOMMU framework >> (detach ops removal). >> >> Fixes: c1fe9119ee70 ("iommu: Add set_platform_dma_ops callbacks") >> Signed-off-by: Steven Price >> --- >> This fixes a splat I was seeing on a Firefly-RK3288, more details here: >> https://lore.kernel.org/all/26a5d1b8-40b3-b1e4-bc85-740409c26838@arm.com/ > > Reviewed-by: Jason Gunthorpe Thanks for the review. > Do you know what state the iommu is left in after > rk_iommu_detach_device()? Ie is it blocking DMA or doing identity or > something else? To be honest I really don't know for sure. But from my small understanding of the code: rk_iommu_detach_device() ends up in rk_iommu_disable_paging() which appears to switch to identity mode ("Disable memory translation"). But I don't actually have any familiarity with the hardware block, so I might be missing something. Steve _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip