Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp327344lqp; Mon, 10 Jun 2024 05:38:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHh2/3i7VdUl3P6jfeDBy+ZMpNnyAQaX0mR01R+d+FBtWO7wd5lRVlZHvTO2KY3hAcqsnwdIszwqVRp9P3fORh7YZfWu12bEy+bxN8Vw== X-Google-Smtp-Source: AGHT+IEiS/03ePNvgI580/Pb/Q5lHQqCW3j5RCfwTiN51R4esZ0muS54eBRzPXUKt6rQy/L4fIqR X-Received: by 2002:a05:6512:b1c:b0:52c:80fb:ee76 with SMTP id 2adb3069b0e04-52c80fbef32mr5314510e87.58.1718023111450; Mon, 10 Jun 2024 05:38:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718023111; cv=pass; d=google.com; s=arc-20160816; b=jOvXAo+w7ekYIDTOYsK3kDJYeCH2nAz4f3aKM43UXYAOO4M107zDIUx6cYd5cV8ItB /B4pvXUowsRCk/8V/tMhKUACHc2+u1ZlV9aNJqY6mRI8ckuVvzPNbtvaOGMgRO5NSnMV bBCKCXMZlpITYNgPjb+wP9K2bWEHBUty2nbPouE+1ORnmp3LSfoSPv/lSdim1x3q9ZYW Z/7GXN1RUwtO69M10WqNYxSVXLWhvLSk2yeuqpjdJ3oMh0JMZVk2CtVPgF3RwQhWAcv0 UwntoXPUCLlN9c+O/Oc85BclCHZK0b6Hi8PYqzB9ZZb/pMEnhTrSJBbU8Mo4QvSTcw69 Wrnw== 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=fEQZCkflD3rKZFUDL0PzkynUMXhvLxBRYUTZPqnbylA=; fh=oMfgzkEw/ooUXqvARCgNaSZrpwGw5y27+DEhhPidNdU=; b=jvMgXuRTDStR8TYlxV9f/gDM3gTJpdh1ovKtiSDnBB3WpR8A5mL0NKGt+8qZ4r5TR6 4iTBlBk89qzsLFDBftJNTtueTsE7hCAMoVNM+rulhMNOJRbt/YtCJNqXZ1KRShDmZV5s kMMbA7OnUTs+0E1d6AxfPQJkxbGhMWrQ1ZMrPDnlD0mutLRmAqzk45gJ5vYvvgEUoKQZ 4RLPIDRvUebo6SJIP0d4rvjgVs8PLjLLF60qbg8Ycgbc3JceGoEjroK5KTy8hvpxd0HI Aklw8hs3mSN7rxhae0KRRgC0Y2YGGiitaDkJUHbuRR/txw/QF3RSEPJvXDc29D4a/N9M 7SQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GrvelJR8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207896-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f1db46e72si112612466b.933.2024.06.10.05.38.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 05:38:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207896-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GrvelJR8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207896-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207896-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 31DD91F23EF4 for ; Mon, 10 Jun 2024 09:02:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D8F474042; Mon, 10 Jun 2024 08:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GrvelJR8" 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 EED4A770F4 for ; Mon, 10 Jun 2024 08:58:52 +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=1718009934; cv=none; b=nwOVSUURI1ZYHSpuDIlt5+OCAhhaASgGQvVPihFz3J6zrQb3gUQ7sNyNwDKyhB4oC2yttxyf4HBDNxTEv1VzjzUIybkbQ24aScvOxKQGq1tRMn3qnQnQKq6YgJOlr05RE39qZHJ5vdukj+K7oCTwzPVfn26hKRcY++bzdAA4baA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009934; c=relaxed/simple; bh=3intrfdlq62sPZGdllNzLo1Ahf/WR8/6yPI2eqBXYY8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uQlRvFNd5igwACn1nFo9hb6Ug6hRXcjUHavbiO2+Xq4Qk3DTx+9n4ivXyecIISjT244iggfyzjLPMg8NKovgufSMZCrYIsO4UEq68xh/6UBFeeAoqzKVbxQJaVHulr2tquUKtkGPofOmMP4G8Xcj60pMIj3ooUEAq9uE8tm83sw= 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=GrvelJR8; 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=1718009933; x=1749545933; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3intrfdlq62sPZGdllNzLo1Ahf/WR8/6yPI2eqBXYY8=; b=GrvelJR8lc4v8Nby6CPs0NUw/nHUGoklKtcPbh4bQaS89AUi+nUodsfU 7d7xiW1IQux0rqGb9K/kyFuo3azx3weZFz4TZxAX28vBstTDtbBEmGbLf QZHr7nt28h+T7y+hp26VqvEl5xYWzQkab+ctu16ighOS4koaNfp604siz SpN6gWZr7oCfIWcrZvql8JSpb+LNM6JMps0xEyxGeUJq1A6nv+Ryl864+ j1e0YaTXcPL7vkzZq0Z3HorxvsR29WFUgjZpWcZuepAsX5gkFV/cv4dLB Xo5maXEGGU+Wo/Hs3nOna1PcxAcuDEoacoEbi5p4rtgpjeJqMvWYEqZ8L g==; X-CSE-ConnectionGUID: fUA/dOQgTSS49zY4Vq5Jgw== X-CSE-MsgGUID: mtHIcXwURqe3FGTQ4TRG7w== X-IronPort-AV: E=McAfee;i="6600,9927,11098"; a="17581630" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="17581630" 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:58:52 -0700 X-CSE-ConnectionGUID: Ilzg052XTkGNg5Xl4jMrRA== X-CSE-MsgGUID: 2uqmD9gJTn61hulUVOHf8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="43432549" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 10 Jun 2024 01:58:48 -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 07/21] gpu: host1x: Use iommu_paging_domain_alloc() Date: Mon, 10 Jun 2024 16:55:41 +0800 Message-Id: <20240610085555.88197-8-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 An iommu domain is allocated in host1x_iommu_attach() and is attached to host->dev. Use iommu_paging_domain_alloc() to make it explicit. Signed-off-by: Lu Baolu --- drivers/gpu/host1x/dev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 3a0aaa68ac8d..f86a6b12f24a 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -404,9 +404,10 @@ static struct iommu_domain *host1x_iommu_attach(struct host1x *host) if (err < 0) goto put_group; - host->domain = iommu_domain_alloc(&platform_bus_type); - if (!host->domain) { - err = -ENOMEM; + host->domain = iommu_paging_domain_alloc(host->dev); + if (IS_ERR(host->domain)) { + err = PTR_ERR(host->domain); + host->domain = NULL; goto put_cache; } -- 2.34.1