From nobody Tue Sep 16 10:49:27 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 508D3C4332F for ; Wed, 4 Jan 2023 13:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239005AbjADNIy (ORCPT ); Wed, 4 Jan 2023 08:08:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239466AbjADNIP (ORCPT ); Wed, 4 Jan 2023 08:08:15 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A75A737387 for ; Wed, 4 Jan 2023 05:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672837646; x=1704373646; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NqpK1UK4zC2YasbUe6iVPvT9t2cN4N0bRVM1VXzIvT0=; b=NF02FhD1eQM8nLxU8MfxJIF+u/my/1K27BVf1gMkLbLLjiuSeKr5a0Fm niM6Jr5o2h414Bgcp2/6C/+MOm99E1OEMXCnn+CygQNjvSUTL23aj3HNK nM7J+uIXVMcqa8brT0zft6ZU76wyHe1rjEcSvoaV/3FNRXTyE6UQ2pKs/ b6pngtha8x9/k+N8N/56WARCcMI3hryh5lx7KbeZePsJMdd4cO9oYcgk2 aevOlXJF6wIeRB9pnW4it6d6p5Yitysnz8d8y21q6skBIBLvhia1YtX29 fooK1hrOea/r6iGb5OGKybUO5fhs5xB2kNIn9Axdur+xiYJCMhzRRWwE6 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="320640190" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="320640190" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 05:07:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="797529147" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="797529147" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 04 Jan 2023 05:06:54 -0800 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Will Deacon , Robin Murphy , Jean-Philippe Brucker Cc: Suravee Suthikulpanit , Hector Martin , Sven Peter , Rob Clark , Marek Szyprowski , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Yong Wu , Matthias Brugger , Heiko Stuebner , Matthew Rosato , Orson Zhai , Baolin Wang , Chunyan Zhang , Chen-Yu Tsai , Thierry Reding , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v4 15/19] iommu/s390: Add set_platform_dma_ops callback Date: Wed, 4 Jan 2023 20:57:21 +0800 Message-Id: <20230104125725.271850-16-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230104125725.271850-1-baolu.lu@linux.intel.com> References: <20230104125725.271850-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma_ops callback so that the IOMMU core could return the DMA control. With the set_platform_dma implemented, there's no need for detach_dev. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/s390-iommu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index ed33c6cce083..5591dab99446 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -144,13 +144,10 @@ static int s390_iommu_attach_device(struct iommu_doma= in *domain, return 0; } =20 -static void s390_iommu_detach_device(struct iommu_domain *domain, - struct device *dev) +static void s390_iommu_set_platform_dma(struct device *dev) { struct zpci_dev *zdev =3D to_zpci_dev(dev); =20 - WARN_ON(zdev->s390_domain !=3D to_s390_domain(domain)); - __s390_iommu_detach_device(zdev); zpci_dma_init_device(zdev); } @@ -435,11 +432,11 @@ static const struct iommu_ops s390_iommu_ops =3D { .probe_device =3D s390_iommu_probe_device, .release_device =3D s390_iommu_release_device, .device_group =3D generic_device_group, + .set_platform_dma_ops =3D s390_iommu_set_platform_dma, .pgsize_bitmap =3D SZ_4K, .get_resv_regions =3D s390_iommu_get_resv_regions, .default_domain_ops =3D &(const struct iommu_domain_ops) { .attach_dev =3D s390_iommu_attach_device, - .detach_dev =3D s390_iommu_detach_device, .map_pages =3D s390_iommu_map_pages, .unmap_pages =3D s390_iommu_unmap_pages, .flush_iotlb_all =3D s390_iommu_flush_iotlb_all, --=20 2.34.1