From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796366916; b=SZfFkbeBWMOQWzpe7YoEWn69aadc1bYOWOB8VwMjMQ62p2UTI9yyNh5cONnro9jy75iz YboINHQZs+dHQSaYcMwXm/wqSwaZAP2Aima1M0AXpZAGv6QVrfLleWlSiw8vURLv737qQ tm1JqB8B4gwLhJGNhaffFNgbRwZAByzg97rjtvazBecJ48dPPxHt5SgCmYo+bW+rM8MqS oJXlI97A4gOhEs8cPmQxXWCvu3rRhi97h0XNwixUX79j9pITSAc/uiHO4hKgSxxjMx2y0 5/UZ2nQ11/wltXeV+8C8XZvepylEmrJc5P1NefttpWQy+m9CdFNtjsUQ/Y/elcXEwCg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796366916; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=18mCg6V7rhfRyLe7GIsrs31cS1lJg6nQLam+lIxG36c=; b=B+2hECYnjRA42/gPOjh3nBXsfW9XsKHVWcnQoMwq65YRwDtJl+UAeqTsfos5N7ZzBj4C oBs9owJ6B347KmgjO87DuP2FZ2VeRCN60IhNKrWeGTdSkKy5vb9rJxJcbUbBnqUqA3nEK FiNRjAhtgLXOVXgg4Vu5yoAqdG145aXJP3wUuMFdSNaVtXa8rLCvU1B13mxmqp5mcd95G ugPLTIKUEspeyrdVa4v6hMwlU+0cDa3I9CvmZ9kuSl2umuuqLkcq+F3f6Q/TaCELe6R76 lQ7TT8F3NikCz4lAklaWyqsllI3HTVWk2UkDjuDw2Xp24auN3iO7eqzCOeeWmVzVpTA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AV8iqo6a; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DA9A606A32C for ; Fri, 4 Dec 2026 06:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AV8iqo6a Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B2B11F00934; Fri, 4 Dec 2026 06:48:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796366915; bh=18mCg6V7rhfRyLe7GIsrs31cS1lJg6nQLam+lIxG36c=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=AV8iqo6aOLp69SYuFvedCFDLEOusoJH3gNBpvEKL0vzrI58rKc9Fu9PTw3OjocU3M dWQVVaV16AuyVSyAG+GXXyI7/2bGMkOJSGLgHQOSzIo/oYBFjpE+KlskWOf/kIdKZ9 WsNFDYFguaTxC5TmiDKBLNlR/AiZazwnlwHFSxLRxt+GTDuR4LFrx5AxK5aooSheoS ZVWgy140ibXHK3Q4KH61/LUCCuve6TOeRWPRMxRkhxQsbcyBZ3rlVDaqi0bxXW1rAT qodnRTczN5b7cA8K6jHD9nZWU60IYPdPH/Svv/7q2Z1rlNXaflTBZGVhCPkMcerKUF URESgQM+gaJ6w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH 3/3] drm/rockchip: Map the reserved regions 1:1 in the DRM IOMMU domain Reply-To: sashiko-reviews@lists.linux.dev To: "Francesco Saverio Pavone" Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <43f9ba0b26794fc58762d4e3188796fbf92becd2.1796334467.git.pavone.lawyer@gmail.com> References: <43f9ba0b26794fc58762d4e3188796fbf92becd2.1796334467.git.pavone.lawyer@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 06:48:35 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/rockchip: rockchip_drm_collect_resv_regions() ignores IOMMU_RESV_RESERVED -- commit 7e781ea37d24b597e54bf98cdf417ce94c06861d Author: Francesco Saverio Pavone drm/rockchip: Map the reserved regions 1:1 in the DRM IOMMU domain This commit collects direct-mapped IOMMU reserved regions from bound VOP devices, maps them 1:1 in the DRM IOMMU domain, and reserves their IOVA ranges in private->mm. > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/dr= m/rockchip/rockchip_drm_drv.c > index ba417f7e9e474..aed22787c05e2 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > @@ -88,6 +88,121 @@ void rockchip_drm_dma_detach_device(struct drm_device= *drm_dev, [ ... ] > +static void rockchip_drm_collect_resv_regions(struct drm_device *drm_dev, > + struct device *dev) > +{ > + struct rockchip_drm_private *private =3D drm_dev->dev_private; > + struct iommu_resv_region *region; > + struct rockchip_drm_resv *resv; > + LIST_HEAD(regions); > + > + iommu_get_resv_regions(dev, ®ions); > + > + list_for_each_entry(region, ®ions, list) { > + if (region->type !=3D IOMMU_RESV_DIRECT && > + region->type !=3D IOMMU_RESV_DIRECT_RELAXABLE) > + continue; [Severity: Medium] Should rockchip_drm_collect_resv_regions() also record IOMMU_RESV_RESERVED regions instead of skipping them? Commit "iommu/rockchip: Report the reserved regions from the devicetree" wires of_iommu_get_resv_regions() into rk_iommu_ops, which emits IOMMU_RESV_RESERVED for an iommu-addresses memory-region without a reg property. Dropping those regions leaves them unreserved in private->mm, so rockchip_gem_iommu_map() can allocate and map GEM buffer IOVAs inside ranges that the IOMMU API contract forbids mapping. Reserving IOMMU_RESV_RESERVED ranges in private->mm (and removing them on teardown) without calling iommu_map() or iommu_unmap() would avoid handing out those IOVAs. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796334467.gi= t.pavone.lawyer@gmail.com?part=3D3