From patchwork Mon Aug 12 07:25:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 13760262 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 80F83C52D7C for ; Mon, 12 Aug 2024 07:30:13 +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: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:In-Reply-To:References:List-Owner; bh=byH1gtcpU+HMRnKEFs4EDMA+6ow6Ap+WHQEjPN8HWSA=; b=vAb+jM+13ImE9b5NjWzTfx7Ktd h6znfaZcy1PcdBvnMrk1VW1T5Q5kAMW4IS7rIWJHBDE3xxWp/+PQGN82HH4H4kjeXb3JaXnNbRKQh Vu5GvosXtHcyE0kp655kfLdN8gPSwqq674FszQESeGjIfWytfGZ5V9uavlfcGaQ89La3jJz61jQyc ghPDa4NsOPQkG9TFPc0Pji8jPRfhzu22q05NY3uVJ9fkciwArcTwmXLjgcinQP4NA0GMnvZxZ+LHP l3M5oPT7BYlJTdbowY+tQBzCOZ/Czc5bc8Caahd8sLdf1SHU9dqeNAxXIF2WPmN6jXeULVJGYYpwT K78w3YvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdPVA-0000000HA15-0jg4; Mon, 12 Aug 2024 07:30:00 +0000 Received: from mgamail.intel.com ([198.175.65.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdPUZ-0000000H9rg-0Pmy for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 07:29:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723447763; x=1754983763; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=e0LBAejigITG9AP6jtpikNxNxU3HNaCX57Mb/ZLuVkc=; b=XkkS9yvtExztVBLVf334Yl0Wv0vG4unz/NeEr0TsY+h6jbxqSc9jVVZ8 o3ZRatLW3ohVdMi33/d8ecV5cN2yuPweVfABQ8h4H39QaQKxSc0BHBz02 wW1p5XYM4AXoGk6Ta3Qs4m9Hie08WG8MRHOFLROoBaZkFBWKqL2rWFlAZ W0zD+m0rAMn9SX3g95jm4ONca/z/dRxOPGZgnr863+Pjj1StoD4PoA78l pxAHL/Ol6IFGAn8Vp/fLgj94Cwwh3/6tCi75kYFegV14JMY+2SKarRloo 3qX7SL5fTMaE5diOrT5J7b7SLyEgXR68EARdTNa+ko35l5VtvbBlFJRz8 A==; X-CSE-ConnectionGUID: g4e5aNjdSx+sYLANePv96g== X-CSE-MsgGUID: C6fpoYImQPSLEiIfhy+N0A== X-IronPort-AV: E=McAfee;i="6700,10204,11161"; a="21686645" X-IronPort-AV: E=Sophos;i="6.09,282,1716274800"; d="scan'208";a="21686645" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2024 00:29:10 -0700 X-CSE-ConnectionGUID: ftLXCe6zSOeVfNj73MeBtA== X-CSE-MsgGUID: Haii5Zw9R/2Xjpz6GDYbrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,282,1716274800"; d="scan'208";a="58894812" Received: from allen-box.sh.intel.com ([10.239.159.127]) by orviesa008.jf.intel.com with ESMTP; 12 Aug 2024 00:29:06 -0700 From: Lu Baolu To: Christophe Leroy , Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe Subject: [PATCH 1/1] soc/fsl/qbman: Use iommu_paging_domain_alloc() Date: Mon, 12 Aug 2024 15:25:27 +0800 Message-Id: <20240812072527.9660-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_002923_209268_EDE6CA6F X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org An iommu domain is allocated in portal_set_cpu() and is attached to pcfg->dev in the same function. Use iommu_paging_domain_alloc() to make it explicit. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20240610085555.88197-14-baolu.lu@linux.intel.com --- drivers/soc/fsl/qbman/qman_portal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c index e23b60618c1a..456ef5d5c199 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c @@ -48,9 +48,10 @@ static void portal_set_cpu(struct qm_portal_config *pcfg, int cpu) struct device *dev = pcfg->dev; int ret; - pcfg->iommu_domain = iommu_domain_alloc(&platform_bus_type); - if (!pcfg->iommu_domain) { + pcfg->iommu_domain = iommu_paging_domain_alloc(dev); + if (IS_ERR(pcfg->iommu_domain)) { dev_err(dev, "%s(): iommu_domain_alloc() failed", __func__); + pcfg->iommu_domain = NULL; goto no_iommu; } ret = fsl_pamu_configure_l1_stash(pcfg->iommu_domain, cpu);