From patchwork Mon Nov 28 06:46:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26540 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475163wrr; Sun, 27 Nov 2022 22:57:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf568LobwQkwubmKPwNIsPuG2KLNt05O9+fNK9yhiL4lh4pOsKEnBg1khr2juqHwzT51Z/Wp X-Received: by 2002:a17:906:b28f:b0:7ad:a942:4d6b with SMTP id q15-20020a170906b28f00b007ada9424d6bmr40929106ejz.379.1669618632577; Sun, 27 Nov 2022 22:57:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618632; cv=none; d=google.com; s=arc-20160816; b=AlUxNMlej6WrOjNdkTabCkOdHorIXN7Uu1NZjnlOLQVcYeJzC3BK4xhTHZVntRXWf+ Cr6+O+gWFt2AB6xusd2gLE3LVGDpn2OsSxGCYQlGH5aLMww+OL31UJgpMHbiPC7Gb+Ko fr42keKdOdYoydpw2TjmzeEsjrpcDqn7qAasDo3twMUJ+jQtXp2aLwqW0J2mrX/ZXsrC 1G4qx7f0FXF5m+3WIxE090c9GwU+u+iyOxWoBPX0Gbyk4pKYPp4duPuz5ymACKCMUKj8 fFVQlAAExfHdiEX0KNPBh94k60tnovIA7kNbz3qNa9ay0h7s4dO1LXRH2sihbCifz7vK kA8Q== 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=cmVF4OP1pNbEEAEiEFCn3jfpLGDV/cAbJ+HyEe9/Yco=; b=en5ijqmsW3uzbahKLRkmGxitZJDsYhZpFqIwyNVfASQA8mUCxYsgdCNDGvIDumnLhc yEaDrnQCzfhRH/H7pURukDRlM902pkmbEIgQXJ1ST0nmXIFRQRJxBtJ1lPIdhmdAHG8F HH5EHAMP36WLb+MKjn1h2RybUutl5GEsSQslmeM2sKMi9GLwsdoadPH6d8Fe3slEdEaG OGaETL9MQ+mWRE1mZu0kHMVQV8tTafY8deMHSc2lRb1RDW4qRcX9ZvEbOMs6mIAb+HqC /9VUeSG88glMP4zwWEK7GDvPt5X1K8+HlgJOmHsvtSr9E4O4OgI5OXerBYOBS3xScfAI OSBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PEVxGswz; 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 p20-20020a1709060dd400b007c07cb9ce06si263927eji.315.2022.11.27.22.56.45; Sun, 27 Nov 2022 22:57:12 -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=PEVxGswz; 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 S229893AbiK1GyS (ORCPT + 99 others); Mon, 28 Nov 2022 01:54:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiK1GyQ (ORCPT ); Mon, 28 Nov 2022 01:54:16 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97024140F2 for ; Sun, 27 Nov 2022 22:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618454; x=1701154454; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z+afdRodACErnoYidPGbh7hMpmtegQAHzVqp7Lq5B/A=; b=PEVxGswz8WYVMfM1oFkC6rOxs1Mml/s7QXR9/d6Ai0KvG0Lw8NcKVX4p T9YObTNeWFmAHRa9nVZMzbk1GPH5Vgs9urtufb5Mp441YhyEzcA0t6Lq8 JwJoUNBCkEHooiz3HSFIe4JwQOcy3NH/+GLBW0G1yX64qQ5/AAkeod/p9 /WELCPcaZaFXgZGcSYE0pqViBPvgKl+oExFuyWdgT3irTY+P062s0qjEC 3AF9zEIfgfxblb+cnqHNkf+gUwWFrOprOkJn5UGnKeLTR39k/xzRYKHSL ZLfRCTWw/NTgcBdTtDbxn5UijTQccEf/DmDguWcX/FdXKKcjnhN3rH5zp w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="341672029" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="341672029" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120646" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120646" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:07 -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 v3 01/20] iommu/amd: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:29 +0800 Message-Id: <20221128064648.1934720-2-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722027155647980?= X-GMAIL-MSGID: =?utf-8?q?1750722027155647980?= The AMD IOMMU supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/amd/iommu.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 5c381cc3658e..bd1970b4f48b 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2126,31 +2126,6 @@ static void amd_iommu_domain_free(struct iommu_domain *dom) protection_domain_free(domain); } -static void amd_iommu_detach_device(struct iommu_domain *dom, - struct device *dev) -{ - struct iommu_dev_data *dev_data = dev_iommu_priv_get(dev); - struct amd_iommu *iommu; - - if (!check_device(dev)) - return; - - if (dev_data->domain != NULL) - detach_device(dev); - - iommu = rlookup_amd_iommu(dev); - if (!iommu) - return; - -#ifdef CONFIG_IRQ_REMAP - if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) && - (dom->type == IOMMU_DOMAIN_UNMANAGED)) - dev_data->use_vapic = 0; -#endif - - iommu_completion_wait(iommu); -} - static int amd_iommu_attach_device(struct iommu_domain *dom, struct device *dev) { @@ -2414,7 +2389,6 @@ const struct iommu_ops amd_iommu_ops = { .def_domain_type = amd_iommu_def_domain_type, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = amd_iommu_attach_device, - .detach_dev = amd_iommu_detach_device, .map_pages = amd_iommu_map_pages, .unmap_pages = amd_iommu_unmap_pages, .iotlb_sync_map = amd_iommu_iotlb_sync_map, From patchwork Mon Nov 28 06:46:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475976wrr; Sun, 27 Nov 2022 22:59:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Mgy6iZ6EcXhl4ozJBC5CMtCkWCtDLGQDTPgwiPFaAc/0vB/PwH5cx0JejEw9lI3aJ2rS9 X-Received: by 2002:a05:6402:1caa:b0:467:78ce:5fe6 with SMTP id cz10-20020a0564021caa00b0046778ce5fe6mr29687050edb.325.1669618760240; Sun, 27 Nov 2022 22:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618760; cv=none; d=google.com; s=arc-20160816; b=ZjHL9mQvf7Xj7EXc62Mdt40/SnxDlXW9U9cwpKsjzx8gSpnMgbYy7nNBofQKCYOiIM y3bXq9HEmGpBMYG5RGJ93LcGof8+vKSxgsIzlq01BWfpwwjTf2XGsZ25m98W13OuPUH5 6Hs0+m6s05FCqSxGxCJhMtafgo3SqcAf/4zjKmQDSJSx+o4PfNyu4+Rg3CG0UqgkZuLF 2bvJ0ekpAanoKnTRAm6YpLTS/1d2GaNuiZ6cUFJvmRCLel3ev+ILN876CpI+3OcdJv9s xg9DyLDnAFgOJlphucRlI/I5+DNjF6pffGFLlNOSuD+k6q2D4VNFMVWT/Xih+wMod8z/ pWRw== 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=0ZEc+4WkaxZPef1cUL0OQgIQsRohw4kGNh8ENnPSAHs=; b=lu/j9V380xU1+BqJDbTLM5VIdTIsXf9gFi4nUE0055yNQjzsVdgZ8i8YjIpimgHQHY L6P1L61tTWKbKrcmSZ0qOMrs+i1lDR3iJ58/xEa/qcT6cjwLJ4PomSzOxUPpNqR8ESJs m2gzay76MXgQ2yE5HUgNmO+OnqOXlnIxw2rQ0CMSrU0KNsuK9AX6CGdrLvet4Z+rgzAT 3INxk7Y/lWGwy07a9NmTUlC91QTV0+VJ9JSavr1umUGKXjikIq/B29lFNTuJXHT7UUNy Jc4TYL09ogRIDf3+c9GJ0BSnSoT273aMVKr5qbE/AcFNuBxN/1cNRXWmIH8SXrbtxTRh LPAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a8byyQAE; 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 g41-20020a056402322900b0046b2327bf88si2133790eda.76.2022.11.27.22.58.56; Sun, 27 Nov 2022 22:59:20 -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=a8byyQAE; 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 S229972AbiK1Gy6 (ORCPT + 99 others); Mon, 28 Nov 2022 01:54:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbiK1Gyj (ORCPT ); Mon, 28 Nov 2022 01:54:39 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DC8B15719 for ; Sun, 27 Nov 2022 22:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618472; x=1701154472; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8akeC95ae32s8n7uxnpCOPX3I9yHcltUgN/OgADfsrI=; b=a8byyQAEmXHjJ9tgVskw9KY+Ykw90CHgaVOZyWrtQPo1apF4qhqGfdaF 6lxvTzrBdZ1NDqUqavPOGLBpVvpiYOSAVGbQMZedYNx0epIDWNKHKHvJG LRKGYfZ8oESizSDZTedCXNCBEiWMF92kWxqkdx2XKQjGQpjZTTKp/gIWb iI3mLL6D63AmRupflVGmG5RhyQ2WuFup6ewjVyqxjrDeC0HDDggkKDF0T Oi1zhYCgOl2hgwpjId7wLfzypDRx2NBIHYHfHLBZ2u5KGKXK90zOcIefE SQB46r5M1XTgPdzXRvC3lKGMm09ZRYU/0yXSMoKrEZbhoFiQTu1r15Fx/ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="379016058" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="379016058" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120721" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120721" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:13 -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 v3 02/20] iommu/apple-dart: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:30 +0800 Message-Id: <20221128064648.1934720-3-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722161397691756?= X-GMAIL-MSGID: =?utf-8?q?1750722161397691756?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Reviewed-by: Sven Peter --- drivers/iommu/apple-dart.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 4f4a323be0d0..6fbe6b275c79 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -535,22 +535,6 @@ static int apple_dart_attach_dev(struct iommu_domain *domain, return ret; } -static void apple_dart_detach_dev(struct iommu_domain *domain, - struct device *dev) -{ - int i; - struct apple_dart_stream_map *stream_map; - struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev); - struct apple_dart_domain *dart_domain = to_dart_domain(domain); - - for_each_stream_map(i, cfg, stream_map) - apple_dart_hw_disable_dma(stream_map); - - if (domain->type == IOMMU_DOMAIN_DMA || - domain->type == IOMMU_DOMAIN_UNMANAGED) - apple_dart_domain_remove_streams(dart_domain, cfg); -} - static struct iommu_device *apple_dart_probe_device(struct device *dev) { struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev); @@ -780,7 +764,6 @@ static const struct iommu_ops apple_dart_iommu_ops = { .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = apple_dart_attach_dev, - .detach_dev = apple_dart_detach_dev, .map_pages = apple_dart_map_pages, .unmap_pages = apple_dart_unmap_pages, .flush_iotlb_all = apple_dart_flush_iotlb_all, From patchwork Mon Nov 28 06:46:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26541 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475204wrr; Sun, 27 Nov 2022 22:57:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pEqY7Vs75EYoRs0l+Oqeg/kK1wOnd1t6evas3sHmnZuRbzPMlxJxbhr53QoXzewb+H84a X-Received: by 2002:a17:906:b108:b0:7b5:dd3e:69c1 with SMTP id u8-20020a170906b10800b007b5dd3e69c1mr25774501ejy.381.1669618639096; Sun, 27 Nov 2022 22:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618639; cv=none; d=google.com; s=arc-20160816; b=FZtwQDY2keUyJrmL/YIaP4L5iWNj4Iob2+dI/Nxs5qOatKpwD5BQf6gsR6A/APpcsN iDyXR/hiT/2+5xUCuL9DgQiYeth0DC0Gq54hgWSXz3zVnbs1LgqpBNCswpVmW5W7uJel l+sRhrZ6dM+Qx4vNQUtC0qAyHC+YxkG863HN+Nc1UWu3j8ftOyS6aSD0tAWZCotS+dmT 6AwfX7a7MvaBLi60+Tzp5QgBJdn1ec+HudIcMF06gVmTfwtg0yeVUQdMvtNi3+wlRt/V e/SQKifbT3yjh/eCD83S+0xxCjCGgnozTd1PMygvKGjbZ2Ll6quRckVBk9N5MFJGKEik pbaQ== 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=7H8mHkwnBmilBRlF4wguazXbJRvm7qdMleGUzbGaurw=; b=r2ZI+758saWMgcw2zG/ZTMFHznyrQFJ55IFyzm7W1VwSAQbEMDhWxdKmWNiKycvXaw VXXRuDHg84KSeNBDlom0hwaW3DYpLfdbQB2ZuXZD5WLnxypioK309TnOf5MXA975b+rq 2S8DeQys1+OUCeOLjB5AcTxZEf7fzZ2FK//OteqVFQp8w3C2X0hbZz0ZxfKMS4u/mW7X DgVdbKPBUEu8b1YIpSci65kIo8SvDhI1DlV1XwJ9wwd+T5Ser3t+HVuOM71O0wyU1Q9h hEYzcetQVS4o0s0NXS+apmohAGgzZZy3RpjKUuNAmXww13GIv6RSe1QkLnrdU3GEhaQ6 2/FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=akk2e6Cn; 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 qb35-20020a1709077ea300b007ae43ee86aesi10099561ejc.69.2022.11.27.22.56.56; Sun, 27 Nov 2022 22:57:19 -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=akk2e6Cn; 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 S229913AbiK1Gyk (ORCPT + 99 others); Mon, 28 Nov 2022 01:54:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbiK1Gyd (ORCPT ); Mon, 28 Nov 2022 01:54:33 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AF9F140F2 for ; Sun, 27 Nov 2022 22:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618468; x=1701154468; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vVcsLAcU1x+PF9hn6JDVgVNAyf43Jf3te2XqSzSydEI=; b=akk2e6Cn8+BmPi5qcvivMy9PpVVTSuEo0yg/MzMD+4rCao4yCPopkAEK TQyxnkx+l7IU8rdPDe8rt3ihYkm0Z/5RsJB5ESC0fWT9az4W9mFuHtuP6 kPxa/evAYhGxlHWhOUgLh/m2Ffo7QT/9/jOpqxuQ+nHQmV2rUGtQARW/N lMYrmpHhgQmoPhVkEHnHQFiKH+pT5WKnJCHeTKxp+3WnZjJiFGm78inQu 3VGC9MW9swFiINN8R0/KdXGxAjEa+zPtBHvlViGUa2rzSO/3csHFctF+v dC3m9KGDCDJTzvVHOyApdfrb6KlAFcrv0PrBGRuJgso0fs9DILaOMGtpK A==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="376901409" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="376901409" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120767" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120767" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:21 -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 v3 03/20] iommu/qcom: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:31 +0800 Message-Id: <20221128064648.1934720-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722034023233418?= X-GMAIL-MSGID: =?utf-8?q?1750722034023233418?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index 270c3d9128ba..d7be3adee426 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -387,28 +387,6 @@ static int qcom_iommu_attach_dev(struct iommu_domain *domain, struct device *dev return 0; } -static void qcom_iommu_detach_dev(struct iommu_domain *domain, struct device *dev) -{ - struct qcom_iommu_domain *qcom_domain = to_qcom_iommu_domain(domain); - struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); - struct qcom_iommu_dev *qcom_iommu = to_iommu(dev); - unsigned i; - - if (WARN_ON(!qcom_domain->iommu)) - return; - - pm_runtime_get_sync(qcom_iommu->dev); - for (i = 0; i < fwspec->num_ids; i++) { - struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]); - - /* Disable the context bank: */ - iommu_writel(ctx, ARM_SMMU_CB_SCTLR, 0); - - ctx->domain = NULL; - } - pm_runtime_put_sync(qcom_iommu->dev); -} - static int qcom_iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -583,7 +561,6 @@ static const struct iommu_ops qcom_iommu_ops = { .pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = qcom_iommu_attach_dev, - .detach_dev = qcom_iommu_detach_dev, .map_pages = qcom_iommu_map, .unmap_pages = qcom_iommu_unmap, .flush_iotlb_all = qcom_iommu_flush_iotlb_all, From patchwork Mon Nov 28 06:46:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475975wrr; Sun, 27 Nov 2022 22:59:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf6QjaA02hxSXyvBgILiViBw8gBRU1UwwK3ZO8x1ZtKjE6nejDx2UqV/IfGhs3JiOVOFJj2L X-Received: by 2002:a17:906:7852:b0:7b7:718d:22c with SMTP id p18-20020a170906785200b007b7718d022cmr27956961ejm.507.1669618760130; Sun, 27 Nov 2022 22:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618760; cv=none; d=google.com; s=arc-20160816; b=YV5VThxPzjSnIkjg5TAJfD0F2/9KgMUqJrUtF+9fnefpCuWfbc86rFj50lSLuw2F+i 9hGlGYdZPMpgtAq15zdOB9wyz2Is0rllW9T1/8jpX/KOn5wrgy0Nnn9/n+o09L4apQ0f slkeD+S0uugseTNN7aQoUg01wY/LU+xssQkaQvtVslxLwie9h/r6cP/SsSaX1U5IWhkW +S2o/SqWEaK+SGhFxciI+W/1KkfkiMMew5LswBmOLQ201IuzHxERuMph6HomFyRlsp1e KgUIb3WxfqaAb5uhECOJjNFc4hIbe0mtLPSRjsH0uK4LKBz86Oqsl0Qwi95xySec90iP Aklg== 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=XFR5ee9VZzXDJ64yvPiCG/lg8eTEPGhYS4eidJAoV9Q=; b=oQ96UUZ8/Rg7q4Yi2OcKb2qvkut9K1jMEVMyhiaK+dyahAZ5gkPKmx9KNDEgV72GXz hhzlUdW9nwwsCdKi+0KW6ARUfo7WRfWmKZJxkBctqxlxS/c2yDMTBykUNd70ib8ikvSk qC02vwpQBfSObs1kJERalUqWKmec3KgwI4YhXYspSMGiPug21ClrHs3IIJaElgJHpb65 RtuY+gnjzZaUwK22MUi4lx1X8k0lXCNKKlizVDO5+iPwyJfpbhnxGO9/2c0RvEZydkON 0pvT059uS3Jq1pQJ9AKrpTKSpsUh0gkixYVbF4C0dOAUwvB1gECCNpX/yJiBeOSlBlCv Tf7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kPyy88A4; 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 y10-20020a056402440a00b0046289aad428si11355593eda.496.2022.11.27.22.58.57; Sun, 27 Nov 2022 22:59:20 -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=kPyy88A4; 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 S229939AbiK1GzC (ORCPT + 99 others); Mon, 28 Nov 2022 01:55:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbiK1Gym (ORCPT ); Mon, 28 Nov 2022 01:54:42 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 075141570D for ; Sun, 27 Nov 2022 22:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618475; x=1701154475; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+lnyWGzP426cIHCkMlfBmYCgDIrk0H3K0Lf9o9XVkwk=; b=kPyy88A47wH5jjIh9Fvodkq4vpADhq4qwlpRi/+XF2CrrIARj1ZRRcoc BCUGDfUVf79ZcD6TbHmAEJdH5Zgfruuvh0DsFemMAwD+Q3SQ08/xmcx6a gowL6tzmryDGp70slU2AJnCGc7KT7qcadNufUAl49xVkfRQcZLq0cUJsK mL0FWRHTIEx3gWQhUHksbk7lDJxgYvwrvnRRXqlJkSakOex+KcVO1ciwj FLQiJ8gT7n5DS32lq4g+qYgmN/5IVuztPhf3IDnZCF+96poVUcqi22dfq C+Nvs8YZ6Y/Z/0VQMfRijzLQkAmNxY/CfOoUcwMda/bifiDUiE5cMbvEn Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="295145602" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="295145602" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120774" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120774" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:27 -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 v3 04/20] iommu/exynos: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:32 +0800 Message-Id: <20221128064648.1934720-5-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722160864588278?= X-GMAIL-MSGID: =?utf-8?q?1750722160864588278?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/exynos-iommu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index b0cde2211987..29ec713e8a21 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1404,7 +1404,6 @@ static const struct iommu_ops exynos_iommu_ops = { .of_xlate = exynos_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = exynos_iommu_attach_device, - .detach_dev = exynos_iommu_detach_device, .map = exynos_iommu_map, .unmap = exynos_iommu_unmap, .iova_to_phys = exynos_iommu_iova_to_phys, From patchwork Mon Nov 28 06:46:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475212wrr; Sun, 27 Nov 2022 22:57:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4kcWLP7dPTSwU9pjNFayULqWkhOCKra9mykcvb8OM2tPB4OTXoELsUqz/xDdWEfR2IcnYQ X-Received: by 2002:a17:907:c787:b0:7ad:8035:ae3d with SMTP id tz7-20020a170907c78700b007ad8035ae3dmr33245370ejc.46.1669618640618; Sun, 27 Nov 2022 22:57:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618640; cv=none; d=google.com; s=arc-20160816; b=PuAVS6784/CbYX2XOdNDNZZa00V1lld3SPKDIZVfYQ9ExZyDDVhFgn65+WZMgkoYWi ZyCGx6yTruYkR/GWikhye5u4ewQ98ApB0+iScQqRF7c+yl16GoElb7DtlEpDuHfmE1lH dkKKHPrRuNp/ucZufJut8GIm6lnUcymYrRtRDT6GvWudiDhMXwKHMNZaViEIcD/4StBP vMXSlg8QRGuAf9Nquq1auzH5PJJWlPsMs+KQtkJZf9VPSf2RU5kq7dyYVx/DW5uyRvIr JBWKvykDZScmPaBX63TCKOF1jvxNFlecBpcygUDoAjdRd8l9l6HS6nFrIkNmqzKMYWg0 bf2Q== 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=HaSmPdkvuw2hcnHwSID/gPaljCCF+rXlfYPyDjJ5Www=; b=zYTJUjVOsTXasGM6L7nWQFT/mxmaWvNHabBGwrVhTmg7EA6mnXPEFX63D7Hl0R/bVy 3HNFfyDMx8KgQXCAyabu8tjdBfZCvC4KFdbTsFYZtzdrlmbONUEGBcJyBOXiH/nb56iu up/+f7WLjL/Dv9prU2YUbB1RNHSIa7yfqsUqeEXXJplyGny+s3e+KbBPEFxuViuVnvd+ 72CPgxwQwY6WwPZG9kwFTcV1mNASrXBX37twIJmKp61bXiWt/IL3WrAOhoUolN3BpYvA V9NEGUwoEygE0LKHsaVSwMU1e0XZFyw1CGtnt5FOlRSjok3AF1kxVESt/jbXRE/lcL9S iX8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mk4KMxTc; 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 qb13-20020a1709077e8d00b007ae0e8f5993si10712591ejc.252.2022.11.27.22.56.57; Sun, 27 Nov 2022 22:57:20 -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=mk4KMxTc; 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 S229987AbiK1GzG (ORCPT + 99 others); Mon, 28 Nov 2022 01:55:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiK1Gys (ORCPT ); Mon, 28 Nov 2022 01:54:48 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40F715738 for ; Sun, 27 Nov 2022 22:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618481; x=1701154481; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eIhdB1b3IGDflIBfoIAJvdUglY1B9SKoTD7H5eODBXw=; b=mk4KMxTcGK37OlF9PXvjpWKaUHGQjEzfW+r9hgEeRMoIuMLFSrlRK5sC ZT4isFG14W1DisGUao9G4pqfXjLBxOeXNjH66cHESuX27ukx0uzIF1hwC 0/4dDgAWN6U7bZwY5Qtlr//5A0gugBoVRph7RfOJOpkMap1y0F3Sd5aEQ V5kK+9F9P3RZ8StcUXnNPGjvyx/7Y8LpiHxhPuYfCawTO9F9BECDqcT0e Wka7D035urO2hZ1TtG+5cTbXwRy5Hj/2B88ijconA9IcMpDENDiN0GgPG /D5piwhIGovxWcgZoQTsDoe/1oluyiY42ZMkI5HRBUhAN4uYDLSqrWg1v Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="316586787" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="316586787" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120787" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120787" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:34 -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 v3 05/20] iommu/ipmmu: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:33 +0800 Message-Id: <20221128064648.1934720-6-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722035662116760?= X-GMAIL-MSGID: =?utf-8?q?1750722035662116760?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/ipmmu-vmsa.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index a003bd5fc65c..3112822ac7be 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -643,21 +643,6 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain, return 0; } -static void ipmmu_detach_device(struct iommu_domain *io_domain, - struct device *dev) -{ - struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); - struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain); - unsigned int i; - - for (i = 0; i < fwspec->num_ids; ++i) - ipmmu_utlb_disable(domain, fwspec->ids[i]); - - /* - * TODO: Optimize by disabling the context when no device is attached. - */ -} - static int ipmmu_map(struct iommu_domain *io_domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -876,7 +861,6 @@ static const struct iommu_ops ipmmu_ops = { .of_xlate = ipmmu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = ipmmu_attach_device, - .detach_dev = ipmmu_detach_device, .map_pages = ipmmu_map, .unmap_pages = ipmmu_unmap, .flush_iotlb_all = ipmmu_flush_iotlb_all, From patchwork Mon Nov 28 06:46:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26543 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475215wrr; Sun, 27 Nov 2022 22:57:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf4AJeFz6QzX06CVkfuLYEPE9Q+K2g+WfERkCzEr9R/oy+c6JUbXpbpKex0EuD8Cev/0jHZG X-Received: by 2002:aa7:c04f:0:b0:45c:f13b:4b96 with SMTP id k15-20020aa7c04f000000b0045cf13b4b96mr11490606edo.129.1669618641163; Sun, 27 Nov 2022 22:57:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618641; cv=none; d=google.com; s=arc-20160816; b=yxyMTtMGv4nr2TnO5w9wWw707lxq6kSglkQBVFWSFWhYbeAMRtxowBwUN6cD+szpL8 NY9RLal5HPUhBVoQYz0ekZUyU6BN9G5guXqcSNq2f0pqrk2hqhKgftNeqR/D+J3CwF55 4AW6qDDl/JmVJHuvl1Pz0GhrARDFReVNrEhrjennlw4P/UUMBFcsqYl/xrB0Xa8KlZLo V8YId/o+B2V4RzgksDtQFuZmYVWcIKi6mFgFNVpSj+O0QChHvhrA/d3Hycyru5MrnJRI LjLomZXjPvW9bqaB5iWvcFYh/EuJsC3A46eb1VPkYErJ6tIxxQT3CrPuj44+BbHghGM9 6sEQ== 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=Nl1Eg7WlXcYUFENHrSYfkoqG86BhOKphGyh+uhgDNhs=; b=p7mbx1eRL8DoVoe9BEKfsytzNgMwz7gNEJ+0tDpsuvNzvoTwzs5LbTp8X8dYYPo6Z2 hJw6oaUW/AV9MvmMzwfCg+bwRr7M74V6BHKLb5K5+0G1oGjk+1F9h8yvCiaLml7/+HDq MDLdZQuVadd4zCHoGmY4a1LpqGddIVCsgm1/0LnZ2Dr9H4zeOyejD+AmAIrwOiaPcXVW wgFjkXfFyM5PLlX5Oj5I0d+RDOJpnar0Td5t7oQ0RBU5RbuYwRdGHy0UFBhWPUrP4QnM ziO+D49F6rEr6bTthknYXEbHZeXAwquZ9+0QHI88iNBuMOjXWiccWgdTY7uzqFsr9UCB 8nOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gLeFmrBe; 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 gt32-20020a1709072da000b007bd8ac3aebbsi6814533ejc.812.2022.11.27.22.56.58; Sun, 27 Nov 2022 22:57:21 -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=gLeFmrBe; 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 S229834AbiK1GzQ (ORCPT + 99 others); Mon, 28 Nov 2022 01:55:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiK1Gy5 (ORCPT ); Mon, 28 Nov 2022 01:54:57 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3F615812 for ; Sun, 27 Nov 2022 22:54:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618488; x=1701154488; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=foe9CYLv4t/yayK/wv2PdURR8PHQrrf3ntMgKPrhGNg=; b=gLeFmrBeTkpXk8YOmIFZC9MJxb8vI7zaZI48wUBR8C0OXgvXALY0ImoI R9zSM7XPMjfld+AVYEuvHCI6z+kHlVvXa2+mRjlOTjUXa/7c7wiXskqhd M6OzRYzL9WDZGr77PvfMWSb0oOez0lse8a7Q1gOHFgpx+LFPCotrKkWPu +lHxwmvxvpA1zjjT4QMvYYmb46xYThuZxfMfXV5ESOKf0JV85a4Ex4fhv fqrFezyGCBDs7ZLzG9qYQwEqMB5YhX/xmt2AZqWtfmVZNyzP/rb8cs/qV 7QBLbdBZZG+f4NlzKc92GFv1lclZGGP3Lrs+Bz4m/i/kDgWWM6VGKhyUc w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="312395009" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="312395009" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120803" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120803" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:41 -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 v3 06/20] iommu/mtk: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:34 +0800 Message-Id: <20221128064648.1934720-7-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722036165805683?= X-GMAIL-MSGID: =?utf-8?q?1750722036165805683?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu --- drivers/iommu/mtk_iommu.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 5dc1009a19ed..2022f47529c1 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -713,14 +713,6 @@ static int mtk_iommu_attach_device(struct iommu_domain *domain, return ret; } -static void mtk_iommu_detach_device(struct iommu_domain *domain, - struct device *dev) -{ - struct mtk_iommu_data *data = dev_iommu_priv_get(dev); - - mtk_iommu_config(data, dev, false, 0); -} - static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -949,7 +941,6 @@ static const struct iommu_ops mtk_iommu_ops = { .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = mtk_iommu_attach_device, - .detach_dev = mtk_iommu_detach_device, .map_pages = mtk_iommu_map, .unmap_pages = mtk_iommu_unmap, .flush_iotlb_all = mtk_iommu_flush_iotlb_all, From patchwork Mon Nov 28 06:46:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475246wrr; Sun, 27 Nov 2022 22:57:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5luKSFGUhNWlE50o+X0VosqMhFxl66kI/qn6rYC18cA26eEwjgkqgzwFk/MGlxLDlQXMSV X-Received: by 2002:a17:906:18e9:b0:78d:48ac:9044 with SMTP id e9-20020a17090618e900b0078d48ac9044mr30626736ejf.613.1669618646729; Sun, 27 Nov 2022 22:57:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618646; cv=none; d=google.com; s=arc-20160816; b=L91qcARFc2PqhxqDNCtjxOomR7MFr6C+m06FlUGHY3zGQWl8X2sfPeYiUR0wGwziXY H6Ro1BYXdJ3I33oifBaxZWsVX/Nq2rUo2E7sMGCCQVGx+32AqwCsnr+SladFicUYYkqy feJasc1auklsv7/BYevUbJpVPyxzAbngIxdRuun7eQDBTx0up6lZyXJoIyJZWqjtDBcd xM55U0a/stDTzPFKmsgQUGiScEZALrGGDC4a8tNMNjGfagbxT5uv9fpBnxiotmGrntWa kMO4c5tlJAchsSMRXeuFyxa1+GXjCxBCKxFmvnq6oGF0tee7ZGsYjU57VEwh7WD99CDn JEAw== 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=OXKiILaDw5MfD7XG8gH85fu5EeQ8CH67y4Ota9m+vyA=; b=qsyxeDU6C51Lz6AkqU7W/9RZGbuqhTS0hN69WGV0VUA7eILnEFRMI0tBRv/mFZWRKM L868B770a03sEmZfgzGlgOsXFcT8NN0RUKhTAueZn4N1bmL4ROH7sp0eKkihlO4K9cZd T3uUfkWbVqEl+75iVCq1ZjVI/mSce0ai3yd48zNBiyZsa27+sJ2Ra98mw2kJPxEO2kYD yvyeHhOjxndDo3E14UR2RZZG5+4YbYJyDWmtG3QZHWApuYKJylsCKc23gfk5cFcCgoC+ Q322C78aZEmXuYW+k3BhW4DLXchrvqDQKwj27aB36J9wmuRsNx9lbjTbKyr4DiDfPNY4 eyfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="AoeB/m0r"; 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 y69-20020a50bb4b000000b004645d47d9e1si7865057ede.345.2022.11.27.22.57.01; Sun, 27 Nov 2022 22:57:26 -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="AoeB/m0r"; 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 S230012AbiK1GzT (ORCPT + 99 others); Mon, 28 Nov 2022 01:55:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbiK1Gy6 (ORCPT ); Mon, 28 Nov 2022 01:54:58 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CD7F15834 for ; Sun, 27 Nov 2022 22:54:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618495; x=1701154495; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uC3pF7hOoVLbt48rw9NtRx8qdAPfr8OWtZGji1zKp8s=; b=AoeB/m0r+ZVUyRfIhIOyfPqfBZtwLfnwLXUp25Y2Yk0Ge/Rc0D0BM9i4 oC4TPwtAzgdgRQtztaBQzcqcaoZtH4zdi9x29/HKmkkqRfR74lu9cKywv U1++ahsRmKZ05I8SD4XqsqCWVK8Pz07R8w0aQ5C84ZGy9de50x2o506k1 QJnvGxu5T5roH6gE/26ms9aMBmwJmyETtMRsR7gTRXZiHhxo2SRR+ufJY cCnsp25lc82E3YhABU7CEiCQjLlCshFKkXqMUYDxkqTikFWIsE2/f+/t4 9daOSWuG3cTS5NQ3mPOhA362E1Y6ZfBwTmUEdG6/2Hyf4Wz4oGUa2EpS5 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="312395023" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="312395023" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:54:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120824" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120824" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:48 -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 v3 07/20] iommu/rockchip: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:35 +0800 Message-Id: <20221128064648.1934720-8-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722042166733846?= X-GMAIL-MSGID: =?utf-8?q?1750722042166733846?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/rockchip-iommu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index a68eadd64f38..f30db22ea5d7 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1192,7 +1192,6 @@ static const struct iommu_ops rk_iommu_ops = { .of_xlate = rk_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = rk_iommu_attach_device, - .detach_dev = rk_iommu_detach_device, .map = rk_iommu_map, .unmap = rk_iommu_unmap, .iova_to_phys = rk_iommu_iova_to_phys, From patchwork Mon Nov 28 06:46:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475359wrr; Sun, 27 Nov 2022 22:57:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MbrOcXzXvTtpzzAC3OWzaxvHOEh0QwFyYfb3S34e2ij1EEQSUZdfmVah3WGrqwUZyIWgg X-Received: by 2002:a17:906:7d13:b0:7bc:addd:2c54 with SMTP id u19-20020a1709067d1300b007bcaddd2c54mr12830882ejo.24.1669618673269; Sun, 27 Nov 2022 22:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618673; cv=none; d=google.com; s=arc-20160816; b=YwnLLvf77e24kyjmBgI/UzryBrh7tp7tryUaiWnsjXERNE4l7O65dNfYDKX5w+VxmU 1Sm2AARtXaCdv2irUwHJOzE8k/WGFQ8AZkdkr9anyQQtKWmQ7M61WlogkhyEOxEAtz7V oLjeVId+eZ3rv2svBfSrEuMTzu6Yf5NznUudnIx2scXKBbk3VHd5qDOPljy89hc54CYT bjM1uuqlVL94qRyd8rQAdNOv20GT9Gy60fcziSVHH63Y4Cj3ykBh3YT/Beqp4mKDTC8J uUVYPa5vqMI0pD+vB0sGfRNVC+x7q1S7UJRBu0zz8m3u6NDo8KnqwbMlzgqR4h1yOZGB 6tZg== 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=1o99Jv/mGKh5uItE/HvHhAO884OTeM4IZgFyYoSAkLw=; b=nw8UBH7d4I5sqTNAoE4jx9VhTCj9rKMFlPGt1CVzS4sVRgcTTsRZy7FRTQEyNU38Ex RCYZ94RT9X0DwCDU0K5neoZdQOJiawM+Sr0t/tzmuc6JVuu8DvROInWeCPHPg377SALd SnKZcUL7HCjYATCaEj7PDfIABcIXaRz5CHFRMp/Xmat1FU5mTX34nJzx3wMQtKVok0Ox ThofQ3/8aadmi/O1XkV9Uk8dc/T6daQy9W+Svvk8tTJ63gYneVqNgoGlxYZ637d4pgWK cobI/PmA3XocrMYPvlxzVsNzxRObZLb1ErDZEf4C+lCm5aUv/2Zz+ww/YghYkajEDgDd 0IXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JkAvuSbr; 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 sy24-20020a1709076f1800b00783ac0b4d32si7542275ejc.941.2022.11.27.22.57.30; Sun, 27 Nov 2022 22:57:53 -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=JkAvuSbr; 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 S229946AbiK1Gza (ORCPT + 99 others); Mon, 28 Nov 2022 01:55:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiK1GzC (ORCPT ); Mon, 28 Nov 2022 01:55:02 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 789FC14D3A for ; Sun, 27 Nov 2022 22:55:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618502; x=1701154502; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=m//sYgF0rdstnqtGp6Wm1Z2gWE/E1AcAWpWObxb6y14=; b=JkAvuSbrURZd+lm2Jo/aWR0HUZQ4Gu+EsKVoEqXHMSsP2ElGXIZ+QV+z qZbHA4y7v1j0WJzpW2cUyRBIgdOOvIunwMA1oLZW+2YDUZO/aNqDW9TXS TqVIDIRKNm5PaqpTtBfuQQH6DcoGRf62W7EE6PYLMr5sZrqhOmVDqTY1p OyV4Yo6QMB32LbVPgH498TlJp3nCwS4bbkRW26oDZqTztZLIkbl/19ztu 2ZFs+wRsSvh9FzghABvEFXzmHa83yKp/2BhsEzE3rs+p02/AXuXBcv887 hDD5LeA8jeiPFl5oHh687M1Q1u+eP5CCOy/z6XrpOynD0gCj1dhxfxpIS Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="294462491" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="294462491" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120857" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120857" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:54:55 -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 v3 08/20] iommu/sprd: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:36 +0800 Message-Id: <20221128064648.1934720-9-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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_PASS, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722070119022942?= X-GMAIL-MSGID: =?utf-8?q?1750722070119022942?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Acked-by: Chunyan Zhang --- drivers/iommu/sprd-iommu.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index 219bfa11f7f4..ae94d74b73f4 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -255,21 +255,6 @@ static int sprd_iommu_attach_device(struct iommu_domain *domain, return 0; } -static void sprd_iommu_detach_device(struct iommu_domain *domain, - struct device *dev) -{ - struct sprd_iommu_domain *dom = to_sprd_domain(domain); - struct sprd_iommu_device *sdev = dom->sdev; - size_t pgt_size = sprd_iommu_pgt_size(domain); - - if (!sdev) - return; - - dma_free_coherent(sdev->dev, pgt_size, dom->pgt_va, dom->pgt_pa); - sprd_iommu_hw_en(sdev, false); - dom->sdev = NULL; -} - static int sprd_iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -414,7 +399,6 @@ static const struct iommu_ops sprd_iommu_ops = { .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = sprd_iommu_attach_device, - .detach_dev = sprd_iommu_detach_device, .map_pages = sprd_iommu_map, .unmap_pages = sprd_iommu_unmap, .iotlb_sync_map = sprd_iommu_sync_map, From patchwork Mon Nov 28 06:46:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5476036wrr; Sun, 27 Nov 2022 22:59:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pao/dP69oJgNNUsBUbJqisd44ffVSAyW8Zl+P6lDz8wQO2qWG03QthC4Y3GvHRt0QwqFy X-Received: by 2002:a05:6402:285:b0:46a:878c:e8e9 with SMTP id l5-20020a056402028500b0046a878ce8e9mr18336200edv.306.1669618771707; Sun, 27 Nov 2022 22:59:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618771; cv=none; d=google.com; s=arc-20160816; b=RsCJNUPekz170OStMWyxtXBBn6YnxaWnhzaOB09UuYOdiMlLaXbMZp817/2QYixTxa z9fdh4P9wwn2e3t+ZeH70VioFm+wZcQa0xMMVIVwlpiD+ru9eOLyUstPmUG7pM1tpQRN rLGLZvUOPlFyB2qGsiE0CUJHqagWGdPc9KWP7P4zr2v/JK4SpVpPytk3MisMyj8Sh8l9 M/vlImYAvPD0qxnQhVK0/H7EnLEEEBbYvTKPVQ7D1u+3NKRCyAzOBCkvJGCi9N9zhvLx NfJu5fZ0QX+L49tu6rwOPhQGuS5Qg4qEeEK9Hjkf1yQU6a/Y0xRL9SO957S2biRDJa1H LdPg== 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=u2f5BKHQCmZCeWskbiwFhBhvwILLC2eOqZ0a+4zpAkY=; b=o2zcyrXKOZY9YlRo6kYu+fdvMo6DO5NqbpBzZEOgEIE0zJCRvoe56hbu+pp+A3EKZQ EPLpWtJA/NyB+7JdgsfzFygadwQSKPS3bx01WFU8i6S9pCZ88gEjgGcpUuzTGx5HT/U5 Js7spiIf4gaDrdbZYmj3l1dbNZWxRV2OlXZoloO/7SXyS90K9cORpprzoMauKJrJ25WA QoI/DVBwymQ6Sne6crtdX8jsBSN0hpbBgeSK9xPbGW23l1isiABVN5FadRNd1xyWSIKt sJ/dZxAov1TGidsHsNn+q6r8V4aCm9naIUmb3NKjnBDbktJaEnaQrjc5pNGgyOcL9jre Q2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SkHE25Dz; 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 hp42-20020a1709073e2a00b0078db371355esi9349872ejc.987.2022.11.27.22.59.08; Sun, 27 Nov 2022 22:59:31 -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=SkHE25Dz; 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 S230000AbiK1Gzp (ORCPT + 99 others); Mon, 28 Nov 2022 01:55:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiK1GzP (ORCPT ); Mon, 28 Nov 2022 01:55:15 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2258815A36 for ; Sun, 27 Nov 2022 22:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618509; x=1701154509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zq7NjJNxRgriS5ThoBBkHtRQsns0/Mg1Qwl0eHqflWY=; b=SkHE25DzDpTKBuf7BOCURMmoTYtWzQubSNUSu1shmIuxYSu5i0YVoy0E vE7ovTkxo3Y3UmywfMLXKwDx8IgMlrMr9/G0GA7qZncTF6k9COsiOUqq7 NMMx8rk4nr5hcq11HDJVLv3U7YVbZG7ywwFgpjBwNWYiM9DbU9wNFTiDw Guu3gbxiRCvHptajss4V/PoMQGPB+EYYMth1kXhKov/FbGjIUnv2guhEd r+7fHN49FDsQ9Xoig8qlxwy5w/Mpu/M98QXHjOWe/8knwyyhHOm4/8Smx wurJe0qbOMmwTyv+65Z/ppDduA1B8gtZBQVa9sr0N6a5jAYeXlweJJdN2 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="314796476" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="314796476" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120912" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120912" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:01 -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 v3 09/20] iommu/sun50i: Remove detach_dev callback Date: Mon, 28 Nov 2022 14:46:37 +0800 Message-Id: <20221128064648.1934720-10-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722173431483115?= X-GMAIL-MSGID: =?utf-8?q?1750722173431483115?= The IOMMU driver supports default domain, so the detach_dev op will never be called. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- drivers/iommu/sun50i-iommu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 5cb2d44dfb92..37b074be87a5 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -835,7 +835,6 @@ static const struct iommu_ops sun50i_iommu_ops = { .probe_device = sun50i_iommu_probe_device, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = sun50i_iommu_attach_device, - .detach_dev = sun50i_iommu_detach_device, .flush_iotlb_all = sun50i_iommu_flush_iotlb_all, .iotlb_sync_map = sun50i_iommu_iotlb_sync_map, .iotlb_sync = sun50i_iommu_iotlb_sync, From patchwork Mon Nov 28 06:46:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475329wrr; Sun, 27 Nov 2022 22:57:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ubr3YumCsuovHASY4a4KtDxofLs/pR3kMx9S+pey51I6xz6TDa+WsTruhi/ww66BPYaus X-Received: by 2002:a05:6402:4c2:b0:461:3ae6:8bf2 with SMTP id n2-20020a05640204c200b004613ae68bf2mr30027475edw.396.1669618666699; Sun, 27 Nov 2022 22:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618666; cv=none; d=google.com; s=arc-20160816; b=tqYPal5k98YnoDasopVAcXAWd4WieR2mhyesnzUapl+rGmlotM6deBEdKNZPRy5QHq wHQ9c9yNlPjC6wplft8qoy95NGbZFUkfmLiGz9no8jz1E/Llo+FuXCE9jqZuaZS/5qGU Cus0CoqI5yAJ3D5DwH3I4ygV5vrk8XVWO6OK/dZJDa2qKxIU1PSzdeUksmREOMEqv/ui ssrt3+6+vWIBoXnQtyn7endH46/jPp3ayBFDOCbu1ojQY9qzWSAPGSRDlQRDfk35Do62 KdpAG9yKRo1CBLIlFlyHE7wiQmrGwbAGfkn+PpntwUKGsw0tozSHZMNf+m4YLgdyvHig yUSg== 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=WnL9ypTZL6P60VJ45M82kVDBIe6WslMmSb2j27US2Kw=; b=pAOJMyb/evC3n5yXbgZgTi/xp2mL1Fnqbic7JiEC5sVznvzXfD/ANnD1ZxvVsUkPXR 3sCQXl23yai8PKa+vrSP9bvvvyVLZ8uU7GHdUfRXA8o8xgXod03fGbIT8bnVN7XdOeaL oiAE7GEFkxCFgsiUVYKcd3XnJdkT8QXJY05UIvXkDCxfOKtUZKSj1DpSBUOULnTZGcNk HKCZLUV7Do3iNpswm2cFh0MbvJtSiblzv4uJg7Ry9UCDdX3zH0pK59gmPgPD0oX7P6hv J4zVjzk0+A08XMHaoWyue5IL5QDoKeREOJ/VCSIXVbXLdqnwM8vJnuwlYzSUN4p4G7o1 BdfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eacNunm3; 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 y13-20020a50e60d000000b0045b265a1712si8235248edm.595.2022.11.27.22.57.23; Sun, 27 Nov 2022 22:57:46 -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=eacNunm3; 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 S229662AbiK1G4H (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbiK1Gzo (ORCPT ); Mon, 28 Nov 2022 01:55:44 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F8471572B for ; Sun, 27 Nov 2022 22:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618525; x=1701154525; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PhxHKh8gGEUFxS7QMyT5AZD9ZvqhOGgKls6j0D/stek=; b=eacNunm3Z60WklM5QOyJxZMrGGv24pVRHC9hKgRCR7xWp0Q5M/Xv8oXK 4mI7bpuZm5n0UYd9GbT9Adl2r5XLOA17g2fSc4GMzstx+tAleElhcwEVQ 5bngJM5ueh5AEREQf1yBxlCUfT4fzk7QpYqeS+yezbIU0tUWVXdv1LXjW EcTy+K1pWMnhagekeQpkf0FTNJXsgbrQrhpm5CbKy1SDwvXvS3Bz17Mu6 TGknE/HQdq4HhrVLpMJXaTHE2MswZ67euljt4MzwhgGM5i6JbqOW0UyON XrjuGy2ZgdhuE+SjBAwsAT4cWK7KmjBmKLfCuwbswUmZKKpZR/RcH5Atv g==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="312395062" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="312395062" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674120967" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674120967" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:08 -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 v3 10/20] iommu: Add set_platform_dma iommu ops Date: Mon, 28 Nov 2022 14:46:38 +0800 Message-Id: <20221128064648.1934720-11-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722063250699983?= X-GMAIL-MSGID: =?utf-8?q?1750722063250699983?= When VFIO finishes assigning a device to user space and calls iommu_group_release_dma_owner() to return the device to kernel, the IOMMU core will attach the default domain to the device. Unfortunately, some IOMMU drivers don't support default domain, hence in the end, the core calls .detach_dev instead. This adds set_platform_dma iommu ops to make it clear that what it does is returning control back to the platform DMA ops. Suggested-by: Jason Gunthorpe Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- include/linux/iommu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 68d7d304cdb7..3542461558fa 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -223,6 +223,9 @@ struct iommu_iotlb_gather { * @release_device: Remove device from iommu driver handling * @probe_finalize: Do final setup work after the device is added to an IOMMU * group and attached to the groups domain + * @set_platform_dma: Returning control back to the platform DMA ops. Only + * valid for IOMMU drivers which don't support default + * domain. * @device_group: find iommu group for a particular device * @get_resv_regions: Request list of reserved regions for a device * @of_xlate: add OF master IDs to iommu grouping @@ -251,6 +254,7 @@ struct iommu_ops { struct iommu_device *(*probe_device)(struct device *dev); void (*release_device)(struct device *dev); void (*probe_finalize)(struct device *dev); + void (*set_platform_dma)(struct device *dev); struct iommu_group *(*device_group)(struct device *dev); /* Request/Free a list of reserved regions for a device */ From patchwork Mon Nov 28 06:46:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5476087wrr; Sun, 27 Nov 2022 22:59:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Wbe7T8QWj3XxXNn8qrCIM2DAeu8jq2RqoJ5Tju0MZZo9U2igGYTC6gELK/ur5rGSqYc/0 X-Received: by 2002:a50:fe11:0:b0:46b:2327:7c5d with SMTP id f17-20020a50fe11000000b0046b23277c5dmr4005038edt.386.1669618779856; Sun, 27 Nov 2022 22:59:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618779; cv=none; d=google.com; s=arc-20160816; b=C98S13uph6oHUQ5uG9ys6KHvLr3oXl42ZSqc1TlXVJOttX0TQvqjBXD0zQ0o0Pn8uC tZQUZk3fReTHCzKWHydBZQDwKmDaD5KeC86q6XroR9kbsj2Lcb7G3b77bkYvdnnO+rtY Yo3PzYGGeoCFeixPO+eZKJ0Vpfv3EENxzp9FeJMhM8lHEbdRZbWuiNDdLUv+GUOYlhvF 6Rx8eruSXi8sLHsbmrwutct9An+QD+10K+bHyOLe8iwyOfXorZ5gVc7LQcU+OtHqyeZ0 UJcjP1h7ueMHGNaI0F2J0Z2e5jRo7aAH+KKEBIXjdDu/Gs26edvoL7qEakaySdrOsLMv rarA== 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=Cu/5sd/eQNsGKIO02pTSxqN/2jjzeBBtSp+NyGqoC5k=; b=clCjyHukabYnZstmgtFfmv8qejt/X20ZvW9IRTuaC8iLXUoaS4NMBVoqRrSHLF8cnz hyXwOEFFxTiPibYnaya1ITNsfiw8sTAv453QLg4sQKNDbOMrz3GAwEFT6aL0xapXcFA3 u/xeQTM3QU0ZhxW3SjITzoxoLEhI0VT24wD6bDgGmOD1FUVS9TX8qxi+6zq9T3H4eT4Y hjasMhnPwVD99zGo5Xd2DLFCZlz7O2KM79L1IiIU7whQ5ZczcyEnrDXyx4OEueaeBkKr wF9DrBo9gPhWo0S0Lpht0Wk6AOLY/jGZ2OldlheRy4utKvYa66FkbDbrhXTWi+AXCYrL jTNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Mhk4Sauj; 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 gs34-20020a1709072d2200b0078df1c345dcsi10449874ejc.535.2022.11.27.22.59.17; Sun, 27 Nov 2022 22:59:39 -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=Mhk4Sauj; 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 S229986AbiK1G4E (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbiK1Gzl (ORCPT ); Mon, 28 Nov 2022 01:55:41 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0535115FEC for ; Sun, 27 Nov 2022 22:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618523; x=1701154523; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AAYy0JUpin+OfoNJn9WkR2B9kCOfW+EhBpCdyTnxdnM=; b=Mhk4SaujCMUmPIM1UELGtIb3lLKqrZIAhUKqQh9DtEOQ1ZcI9uecdJGu u3o/v2bM0AuqLIEDCE1ppVfkmq8hCL2ak0q7B41D3x4nFNSz2RO2HEWb5 S0nQupneAth2FewKABEBr9rqF4+VIlmr+h9Jft/z8mt4dAh41zgnBjMd+ cGwJW0lvl+vCEQGNTDvmYfK7l/OD38rXVpVJi/80NGHfEEpbBos16uW3h o3PpegW/aSr1KJWshmxkNdEHzg32fsJDMllUk36lcQAloSwipfxeX934/ 9pZd+5vl9zo+3nyyXDQrymFugDV0innJIKaFxTvRQc29HAaGEyc+pbrr5 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="315916165" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="315916165" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121024" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121024" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:15 -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 v3 11/20] iommu/fsl_pamu: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:39 +0800 Message-Id: <20221128064648.1934720-12-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722181805150810?= X-GMAIL-MSGID: =?utf-8?q?1750722181805150810?= This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/fsl_pamu_domain.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 4408ac3c49b6..b8c716e7c424 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -314,6 +314,14 @@ static void fsl_pamu_detach_device(struct iommu_domain *domain, pr_debug("missing fsl,liodn property at %pOF\n", dev->of_node); } +static void fsl_pamu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); + + if (domain) + fsl_pamu_detach_device(domain, dev); +} + /* Set the domain stash attribute */ int fsl_pamu_configure_l1_stash(struct iommu_domain *domain, u32 cpu) { @@ -452,6 +460,7 @@ static const struct iommu_ops fsl_pamu_ops = { .domain_alloc = fsl_pamu_domain_alloc, .probe_device = fsl_pamu_probe_device, .device_group = fsl_pamu_device_group, + .set_platform_dma = fsl_pamu_set_platform_dma; .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = fsl_pamu_attach_device, .detach_dev = fsl_pamu_detach_device, From patchwork Mon Nov 28 06:46:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26547 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475422wrr; Sun, 27 Nov 2022 22:58:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gbZzmRTDkE1tjZ40pL5KxVhCkNUUb7xgTiJytBwCv6/nVczKf9MSgZ6mi9+x/KNgWyg8L X-Received: by 2002:aa7:d74c:0:b0:461:b952:8932 with SMTP id a12-20020aa7d74c000000b00461b9528932mr37948597eds.104.1669618686320; Sun, 27 Nov 2022 22:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618686; cv=none; d=google.com; s=arc-20160816; b=hkWYaxekpUWaHBUHsVNR3WiD9ZdS3/L2DXL1szQb9VXgYAeVTsDOCEIZMiZSWjS3h+ sFuTNjZ6m47zyisa58/WJkpiVDu77DLV4x77+Gnl/T5+NheApi2Z1gad7AGQq2JoxLrG kWXFvQvKhIpQSnk2zjo/AYC/RKPLtjZoa9kUTLNJGlKQZqb3WclDiatgoJJF0rVWkIyq kMEEOgIIwJhpOZikFDR2DlxXy3/iry66iIXB6x/Fp7FaqSPBpp6JFHDRm8+S4Zcq91gW Qf8qabWYforH2+FBEU4zL9/TNy+rwpg0J7IojVboXv7Y6l/kOGaun/BZFISuX7YbOI2l j9XQ== 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=RXbdKTA/bUVRNjse77OxG1bwtUCiq2JzbjcdNGtq0RQ=; b=Vx+lT18me8KWaufnkmoEccONFum3WP5/OXBYYkZgtXp5CL52KKxnGBlnEnSJ+5S2xd cQVaMmaXqBpwIK1R76HdZqhS+uEZ7KVrFPkO6vPyYWBew4SPHcXcgdXVZwr/B6Gh/CXf 64bMq7QhcDJdldKegyKHkdR5xe39qPkfmWlK6/7ZiTKvL+qBveacJYuLg5gdR2eusuhT DUYbtTMUZAtPU21uqSDiI86RR3O8EIPXEzL/JX9928aav9fnouUsBQ59MfrlkV/iOAu+ liPwLq/9flrh5siHzRDyBXuo7xm7BRzP9+OSKyKd1bLPwTJ3dO7/1C5gtkFL5FGI6eTn f6rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Oz8jptwm; 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 e16-20020a17090658d000b007be835e8f3esi3730986ejs.582.2022.11.27.22.57.43; Sun, 27 Nov 2022 22:58:06 -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=Oz8jptwm; 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 S229794AbiK1G4W (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiK1Gzz (ORCPT ); Mon, 28 Nov 2022 01:55:55 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B59371582A for ; Sun, 27 Nov 2022 22:55:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618530; x=1701154530; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9D0XyFvFSOhAEwulu1xI29MelRcePwGMxUZNH4H/TSo=; b=Oz8jptwmIbbvJV2LEPfVub3KC6DSc9pRXanF7etE2MzGOsrZXhhIvzvM d2D1xxFforpFLbzY6z7RH7i2k2TA1ivaCFmpsQXMQgJMNNL357ZFSUSaM /Dy+oWHILmSk3xTYWX2JvgKxblsO+9/k39OGTlXJ5ashlIiAcBrEn8nw2 Nt9Iy++DZPtef+u1N4mxwioijmvwpdSXeAcJXX321PvZjyKGc+co11XD1 ZBC+vD10VKCkxzJAdcE1xePd/SDFXc99VCu/ReLUymbTF8IEvGgGqrQav 7c11GdRroLgGF3zFwmXYBcy5iEw46WbTv0nEtkPkaWtuqrgWw0be6vL2O A==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="379016263" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="379016263" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121106" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121106" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:22 -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 v3 12/20] iommu/msm: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:40 +0800 Message-Id: <20221128064648.1934720-13-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722083593193782?= X-GMAIL-MSGID: =?utf-8?q?1750722083593193782?= This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/msm_iommu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index c60624910872..3eb1bc668cad 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -470,6 +470,14 @@ static void msm_iommu_detach_dev(struct iommu_domain *domain, spin_unlock_irqrestore(&msm_iommu_lock, flags); } +static void msm_iommu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); + + if (domain) + msm_iommu_detach_dev(domain, dev); +} + static int msm_iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t pa, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -678,6 +686,7 @@ static struct iommu_ops msm_iommu_ops = { .domain_alloc = msm_iommu_domain_alloc, .probe_device = msm_iommu_probe_device, .device_group = generic_device_group, + .set_platform_dma = msm_iommu_set_platform_dma, .pgsize_bitmap = MSM_IOMMU_PGSIZES, .of_xlate = qcom_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { From patchwork Mon Nov 28 06:46:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26548 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475440wrr; Sun, 27 Nov 2022 22:58:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf4d5lBdhlgm1Rnl0uFAhXyvZ6tnrBy8yc+Dzbv9o36IcdETezM855lf56rle5Vx1+50BFMo X-Received: by 2002:aa7:d555:0:b0:464:6485:419b with SMTP id u21-20020aa7d555000000b004646485419bmr32101991edr.382.1669618691572; Sun, 27 Nov 2022 22:58:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618691; cv=none; d=google.com; s=arc-20160816; b=IHlY4qoL1REGL9/okXCuoISS1YdohBKumEXZSIF4fA/DzcvJ4YKJ2+If5RbkWZr7S4 QcAhqiGqiymwlo0PqpARmRi+yU03vR5tkUTRrQK1jdyQsQAQyGCGiQqF3GqiSdcItqgY D0JHQdjaTbg5cP4yCtAlB72exYRZ0OMBy3uytFRwXp8B2amWyaUaZ8QAZtYmlwmT6U60 nmHpDPqUX7xtems1gsThQQ9L5tUBO1iJEXa+fj1QM2fA2+/VUz72q9JhRt7HobtOAs86 yv8qsRaazPZhdz40o5qPrn0TZ6WzyUKJdKS1GRQBAxNPvwUcA3jtPbBwsB85AdDhuUBH dq/A== 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=TgKubcGX7mWrYWbFb9axLDn8b2Y1b3s1+8UBLH/puas=; b=Fayg1PObCEESV2Ghrl9sSBhRyVVZi5JNcb8m6AvflwccKiHHr4UBGwPCKI80kh60Nk bHBDRkLQudn2PmVSnc9VZmtu0rVXDOvqq6SYvcvFWxROBp/8NruiZmj6AR839SbRa+We vkf8IOoiNsu7RsEnMR8zLPO0eeUYNbrcg2wg6kjSOz3M9dvYJGc3elFuxaqyOCbaFyab u5THm2/oJrilBhU4R5BqtLsSvitWAocsIOQLW5TnSejgRKTe7RMlWTQc6raBv9u6xi9k mxanFt0ygaSYbCMed6EEknxz3WLelcwwmUpr23bBmF8+Lbc7d7YH7Z9y13ODiA6wcuum 7ftg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=oGPJ4l8I; 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 hs34-20020a1709073ea200b007bf848e0a05si2135974ejc.912.2022.11.27.22.57.48; Sun, 27 Nov 2022 22:58:11 -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=oGPJ4l8I; 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 S229936AbiK1G40 (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbiK1G4B (ORCPT ); Mon, 28 Nov 2022 01:56:01 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E49951659C for ; Sun, 27 Nov 2022 22:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618537; x=1701154537; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XGpxXhNOa/KRt7xgRHD7urYBt16kQhELiSo10tcOAJE=; b=oGPJ4l8IJ0VY4ixwR5hWtThlX8pxw8l6wxx8ZtyObSKYzS5AnAaelTeM y0h70yguPwqdF7YUNUQ4tZRqm27duFD3UZQB0UmoWO5gaDIisyIEMRwCy vZ5pU7zwLa9X596GviyG9UMG+2QuMEnlaOiREvvRhy7+LgFyPotT+CR3H 30mBWeUcO9dJ64Er9vsRQK9qeRXCdP2QeE3vGtdMb1P8y3KaDcdIy/ABw 5k1FmWwGtO70iTElvFw8bmuMHTXoYI+Tw8zX/NF/d+6ko7YufyXkeSuNj 1nHXVrICxoZqWtxrHRxsokk1xWAjZr7HAmeH1F5wFqN6h2tWde7vpWM56 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="315916234" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="315916234" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121167" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121167" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:30 -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 v3 13/20] iommu/mtk_v1: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:41 +0800 Message-Id: <20221128064648.1934720-14-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722088733542748?= X-GMAIL-MSGID: =?utf-8?q?1750722088733542748?= This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/mtk_iommu_v1.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 69682ee068d2..6a815da8a020 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -326,6 +326,14 @@ static void mtk_iommu_v1_detach_device(struct iommu_domain *domain, struct devic mtk_iommu_v1_config(data, dev, false); } +static void mtk_iommu_v1_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); + + if (domain) + mtk_iommu_v1_detach_device(domain, dev); +} + static int mtk_iommu_v1_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -585,6 +593,7 @@ static const struct iommu_ops mtk_iommu_v1_ops = { .def_domain_type = mtk_iommu_v1_def_domain_type, .device_group = generic_device_group, .pgsize_bitmap = MT2701_IOMMU_PAGE_SIZE, + .set_platform_dma = mtk_iommu_v1_set_platform_dma, .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = mtk_iommu_v1_attach_device, From patchwork Mon Nov 28 06:46:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475490wrr; Sun, 27 Nov 2022 22:58:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Fsp9BP6pB5/1AvZRsPoN8B1HhLoR+o+D6VaAh1UYY5qMBXWDNmuJZ5+dKc305ZU2iqW9F X-Received: by 2002:aa7:d1c5:0:b0:461:dd11:c1bd with SMTP id g5-20020aa7d1c5000000b00461dd11c1bdmr44693156edp.406.1669618700531; Sun, 27 Nov 2022 22:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618700; cv=none; d=google.com; s=arc-20160816; b=AMzvhf+BCuwmmwhiALAJPfCBrGbpk3IR7M/UyTp4LYxP23vMjxv7wrlHMc/E5y8Bwj bWX2bsoiHxAjFNg4gBK9xe3zXU1S0dDFYLC4b9H3G0H5/E9xJPG15HCN13u+1f+7RD+S Ssm00Jx9oyRCN0Cs9eV09g8kjNqfLnI2mbvGohY7sR00ef//Norazk3bIfFR0G+KE9H6 SS7cfrCfzGipqYXFXW96bYVm+TnSxRT6iYdSxu7f7cb3NKJAidfhhIW63+d6Gk/WJ45Q v8+txfMsGdWbEHz3izLLnVagtxbxkXGY0zYZ1neyDuYrKzroKjf2GsX5c7el4+6Jf9/R ojMg== 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=MmFcfZex1Cm3AQUgJrUUafOT8W0hVLPGz2DQWiDar2c=; b=rpCfZO52KrxnrSYNurF7/UfpJ8tnRJdiev2GSs7UAgGxn237Xok8dnKZy5c1x6NEvc Bjdgrth8OUObd0WN4X9j+aymAJSaSRS+7RkVhyr3goWfBcJ7II5nsJDivB65xTgTNiDG dEIW/QhhNAnnnBWLCMRynujrW2UbRVpsPKQ5dZ+hzTKK8YlwVLJ+hX5BDZILXvdgPmMD e4fSNMiy3XHfhDG6FuF0dsqktCCPWk6ieHZxVVpViYlEmrkGPRe5qQk2+/TXxC4yQuz8 mstbkFyMh6hbS2w1TJSvN2dDOT86nDp5qEzS9LHXbfn5xUMb4S6VuM6cv7epvt0q/z+G rkdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nO6mryGu; 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 ji11-20020a170907980b00b0078dd22dd569si9193799ejc.121.2022.11.27.22.57.57; Sun, 27 Nov 2022 22:58:20 -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=nO6mryGu; 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 S229730AbiK1G4j (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbiK1G4G (ORCPT ); Mon, 28 Nov 2022 01:56:06 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED01A15A19 for ; Sun, 27 Nov 2022 22:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618544; x=1701154544; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ff31laKxSfpGr9mFdQQubwFooU0bdzqdYVYXB0kO0dk=; b=nO6mryGu2cs6NBNmObkLlUl31LjuaLmQEESaAsMBsdXyDKmPtwuqnnjA 48FeEiOYnCam1awlxa/Nc3mtSBlNVZY3O5Ju1suiVz7kI//Z7vBh/dkUj LAE2PrRJaEq2rxHBkKuGLCj8dzVQzbGEufi6qnCRMQAc2GYlPO9Xr8aaX nivJ0Iwuvfoq/pZaoT3D7j4AjAejJFaKOOivkdWdH4mMx5HCu5yLzfFha 7Y3QjBm9MZYqXxqV9nCkCXoCu+5upBfnPwLRSrZOTwH6ISbLOnKqArhi9 wUu8VDO+5ZSIeAVwqtMlhCFnyrqDorZy+aNe8VdmLAprSiR14vK17kYgm w==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="294462601" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="294462601" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121224" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121224" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:37 -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 v3 14/20] iommu/omap: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:42 +0800 Message-Id: <20221128064648.1934720-15-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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_PASS, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722098557911349?= X-GMAIL-MSGID: =?utf-8?q?1750722098557911349?= This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/omap-iommu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 2fd7702c6709..aa3858a48bbf 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1566,6 +1566,14 @@ static void omap_iommu_detach_dev(struct iommu_domain *domain, spin_unlock(&omap_domain->lock); } +static void omap_iommu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); + + if (domain) + omap_iommu_detach_dev(domain, dev); +} + static struct iommu_domain *omap_iommu_domain_alloc(unsigned type) { struct omap_iommu_domain *omap_domain; @@ -1737,6 +1745,7 @@ static const struct iommu_ops omap_iommu_ops = { .probe_device = omap_iommu_probe_device, .release_device = omap_iommu_release_device, .device_group = omap_iommu_device_group, + .set_platform_dma = omap_iommu_set_platform_dma, .pgsize_bitmap = OMAP_IOMMU_PGSIZES, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = omap_iommu_attach_dev, From patchwork Mon Nov 28 06:46:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475696wrr; Sun, 27 Nov 2022 22:58:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf4WzLVSF4LbbYSqq0CRbKcOnYp99gQ89xlTDCNeoWy7VjDulRqXZ6faDQh+r+xVvle4o2jO X-Received: by 2002:a05:6402:28cb:b0:463:b0de:c210 with SMTP id ef11-20020a05640228cb00b00463b0dec210mr46575384edb.10.1669618727508; Sun, 27 Nov 2022 22:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618727; cv=none; d=google.com; s=arc-20160816; b=naoYcucwzmH/MuA8slVtke1/qwpzKfcnTaGrD10miKF/VowK+inzf4ztETATpOO+Sf O1cFkUNo6RLoMWZYvW0P7qnsWdrtxGc9IBWtCaQFCzdLVRqHHy3hLjzDymEMlaj4jVIE ddTM9YrFBl8UAUoK0MK1tv/SQXE5MrHYZiaNEl+5Gj4J6q/5GI64VX4yMlbmv6jO3CPf b4zwQs5RrPCbKUHM/m0B9O1+PkFGlRodZj3Qz8UvsmnUZDbtD5KYvI7RMMYhmPQqLnc1 RwM0ILn8NFy8Xpwegt+/6Vkoxsezph0qyeOErmFsN7D+OBBKJKuN8fCQs2bIK3UehZqi ztdA== 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=66zhlEepmCk0H160L43LDwsUoySEOdWBQALO9Zie9qA=; b=yv2vGAAgnKWdlnYJlVq2igS7lR9QERZSFESDbojBdJlYS34j0R2BIn6em0y59J+XP1 N7L/iOnzhkxb8oGXcVjAks90VqTUGASzke5Yzdz2jK8VQ5/AF7dCYu2g5+l6DcutSfXi usksGfvpGTzchPJV8H4OeZUB8kM/H3TWpJCeB29mnnDqdNTq6Xx4TGsClAMX6q+xvFq5 70EdBsdyZG5R5imdVjTI8ttwm/FJA6NG+gQy6RuScSyyHqZfckOwiopXm1g5wL4Ttpcw W4RUEj2q4kpsYjHNpMkzE2ZxaxgTi7Ppa1XbMXyGuOsw/SgtoyWDlY3NuahdrLn/Rgx2 6X0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Dhy1gCw8; 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 f4-20020a50fc84000000b0046b42b984f1si983640edq.492.2022.11.27.22.58.24; Sun, 27 Nov 2022 22:58:47 -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=Dhy1gCw8; 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 S229745AbiK1G4n (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbiK1G4G (ORCPT ); Mon, 28 Nov 2022 01:56:06 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C213815A24 for ; Sun, 27 Nov 2022 22:55:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618551; x=1701154551; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ol98imkt/vwMTgfO5T+HiqA4V5Kbbou7eJPlJ+Hm468=; b=Dhy1gCw8prjGRJ01TcrFi5Hf0en3tS6ITPzY2SfsBU0n187tozSwNOqv DdPkdmbcMBkPr2XbJBkBgv0L7Ruv5VeCMgk+gSlEeKgdIygm2GtNWoGc4 iItu0Uf9iAUUCNN+Vqfc12mTl3H9+c8Uu4QoRzAJDE/2mldcEp1uLa5ci HrzhrcjGqXwu1nteMdb4+HMkjq2rL59j6WGDjCEiHKOtqnt90hKOmVC03 QnUAaYlvaZO9jsu7K/33zRZvUmxOVNvk3Xjv8EW1E8gTwf7PKt/X1Hmt+ wge0QnX/6vBSRKF4sfGFm4O0ZFN/eoouB3xM1F86khYFgLkpeomuJq7k5 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="401050448" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="401050448" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121238" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121238" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:44 -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 v3 15/20] iommu/s390: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:43 +0800 Message-Id: <20221128064648.1934720-16-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722126915149789?= X-GMAIL-MSGID: =?utf-8?q?1750722126915149789?= This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/s390-iommu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index ed33c6cce083..507bbc2c9b58 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -179,6 +179,14 @@ static void s390_iommu_get_resv_regions(struct device *dev, } } +static void s390_iommu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); + + if (domain) + s390_iommu_detach_device(domain, dev); +} + static struct iommu_device *s390_iommu_probe_device(struct device *dev) { struct zpci_dev *zdev; @@ -435,6 +443,7 @@ 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 = 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) { From patchwork Mon Nov 28 06:46:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26551 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475705wrr; Sun, 27 Nov 2022 22:58:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf5/0784bOWvOvTQeO5KYdz3J7LwBIK6mTyjm28JKdUPvO4gaUlkEvq1SBvbMbQ74wQsfFdN X-Received: by 2002:a17:906:edce:b0:7ad:dd43:5d18 with SMTP id sb14-20020a170906edce00b007addd435d18mr25234525ejb.389.1669618728634; Sun, 27 Nov 2022 22:58:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618728; cv=none; d=google.com; s=arc-20160816; b=G58SQj+BPaWPY7uRZBdp8VHfpDnrEZjNdv+QsW9VeN6NPuCDH8UlTxJUoMh98JWbzi SbJgLfkcak/qG9wKL1gFH107Da5hf5WcIlS/KpN1WxPqksyW596GOiSRMpZFMTa3PeMu Xv8W3dXPi30qn2+6tzz6pEXlT/eNi3Ujx5KKb4aBTkfgEvSpvRgo2LFCzGKWUeD7Yo5S qjt/fWGn2j8zBI48qDRuWTwsY2iVOhc55742kKDYP7blPNmM3Rp4IJQh9Vd2XAg2bnze WH18NT5hHG9PUsG2eSwYVJ+gcm33Psqi03IAjMJ8sZJDpVNVD79mUZuUMVFlI+Fwt5wc immA== 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=mk8cIJPp5vjDoHQIRBhc9+qhdgWV7mthSrXFYKzUjfI=; b=oBsa0q8wijVldDCr6I7NEhLVTfHNNW1jXnmQFu6en5XXO4QQV/T9ReMFkq3S17VTry 7qD1Ey66GpCm37SXdfba5v3kRrplgFBtqrA/NhX2hzqtvldrJS+493BaA6ytxDV96QfF vIKMH3J+V+CMWakCxHhbE/ZLTD47ZTpwRjcpoFlJgJ0vxoUDhq0Ky9pj2bY+lrNVfvTD UJ2Ew8BOv9HPfOVDYt3zMPVSFUWvv9REeGLMUXq7ecfn+FeVGWf9lJAITFJrqTS9o7pP Ji9ItxQq+7L3FeN4rCNQle9Fs/Abd8COnPJhy/ssh/wtnsLxJqKHCvrnupblLb36RIU5 vKsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MQvKTmw4; 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 y14-20020a50e60e000000b004602a1b7da9si8165626edm.133.2022.11.27.22.58.25; Sun, 27 Nov 2022 22:58:48 -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=MQvKTmw4; 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 S230022AbiK1G4v (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbiK1G4L (ORCPT ); Mon, 28 Nov 2022 01:56:11 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 687F114D0E for ; Sun, 27 Nov 2022 22:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618558; x=1701154558; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r5xbh896pHOm4nF0J2WHqkUdwYnD0sIQJbuduyaVUB4=; b=MQvKTmw4fi1bVD4F0Llp7FCeAuuyMKDHlH6zbPIssTfPjNgCvsbiHb5q +468s1Wly9RIstmGULcNN0Ta9XFsdD8S9ZVUTQPu0eisJRYrHFhUK2MgR wSDOqwT7XqzF/K9C970FyEzveGoH67Wsch9ayqF3tu+RwOoRcIWWcuHUt MAMoVWeFMYskCv8ueJSddEx8cd0HvvEmT95x4/tjFSHl8t3TZcCd+7KT2 3NfckKSb5pseNQsLeHw4P5QPQWDyMXIQf2M7Jwak9EKKedFt5ZOYkIq8E wG039RIf4JZNvA4+Uk3OhlJmxHeYrb645BofIb4deYNwxII1pOzAokTH6 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="294462659" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="294462659" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:55:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121259" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121259" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:51 -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 v3 16/20] iommu/gart: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:44 +0800 Message-Id: <20221128064648.1934720-17-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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_PASS, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722128167285205?= X-GMAIL-MSGID: =?utf-8?q?1750722128167285205?= This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/tegra-gart.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index ed53279d1106..f56e40b5c47a 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -141,6 +141,14 @@ static void gart_iommu_detach_dev(struct iommu_domain *domain, spin_unlock(&gart->dom_lock); } +static void gart_iommu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); + + if (domain) + gart_iommu_detach_dev(domain, dev); +} + static struct iommu_domain *gart_iommu_domain_alloc(unsigned type) { struct iommu_domain *domain; @@ -270,6 +278,7 @@ static const struct iommu_ops gart_iommu_ops = { .domain_alloc = gart_iommu_domain_alloc, .probe_device = gart_iommu_probe_device, .device_group = generic_device_group, + .set_platform_dma = gart_iommu_set_platform_dma, .pgsize_bitmap = GART_IOMMU_PGSIZES, .of_xlate = gart_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { From patchwork Mon Nov 28 06:46:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5475959wrr; Sun, 27 Nov 2022 22:59:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf5CieMbzhnFMz585lRf5b8jpd9dJb8clev98dQOWEe74gLhA4PxuTaGnFOW0tpaK0DVj+vj X-Received: by 2002:a05:6402:401:b0:461:5b2f:2d8f with SMTP id q1-20020a056402040100b004615b2f2d8fmr32613319edv.348.1669618758258; Sun, 27 Nov 2022 22:59:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618758; cv=none; d=google.com; s=arc-20160816; b=jxONDkxH3A77L7EV4G+6bjfybvTgfvSOFL3VWwpzi6nsKSTyDxiGzOnzXwiEhBpO6E Za4F+JxbW+SiOekWxgFEk3drjoz6TfD3tuBkKTjUH4ovfJUCJbxLOq5I1sbNstpek7Ly cUn6kXr/082v+jQ9fbK3GWKc8wOI9rWvzhs14+Wf+lCM+6YV9llZ+u3q3AFkPO0Qp3cQ Va0XElOX7jU/ZvS9qxyWgSaf7ru/9UMVDecuAH93zUBOVz1acBrZ0gvsjBcO7Ftd4grM yNb1AZ5xjYFP7NZNXfJysNl90mGp3yQzUTEgQAyatUVMl5bhu401Aw0rK9SkiwSZJplv +wvA== 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=FFu2TiaTa8GmIVNtEKrfpPbsEVRu0OhaBKJi05VjQEI=; b=DvVg2O6BNCl5IM3tUkC9oZQFrMdfPm6NAHDkIDXsgwWpDFEadvNNmltpQc/K0BaMWL 6Gb/tXVuXEpIYpCRls0t9BGq5WenRowMPv1S3Bb9ZwfstwjJzELKNlAOaB2ql6Fx9bRV FsmOSRAkIiBGe0jjmtuYn/e3XPMWZXRwiwbJdZupq42oyTZoB4UwfAIEGiNWn671mKTL h6aK8Jq8l/PDYd4enZw0YKSiHf5/xf3h9ii8ts+u/L9P4Itzwx+NpDf+OMAOLdS8vnWN XJ9F7zy7fy6dQ/SeNyNU1CMJzCj6cMS6h9xdeGibs1eYhUu4xBLkDxCdZ4HraRKTNjzU pI+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FWuIz94d; 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 z17-20020a05640240d100b00468468cd389si10697723edb.205.2022.11.27.22.58.55; Sun, 27 Nov 2022 22:59:18 -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=FWuIz94d; 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 S229589AbiK1G44 (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiK1G4Q (ORCPT ); Mon, 28 Nov 2022 01:56:16 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAECE1572B for ; Sun, 27 Nov 2022 22:56:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618565; x=1701154565; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2uZWB31+7BHbXDhpDwxdAHkoChULgPE00ii//Ntnb2A=; b=FWuIz94duB0Lv0Hi9yCaWVq/VwoJQxjJ7YSUzk7x48eLgTAMkKANyaGu ApCKC9kdHbMyJ3SyS95qnxlijeIQN02CziESzPggKtOFlsCmkC4Ej2XLX KpXRBo3jLae5nKzYhci7PDB3elz0T4ikbq3oiAtu4nAiWHHfO476Ck1QP MD9Fc8hyLl/5jfvESixVVJHlv2an/SO7NT+9NjZe/nQz/TJNoWJGRsDYd +fFKIzzTtzBWnGkW5pNAnek86Rn9iVGsCSXPvfli/e5tDAgELlHgcIJ5b 1/9bVwc/CnCVODDL7f4qoD0L5h1q+8vReZpvhGsI/9c7cvMlOJL8+AX2Z A==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="312395267" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="312395267" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:56:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121278" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121278" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:55:58 -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 v3 17/20] iommu/tegra: Add set_platform_dma callback Date: Mon, 28 Nov 2022 14:46:45 +0800 Message-Id: <20221128064648.1934720-18-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722159438009046?= X-GMAIL-MSGID: =?utf-8?q?1750722159438009046?= This IOMMU driver doesn't support default domain. Add the implementation of set_platform_dma callback so that the IOMMU core could return the DMA control. Signed-off-by: Lu Baolu --- drivers/iommu/tegra-smmu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 5b1af40221ec..a36e163e5cc1 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -527,6 +527,14 @@ static void tegra_smmu_detach_dev(struct iommu_domain *domain, struct device *de } } +static void tegra_smmu_set_platform_dma(struct device *dev) +{ + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); + + if (domain) + tegra_smmu_detach_dev(domain, dev); +} + static void tegra_smmu_set_pde(struct tegra_smmu_as *as, unsigned long iova, u32 value) { @@ -965,6 +973,7 @@ static const struct iommu_ops tegra_smmu_ops = { .domain_alloc = tegra_smmu_domain_alloc, .probe_device = tegra_smmu_probe_device, .device_group = tegra_smmu_device_group, + .set_platform_dma = tegra_smmu_set_platform_dma, .of_xlate = tegra_smmu_of_xlate, .pgsize_bitmap = SZ_4K, .default_domain_ops = &(const struct iommu_domain_ops) { From patchwork Mon Nov 28 06:46:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5476035wrr; Sun, 27 Nov 2022 22:59:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7eHDui2cxn+pligA2XUcC6KlV13+tY0FqW+xWoA4l21dzb8gmdRTfkXghV7ChaBkpfjKzj X-Received: by 2002:aa7:cc12:0:b0:462:79ec:55eb with SMTP id q18-20020aa7cc12000000b0046279ec55ebmr45037825edt.151.1669618771625; Sun, 27 Nov 2022 22:59:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618771; cv=none; d=google.com; s=arc-20160816; b=A+le4t60M8K0e1Jr/LW57jFG2qsqXBj7eJMXzdJpayjqXZkZJwMY0raKv/lcfd7xDi RgBdO4igmICY1BwnjOPnRzeqW5/eqPnnJaY8iXNr/LI+CCY1XPBB7g8mw7wC7DACURqG dINUHh73h9ZUZqt/tB+Nt6KTqN7FpG5mg4QtKLGsxL7E5571m231bCcxACQr0mew+uAf 4Sf4O3rzkOdYLJbzfLOrNsjT/aPYoFrnoDas8wwf471zUlDEhFNl6u2qEn/Fhlxdk8sq Cu1nLPm9ySdArez8KX8TMjQJdYwLpsgWLYZEjn0Fi4ICQNBx5x5SpcxiG7bCiojW9KUJ AVlw== 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=brdbahYQyV2jwDdygf0gWag5Vzeo/4P3LbhpqOZjHm8=; b=Q7/KAL3aCEhcFzJ3fgmpoGV5uTukNEFizrZxdqNoVXVkxkkhj2qGYG9rkQr7j25SnY M9rreUi4DV1tdHlCs7g5I+zANCY+j++hW/ZMxF/pvOc+ILkHguaYtg/o8qoo0f6aZE3y Ntz6++LXwY46CWxb+LOMbsq2lK1rUxcZ+9CY0VG+6gXjw6IM5BBxKuw2+blExIh09fRf q5Pfsf2GxOLr0ElpGC7Toyj73/eX5fEd/u+3Ae3Q3J2l15fz7CQhfo1xs2OqMdsElX4b b03qaGVBfeix9gKrBSyI+vxjz+fISz62D5P7Hw0o1y/KdS7+2LHbWEkdjqTcMXNWvWUG mzbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bZDvXmg3; 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 qw24-20020a1709066a1800b007baa6e2275asi9545091ejc.236.2022.11.27.22.59.08; Sun, 27 Nov 2022 22:59:31 -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=bZDvXmg3; 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 S229868AbiK1G5C (ORCPT + 99 others); Mon, 28 Nov 2022 01:57:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbiK1G4U (ORCPT ); Mon, 28 Nov 2022 01:56:20 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C202B15826 for ; Sun, 27 Nov 2022 22:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618577; x=1701154577; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2u7/GIfAe0DIonm/0hJIJlmbZhf+CBwAyKoVx4wlxOs=; b=bZDvXmg33vtWikJdBBjf8FS/AKg5ydS+avyP9b74slaqHwNHfGqyLSjA 0ZAN5mtyoGWT/T868EM1b26pgRDIA4+x+hX8T5eyhae53gVsW/J4Kmh6L 21p6y+eRxiPnMtyFlF2op1VCh8vtuJb8w6aHkYJWmdoIiDmcu0WeR9aw2 nZbzFaPULH8MMjoOhNuCXdsKRMFmnRAY4z0RIlBaWFxvOtLNfn6+3rdQL 8i26w0GHpaIKyGe7Knr92WnGjRtV5ZCwAGe1649NCGcaXc4Uo7yI+iokX RQACHuwiJN3+kAMrvysnqay0hOC+FtrSynvXs/7Sf9ziV+a/kSCL5qQWy Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="379016449" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="379016449" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:56:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121303" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121303" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:56:05 -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 v3 18/20] iommu: Call set_platform_dma if default domain is unavailable Date: Mon, 28 Nov 2022 14:46:46 +0800 Message-Id: <20221128064648.1934720-19-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722173040599797?= X-GMAIL-MSGID: =?utf-8?q?1750722173040599797?= If the IOMMU driver has no default domain support, call set_platform_dma explicitly to return the kernel DMA control back to the platform DMA ops. Signed-off-by: Lu Baolu --- drivers/iommu/iommu.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 7c99d8eb3182..e4966f088184 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2040,16 +2040,6 @@ int iommu_deferred_attach(struct device *dev, struct iommu_domain *domain) return 0; } -static void __iommu_detach_device(struct iommu_domain *domain, - struct device *dev) -{ - if (iommu_is_attach_deferred(dev)) - return; - - domain->ops->detach_dev(domain, dev); - trace_detach_device_from_domain(dev); -} - void iommu_detach_device(struct iommu_domain *domain, struct device *dev) { struct iommu_group *group; @@ -2154,11 +2144,12 @@ int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group) } EXPORT_SYMBOL_GPL(iommu_attach_group); -static int iommu_group_do_detach_device(struct device *dev, void *data) +static int iommu_group_do_set_platform_dma(struct device *dev, void *data) { - struct iommu_domain *domain = data; + const struct iommu_ops *ops = dev_iommu_ops(dev); - __iommu_detach_device(domain, dev); + if (!WARN_ON(!ops->set_platform_dma)) + ops->set_platform_dma(dev); return 0; } @@ -2172,15 +2163,12 @@ static int __iommu_group_set_domain(struct iommu_group *group, return 0; /* - * New drivers should support default domains and so the detach_dev() op - * will never be called. Otherwise the NULL domain represents some - * platform specific behavior. + * New drivers should support default domains. Otherwise the NULL + * domain represents returning control back to the platform DMA. */ if (!new_domain) { - if (WARN_ON(!group->domain->ops->detach_dev)) - return -EINVAL; - __iommu_group_for_each_dev(group, group->domain, - iommu_group_do_detach_device); + __iommu_group_for_each_dev(group, NULL, + iommu_group_do_set_platform_dma); group->domain = NULL; return 0; } From patchwork Mon Nov 28 06:46:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5476124wrr; Sun, 27 Nov 2022 22:59:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf40AHsnz+sUeyhLVwPRFiL7jaaRwVZVuc/TjiLhwNswKTMV6yWrmzMkE+234g5wYFWm+UC/ X-Received: by 2002:a17:906:b250:b0:7b2:86d5:8b14 with SMTP id ce16-20020a170906b25000b007b286d58b14mr42332829ejb.230.1669618787410; Sun, 27 Nov 2022 22:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618787; cv=none; d=google.com; s=arc-20160816; b=0DYIIP+vrKsjneEzs1uFwvTKMlkYiBweV1EJD6hq1Xl/PE+SPBG7XtB1L6CJbkdyY0 nakSduRSe6TH8AWYKC/EPeZF2yZ1b23nCHKslv/Q/jr6cEX4etcB2czP4LZ3dXI5jvdJ HBLn0OKr3jHD958gJ3iyz1N/2lB/dzl2nrDWxTimdhvLNJj512oCu8UUaLwtm8jJQeGY muMk2Uh49xQVJ+P5cwlmWMtX4cQkmslL8SUBsMl1kJGkJ5hTnw2LIq6LpA6+lS0WKTxV 9T9hCdr/uIfUNK0dAa1JclblzXpytuOpu/CI1u49ZuiblVAKznbEW1MGhGlKgCaL7/+K dXIQ== 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=yG5qg3LWU+s9WAk/oDFzpZxLvHsVk/fqTVgpIy4wgEo=; b=zvx2JEyRNi4hXc6S5QBOuUqsmWAFH83EF8IXFSSMQjLeSKvl1XZkO0eCBtSGdqvOT2 KfwLAu4E6NfTLaMqgpATJUDAikfDUUSW1jgdDeNLJOeEVO6mBd3fAlUt2A1M/gcDF8Mb dySUumDdrxXYUrFA8xtM5SMMgaQKFAGm6TN608Rb+iIzDhTFjTOZK1OWhynwBPH9nT8h MoCQn4UOPlveO3kmi3cygqLU+nVw+MwLbeBpjDiORL4zN7M0moHHK/Qa9UpUlPEFfpLv sdKikasO124el6jB8d51v0/Qx/fUv8BGYDjA7YrKvTvOBMxV7SzTGONhWmRJbTRSpn6C 0RcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HTpz60m8; 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 y12-20020a056402358c00b0046aadad5521si9645550edc.449.2022.11.27.22.59.24; Sun, 27 Nov 2022 22:59:47 -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=HTpz60m8; 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 S229671AbiK1G47 (ORCPT + 99 others); Mon, 28 Nov 2022 01:56:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbiK1G4W (ORCPT ); Mon, 28 Nov 2022 01:56:22 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9AC214D3F for ; Sun, 27 Nov 2022 22:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669618580; x=1701154580; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gUstT2MwrHgpmVm8ozwibpzvZnHb5hlxoDudunwPD3E=; b=HTpz60m8rlzWUVmqlblS+YZM5Owt4SyRuQGZpUU0wgHUb/EcQa0zx04A 6k4neojNOq1mezpmhiv4Q+OQWmjR/BoBovEBIFzERiwUT64Ljw5RlUe31 wfmUDyWv5A8YEfN0h/xxgETazv7/VdPyJVYBp3rMgVARuC3A6nX3ijxYj +Pt+iO2gAY4FHi9SePvX7YFRPlMeyyowaWbJHFtFgr7KhoHXvEtgHHmVn p2Y8DPmaKBU1jgc8/T1pR5sB6g96NWxk9TJUYtkul9PFOKc30Ur26jaRA DPMiRQkXmnC1arNHrzJbuN5jPh9FgF/uPolK39UQKr7vtrrLqOxFUodMn g==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="313459237" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="313459237" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:56:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121339" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121339" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:56:12 -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 v3 19/20] iommu: Retire detach_dev callback Date: Mon, 28 Nov 2022 14:46:47 +0800 Message-Id: <20221128064648.1934720-20-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722026917399071?= X-GMAIL-MSGID: =?utf-8?q?1750722189735928836?= The detach_dev callback of domain ops is not used in the IOMMU core. Remove this callback to avoid dead code. Signed-off-by: Lu Baolu --- include/linux/iommu.h | 2 -- drivers/iommu/fsl_pamu_domain.c | 1 - drivers/iommu/msm_iommu.c | 1 - drivers/iommu/mtk_iommu_v1.c | 1 - drivers/iommu/omap-iommu.c | 1 - drivers/iommu/s390-iommu.c | 1 - drivers/iommu/tegra-gart.c | 1 - drivers/iommu/tegra-smmu.c | 1 - 8 files changed, 9 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 3542461558fa..4c0491e5708c 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -294,7 +294,6 @@ struct iommu_ops { * * EBUSY - device is attached to a domain and cannot be changed * * ENODEV - device specific errors, not able to be attached * * - treated as ENODEV by the caller. Use is discouraged - * @detach_dev: detach an iommu domain from a device * @set_dev_pasid: set an iommu domain to a pasid of device * @map: map a physically contiguous memory region to an iommu domain * @map_pages: map a physically contiguous set of pages of the same size to @@ -315,7 +314,6 @@ struct iommu_ops { */ struct iommu_domain_ops { int (*attach_dev)(struct iommu_domain *domain, struct device *dev); - void (*detach_dev)(struct iommu_domain *domain, struct device *dev); int (*set_dev_pasid)(struct iommu_domain *domain, struct device *dev, ioasid_t pasid); diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index b8c716e7c424..272d88e415c6 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -463,7 +463,6 @@ static const struct iommu_ops fsl_pamu_ops = { .set_platform_dma = fsl_pamu_set_platform_dma; .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = fsl_pamu_attach_device, - .detach_dev = fsl_pamu_detach_device, .iova_to_phys = fsl_pamu_iova_to_phys, .free = fsl_pamu_domain_free, } diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 3eb1bc668cad..564f9dc0140d 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -691,7 +691,6 @@ static struct iommu_ops msm_iommu_ops = { .of_xlate = qcom_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = msm_iommu_attach_dev, - .detach_dev = msm_iommu_detach_dev, .map_pages = msm_iommu_map, .unmap_pages = msm_iommu_unmap, /* diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 6a815da8a020..c2d80b7a377f 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -597,7 +597,6 @@ static const struct iommu_ops mtk_iommu_v1_ops = { .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = mtk_iommu_v1_attach_device, - .detach_dev = mtk_iommu_v1_detach_device, .map_pages = mtk_iommu_v1_map, .unmap_pages = mtk_iommu_v1_unmap, .iova_to_phys = mtk_iommu_v1_iova_to_phys, diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index aa3858a48bbf..c3eedab00038 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1749,7 +1749,6 @@ static const struct iommu_ops omap_iommu_ops = { .pgsize_bitmap = OMAP_IOMMU_PGSIZES, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = omap_iommu_attach_dev, - .detach_dev = omap_iommu_detach_dev, .map = omap_iommu_map, .unmap = omap_iommu_unmap, .iova_to_phys = omap_iommu_iova_to_phys, diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index 507bbc2c9b58..33dba5ee5e20 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -448,7 +448,6 @@ static const struct iommu_ops s390_iommu_ops = { .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, diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index f56e40b5c47a..a532b333233f 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -283,7 +283,6 @@ static const struct iommu_ops gart_iommu_ops = { .of_xlate = gart_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = gart_iommu_attach_dev, - .detach_dev = gart_iommu_detach_dev, .map = gart_iommu_map, .unmap = gart_iommu_unmap, .iova_to_phys = gart_iommu_iova_to_phys, diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index a36e163e5cc1..247d485904c1 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -978,7 +978,6 @@ static const struct iommu_ops tegra_smmu_ops = { .pgsize_bitmap = SZ_4K, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = tegra_smmu_attach_dev, - .detach_dev = tegra_smmu_detach_dev, .map = tegra_smmu_map, .unmap = tegra_smmu_unmap, .iova_to_phys = tegra_smmu_iova_to_phys, From patchwork Mon Nov 28 06:46:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 26559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5476782wrr; Sun, 27 Nov 2022 23:00:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5/03cN9AOb6FoYcrXrQHU7wp7m3ssTG5rIMwX/ObnV0ZMMurgFnUHGfm7UQCx3IC2OWcir X-Received: by 2002:a17:906:2b8f:b0:7a0:3125:f1e5 with SMTP id m15-20020a1709062b8f00b007a03125f1e5mr40883620ejg.314.1669618855051; Sun, 27 Nov 2022 23:00:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669618855; cv=none; d=google.com; s=arc-20160816; b=MjiVOpNFKdYVEriZVNuKdWzTjaaFowCt5j85InAnnozoZHVrBuaTnB8OpQlZrJr3dN 2Sl6jvEunelUxkAdCcK3DGnk1qOw4n+6uu1OFhpNZruI62r5D66/XQYLC9u79Sbie9mo bW6Cl/A4bpQ/XyHEfDdwF48AG10ukEKVU/7sDDGoq8HcSAGZu4FERhqVSJxwvQKKKRhp 5hAbA8MuY//3F7dElla06nmoDW2VGgRfttJKWP8tByEtr+OlPXkBqiZ4UYDSe3tSRFPX /vyTsrDwVYyQVKFLrfO38u3HCxSYsgO0qZinhL65Bb3JQq6qEizR6EelrZh8Io9rGTtZ sGUg== 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=kML0V9gFjLV5gLiDVNbnniIhi5NlP+Z/U/tvf5QMaeo=; b=ZNe2uPDzcLawPJ3FbKdoe+f/ziNRIq7tPzjVVZq3YQvVDuA+kj27fzvgYICfblnr5o avZTWleln0F8D14XQiIUwNZ4/4F10oikvftwIqXNglEUM7QQxohGfQ4HnPF1T3C6beHY 6rf1D1P1E5tByN8eHvsfX2FYtFRqeMsst3okTS7FJwtSPQZRFdlUh/Ux4C+oTuRZRMre z2sezi17GxvxleD0NuuM6Ca5W8hOD1xY4e4CrTrX1aF4NqAKjDVwCGlrBjhhsqRorAMn WVzwn8jyi7Flel3BGCmjItKe4tyKJfgWLW1kV4jaOZnoy6cJExof9jWAw3UUWAuM+tAW 362A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gCbYUGaT; 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 j19-20020a05640211d300b00458ab55ccc9si8418150edw.168.2022.11.27.23.00.30; Sun, 27 Nov 2022 23:00:55 -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=gCbYUGaT; 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 S229916AbiK1G5H (ORCPT + 99 others); Mon, 28 Nov 2022 01:57:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiK1G41 (ORCPT ); Mon, 28 Nov 2022 01:56:27 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C0DF15A3F for ; Sun, 27 Nov 2022 22:56: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=1669618586; x=1701154586; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nLuhPxobe8kTeSr/8uapIkQWPmWiW5lqkROueW3ss2c=; b=gCbYUGaTLvOVEdjRfB1CZtHfIF+Ba76Ot04FN3GdSw0yRkyStReMqZAE uOhmMFj+NfQM20lBIQ/ZYWdFRptGVmd1olDZAMlAsaMZ2l7YPv6SctWtW zE0hTROyQ548v0kLfP5PD1I4Ywipi3hf5Cz0CS7dHMjeSXWfGSgFH4rrX KCqcsBhDf2TiYKg6VchErv22NsZfV7XLoXmHPQzdvsGL9ajG2E0Osi4pH u0HRfJLTQQi3eKqt6kEHMdKLGbqszvWcClkEjr3aG7ykA7fHv8Ht5Lt9s xq5a5oYfaVid3LKFnawGk63fTSrEpbqDz3JOX7OdLuVgNum5kZAmhMquz Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="313459258" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="313459258" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 22:56:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="674121355" X-IronPort-AV: E=Sophos;i="5.96,199,1665471600"; d="scan'208";a="674121355" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga008.jf.intel.com with ESMTP; 27 Nov 2022 22:56:19 -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 v3 20/20] iommu: Rename attach_dev to set_dev Date: Mon, 28 Nov 2022 14:46:48 +0800 Message-Id: <20221128064648.1934720-21-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128064648.1934720-1-baolu.lu@linux.intel.com> References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722260779555800?= X-GMAIL-MSGID: =?utf-8?q?1750722260779555800?= With the retirement of the detach_dev callback, the naming of attach_dev isn't meaningful anymore. Rename it to set_dev to restore its real meaning, that is, setting an iommu domain to a device. Signed-off-by: Lu Baolu --- include/linux/iommu.h | 4 ++-- drivers/iommu/amd/iommu.c | 2 +- drivers/iommu/apple-dart.c | 2 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 2 +- drivers/iommu/exynos-iommu.c | 2 +- drivers/iommu/fsl_pamu_domain.c | 2 +- drivers/iommu/intel/iommu.c | 4 ++-- drivers/iommu/iommu.c | 4 ++-- drivers/iommu/ipmmu-vmsa.c | 2 +- drivers/iommu/msm_iommu.c | 2 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- drivers/iommu/omap-iommu.c | 2 +- drivers/iommu/rockchip-iommu.c | 2 +- drivers/iommu/s390-iommu.c | 2 +- drivers/iommu/sprd-iommu.c | 2 +- drivers/iommu/sun50i-iommu.c | 2 +- drivers/iommu/tegra-gart.c | 2 +- drivers/iommu/tegra-smmu.c | 2 +- drivers/iommu/virtio-iommu.c | 2 +- 22 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 4c0491e5708c..1def4b4bb2b9 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -281,7 +281,7 @@ struct iommu_ops { /** * struct iommu_domain_ops - domain specific operations - * @attach_dev: attach an iommu domain to a device + * @set_dev: set an iommu domain to a device * Return: * * 0 - success * * EINVAL - can indicate that device and domain are incompatible due to @@ -313,7 +313,7 @@ struct iommu_ops { * @free: Release the domain after use. */ struct iommu_domain_ops { - int (*attach_dev)(struct iommu_domain *domain, struct device *dev); + int (*set_dev)(struct iommu_domain *domain, struct device *dev); int (*set_dev_pasid)(struct iommu_domain *domain, struct device *dev, ioasid_t pasid); diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index bd1970b4f48b..f628bd0f9632 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2388,7 +2388,7 @@ const struct iommu_ops amd_iommu_ops = { .pgsize_bitmap = AMD_IOMMU_PGSIZES, .def_domain_type = amd_iommu_def_domain_type, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = amd_iommu_attach_device, + .set_dev = amd_iommu_attach_device, .map_pages = amd_iommu_map_pages, .unmap_pages = amd_iommu_unmap_pages, .iotlb_sync_map = amd_iommu_iotlb_sync_map, diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 6fbe6b275c79..77c9e7d3e1a2 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -763,7 +763,7 @@ static const struct iommu_ops apple_dart_iommu_ops = { .pgsize_bitmap = -1UL, /* Restricted during dart probe */ .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = apple_dart_attach_dev, + .set_dev = apple_dart_attach_dev, .map_pages = apple_dart_map_pages, .unmap_pages = apple_dart_unmap_pages, .flush_iotlb_all = apple_dart_flush_iotlb_all, diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index ab160198edd6..194c304c5ee8 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2859,7 +2859,7 @@ static struct iommu_ops arm_smmu_ops = { .pgsize_bitmap = -1UL, /* Restricted during device attach */ .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = arm_smmu_attach_dev, + .set_dev = arm_smmu_attach_dev, .map_pages = arm_smmu_map_pages, .unmap_pages = arm_smmu_unmap_pages, .flush_iotlb_all = arm_smmu_flush_iotlb_all, diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 719fbca1fe52..e31002d84b4a 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1567,7 +1567,7 @@ static struct iommu_ops arm_smmu_ops = { .pgsize_bitmap = -1UL, /* Restricted during device attach */ .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = arm_smmu_attach_dev, + .set_dev = arm_smmu_attach_dev, .map_pages = arm_smmu_map_pages, .unmap_pages = arm_smmu_unmap_pages, .flush_iotlb_all = arm_smmu_flush_iotlb_all, diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index d7be3adee426..195add905364 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -560,7 +560,7 @@ static const struct iommu_ops qcom_iommu_ops = { .of_xlate = qcom_iommu_of_xlate, .pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = qcom_iommu_attach_dev, + .set_dev = qcom_iommu_attach_dev, .map_pages = qcom_iommu_map, .unmap_pages = qcom_iommu_unmap, .flush_iotlb_all = qcom_iommu_flush_iotlb_all, diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 29ec713e8a21..7e735929e395 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1403,7 +1403,7 @@ static const struct iommu_ops exynos_iommu_ops = { .pgsize_bitmap = SECT_SIZE | LPAGE_SIZE | SPAGE_SIZE, .of_xlate = exynos_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = exynos_iommu_attach_device, + .set_dev = exynos_iommu_attach_device, .map = exynos_iommu_map, .unmap = exynos_iommu_unmap, .iova_to_phys = exynos_iommu_iova_to_phys, diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 272d88e415c6..c66e48b0ed6f 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -462,7 +462,7 @@ static const struct iommu_ops fsl_pamu_ops = { .device_group = fsl_pamu_device_group, .set_platform_dma = fsl_pamu_set_platform_dma; .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = fsl_pamu_attach_device, + .set_dev = fsl_pamu_attach_device, .iova_to_phys = fsl_pamu_iova_to_phys, .free = fsl_pamu_domain_free, } diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index cd71194fe7a6..7bcadb702e00 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4131,7 +4131,7 @@ static int blocking_domain_attach_dev(struct iommu_domain *domain, static struct iommu_domain blocking_domain = { .ops = &(const struct iommu_domain_ops) { - .attach_dev = blocking_domain_attach_dev, + .set_dev = blocking_domain_attach_dev, .free = intel_iommu_domain_free } }; @@ -4750,7 +4750,7 @@ const struct iommu_ops intel_iommu_ops = { .page_response = intel_svm_page_response, #endif .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = intel_iommu_attach_device, + .set_dev = intel_iommu_attach_device, .map_pages = intel_iommu_map_pages, .unmap_pages = intel_iommu_unmap_pages, .iotlb_sync_map = intel_iommu_iotlb_sync_map, diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index e4966f088184..dca31065cdb5 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1983,10 +1983,10 @@ static int __iommu_attach_device(struct iommu_domain *domain, { int ret; - if (unlikely(domain->ops->attach_dev == NULL)) + if (unlikely(!domain->ops->set_dev)) return -ENODEV; - ret = domain->ops->attach_dev(domain, dev); + ret = domain->ops->set_dev(domain, dev); if (!ret) trace_attach_device_to_domain(dev); return ret; diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 3112822ac7be..8d40a2c150d4 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -860,7 +860,7 @@ static const struct iommu_ops ipmmu_ops = { .pgsize_bitmap = SZ_1G | SZ_2M | SZ_4K, .of_xlate = ipmmu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = ipmmu_attach_device, + .set_dev = ipmmu_attach_device, .map_pages = ipmmu_map, .unmap_pages = ipmmu_unmap, .flush_iotlb_all = ipmmu_flush_iotlb_all, diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 564f9dc0140d..9f7432443726 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -690,7 +690,7 @@ static struct iommu_ops msm_iommu_ops = { .pgsize_bitmap = MSM_IOMMU_PGSIZES, .of_xlate = qcom_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = msm_iommu_attach_dev, + .set_dev = msm_iommu_attach_dev, .map_pages = msm_iommu_map, .unmap_pages = msm_iommu_unmap, /* diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2022f47529c1..6bd4eb39c08f 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -940,7 +940,7 @@ static const struct iommu_ops mtk_iommu_ops = { .pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M, .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = mtk_iommu_attach_device, + .set_dev = mtk_iommu_attach_device, .map_pages = mtk_iommu_map, .unmap_pages = mtk_iommu_unmap, .flush_iotlb_all = mtk_iommu_flush_iotlb_all, diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index c2d80b7a377f..785fc1569bc7 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -596,7 +596,7 @@ static const struct iommu_ops mtk_iommu_v1_ops = { .set_platform_dma = mtk_iommu_v1_set_platform_dma, .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = mtk_iommu_v1_attach_device, + .set_dev = mtk_iommu_v1_attach_device, .map_pages = mtk_iommu_v1_map, .unmap_pages = mtk_iommu_v1_unmap, .iova_to_phys = mtk_iommu_v1_iova_to_phys, diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index c3eedab00038..6f1031336611 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1748,7 +1748,7 @@ static const struct iommu_ops omap_iommu_ops = { .set_platform_dma = omap_iommu_set_platform_dma, .pgsize_bitmap = OMAP_IOMMU_PGSIZES, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = omap_iommu_attach_dev, + .set_dev = omap_iommu_attach_dev, .map = omap_iommu_map, .unmap = omap_iommu_unmap, .iova_to_phys = omap_iommu_iova_to_phys, diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index f30db22ea5d7..5381dbf624ad 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1191,7 +1191,7 @@ static const struct iommu_ops rk_iommu_ops = { .pgsize_bitmap = RK_IOMMU_PGSIZE_BITMAP, .of_xlate = rk_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = rk_iommu_attach_device, + .set_dev = rk_iommu_attach_device, .map = rk_iommu_map, .unmap = rk_iommu_unmap, .iova_to_phys = rk_iommu_iova_to_phys, diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index 33dba5ee5e20..5fa8ea6687e7 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -447,7 +447,7 @@ static const struct iommu_ops s390_iommu_ops = { .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, + .set_dev = s390_iommu_attach_device, .map_pages = s390_iommu_map_pages, .unmap_pages = s390_iommu_unmap_pages, .flush_iotlb_all = s390_iommu_flush_iotlb_all, diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index ae94d74b73f4..e105fa476e94 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -398,7 +398,7 @@ static const struct iommu_ops sprd_iommu_ops = { .pgsize_bitmap = SPRD_IOMMU_PAGE_SIZE, .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = sprd_iommu_attach_device, + .set_dev = sprd_iommu_attach_device, .map_pages = sprd_iommu_map, .unmap_pages = sprd_iommu_unmap, .iotlb_sync_map = sprd_iommu_sync_map, diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 37b074be87a5..2a35148c2b65 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -834,7 +834,7 @@ static const struct iommu_ops sun50i_iommu_ops = { .of_xlate = sun50i_iommu_of_xlate, .probe_device = sun50i_iommu_probe_device, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = sun50i_iommu_attach_device, + .set_dev = sun50i_iommu_attach_device, .flush_iotlb_all = sun50i_iommu_flush_iotlb_all, .iotlb_sync_map = sun50i_iommu_iotlb_sync_map, .iotlb_sync = sun50i_iommu_iotlb_sync, diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index a532b333233f..2b3944d10735 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -282,7 +282,7 @@ static const struct iommu_ops gart_iommu_ops = { .pgsize_bitmap = GART_IOMMU_PGSIZES, .of_xlate = gart_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = gart_iommu_attach_dev, + .set_dev = gart_iommu_attach_dev, .map = gart_iommu_map, .unmap = gart_iommu_unmap, .iova_to_phys = gart_iommu_iova_to_phys, diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 247d485904c1..b9f035069794 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -977,7 +977,7 @@ static const struct iommu_ops tegra_smmu_ops = { .of_xlate = tegra_smmu_of_xlate, .pgsize_bitmap = SZ_4K, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = tegra_smmu_attach_dev, + .set_dev = tegra_smmu_attach_dev, .map = tegra_smmu_map, .unmap = tegra_smmu_unmap, .iova_to_phys = tegra_smmu_iova_to_phys, diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 5b8fe9bfa9a5..c407c4b213db 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -1028,7 +1028,7 @@ static struct iommu_ops viommu_ops = { .of_xlate = viommu_of_xlate, .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { - .attach_dev = viommu_attach_dev, + .set_dev = viommu_attach_dev, .map_pages = viommu_map_pages, .unmap_pages = viommu_unmap_pages, .iova_to_phys = viommu_iova_to_phys,