From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56489606A330 for ; Sat, 5 Dec 2026 02:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=yJ+n7tyt; dkim=fail reason="signature verification failed" (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.a=rsa-sha256 header.s=default header.b=h56TofR5 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-Unsubscribe-Post:List-Owner; bh=+PGPbKaSFmgz852v6QONy6hDolWjWjAcgU0UjubmCBg=; b=yJ+n7tytgx14kEZTAudQ9u8K/I yfwZbYW1wtRZ1jnV8awMhHKvyL6Gp+iZMmG33cpqHYU1pME8cvcXXauwz+KBPPKybYKZoYz+xf5V/ gTQkk96WW63n63r0hx5HJHwsr2s46q+tRZqvhl9SX8lgGpnYh1LhqqSGT5PMPQ9znxTn7rbQCG936 fn7i4Ic3s4GgMNlDpZMG0/KmJwu6LHFLZBEphQNRmL2vtxqHqaiLxkrQr+GFKcSkEah/BJrnex3xG +B1dWQMGjC5iwK/aE0AciwTeDKwkp09TgErf6Ap6QHZWI+hMBn2HXXYM7hGr+QS04v0CiipyemNea v9TIGrpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZfNC-00000001tlp-1nsN; Sat, 05 Dec 2026 02:19:38 +0000 Received: from mail-m82234.xmail.ntesmail.com ([156.224.82.234]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZfN1-00000001tjz-3OzC; Sat, 05 Dec 2026 02:19:33 +0000 Received: from [172.16.12.90] (unknown [61.154.14.86]) by smtp.qiye.163.com (Hmail) with ESMTP id 6fce62210; Sat, 5 Dec 2026 10:19:09 +0800 (GMT+08:00) Message-ID: <480259ce-4971-45d4-b34e-e8b5a8e6ee29@rock-chips.com> Date: Sat, 5 Dec 2026 10:19:07 +0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 3/3] drm/rockchip: Map the reserved regions 1:1 in the DRM IOMMU domain To: Robin Murphy , Francesco Saverio Pavone Cc: Joerg Roedel , Will Deacon , Sandy Huang , Heiko Stuebner , Andy Yan , Damon Ding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiaxing Hu , iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org References: <20261204153227.7794-1-pavone.lawyer@gmail.com> Content-Language: en-US From: Chaoyi Chen In-Reply-To: X-HM-Tid: 0aa243ff87ec03a7kunmba5229301f6d88 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlCTkwZVkkfTRlMGUpJSU9JTVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlNSlVKTk9VSk9VQ01ZV1kWGg8SFR0UWUFZT0tIVUpLSE pKQk1VSktLVUpCWQY+ DKIM-Signature: a=rsa-sha256; b=h56TofR5Z8QAWLPISpQQeZGGMmPekI2RnJykBkFRyg/NJwBCO01h62iTtLV+bBzfWC5yxWgNY7Bm4HZG65FNwTYorR7YSbVS9v4v7fF372bkzaafe2CB+LoQKx99fOs31AN9K7kHq1H/IXqk+T2vSDgAaAADBt0CV9bFSZbK19E=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=j+UwdBM8gYnju1/iVyDnGC23heGs9r1JBoonuAoC/OI=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_181931_323595_9A3A8958 X-CRM114-Status: GOOD ( 19.54 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi, On 12/5/2026 1:14 AM, Robin Murphy wrote: > On 04/12/2026 3:32 pm, Francesco Saverio Pavone wrote: >> Hi Robin, >> >> On 2026-12-04 12:00, Robin Murphy wrote: >>> If you reach the point of creating private abstractions of entire >>> IOMMU API concepts inside a DRM driver, you should probably stop and >>> think "Why aren't other drivers doing this?" >> >> Thank you. That was blunt, and it was right. I went and looked: no >> driver outside drivers/iommu walks the reserved regions the way my >> patch does. > > Heh, sometimes it's hard to see the wood for the trees when you're working backwards from one very specific symptom of a larger issue. > >> I am withdrawing the series. >> >> The driver already does the standard takeover. I think the real gap >> is smaller: the VOP2 is not stopped before it is attached to the >> IOMMU domain, while the older VOP driver resets itself first. I will >> look at that instead, and only send something if it removes the >> faults on my board. > > I don't doubt that both the IOMMU driver and the VOP drivers might need a bit of smoothing out to make this properly work, it's just one of those scenarios where I'm almost certain that taking a step back to do things the "right" way will end up being easier. > > And that's not to say that this "minimal glitch" approach of pre-mapping the initial framebuffer prior to attaching the domain (and ideally unmapping it again as soon as we're sure it's out of use) isn't still potentially worth exploring, just that I'd hope we could pull the relevant config straight out of the VOP registers, or at worst add a DRM-appropriate way to query any existing sysfb aperture. But yeah, if just stopping the thing for the duration of driver registration is good enough for now, even simpler! > Yes, this depends largely on what we are trying to achieve. If we merely want to eliminate the IOMMU warnings, then resetting the hardware before attach, or stopping the DMA, would easily accomplish that. But if we want the display to remain completely continuous throughout the entire boot process and to transition smoothly from IOMMU disabled to IOMMU enabled, then it may require more effort. I saw some interesting examples: - Exynos uses a default domain. - Msm mdp4/mdp5 disable display before attaching IOMMU. - i915 wraps the reserved region as a GEM object (DRM framebuffer) and displays it. If we adopt an i915-style takeover, perhaps we need to do the following: { rockchip_gem_alloc_object() /* alloc object */ drm_mm_reserve_node() /* optional? reserve old iova */ iommu_map_sgtable() /* map old iova to new GEM */ /* copy old fb data to new GEM */ } /* Now iova is in private domain */ rockchip_drm_dma_attach_device() /* IOMMU take over! */ /* after userspace take over */ { iommu_unmap(); drm_mm_remove_node(); drm_gem_object_put(); } This looks more like something done in the DRM world. Robin, what do you think of this? Thank you. > Cheers, > Robin. -- Best, Chaoyi _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip