From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7E21C27C65 for ; Mon, 10 Jun 2024 10:02:24 +0000 (UTC) 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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t1RfAV4PLwvTnmu8HHsceEpEdR+TeZfEUh8Xl6gJd1M=; b=2PH3OtNc/EhAo0loTMUo6L06Nv i3yzTdh21TkMMB3YQ3J2qOMYDqyKC5vX5uZ2WJhsf9umDzq/UjxucHZ4keg8IOCXIioEbUsHCQDWH zzLf8BBR5Aj8F9oDjm48XRt5OEPe/46sZKbQDP+ZZ5zJveMh9Uoo1I3SlTYfkR4DBbEokiqx8nJpb GXYkn6m1H0AuD4Uzi6pc+bKvyovwEcOd3wxClSg0vyuccr70l9dpw/neXklaMZ9rfCjQpu3jnndKZ 9YScEYeQOWULD8QMtv//YBP0yXd5JgGAUs46P/1N7+HnvLcENPZOaVdSJLDYmTeBxloh6zvOkeOy+ VaPIT1ZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGbr6-00000004XvO-27Q3; Mon, 10 Jun 2024 10:02:24 +0000 Received: from mgamail.intel.com ([192.198.163.13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGarU-00000004Ku8-1jbR; Mon, 10 Jun 2024 08:59:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718009924; x=1749545924; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4msQrWBVL2b4JwUEKLRwKbzNTovn+5JwozhskLlkUwI=; b=EGoPeOfzvUHF8r+Cg8gFPObu4A0QC1db8KttwuvTe6h1VZPfxbYm4b+z OHknJKtq+gB1tB5Z5Xf8aGAxnWC0eOHTJL19Lzu2EhVEXZvGYOd8//lD6 54V3Cy4UbfsXEyIcznRp6Yo+/6wG79jxAB5Mmr431RnLRkpZNmuO0lF8d ZG773gd7RbeetRzmuErednDbnpY9Nj8EHZ3+M8Et+H6V1eueM5bbU0Who LhB+Ro6rNcRyq9HU5+lrdLqF/JzHITZpuP0O/t5r7WKIhtDAKFUUUJIQu cqBVmjhsIXigqNOz3wgnK6TdqSriMumBLWyqQCWPvswv8EGxIW+kNYkDk Q==; X-CSE-ConnectionGUID: uyleKBK8TFuYVQ5DrD8rIw== X-CSE-MsgGUID: qOaxNxvhSTC9Cw+3E8pGFA== X-IronPort-AV: E=McAfee;i="6600,9927,11098"; a="17581601" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="17581601" 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:42 -0700 X-CSE-ConnectionGUID: 3haueZ8xSc2KYY4kPv/lrg== X-CSE-MsgGUID: cSDsjgrOSmyakXpWAx+X+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="43432474" 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:38 -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 , Dmitry Baryshkov Subject: [PATCH v3 05/21] drm/msm: Use iommu_paging_domain_alloc() Date: Mon, 10 Jun 2024 16:55:39 +0800 Message-Id: <20240610085555.88197-6-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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_015845_838970_5D72B22B X-CRM114-Status: UNSURE ( 8.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath11k" Errors-To: ath11k-bounces+ath11k=archiver.kernel.org@lists.infradead.org The domain allocated in msm_iommu_new() is for the @dev. Replace iommu_domain_alloc() with iommu_paging_domain_alloc() to make it explicit. Signed-off-by: Lu Baolu Acked-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_iommu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c index d5512037c38b..2a94e82316f9 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -407,10 +407,13 @@ struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks) struct msm_iommu *iommu; int ret; - domain = iommu_domain_alloc(dev->bus); - if (!domain) + if (!device_iommu_mapped(dev)) return NULL; + domain = iommu_paging_domain_alloc(dev); + if (IS_ERR(domain)) + return ERR_CAST(domain); + iommu_set_pgtable_quirks(domain, quirks); iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); -- 2.34.1