From patchwork Thu Feb 25 21:34:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102676 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp383233lbc; Thu, 25 Feb 2016 13:35:47 -0800 (PST) X-Received: by 10.98.12.8 with SMTP id u8mr65695098pfi.36.1456436147778; Thu, 25 Feb 2016 13:35:47 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wq13si14821619pac.86.2016.02.25.13.35.47; Thu, 25 Feb 2016 13:35:47 -0800 (PST) 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 S1752039AbcBYVfp (ORCPT + 30 others); Thu, 25 Feb 2016 16:35:45 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:51594 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494AbcBYVfo (ORCPT ); Thu, 25 Feb 2016 16:35:44 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LpfQU-1a2jM73CdC-00fO3q; Thu, 25 Feb 2016 22:35:05 +0100 From: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, alex.williamson@redhat.com, Arnd Bergmann , Marc Zyngier , Bjorn Helgaas , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH] pci: stub out some MSI functions Date: Thu, 25 Feb 2016 22:34:27 +0100 Message-Id: <1456436095-607394-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:/CLmfrduAxF4XAzP/Lex2BPIQTBB5IM8rWF80SiaHuF5OoPR3TP MSZ+/GrT/qr1NKawSYsxcUBlMCC3a5eiqqSh/u8iSAb0V3ci1952Nkl+Xocet2si+AWhv2V vd4wOy6CjGpUC+qN9+1HKiYnVcvpCOlJvy+oUYlZV3LokIT3g0noxFu+hKH4eZf5+1AvNRE ni1uxfdtr5N2LkAwhrJpw== X-UI-Out-Filterresults: notjunk:1; V01:K0:LL1IunN0U0M=:MH/LD8F4M5pZLEHJ8qeud9 wJ42ZiNiX8YPvFJ4vDR+1ZI5kjgfhAoqJEpDPomouRx1be4g2VXIjzCnMrrst+WUm+Lpx53DI b7/8+lFqJ5A4Or1hID5KED5XNd55vqZOn+qv/hir0DXmb/YFsZWt3jyLDF6oBC8vyqhPjOgcN J6BtAK0yU83xb3xsd7ZviAEdt3UmJ9aLzvJogXFQ9eF7C6ZnVVKLhmVOBXoOpx3uR/DYSaqlk tP78YCMg+WouREZJawjAxJPIG30/KjxMSO94adrGCTsQv1jAgyIn0kJG2MPXPZ9oUQ3hPko76 xkZupHGbk9++5bfQ+E0qiB5ydMzZLrmPdO0FCT+IfkkR4EslMzCs10gdHfn+rTlIu4SA10bUb C4Rx6q6s5vOxx1rN8ofL28mo77b/Qg6dEmZaG7wzwk3W8XyZM1hBUmQ4A6X1yJLoME2CiDncY Tp+IuYOv3oH2hxZpYZaxevVCN8EGUR9Tsf09J6JFS4Spu7tiVmPxdL7WpH+Utp4CGjiHA4SJq PiY97aVPcudml8I3CrJOqdQucNhHyZFei4oOV7PR/2k4cycXU51J7kwz/UfnCN2WnkXPVWhGX TwutQMj2y+0QZ7DY6egFdB8KBjVYOaRRE5QtQe16KaonX9OhynQv4m3VVhP4GOD1Jxhyv3uFn V3G03sN5jHwy2Sl0NtJWJrhNMlY8PqxvRKOl5oa4ranviC9I1JIfh0QOd9c/wXRohRnM= To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A bug fix to the MSIx handling in vfio added references to functions that may not be defined if MSI is disabled in the kernel, resulting in this link error: drivers/built-in.o: In function `vfio_msi_set_vector_signal': :(.text+0x450808): undefined reference to `get_cached_msi_msg' :(.text+0x45080c): undefined reference to `write_msi_msg' When MSI is disabled, we should never get into this code path, so by adding stub implementations we can avoid the link error without causing any other changes. Signed-off-by: Arnd Bergmann Fixes: b8f02af096b1 ("vfio/pci: Restore MSIx message prior to enabling") Link: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-October/294293.html --- include/linux/msi.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.7.0 diff --git a/include/linux/msi.h b/include/linux/msi.h index 8b425c66305a..ae9a65cd6d43 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -17,7 +17,15 @@ struct msi_desc; struct pci_dev; struct platform_msi_priv_data; void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); + +#ifdef CONFIG_PCI_MSI void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); +#else +static inline void get_cached_msi_msg(unsigned int irq, + struct msi_msg *msg) +{ +} +#endif typedef void (*irq_write_msi_msg_t)(struct msi_desc *desc, struct msi_msg *msg); @@ -125,7 +133,14 @@ struct msi_desc *alloc_msi_entry(struct device *dev); void free_msi_entry(struct msi_desc *entry); void __pci_read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); + +#ifdef CONFIG_PCI_MSI void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg); +#else +static inline void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg) +{ +} +#endif u32 __pci_msix_desc_mask_irq(struct msi_desc *desc, u32 flag); u32 __pci_msi_desc_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);