From patchwork Sun Mar 31 12:34:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hawa, Hanna" X-Patchwork-Id: 10878725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CFCB4922 for ; Sun, 31 Mar 2019 12:35:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B45A7287D1 for ; Sun, 31 Mar 2019 12:35:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A56DC28952; Sun, 31 Mar 2019 12:35:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 49517287D1 for ; Sun, 31 Mar 2019 12:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m8CSAYcNgR+4R2FA4GxLEMNFeiaFtlk5kQRKLhR4QGg=; b=AbSRFhwfG4xUKq qyXZZKdKA5evOvIbTq3tP/Ay8Up4y8OVODWspzwnSPTHSq1WCmz67mdyKiE4Mew/tElGFLmiS3zMM RLR0/51R+aSRTd2BVSjTVWw8BPTQvjkxZzTixMmwI2564bNl9Q7mzrVI7tVKl2zLQspBsgpICT0x2 sVH7mTswNTWJwqg4z9M6DM+RDtmIlTJ5L89DWHYKgI2LvlgwjnCSdGpNToqhTEyjAbENhHszJHchL 1hkfAAhKrHBk2zBqQ1WaU7ZgScr7dbtQx9MoYlPptsz+GNjuermgKFwfNAmHeYw27hAlR6qa8qySN 8epQHmllhi1XmTs3kHIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAZgL-0006Tt-2r; Sun, 31 Mar 2019 12:35:25 +0000 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAZg5-00069A-Cs for linux-arm-kernel@lists.infradead.org; Sun, 31 Mar 2019 12:35:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1554035709; x=1585571709; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=UZvniym4k0zMasC4ZjUS54wGm2H/8Ph+7ayxg+KlP/U=; b=ClTjJ4l2nbKMDoMdVZt2IfucriGWTsSzB0MScLAou4geGIEewc6W5hfC +xh7pfvd8zQzz4wMeho6WA1GB66fd+O9M5fj2gSIfV8rouEHyxbVfvf4K jT579QoFzr2l1OQAo4DFGNhBFcjZ/Kb7FOAsM6X2BtTDuDeuxfromqMZr o=; X-IronPort-AV: E=Sophos;i="5.60,292,1549929600"; d="scan'208";a="791784885" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2a-f14f4a47.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Mar 2019 12:35:05 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2a-f14f4a47.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id x2VCZ0xH106428 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sun, 31 Mar 2019 12:35:03 GMT Received: from EX13D19EUB003.ant.amazon.com (10.43.166.69) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 31 Mar 2019 12:35:03 +0000 Received: from ub6d44c9ce3e25c.ant.amazon.com (10.43.160.69) by EX13D19EUB003.ant.amazon.com (10.43.166.69) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 31 Mar 2019 12:34:53 +0000 From: Hanna Hawa To: , , , , , , , , , Subject: [PATCH 1/7] irqchip/alpine-msi: Call IOMMU DMA mapping MSI message hook Date: Sun, 31 Mar 2019 15:34:09 +0300 Message-ID: <1554035655-11352-2-git-send-email-hhhawa@amazon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554035655-11352-1-git-send-email-hhhawa@amazon.com> References: <1554035655-11352-1-git-send-email-hhhawa@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.43.160.69] X-ClientProxiedBy: EX13P01UWA003.ant.amazon.com (10.43.160.197) To EX13D19EUB003.ant.amazon.com (10.43.166.69) Precedence: Bulk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190331_053509_713404_EBC4A1E6 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, barakw@amazon.com, hhhawa@amazon.com, vaerov@amazon.com, linux-kernel@vger.kernel.org, hanochu@amazon.com, linux-acpi@vger.kernel.org, zeev@amazon.com, dwmw@amazon.co.uk, jonnyc@amazon.com, ronenk@amazon.com, talel@amazon.com, alisaidi@amazon.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add missing IOMMU DMA mapping MSI message hook in compose_msi_msg() callback for Alpine MSIx driver, to map the MSI physical address to IOMMU IOVA for any device attached to IOMMU DMA ops domains. Signed-off-by: Hanna Hawa Co-developed-by: Vladimir Aerov Signed-off-by: Vladimir Aerov --- drivers/irqchip/irq-alpine-msi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-msi.c index 23a3b87..ae2fca7 100644 --- a/drivers/irqchip/irq-alpine-msi.c +++ b/drivers/irqchip/irq-alpine-msi.c @@ -12,6 +12,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -99,6 +100,12 @@ static void alpine_msix_compose_msi_msg(struct irq_data *data, msg->address_hi = upper_32_bits(msg_addr); msg->address_lo = lower_32_bits(msg_addr); msg->data = 0; + + /* + * Mapping MSI address to IOMMU IOVA, relevant for devices associated + * with IOMMU DMA ops domain. + */ + iommu_dma_map_msi_msg(data->irq, msg); } static struct msi_domain_info alpine_msix_domain_info = {