Message ID | 20221128064648.1934720-14-baolu.lu@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;gah0developer@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <baolu.lu@linux.intel.com> To: Joerg Roedel <joro@8bytes.org>, Jason Gunthorpe <jgg@nvidia.com>, Christoph Hellwig <hch@infradead.org>, Kevin Tian <kevin.tian@intel.com>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Jean-Philippe Brucker <jean-philippe@linaro.org> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>, Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>, Rob Clark <robdclark@gmail.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Yong Wu <yong.wu@mediatek.com>, Matthias Brugger <matthias.bgg@gmail.com>, Heiko Stuebner <heiko@sntech.de>, Matthew Rosato <mjrosato@linux.ibm.com>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Thierry Reding <thierry.reding@gmail.com>, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu <baolu.lu@linux.intel.com> Subject: [PATCH 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750722088733542748?= X-GMAIL-MSGID: =?utf-8?q?1750722088733542748?= |
Series |
iommu: Retire detach_dev callback
|
|
Commit Message
Baolu Lu
Nov. 28, 2022, 6:46 a.m. UTC
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 <baolu.lu@linux.intel.com>
---
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,