From patchwork Wed May 15 03:34:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 10944209 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 346846C5 for ; Wed, 15 May 2019 03:25:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F46628978 for ; Wed, 15 May 2019 03:25:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D51B289A7; Wed, 15 May 2019 03:25:38 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable 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 B0A5428978 for ; Wed, 15 May 2019 03:25:37 +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: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:In-Reply-To:References: List-Owner; bh=SlTgNzu6hMd11f1LShCV4wcdFwLd84lz/cED3zLPSG8=; b=GCNyn38Z0NqnN5 rOfDLOECZMvphKjtA4QeiCg1Huf/OJORi4KhIX58cNSDly+RxIr8YLmLQABVgY1KL8eHav5qS/BEQ rTPERvOMAZaug4LEzGY8Ng4oSy2jNrHUFbtB+f+21SuymLRYloTsfxNmGy233S92HZ7axDNAy7jj9 Pv5DxoYORFUkEr8cOY/sRdyLbKJSrg+8GU+s99NcTVhyzkzUDQqO+SviGnJZynVHyFfBuOPl8NWzG zPto/9J0+1FawTEkDc3dnSluGAKhDsxvyVws8t835KcmT6laivCiRK3M34/Omf7K8v3Qlo7t6MDMc 4i+iW0RfyZL6+2U2cCOQ==; 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 1hQkXt-00028i-21; Wed, 15 May 2019 03:25:33 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQkXo-00027K-OQ for linux-arm-kernel@lists.infradead.org; Wed, 15 May 2019 03:25:30 +0000 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A980A42DC83E8B82F892; Wed, 15 May 2019 11:25:06 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Wed, 15 May 2019 11:24:58 +0800 From: Kefeng Wang To: , Subject: [PATCH] ACPI/IORT: Fix build error when IOMMU_SUPPORT disabled Date: Wed, 15 May 2019 11:34:06 +0800 Message-ID: <20190515033406.79020-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190514_202529_022928_9F973C3D X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jean-Philippe Brucker , Kefeng Wang , Lorenzo Pieralisi , Will Deacon , guohanjun@huawei.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 drivers/acpi/arm64/iort.c: In function iort_iommu_configure: drivers/acpi/arm64/iort.c:1079:21: error: struct iommu_fwspec has no member named flags dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; ^~ drivers/acpi/arm64/iort.c:1079:32: error: IOMMU_FWSPEC_PCI_RC_ATS undeclared (first use in this function) dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; ^~~~~~~~~~~~~~~~~~~~~~~ drivers/acpi/arm64/iort.c:1079:32: note: each undeclared identifier is reported only once for each function it appears in Cc: Jean-Philippe Brucker Cc: Lorenzo Pieralisi Cc: Will Deacon Fixes: 5702ee24182f ("ACPI/IORT: Check ATS capability in root complex nodes") Signed-off-by: Kefeng Wang --- drivers/acpi/arm64/iort.c | 2 +- include/linux/iommu.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 9058cb084b91..4ccf0dd99852 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -1076,7 +1076,7 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) iort_pci_iommu_init, &info); if (!err && iort_pci_rc_supports_ats(node)) - dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; + iommu_fwspec_set_ats_flags(dev); } else { int i = 0; diff --git a/include/linux/iommu.h b/include/linux/iommu.h index a815cf6f6f47..0a84556c0eb6 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -479,6 +479,11 @@ static inline void dev_iommu_fwspec_set(struct device *dev, dev->iommu_fwspec = fwspec; } +static inline void iommu_fwspec_set_ats_flags(struct device *dev) +{ + dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; +} + int iommu_probe_device(struct device *dev); void iommu_release_device(struct device *dev); @@ -770,6 +775,10 @@ static inline void iommu_fwspec_free(struct device *dev) { } +static inline void iommu_fwspec_set_ats_flags(struct device *dev) +{ +} + static inline int iommu_fwspec_add_ids(struct device *dev, u32 *ids, int num_ids) {