Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1339178lqj; Mon, 3 Jun 2024 19:55:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGjNGiWlVwkEKIs4p8Y+S9ZIpAa/gesaGE0CeWt9ZKe3Gl/9LRDSRUrC5V39rZNP2x9P8cgyfP7E0GApa7tA+2hRdajB6u+Qzh62Pqjg== X-Google-Smtp-Source: AGHT+IFmOUCx+Puz7LRC2F4930wFqpbs98snZKrfDZ+pcB7HS8HN0/hCdKo3syoz4t1DsIHV+lK1 X-Received: by 2002:a05:6a20:8409:b0:1af:b0d0:281 with SMTP id adf61e73a8af0-1b26f16ea78mr12858426637.6.1717469741411; Mon, 03 Jun 2024 19:55:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717469741; cv=pass; d=google.com; s=arc-20160816; b=S3KSw5PUBzhoinQNyBLp2mHTYe6K+IKQhyer3cpzOGuxlwIYcZWeYMj5nPsccikzOB pHi/rNw2Kp3ePV3KMCd4hLccmJJXWcwMzqzOLL1j9oOhOk8c2AlZPxV64Ofw0pYMKDAQ 0WESaaFDDABZ3XkhctGJCy8tuv/m+rb3bPD81ywhDxM/+1Bew5R8wII8evPnQbzVY8f6 B8GnLWT49dyzMijAck2hf778eIDE9h1LM+L4BeLNgFmDwJBK7M1HBYbF0fTrFPILtEk+ MsjixdKNwW2NbnMnravTZLGFiy5OOH/plzOgij5V3fVWw44QiNNIo0QGrXaoFgRlTJia gsKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=B8xo9fI7Hnp8L4pRiYaelnAUj51huFWgQRALBrrxqcU=; fh=u7VIfotmvhCnFPKh0R845OAh004BwcT1TGiZ1dQEGzo=; b=tc52B6tWpPkXSkzUZsX5el7pg8vuXP8cwppuACt+VO/ATer+pCfdGBuTydkezxZBVj 6yFpOIgp+7ywFX6KN87j6OpIHLfsIdrYawER/HqSGjjxOLmVrKk9i3MPGPcHzW3Ga5AX g8Au8wn0g7Mof/uaZ5STlgIUBBVLyiXJ2PARQvr17O0LJE51r/J6x8bNFrHmydO1FwrW GrzizH9wd3j/tOoref5eXhYJHIuyRkOAulCSpK8LjdsqW0Zt3+GD32ArvlSy8xJW3Fbz zdWYhzYkUCTP3kkxcOiIaSPW+QZYGAmUIgiXMkCyDLy5kLbeYUz9jiAcEEYWbvZE/jPN a7pQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rlr5wSER; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-199936-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199936-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233d011si74378435ad.23.2024.06.03.19.55.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 19:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199936-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rlr5wSER; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-199936-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199936-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 57B23B260D1 for ; Tue, 4 Jun 2024 01:58:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A8621428EF; Tue, 4 Jun 2024 01:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Rlr5wSER" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55DF213D62A for ; Tue, 4 Jun 2024 01:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717466131; cv=none; b=ukAxNOVaG33Spu0XNdtumNB4E4/6pzyWbfEyPvv6mB8ey1zr0J30EKwUo/87McjZ7KJoL55Euq45Dgdb14SqfBXY7Ubg6gcihXky3MW0nuNIHaIl3BvQt7Uq77QU5QlITSHfmkmpz8lXVvNEj+Kpk3NbRHitVa45gCAJUYNuIF4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717466131; c=relaxed/simple; bh=2RzKLZKa9aMbeh8zX7gRXSDK8Hv/vXOsjqYlhYXqS5Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eQAJUiazOzQHsh+Rq0Eq08452QYWy276TWePS506RYNhJlf65JZezThn6lR1IO+45k2+E1lhzH64R2pgj6f+r2bSZtFrxTi2W3gzC10hn2q9kW9z7mI17T2nUrsoh4pXZ44tCkZeMKBhqFbxTXnfbkmViRpyU1/QlxSYffZhRmg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Rlr5wSER; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717466130; x=1749002130; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2RzKLZKa9aMbeh8zX7gRXSDK8Hv/vXOsjqYlhYXqS5Y=; b=Rlr5wSERCUw83JfXhbs+Omrm4rtb/+gcPRz0hO3x0ZF1YrKqkerdTWqp gPUnZSeQ9jHmszYUsCdMRN3SGiczN/HLb9XxCU9VITe0pevRHLYHrS4oo WPPTvSYu6cFALpYJR+odRyoHqEcdJlcA7ln367zSMeuguxIYKcVwkS6fp Xfat8PRH9GP4GASsu6Z5Lbd4B3dxU523o3i9Vu181k1V3Tj+IphzybGmY nJYsBmLBHpe6LxTVL9AvGldRTGbO+bznbb7uP5Bmn9463OHxWRY0516a5 9bnXduyqP6NXffabY/pO/vFSiY7oe9jIzkro4n4UqKoOGswyjKGdUDT3B g==; X-CSE-ConnectionGUID: wVJMw0/lSr63AeQwQaK+Rg== X-CSE-MsgGUID: jLwzpc+CRv6v3WxNvmQN0w== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="25385167" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="25385167" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 18:55:30 -0700 X-CSE-ConnectionGUID: 8Ijzyl4kRVWuMkWYuL3Cgg== X-CSE-MsgGUID: wQRiAP+zTimow0SHenz+fg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="37662048" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by orviesa008.jf.intel.com with ESMTP; 03 Jun 2024 18:55:26 -0700 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian Cc: Yi Liu , David Airlie , Daniel Vetter , Kalle Valo , Bjorn Andersson , Mathieu Poirier , Alex Williamson , mst@redhat.com, Jason Wang , Thierry Reding , Jonathan Hunter , Mikko Perttunen , iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v2 19/22] drm/rockchip: Use iommu_paging_domain_alloc() Date: Tue, 4 Jun 2024 09:51:31 +0800 Message-Id: <20240604015134.164206-20-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604015134.164206-1-baolu.lu@linux.intel.com> References: <20240604015134.164206-1-baolu.lu@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Commit <421be3ee36a4> ("drm/rockchip: Refactor IOMMU initialisation") has refactored rockchip_drm_init_iommu() to pass a device that the domain is allocated for. Replace iommu_domain_alloc() with iommu_paging_domain_alloc() to retire the former. Signed-off-by: Lu Baolu --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index ab55d7132550..52126ffb9280 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -103,13 +103,17 @@ static int rockchip_drm_init_iommu(struct drm_device *drm_dev) struct rockchip_drm_private *private = drm_dev->dev_private; struct iommu_domain_geometry *geometry; u64 start, end; + int ret; if (IS_ERR_OR_NULL(private->iommu_dev)) return 0; - private->domain = iommu_domain_alloc(private->iommu_dev->bus); - if (!private->domain) - return -ENOMEM; + private->domain = iommu_paging_domain_alloc(private->iommu_dev); + if (IS_ERR(private->domain)) { + ret = PTR_ERR(private->domain); + private->domain = NULL; + return ret; + } geometry = &private->domain->geometry; start = geometry->aperture_start; -- 2.34.1