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: 13760232 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 7239EC3DA7F for ; Mon, 12 Aug 2024 07:07:29 +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=Gsbp3aO3mgfHXefctrP03WG5eoAUzkvQvHWhmrh+PyU=; b=aHdZDXMxOzyqA08ekrSU2UDsEI ZylnHal00jUYhDfpqO+CZLX3EpyPzqJwtijBXWppjsjgcJp1FW7s1nmFz6/f09IzH4tFjrGvWfAnX XqmCYbc9bwgdHcx2Q3NnVCn7wBnbzbaKZgJ9kZ75jwinAov/uvlTEAMluVdBiHtWCCHQktbsWfHMS yz/4eue2cTNl8oLg46HwkXduDTDyrz7SnBJzBCEIliuJL1MEPIbnm1SWrRrxfKMqhQyyu4yTwuqoz PaRe4GTUB8GnrXJQ/eTUcizQy3qnWLRKmr6GPPdkILQ5Xfh27wU7ZqTNZ+msuKtCDw3VZtBXesgOG 1FUTb4lA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdP9A-0000000H6vT-3gJ1; Mon, 12 Aug 2024 07:07:16 +0000 Received: from mgamail.intel.com ([192.198.163.17]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdP7f-0000000H6cp-3DoR for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 07:05:45 +0000 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: ATKbHgj+SianP2zQBGK8zg== X-CSE-MsgGUID: QLJyYyBFTNqX4t+HaDKqCw== X-IronPort-AV: E=McAfee;i="6700,10204,11161"; a="21418191" X-IronPort-AV: E=Sophos;i="6.09,282,1716274800"; d="scan'208";a="21418191" 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_000543_850441_A73FABFA X-CRM114-Status: GOOD ( 11.65 ) 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 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;