From patchwork Mon Aug 12 07:02:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 13760219 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 86F6FC3DA7F for ; Mon, 12 Aug 2024 07:05:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1368010E0F7; Mon, 12 Aug 2024 07:05:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="diBuGuSf"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C10E10E0F7 for ; Mon, 12 Aug 2024 07:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723446344; x=1754982344; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X0ZSpA6pYNtVglGXUJ8Hdn3nA3Sm4FX8yT8TZxIbhck=; b=diBuGuSfEQLQfqfskCsLaWuVSmSp/VwNCJJ/BJuDsAsVEdbdOaZBQDo3 Cl1GzXcTCka1QrDgoGxRciEDYUporqSfJyg3BijnEu+gjhIr3e/8rP7NW Uk0LQSIwDfQmEixvF+tqGFWuqeml1xHCdzXSNUBHtsCy855UGDQ3A2fcR sxRfV7oxHWbD04oz4stwge5etKCxGu4S2+9T7nkX/Zd3cWBgFQJJqJGn1 hg/JPMgBeysFz5lLDgDNEsxmvqftDgAAuN/uXAq7CyvByJ6S8lHPk7s18 tHYx9V5Fg/W+ptR1w0rSpReI6bHIhfKs8nN2awZ2ou22lR2WU+CC4n09o w==; X-CSE-ConnectionGUID: coRxnwsFTiaSuTFxrvlIoA== X-CSE-MsgGUID: n1Ig/gkKTpONvhVkLUkS+w== X-IronPort-AV: E=McAfee;i="6700,10204,11161"; a="21418186" X-IronPort-AV: E=Sophos;i="6.09,282,1716274800"; d="scan'208";a="21418186" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2024 00:05:43 -0700 X-CSE-ConnectionGUID: B1d9f9FpScSKBHKsscuddg== X-CSE-MsgGUID: 4UYjLl2eTyOw7y8yheaagw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,282,1716274800"; d="scan'208";a="58070144" Received: from allen-box.sh.intel.com ([10.239.159.127]) by orviesa010.jf.intel.com with ESMTP; 12 Aug 2024 00:05:39 -0700 From: Lu Baolu To: Russell King , Inki Dae , Seung-Woo Kim , Kyungmin Park , David Airlie , Daniel Vetter , Krzysztof Kozlowski , Alim Akhtar , Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian Cc: Yi Liu , iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe Subject: [PATCH 2/2] ARM: dma-mapping: Use iommu_paging_domain_alloc() Date: Mon, 12 Aug 2024 15:02:02 +0800 Message-Id: <20240812070202.9366-2-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240812070202.9366-1-baolu.lu@linux.intel.com> References: <20240812070202.9366-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Since arm_iommu_create_mapping() now accepts the device, let's replace iommu_domain_alloc() with iommu_paging_domain_alloc() to retire the former. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20240610085555.88197-18-baolu.lu@linux.intel.com --- arch/arm/mm/dma-mapping.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 52f9c56cc3cb..88c2d68a69c9 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1585,9 +1585,11 @@ arm_iommu_create_mapping(struct device *dev, dma_addr_t base, u64 size) spin_lock_init(&mapping->lock); - mapping->domain = iommu_domain_alloc(dev->bus); - if (!mapping->domain) + mapping->domain = iommu_paging_domain_alloc(dev); + if (IS_ERR(mapping->domain)) { + err = PTR_ERR(mapping->domain); goto err4; + } kref_init(&mapping->kref); return mapping;