From patchwork Wed May 1 13:58:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 163220 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp4554751ill; Wed, 1 May 2019 06:58:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZNmXCPoAjEsfz1SiJCXa+/gNwmsNWhC/dMVOD3x6Q5YkaJIZC7RjLyAN3XmjmJ0EDqmzx X-Received: by 2002:a65:6688:: with SMTP id b8mr51490723pgw.81.1556719138761; Wed, 01 May 2019 06:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556719138; cv=none; d=google.com; s=arc-20160816; b=JsNJaZYYQ1T+BzjzktduJLHV/Zk+RF4lCm/Dc0wLYrC5hDaHMpxo1fkozOorxa2to4 ceP3ryEbW99Xek3Kr5ebMlqh4AhBnkD/wcmh0N5WfFalyzmUfPG0qQLStML6L1bocLlS b9DcFti7XIBvh0VFApnbSdFoNkTkou4nnkiE74TzhiCznclRVatd1PugNlGRe/8mynaO FqMe+HEXeISwUFsJmmC17WirxbVIgXBd9rIW2bDTwd6EXXOvdBonCYyhhyOSLFk4EWM+ 6WpTYwJE4M292hLDJtAxbHQ0GYzIDR/yOJZUqJmfEH0a7Tc/WsLRkeQTnXQECvQIvDVk g82A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=MMDPb+rKSRQ12dw90+71TPUXBVe4BI4p4ARWII0uWys=; b=a83Zv7F9vr2BQqMzY91J/El49GojPo4+qruey6YzV1qYQsdOwO2O4BW94ZgDin8VS/ EskNKPmybmlJ8j6i4SzlXV80NcKCnR2BUlpfiMSQvPleFUQ9y/pVeAww3WIlnHjnTXEV lyOWUh7R98zeizO/zNW2goAKsxCXG+iSY/NHg+2ygTNl4KQGnTpyOPcAezwN3Ld016ih srR09kolo8K79nT4/tUTpEMl1DtrTTWHwzVL5kI/FhLEwcW5ZXFS0Z4VqqipkyqYgQHU S/okNbwk8cVrAIMOjkjl6Frqujcv0U9GJBaR/ozeyXcPNelBGhpZ7iwuGCa5ak8l7Be+ QNYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si38728229pgq.219.2019.05.01.06.58.58; Wed, 01 May 2019 06:58:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbfEAN64 (ORCPT + 30 others); Wed, 1 May 2019 09:58:56 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59756 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbfEAN6z (ORCPT ); Wed, 1 May 2019 09:58:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7424AA78; Wed, 1 May 2019 06:58:54 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 00E743F5AF; Wed, 1 May 2019 06:58:51 -0700 (PDT) From: Julien Grall To: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Cc: logang@deltatee.com, douliyangs@gmail.com, miquel.raynal@bootlin.com, marc.zyngier@arm.com, jason@lakedaemon.net, tglx@linutronix.de, joro@8bytes.org, robin.murphy@arm.com, bigeasy@linutronix.de, linux-rt-users@vger.kernel.org, Julien Grall , Eric Auger Subject: [PATCH v3 7/7] iommu/dma-iommu: Remove iommu_dma_map_msi_msg() Date: Wed, 1 May 2019 14:58:24 +0100 Message-Id: <20190501135824.25586-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190501135824.25586-1-julien.grall@arm.com> References: <20190501135824.25586-1-julien.grall@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A recent change split iommu_dma_map_msi_msg() in two new functions. The function was still implemented to avoid modifying all the callers at once. Now that all the callers have been reworked, iommu_dma_map_msi_msg() can be removed. Signed-off-by: Julien Grall Reviewed-by: Robin Murphy Reviewed-by: Eric Auger --- Changes in v3: - Add Robin's and Eric's reviewed-by Changes in v2: - Rework the commit message --- drivers/iommu/dma-iommu.c | 20 -------------------- include/linux/dma-iommu.h | 5 ----- 2 files changed, 25 deletions(-) -- 2.11.0 Acked-by: Joerg Roedel diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index f847904098f7..13916fefeb27 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -935,23 +935,3 @@ void iommu_dma_compose_msi_msg(struct msi_desc *desc, msg->address_lo &= cookie_msi_granule(domain->iova_cookie) - 1; msg->address_lo += lower_32_bits(msi_page->iova); } - -void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg) -{ - struct msi_desc *desc = irq_get_msi_desc(irq); - phys_addr_t msi_addr = (u64)msg->address_hi << 32 | msg->address_lo; - - if (WARN_ON(iommu_dma_prepare_msi(desc, msi_addr))) { - /* - * We're called from a void callback, so the best we can do is - * 'fail' by filling the message with obviously bogus values. - * Since we got this far due to an IOMMU being present, it's - * not like the existing address would have worked anyway... - */ - msg->address_hi = ~0U; - msg->address_lo = ~0U; - msg->data = ~0U; - } else { - iommu_dma_compose_msi_msg(desc, msg); - } -} diff --git a/include/linux/dma-iommu.h b/include/linux/dma-iommu.h index 0b781a98ee73..476e0c54de2d 100644 --- a/include/linux/dma-iommu.h +++ b/include/linux/dma-iommu.h @@ -84,7 +84,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr); void iommu_dma_compose_msi_msg(struct msi_desc *desc, struct msi_msg *msg); -void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg); void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list); #else @@ -124,10 +123,6 @@ static inline void iommu_dma_compose_msi_msg(struct msi_desc *desc, { } -static inline void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg) -{ -} - static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) { }