From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755866AbdBNVyR (ORCPT ); Tue, 14 Feb 2017 16:54:17 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:52821 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753857AbdBNVyO (ORCPT ); Tue, 14 Feb 2017 16:54:14 -0500 From: Arnd Bergmann To: Thomas Gleixner Cc: Alex Williamson , Arnd Bergmann , Marc Zyngier , Bjorn Helgaas , Bart Van Assche , linux-kernel@vger.kernel.org Subject: [PATCH] genirq/msi: add stubs for get_cached_msi_msg/pci_write_msi_msg Date: Tue, 14 Feb 2017 22:53:12 +0100 Message-Id: <20170214215343.3307861-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:q/QBfqEuc1Ott37M5YOYTWZXs0sJzhqQrD24vDk5/NGtAX+bFNd TmXe43IOBkZ5laj93f3IIUtAK/VLjIz+OSUXFlEDkF4yMlwbTTUG/Vi/13Dcut9rtvIJjHj MtR4ZVa5qeDOHMh/F4dCbBFnU7p07IVuVeW83ywtpKaZ4QNfq9310k+cywN+wIgvSGYp30v dY1MQIx3vDeW+b1KBrYxQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:6+69nHg4Jsw=:6RV/Cq3ue7+DCfz82GnRSH 34LfFp4t+c4sgeuRM0uxamHm8xOAa1sjiSbjcSfbCVsNmmsFMoNvEpi72D3RFzZ5CDbAqBTUv EorUHqt/jifxVyy/LMdRi5xZ73Cx2k/IYfuGBD2rSrFeSQKQ4HWESe5/VNHjMf1g1B4Vbp8Bs U6ecTCbs6xrBNao0NMF0u4X3r10RmP5fzkYJ+V/wow8rXVRqrTjKjdHpHKxfnIipDVudzsZ2H aTahR1u1zgEBYumycqYciBNk+pbZNyAIwV6s444AZnTujXeM+ctJroYZ474lTCOD3f8vCrMJq QNWIzfa8Srl9ELW3aGomHUDKtpCcddFNzjhVqjIMkkglaOS/xZRpqatoDn0vORbYi5XK5JT8d 18TrpTW1Al9n+MksfpPQiuiyc+5Fao79EmUmUCB9fA4fbtxP+v7Uf78I9CGW9eCJ+Kx7yLVOz Oxd8f2gO27LAmS8N8THBxIAC5CVVYrZF8QfRkR8vkzwst1BbXpRnRet64AHu8ehcTetRY6G0u B0uAEiNd9KIOeL2jwbjKxmftqa1tTSjV9T74fAWIZYj2Cppa/3c6Esq78qmwhXkBM99RPFTj7 vSC7OvVZ0Mb1Zxrh97ojx1HFfq7xJQVRWH0cmSydg2nAZ70d5p0yTd8hkCaKsE/EaXHpnijRh R4Pf92/uytL7eO/dYzGBlg+ph9Wiz6F4ZpfDvSSFt59g994OCxDABwEl0wbnPaB6zhK0= Sender: linux-kernel-owner@vger.kernel.org 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' As suggested by Alex Williamson, this adds stub implementations for get_cached_msi_msg() and pci_write_msi_msg(). In case this bugfix gets backported, please note that the #ifdef has changed over time, originally both functions were implemented in drivers/pci/msi.c and controlled by CONFIG_PCI_MSI, while nowadays get_cached_msi_msg() is part of the generic MSI support and can be used without PCI. Signed-off-by: Arnd Bergmann Fixes: b8f02af096b1 ("vfio/pci: Restore MSIx message prior to enabling") Link: https://lkml.org/lkml/2014/10/13/124 --- I had a workaround for this hidden in my randconfig tree but have now stumbled over it again, sorry for not following up a couple of years earlier. --- include/linux/msi.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/msi.h b/include/linux/msi.h index 0db320b7bb15..a83b84ff70e5 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -17,7 +17,13 @@ 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_GENERIC_MSI_IRQ 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); @@ -116,11 +122,15 @@ struct msi_desc { struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc); void *msi_desc_to_pci_sysdata(struct msi_desc *desc); +void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg); #else /* CONFIG_PCI_MSI */ static inline void *msi_desc_to_pci_sysdata(struct msi_desc *desc) { return NULL; } +static inline void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg) +{ +} #endif /* CONFIG_PCI_MSI */ struct msi_desc *alloc_msi_entry(struct device *dev, int nvec, @@ -128,7 +138,6 @@ struct msi_desc *alloc_msi_entry(struct device *dev, int nvec, 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); -void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg); 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); -- 2.9.0