Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp229299lqp; Mon, 10 Jun 2024 02:05:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9AsLqmEmG06j9w9SG2qzKGrswsiTbkQ7K9E+WvWn2N6zhp4Y67z8s7Od9ftz+w4nc5R6FX4Y6JF5YnYuB1zoOOO/x9jbXcsxhwsrMbw== X-Google-Smtp-Source: AGHT+IFj5PyMg5eFje8Q+8yvNb8aiuWRzLNnZACs2cYZsD0UfnHthGOKv3qYezc7u8NWkCvkEtGg X-Received: by 2002:a05:6870:46ac:b0:254:b5b9:3552 with SMTP id 586e51a60fabf-254b5b95e3dmr3556387fac.33.1718010311884; Mon, 10 Jun 2024 02:05:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718010311; cv=pass; d=google.com; s=arc-20160816; b=EvojAC1Yp6xgepMRExfO4KKaEZkoearwrG1FG4SLTwK+Z2TzsZRhCXBDtBb6g9LnQR VqDBaJ3wWEjW08vU95Mp/QE7RaZjNNmXZSWijNa8rvKPHAw3ToLTXSROj2ovaangfs2b dmOAwtPoVH6e1brAR+4cTjnpeM0dT8b8G7L08z+0UGI9se22L92xgFLS2e2LHuhAMx2J 0ECVRUZZ9pHod0eBZleEK+OLzmLUuFIVhcEY40WEmuJH6zwFfNC8vIEcCV6vOSfBrTb9 6jNt5nPWjca3K4229iISGeVWzRqYxylaOSbmxO7auHZE2X9gLDD8ehdk73JV/qVx5zFz Kh1A== 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=oMfgzkEw/ooUXqvARCgNaSZrpwGw5y27+DEhhPidNdU=; b=KraSDnLVsRcT+cfyTxOC6F3zlkSdRLMCHO05TIrp+3D56lwnzZT7xXTOgqINCAy8cn ZQAJQrmHci/hIwFKQhFq/hnxP9GRyOOny9rhWXePZK5/2uLK00BpvK+pQJH4pRlxXWCo 6+fFtC8ZpqUUHLu/bVbp++NmEcmK5Uoa1YgManK080orsXx2bd+Y6+OoQpTk4eH+VkjF TdMKalxNUaVM3tofkn+e+APeGTyZwwqV2kQ+OguZ7RIVANJhQEEOILiKXb0HOFtp2hyD shVXitkCTVmOt9OFMWwZBHpWpU3gQcrSl1yIlPF9Eiw81oKHuQ+2K+Ueirlvvhclrltc /Nww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m+vJEdC9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207909-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207909-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-795515189c6si559749485a.659.2024.06.10.02.05.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 02:05:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207909-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m+vJEdC9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207909-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207909-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 96E791C21DB6 for ; Mon, 10 Jun 2024 09:05:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 257701369AC; Mon, 10 Jun 2024 08:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="m+vJEdC9" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 0F0A67BAFF for ; Mon, 10 Jun 2024 08:59:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009991; cv=none; b=I7BbvRglkg4GCLdLLRepMEEfFCiKh1vKcXRqhLuQQflmWynvN0/UXJ+FJx6n6e4TAj6rtVhrSEVCUrAiIYW8jk8zQlyb5T+a8NZ1arG1/G/rmbhSmNDimjSl2psznlhWNifJ2B60GKmdU7IuhjO+CQF8ErG4cKGCl9T4/PLWbEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009991; c=relaxed/simple; bh=2RzKLZKa9aMbeh8zX7gRXSDK8Hv/vXOsjqYlhYXqS5Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pf2+1vBBnO7twqWf67J5gk6PKVY5KaZGLfMGgF6hqJXc6OkhzxYFK89ofoIyLlgMq09xV6QOus/1x/RL1F3qvB02tp/+6D+fLLJjeBuIMiayiVlE8N7oGdqqebf0JOZfEqyzzbeHUV3v1H2l6rKIHXGwKE+K/71NMYVp8uSYzLY= 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=m+vJEdC9; arc=none smtp.client-ip=192.198.163.13 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=1718009990; x=1749545990; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2RzKLZKa9aMbeh8zX7gRXSDK8Hv/vXOsjqYlhYXqS5Y=; b=m+vJEdC9Iej41wk0zA+0I82K8ei1Y5Tf4vxWr3iPw4z3euj86Y/1n8ce W2t1zQ+morYxoWtfqwYtZE6gk6ppJg/E54lGKyM85XK0EPiCePwZ5FwgI CYWen3pRQOnOMtPJbZRQnAxTQXPu6VUsOROpCKHhrpn/iNT45mQqWgUXP d3nMa9c3w6p6Y3d87GYkGymOMtr986h3OvPaHQOuCusDMt8DMIoA8N+MU 5xwR8XCSL3cPiz/g3sfqEPpDahEDB2/0Hang9VTGhIxX+pZ1po5HjS8Bq Ga9egzQ4OfC2tfpr01ia6lo2X31N/tQuj9OGEEJDWJ1xZpin8goXUW3A9 g==; X-CSE-ConnectionGUID: O/z7bgccT9CozMb1okql5Q== X-CSE-MsgGUID: nJb3C9WwSp+B993c2u7jmg== X-IronPort-AV: E=McAfee;i="6600,9927,11098"; a="17581971" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="17581971" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 01:59:49 -0700 X-CSE-ConnectionGUID: QxgTd28SQrGRjUA9euRVfg== X-CSE-MsgGUID: gs8aoJhZQmubGCpSr1nBLw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="43433021" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 10 Jun 2024 01:59:45 -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 , Jeff Johnson , ath10k@lists.infradead.org, ath11k@lists.infradead.org, iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v3 18/21] drm/rockchip: Use iommu_paging_domain_alloc() Date: Mon, 10 Jun 2024 16:55:52 +0800 Message-Id: <20240610085555.88197-19-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610085555.88197-1-baolu.lu@linux.intel.com> References: <20240610085555.88197-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