From nobody Tue Nov 26 11:32:27 2024 Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8595C200CB7; Fri, 18 Oct 2024 09:51:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729245100; cv=none; b=WywxemffNIgCGQQAq2WDnLYmTRysVHnybjxLapzxtcqhBYKICD9d5x5+LRZ+ONoKhbHF88tJCflX/goEVTxJ3T2NY6VLMALNqt/D0FhiCX6614wkqgbuXFoRQR04O8yEvYt+tzqrROQkB9XeJ8XZ21uKeu0hUQipA0I3jasy9tc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729245100; c=relaxed/simple; bh=PxzUmdXNHgEZJkbEy8BdAR2H6oI/oOlnob544rXFLNA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hf/6m53D06uxCCpaE6IzUxbBDA1dAS7Tg81C/hLkIxcDQwDPNVCD+EJ2/5vJLsIw3tfnEAThl6Pr4H5TRkEAmfNAhJCoU/Vbe0XSHF7Uwmsalnjh4QCgohE+khIWScO4J6MdpagCjFFFYKWewmNz7j68icpvqGtsFFZrf9HtBKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov To: , Greg Kroah-Hartman CC: Daniil Dulov , Joerg Roedel , Will Deacon , "open list:AMD IOMMU (AMD-VI)" , , , Robin Murphy , Joerg Roedel Subject: [PATCH 5.10 1/1] iommu/amd: Prepare for multiple DMA domain types Date: Fri, 18 Oct 2024 12:51:22 +0300 Message-ID: <20241018095122.437330-2-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241018095122.437330-1-d.dulov@aladdin.ru> References: <20241018095122.437330-1-d.dulov@aladdin.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EXCH-2016-02.aladdin.ru (192.168.1.102) To EXCH-2016-02.aladdin.ru (192.168.1.102) Content-Type: text/plain; charset="utf-8" From: Robin Murphy commit 6d596039392bac2a0160fb71300d314943411e2a upstream. The DMA ops reset/setup can simply be unconditional, since iommu-dma already knows only to touch DMA domains. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/6450b4f39a5a086d505297b4a53ff1e4a7a0fe7c.16= 28682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel Signed-off-by: Daniil Dulov --- drivers/iommu/amd/iommu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 0a061a196b53..16a1c2a44bce 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2257,12 +2257,9 @@ static struct iommu_device *amd_iommu_probe_device(s= truct device *dev) =20 static void amd_iommu_probe_finalize(struct device *dev) { - struct iommu_domain *domain; - /* Domains are initialized for this device - have a look what we ended up= with */ - domain =3D iommu_get_domain_for_dev(dev); - if (domain->type =3D=3D IOMMU_DOMAIN_DMA) - iommu_setup_dma_ops(dev, IOVA_START_PFN << PAGE_SHIFT, 0); + set_dma_ops(dev, NULL); + iommu_setup_dma_ops(dev, 0, U64_MAX); } =20 static void amd_iommu_release_device(struct device *dev) --=20 2.25.1