Message ID | 20230104125725.271850-16-baolu.lu@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5134282wrt; Wed, 4 Jan 2023 05:09:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXtPNR8jHZ/gsnxS34ybV48BUFjFFRRJMfgZAKeGFmQxqf6l3jSRRdX7w5u4D6dAsp0jjNse X-Received: by 2002:a17:90a:800b:b0:219:ef02:824d with SMTP id b11-20020a17090a800b00b00219ef02824dmr54983480pjn.38.1672837789739; Wed, 04 Jan 2023 05:09:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672837789; cv=none; d=google.com; s=arc-20160816; b=V6kVqRbK6++ZGxisNWgq2sXbB+BXSZBbJ5TlgsdbqDimJ+6LrL/sggDxa+HHE/iHwe th+b1/tQkj7LXtIe2va8f0JhElcQh8ceHVtmZm318DofMojqpvcbVbd23HTEe17G3vUy 5aUx568ZdPUS16CbvhzSqhf94fCEd1tvd1Z4ndSlaE5NRar6dvcCz7OuZbpcW57efaSb u9sHZQB/Y/5u9y61fL3TqSusrb8oypzAK6q3jFznPUUGGeh40MuUgmVXoRmoyFkChdGz QNaWqbRgsYKHaLFJk5QX6P8Q27LBSU9vVp4+utl5v7nHeXtfsummlHH+AjSBPaDheBQ+ pi5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z0RVRiyJAHMYMLV2AIh6q5wStaRQqcJX6nVPd1P/QyM=; b=eYclxXH0SIsgqAg2CZ9y9gXKiMCq8QRu+3m6K+NapjaMlywj2FpBE69xyVCifTsxJg Bt91THgtZXTHNVO3A2rnRAwSOPxazFInqH6+EIJbcSHXvjF+wlwSFNrnxL2fgMUsoYio MUjkSKYowe95/tI3dvBYdPOF1i5PM+mTQMqP9cbnZaaxRzy1yzIoWZqKY0KZL/AVqn/r Qw8iEYN/bxrXsrvKG6rugJUb88G62iyuCQo2TtoC6omyv2VF8HEm7d2mSb7bw4TpHj6O lOiEMBsAhsK/60qeNygwdNC6P6ifJ7iUG0c9/dd5l81VttnowoFPPu9ChJiLJgVfqKhG GgHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NF02FhD1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc22-20020a656d96000000b00491c2c993b8si36664433pgb.763.2023.01.04.05.09.37; Wed, 04 Jan 2023 05:09:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NF02FhD1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237542AbjADNIw (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Wed, 4 Jan 2023 08:08:52 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <baolu.lu@linux.intel.com> To: Joerg Roedel <joro@8bytes.org>, Jason Gunthorpe <jgg@nvidia.com>, Christoph Hellwig <hch@infradead.org>, Kevin Tian <kevin.tian@intel.com>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Jean-Philippe Brucker <jean-philippe@linaro.org> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>, Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>, Rob Clark <robdclark@gmail.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Yong Wu <yong.wu@mediatek.com>, Matthias Brugger <matthias.bgg@gmail.com>, Heiko Stuebner <heiko@sntech.de>, Matthew Rosato <mjrosato@linux.ibm.com>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Thierry Reding <thierry.reding@gmail.com>, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu <baolu.lu@linux.intel.com> 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: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754097558348110172?= X-GMAIL-MSGID: =?utf-8?q?1754097558348110172?= |
Series |
iommu: Retire detach_dev callback
|
|
Commit Message
Baolu Lu
Jan. 4, 2023, 12:57 p.m. UTC
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 <baolu.lu@linux.intel.com>
---
drivers/iommu/s390-iommu.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Comments
On Wed, Jan 04, 2023 at 08:57:21PM +0800, Lu Baolu wrote: > 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 <baolu.lu@linux.intel.com> > --- > drivers/iommu/s390-iommu.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Jason
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_domain *domain, return 0; } -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 = to_zpci_dev(dev); - WARN_ON(zdev->s390_domain != 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 = { .probe_device = s390_iommu_probe_device, .release_device = s390_iommu_release_device, .device_group = generic_device_group, + .set_platform_dma_ops = s390_iommu_set_platform_dma, .pgsize_bitmap = SZ_4K, .get_resv_regions = s390_iommu_get_resv_regions, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = s390_iommu_attach_device, - .detach_dev = s390_iommu_detach_device, .map_pages = s390_iommu_map_pages, .unmap_pages = s390_iommu_unmap_pages, .flush_iotlb_all = s390_iommu_flush_iotlb_all,