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 A121F606A31C for ; Mon, 30 Nov 2026 11:13:53 +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=3RD76iz5; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lytHLufc DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type: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=Zz5icKJdSOg7K3/EAQbeXYNq8TynY/a0+TrFc4xiUZc=; b=3RD76iz5lYYmjv P+gNk58/vzDhnA1WYVIKDXeIP8OzJ8lCOKCkIgIbzkzdtzvd2SNRZIznqRhtrbrX/G/qwZa05N1Jy k4R6iPub//WgBNZnS/S407Xbair5H0eNOObahpwKZfT3n0ybtuFzVuaoDNY/0khMk5OZyxaekMfcw D20DunRdJL5cOb6CM0WYysYh8BNdlTrQNm/wUuCgyCtCaUkWEhdmqzygRsRG9PFLSxHiu359H3EBT Q9ZF3dGWqpicbM8C6MMNgbWaWtyF7XO/gJVtg2sm7aSZA9NdkovwHMELsn1K44TugTSaNkFk4hso6 FpUjscKyug7obhw+Lu1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXzKN-00000004Hh7-20I1; Mon, 30 Nov 2026 11:13:47 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXzKK-00000004Hft-02lf for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 11:13:45 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-4a2f4ca0dcfso5986641f8f.1 for ; Mon, 30 Nov 2026 03:13:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796037222; x=1796642022; darn=lists.infradead.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=Zz5icKJdSOg7K3/EAQbeXYNq8TynY/a0+TrFc4xiUZc=; b=lytHLufcUVPZ+SLH/zUDNWHbNp7jCW4k0M6e0FgsGwwrFSBkVL7z0Y8D1H9McvRueC As8/LNaFVnQFFGV0CeKxPLmnXGn5vp5mcQ9x4XrTZgr40iJMeotS7TE6oiUFuOMCDV0C aUOnKQjxgd6i9h78RGS4kQl5f5C94j60Zo9B5QvwXgefXFguI77K469OZvIIR9cDTyGJ vjukv/XvEkLM8mi5OxXtfizmJxjJPiCblxkGQaewiulctMGRweUvnQyfapy7DhJwE0xw yukhgnBs0/J02mxUnD8gs39sYrkj0ZaAQP8UsmKoSrLB4yEqiDk0ZLqIvfYBZNH/Rtb/ VAvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796037222; x=1796642022; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Zz5icKJdSOg7K3/EAQbeXYNq8TynY/a0+TrFc4xiUZc=; b=bdESfMPdROVy6K+relvniEzNRAev689Lb+h5ucHEWL7BntxBWYecrxvpJZD9m+2nY0 QRBLh44kchY1Dia/fkQcC7LlKXKvULpbRaIL1gbT5pWkMUa/WRbZHUIs6bHCgqOQQBwg vFI6irwHA48CF14cY2UhsSytkJj7QJtDnt2ksPECDo8K8xBIVV21A4aQmtGixv+JOWQL vaRbdH9Zi4KqK1uLf5GtBeooqyQU0TtBh4hpHbbKs4rsC8yqM/km9LvwxY7OWdZr4vb7 09ii05PdfRR1mAYPlXouYKMT0Z1iB5GIY2T2Tny6/HpAC49Rt2GDuPawV1JJFnoJkSgX hCUA== X-Forwarded-Encrypted: i=1; AL+hErE90jubloifb9BEX3IeaqBmnwQaZAvmsBvH8YcWtG2dj4MCQyzaXMdNHrgM+2o0usby4XM24AsmeZsWpyZafH5x@lists.infradead.org X-Gm-Message-State: APuU4Z8XnFPJJkY1td1VBnIhi5rPExOFmituO+1tuFw25NslD/sDYl1D D4adZH6PVg9mCe8c7So1GNzV/yic6hdk3ZFukpDmA/ZWosGGqFZnIy8= X-Gm-Gg: AZFdTZfgsgVSLh/SNftErqLCkjp2/r7JuF6AdPIUvnW5b/2mUEoF+RoEYSekPkObs/D Qrpou93wvnL9Zf3SEFJAMc+wfHiJRMzsyRx1nJ6LBQNVFEq6jzJPbFMC/hPCNV0nhnCob4s6NRU ftityoU2BMx9qqysJquyrnTT32rfbCEEwWoWkktfj4ZBpITfashCU1NDhAjYRPi+iMmknc7fofV OAe3cNYJ5CMtD/c4qZ7bYS7l+nWu9IP7JFyEblxa6+ywADumUWCelSSGsenhrxK8iGwDgBU0YLw t7jOYVCpCFhhpX2mrS7DFiiMOjAr3kelcKOzkH5MwZ2vBwnSoW86yOBNSnl2GaVYkazoVdnV+RJ Rnds7TsxweZfA0tXLs3EApr0HihhgWUKyXyVFjV7FR2oVdqUIi5cn30Dk2OYJnQmD563Bl5pqQa 6FBnYbUgHxS77FXOd0G12yGMOxWhSFcCyQveFxNTlEY0dMg1Yc0P+W1odoKtpvShsN/UGjxL4EX GVUZy1zq6/Uw/hnuMlCPTbCYdB7HJkdFZkcTTfhUP7Vcc8Zv/N+Egtd4GYe6G448pX6u1KdQ+s5 GnNzPyfamuKK6D4l+KRbuh+h/tnjg9EOg7d6tezEWTrAP/lYfQC2851Z6gjV926j4uxLkAtVZSv LGS/eyA== X-Received: by 2002:a05:6000:1a8f:b0:499:978:251a with SMTP id ffacd0b85a97d-4abb5db73d6mr67750701f8f.54.1796037222011; Mon, 30 Nov 2026 03:13:42 -0800 (PST) Received: from smtpclient.apple ([151.35.252.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6c61e53asm70131340f8f.59.2026.11.30.03.13.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2026 03:13:41 -0800 (PST) Content-Type: text/plain; charset=us-ascii X-Archived-By: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3901.200.71.1.16\)) Subject: Re: rk3588: VOP IOMMU faults at boot while the firmware window is on From: Francesco Saverio Pavone In-Reply-To: <20261130020431.487169-1-gahing@gahingwoo.com> Date: Mon, 30 Nov 2026 12:13:29 +0100 Cc: Joerg Roedel , Will Deacon , Robin Murphy , Heiko Stuebner , Sandy Huang , Andy Yan , Damon Ding , Jagan Teki , Lucas Tanure , Sebastian Reichel , Cristian Ciocaltea , iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Message-Id: <9FA73405-B940-488F-8070-8243C3FC012A@gmail.com> References: <16FDB47B-9986-417E-B081-89A381BE9411@gmail.com> <20261129100436.290926-1-gahing@gahingwoo.com> <47C82988-469A-4998-97EE-1D7E770C4EFB@gmail.com> <1c5a8286-d61f-4c7c-b2ff-33aac9018abe@rock-chips.com> <20261130020431.487169-1-gahing@gahingwoo.com> To: Jiaxing Hu , Chaoyi Chen X-Mailer: Apple Mail (2.3901.200.71.1.16) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_031344_759420_6E3605EB X-CRM114-Status: GOOD ( 25.24 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 Chaoyi, Jiaxing, Chaoyi wrote: > Why not just use iommu_map() to establish a 1:1 mapping? I tried that on the ROCK 5B+ with v7.4-rc4. It gets rid of the errors here, but it takes two mappings. The stall timeouts at 0.23 s come before the DRM driver has a domain. The VOP is in the default DMA domain by then. So there are two changes: 1. rockchip-iommu: .get_resv_regions = iommu_dma_get_resv_regions, so the core maps into the default domain a reserved-memory region that the VOP points at with memory-region and that names the VOP in iommu-addresses; 2. rockchip_drm_init_iommu(): map the same direct regions 1:1 in the DRM domain and reserve them in the drm_mm, before the first attach. To test them I added a node for the EDK2 buffer to the board DTS by hand (0xe6810000, 2560x1440x4). Boots with rk_iommu errors: fbdev client off fbdev client on plain v7.4-rc4 10 of 10 - 1+2, node removed 7 of 8 - 1 only, node 0 of 2 2 of 2 1+2, node 0 of 6 0 of 2 "Client off" is drm_client_lib.active=, where the first modeset is the compositor's. With the client on and only patch 1, the timeouts at 0.23 s are gone, but the VOP faults on the firmware buffer at the fbdev modeset, 0.39 to 0.40 s: rk_iommu fdd97e00.iommu: Page fault at 0x00000000e6810400 of type read and again at 14 to 15 s, together with the two timeouts. So the second mapping is needed, and the window is still being read long after the first modeset. I have not looked at why patch 1 alone is enough with the client off, and I do not know why one of the eight boots without the node was clean. With the node and both patches the picture stayed on the TV through the boot, with no black screen. Jiaxing wrote: > On EFI boots the address would have to come from screen_info As far as I can tell there is none to read on this board. It boots EDK2, then GRUB with a DTB loaded by GRUB, and no efifb or simpledrm comes up, with the TV on or off. I have not found out why. So here the node would have to be written by the firmware, and I only know the address for this one mode. > the 1:1 mapping has to outlive the initial modeset I keep it until the domain is freed. Still open: the VOP bindings do not allow memory-region; with IOMMU_DMA=n (32-bit ARM) both changes do nothing; and only the first VOP is asked for its regions, which is wrong for RK3399. If this is the direction you want, I can fix those and send the two as an RFC with a binding patch. I have not tested with the clk sync_state series. The two patches were written with Claude (Anthropic). I ran the boots above on my board and checked the logs quoted here. Francesco