From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0DEBC433EF for ; Mon, 29 Nov 2021 07:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=US4HhiAYFIHhH49ONcKxkGFomvmRgfU5M+kJLkxvnxo=; b=qBVlaiOc19EEOj JhE4nI1kGZ+fVMiepsjmt7eQsdhXQfl1feMzXV+d+5xdZui4TgSHre0Zu4SV+FhGK1HbMlviadorA FCYnOVBwxMp3DliA7JrdHQzRdhhAZjjMBdtRcbRLmZxOvhzuDtUoFDvJcM3icHopMiMLKkJhWGHjU Vx4cmniH7uUIcHBx3MvOeL8Z1AG2tVxDJdcTUS3rFwF5vLMFE2ccYJreStoasLcIHKutpp7QSRboR qba184e9BvbJahUUHMeM5j+UK2zjVvptRJ4AhfQsAnH+4jzdgMhi5cZvGumVBglEmnxuN5XUQkBaW A/8uIjOB0GuKk1sGmCjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrbOQ-0002xn-EF; Mon, 29 Nov 2021 07:48:06 +0000 Received: from 6.mo548.mail-out.ovh.net ([188.165.58.48]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrbON-0002wq-90 for ath11k@lists.infradead.org; Mon, 29 Nov 2021 07:48:05 +0000 Received: from mxplan5.mail.ovh.net (unknown [10.108.16.148]) by mo548.mail-out.ovh.net (Postfix) with ESMTPS id BB56A20523; Mon, 29 Nov 2021 07:47:59 +0000 (UTC) Received: from kaod.org (37.59.142.103) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 29 Nov 2021 08:47:58 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-103G00595d4a801-821e-4892-b50b-80a730e95f26, 3279756C2EB34864E332BB908A933B747C53BE44) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <7e3022e0-2183-288b-a4ae-e2e1e0551b38@kaod.org> Date: Mon, 29 Nov 2021 08:47:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [patch 17/22] PCI/MSI: Split out !IRQDOMAIN code Content-Language: en-US To: Thomas Gleixner , LKML CC: , Paul Mackerras , , Wei Liu , Ashok Raj , Marc Zygnier , , Christian Borntraeger , Bjorn Helgaas , Jason Gunthorpe , , , , Kevin Tian , Heiko Carstens , Alex Williamson , Megha Dey , Juergen Gross , Thomas Bogendoerfer , Greg Kroah-Hartman , , References: <20211126222700.862407977@linutronix.de> <20211126223825.093887718@linutronix.de> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20211126223825.093887718@linutronix.de> X-Originating-IP: [37.59.142.103] X-ClientProxiedBy: DAG7EX2.mxp5.local (172.16.2.62) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 0f0123d7-fbb1-4bc8-86c7-5f8c7875e9d6 X-Ovh-Tracer-Id: 9632918131166251932 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddrheekgdehtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgihesthejredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpefhhfelgeeukedtteffvdffueeiuefgkeekleehleetfedtgfetffefheeugeelheenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehlihhnuhigphhptgdquggvvheslhhishhtshdrohiilhgrsghsrdhorhhg X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211128_234803_642069_3CAA4A26 X-CRM114-Status: GOOD ( 22.50 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "ath11k" Errors-To: ath11k-bounces+ath11k=archiver.kernel.org@lists.infradead.org On 11/27/21 02:19, Thomas Gleixner wrote: > Split out the non irqdomain code into its own file. > > Signed-off-by: Thomas Gleixner > --- > drivers/pci/msi/Makefile | 5 ++-- > drivers/pci/msi/legacy.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ > drivers/pci/msi/msi.c | 46 ------------------------------------------ > 3 files changed, 54 insertions(+), 48 deletions(-) > > --- a/drivers/pci/msi/Makefile > +++ b/drivers/pci/msi/Makefile > @@ -1,5 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0 > # > # Makefile for the PCI/MSI > -obj-$(CONFIG_PCI) += pcidev_msi.o > -obj-$(CONFIG_PCI_MSI) += msi.o > +obj-$(CONFIG_PCI) += pcidev_msi.o > +obj-$(CONFIG_PCI_MSI) += msi.o > +obj-$(CONFIG_PCI_MSI_ARCH_FALLBACKS) += legacy.o > --- /dev/null > +++ b/drivers/pci/msi/legacy.c > @@ -0,0 +1,51 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * PCI Message Signaled Interrupt (MSI). > + * > + * Legacy architecture specific setup and teardown mechanism. > + */ > +#include "msi.h" I am getting a : ../drivers/pci/msi/legacy.c:7:10: fatal error: msi.h: No such file or directory 7 | #include "msi.h" which seems to be fixed later. C. > + > +/* Arch hooks */ > +int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) > +{ > + return -EINVAL; > +} > + > +void __weak arch_teardown_msi_irq(unsigned int irq) > +{ > +} > + > +int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) > +{ > + struct msi_desc *desc; > + int ret; > + > + /* > + * If an architecture wants to support multiple MSI, it needs to > + * override arch_setup_msi_irqs() > + */ > + if (type == PCI_CAP_ID_MSI && nvec > 1) > + return 1; > + > + for_each_pci_msi_entry(desc, dev) { > + ret = arch_setup_msi_irq(dev, desc); > + if (ret) > + return ret < 0 ? ret : -ENOSPC; > + } > + > + return 0; > +} > + > +void __weak arch_teardown_msi_irqs(struct pci_dev *dev) > +{ > + struct msi_desc *desc; > + int i; > + > + for_each_pci_msi_entry(desc, dev) { > + if (desc->irq) { > + for (i = 0; i < entry->nvec_used; i++) > + arch_teardown_msi_irq(desc->irq + i); > + } > + } > +} > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -50,52 +50,6 @@ static void pci_msi_teardown_msi_irqs(st > #define pci_msi_teardown_msi_irqs arch_teardown_msi_irqs > #endif > > -#ifdef CONFIG_PCI_MSI_ARCH_FALLBACKS > -/* Arch hooks */ > -int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) > -{ > - return -EINVAL; > -} > - > -void __weak arch_teardown_msi_irq(unsigned int irq) > -{ > -} > - > -int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) > -{ > - struct msi_desc *entry; > - int ret; > - > - /* > - * If an architecture wants to support multiple MSI, it needs to > - * override arch_setup_msi_irqs() > - */ > - if (type == PCI_CAP_ID_MSI && nvec > 1) > - return 1; > - > - for_each_pci_msi_entry(entry, dev) { > - ret = arch_setup_msi_irq(dev, entry); > - if (ret < 0) > - return ret; > - if (ret > 0) > - return -ENOSPC; > - } > - > - return 0; > -} > - > -void __weak arch_teardown_msi_irqs(struct pci_dev *dev) > -{ > - int i; > - struct msi_desc *entry; > - > - for_each_pci_msi_entry(entry, dev) > - if (entry->irq) > - for (i = 0; i < entry->nvec_used; i++) > - arch_teardown_msi_irq(entry->irq + i); > -} > -#endif /* CONFIG_PCI_MSI_ARCH_FALLBACKS */ > - > /* > * PCI 2.3 does not specify mask bits for each MSI interrupt. Attempting to > * mask all MSI interrupts by clearing the MSI enable bit does not work > -- ath11k mailing list ath11k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath11k From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36CA1C433FE for ; Mon, 29 Nov 2021 08:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346675AbhK2IiG (ORCPT ); Mon, 29 Nov 2021 03:38:06 -0500 Received: from 10.mo548.mail-out.ovh.net ([46.105.77.235]:33601 "EHLO 10.mo548.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238658AbhK2IgF (ORCPT ); Mon, 29 Nov 2021 03:36:05 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.108.16.148]) by mo548.mail-out.ovh.net (Postfix) with ESMTPS id BB56A20523; Mon, 29 Nov 2021 07:47:59 +0000 (UTC) Received: from kaod.org (37.59.142.103) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 29 Nov 2021 08:47:58 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-103G00595d4a801-821e-4892-b50b-80a730e95f26, 3279756C2EB34864E332BB908A933B747C53BE44) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <7e3022e0-2183-288b-a4ae-e2e1e0551b38@kaod.org> Date: Mon, 29 Nov 2021 08:47:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [patch 17/22] PCI/MSI: Split out !IRQDOMAIN code Content-Language: en-US To: Thomas Gleixner , LKML CC: , Paul Mackerras , , Wei Liu , Ashok Raj , Marc Zygnier , , Christian Borntraeger , Bjorn Helgaas , Jason Gunthorpe , , , , Kevin Tian , Heiko Carstens , Alex Williamson , Megha Dey , Juergen Gross , Thomas Bogendoerfer , Greg Kroah-Hartman , , References: <20211126222700.862407977@linutronix.de> <20211126223825.093887718@linutronix.de> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20211126223825.093887718@linutronix.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [37.59.142.103] X-ClientProxiedBy: DAG7EX2.mxp5.local (172.16.2.62) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 0f0123d7-fbb1-4bc8-86c7-5f8c7875e9d6 X-Ovh-Tracer-Id: 9632918131166251932 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddrheekgdehtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgihesthejredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpefhhfelgeeukedtteffvdffueeiuefgkeekleehleetfedtgfetffefheeugeelheenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehlihhnuhigphhptgdquggvvheslhhishhtshdrohiilhgrsghsrdhorhhg Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/27/21 02:19, Thomas Gleixner wrote: > Split out the non irqdomain code into its own file. > > Signed-off-by: Thomas Gleixner > --- > drivers/pci/msi/Makefile | 5 ++-- > drivers/pci/msi/legacy.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ > drivers/pci/msi/msi.c | 46 ------------------------------------------ > 3 files changed, 54 insertions(+), 48 deletions(-) > > --- a/drivers/pci/msi/Makefile > +++ b/drivers/pci/msi/Makefile > @@ -1,5 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0 > # > # Makefile for the PCI/MSI > -obj-$(CONFIG_PCI) += pcidev_msi.o > -obj-$(CONFIG_PCI_MSI) += msi.o > +obj-$(CONFIG_PCI) += pcidev_msi.o > +obj-$(CONFIG_PCI_MSI) += msi.o > +obj-$(CONFIG_PCI_MSI_ARCH_FALLBACKS) += legacy.o > --- /dev/null > +++ b/drivers/pci/msi/legacy.c > @@ -0,0 +1,51 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * PCI Message Signaled Interrupt (MSI). > + * > + * Legacy architecture specific setup and teardown mechanism. > + */ > +#include "msi.h" I am getting a : ../drivers/pci/msi/legacy.c:7:10: fatal error: msi.h: No such file or directory 7 | #include "msi.h" which seems to be fixed later. C. > + > +/* Arch hooks */ > +int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) > +{ > + return -EINVAL; > +} > + > +void __weak arch_teardown_msi_irq(unsigned int irq) > +{ > +} > + > +int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) > +{ > + struct msi_desc *desc; > + int ret; > + > + /* > + * If an architecture wants to support multiple MSI, it needs to > + * override arch_setup_msi_irqs() > + */ > + if (type == PCI_CAP_ID_MSI && nvec > 1) > + return 1; > + > + for_each_pci_msi_entry(desc, dev) { > + ret = arch_setup_msi_irq(dev, desc); > + if (ret) > + return ret < 0 ? ret : -ENOSPC; > + } > + > + return 0; > +} > + > +void __weak arch_teardown_msi_irqs(struct pci_dev *dev) > +{ > + struct msi_desc *desc; > + int i; > + > + for_each_pci_msi_entry(desc, dev) { > + if (desc->irq) { > + for (i = 0; i < entry->nvec_used; i++) > + arch_teardown_msi_irq(desc->irq + i); > + } > + } > +} > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -50,52 +50,6 @@ static void pci_msi_teardown_msi_irqs(st > #define pci_msi_teardown_msi_irqs arch_teardown_msi_irqs > #endif > > -#ifdef CONFIG_PCI_MSI_ARCH_FALLBACKS > -/* Arch hooks */ > -int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) > -{ > - return -EINVAL; > -} > - > -void __weak arch_teardown_msi_irq(unsigned int irq) > -{ > -} > - > -int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) > -{ > - struct msi_desc *entry; > - int ret; > - > - /* > - * If an architecture wants to support multiple MSI, it needs to > - * override arch_setup_msi_irqs() > - */ > - if (type == PCI_CAP_ID_MSI && nvec > 1) > - return 1; > - > - for_each_pci_msi_entry(entry, dev) { > - ret = arch_setup_msi_irq(dev, entry); > - if (ret < 0) > - return ret; > - if (ret > 0) > - return -ENOSPC; > - } > - > - return 0; > -} > - > -void __weak arch_teardown_msi_irqs(struct pci_dev *dev) > -{ > - int i; > - struct msi_desc *entry; > - > - for_each_pci_msi_entry(entry, dev) > - if (entry->irq) > - for (i = 0; i < entry->nvec_used; i++) > - arch_teardown_msi_irq(entry->irq + i); > -} > -#endif /* CONFIG_PCI_MSI_ARCH_FALLBACKS */ > - > /* > * PCI 2.3 does not specify mask bits for each MSI interrupt. Attempting to > * mask all MSI interrupts by clearing the MSI enable bit does not work > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5E6FC433EF for ; Mon, 29 Nov 2021 08:08:06 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4J2dJP0Rlfz301B for ; Mon, 29 Nov 2021 19:08:05 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kaod.org (client-ip=46.105.45.231; helo=8.mo548.mail-out.ovh.net; envelope-from=clg@kaod.org; receiver=) Received: from 8.mo548.mail-out.ovh.net (8.mo548.mail-out.ovh.net [46.105.45.231]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4J2dHt0kM2z2ynV for ; Mon, 29 Nov 2021 19:07:36 +1100 (AEDT) Received: from mxplan5.mail.ovh.net (unknown [10.108.16.148]) by mo548.mail-out.ovh.net (Postfix) with ESMTPS id BB56A20523; Mon, 29 Nov 2021 07:47:59 +0000 (UTC) Received: from kaod.org (37.59.142.103) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 29 Nov 2021 08:47:58 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-103G00595d4a801-821e-4892-b50b-80a730e95f26, 3279756C2EB34864E332BB908A933B747C53BE44) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <7e3022e0-2183-288b-a4ae-e2e1e0551b38@kaod.org> Date: Mon, 29 Nov 2021 08:47:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [patch 17/22] PCI/MSI: Split out !IRQDOMAIN code Content-Language: en-US To: Thomas Gleixner , LKML References: <20211126222700.862407977@linutronix.de> <20211126223825.093887718@linutronix.de> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20211126223825.093887718@linutronix.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [37.59.142.103] X-ClientProxiedBy: DAG7EX2.mxp5.local (172.16.2.62) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 0f0123d7-fbb1-4bc8-86c7-5f8c7875e9d6 X-Ovh-Tracer-Id: 9632918131166251932 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddrheekgdehtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgihesthejredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpefhhfelgeeukedtteffvdffueeiuefgkeekleehleetfedtgfetffefheeugeelheenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehlihhnuhigphhptgdquggvvheslhhishhtshdrohiilhgrsghsrdhorhhg X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Paul Mackerras , sparclinux@vger.kernel.org, Wei Liu , Ashok Raj , Marc Zygnier , x86@kernel.org, Christian Borntraeger , Bjorn Helgaas , Jason Gunthorpe , xen-devel@lists.xenproject.org, ath11k@lists.infradead.org, Kevin Tian , Heiko Carstens , Alex Williamson , Megha Dey , Juergen Gross , Thomas Bogendoerfer , Greg Kroah-Hartman , linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 11/27/21 02:19, Thomas Gleixner wrote: > Split out the non irqdomain code into its own file. > > Signed-off-by: Thomas Gleixner > --- > drivers/pci/msi/Makefile | 5 ++-- > drivers/pci/msi/legacy.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ > drivers/pci/msi/msi.c | 46 ------------------------------------------ > 3 files changed, 54 insertions(+), 48 deletions(-) > > --- a/drivers/pci/msi/Makefile > +++ b/drivers/pci/msi/Makefile > @@ -1,5 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0 > # > # Makefile for the PCI/MSI > -obj-$(CONFIG_PCI) += pcidev_msi.o > -obj-$(CONFIG_PCI_MSI) += msi.o > +obj-$(CONFIG_PCI) += pcidev_msi.o > +obj-$(CONFIG_PCI_MSI) += msi.o > +obj-$(CONFIG_PCI_MSI_ARCH_FALLBACKS) += legacy.o > --- /dev/null > +++ b/drivers/pci/msi/legacy.c > @@ -0,0 +1,51 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * PCI Message Signaled Interrupt (MSI). > + * > + * Legacy architecture specific setup and teardown mechanism. > + */ > +#include "msi.h" I am getting a : ../drivers/pci/msi/legacy.c:7:10: fatal error: msi.h: No such file or directory 7 | #include "msi.h" which seems to be fixed later. C. > + > +/* Arch hooks */ > +int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) > +{ > + return -EINVAL; > +} > + > +void __weak arch_teardown_msi_irq(unsigned int irq) > +{ > +} > + > +int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) > +{ > + struct msi_desc *desc; > + int ret; > + > + /* > + * If an architecture wants to support multiple MSI, it needs to > + * override arch_setup_msi_irqs() > + */ > + if (type == PCI_CAP_ID_MSI && nvec > 1) > + return 1; > + > + for_each_pci_msi_entry(desc, dev) { > + ret = arch_setup_msi_irq(dev, desc); > + if (ret) > + return ret < 0 ? ret : -ENOSPC; > + } > + > + return 0; > +} > + > +void __weak arch_teardown_msi_irqs(struct pci_dev *dev) > +{ > + struct msi_desc *desc; > + int i; > + > + for_each_pci_msi_entry(desc, dev) { > + if (desc->irq) { > + for (i = 0; i < entry->nvec_used; i++) > + arch_teardown_msi_irq(desc->irq + i); > + } > + } > +} > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -50,52 +50,6 @@ static void pci_msi_teardown_msi_irqs(st > #define pci_msi_teardown_msi_irqs arch_teardown_msi_irqs > #endif > > -#ifdef CONFIG_PCI_MSI_ARCH_FALLBACKS > -/* Arch hooks */ > -int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) > -{ > - return -EINVAL; > -} > - > -void __weak arch_teardown_msi_irq(unsigned int irq) > -{ > -} > - > -int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) > -{ > - struct msi_desc *entry; > - int ret; > - > - /* > - * If an architecture wants to support multiple MSI, it needs to > - * override arch_setup_msi_irqs() > - */ > - if (type == PCI_CAP_ID_MSI && nvec > 1) > - return 1; > - > - for_each_pci_msi_entry(entry, dev) { > - ret = arch_setup_msi_irq(dev, entry); > - if (ret < 0) > - return ret; > - if (ret > 0) > - return -ENOSPC; > - } > - > - return 0; > -} > - > -void __weak arch_teardown_msi_irqs(struct pci_dev *dev) > -{ > - int i; > - struct msi_desc *entry; > - > - for_each_pci_msi_entry(entry, dev) > - if (entry->irq) > - for (i = 0; i < entry->nvec_used; i++) > - arch_teardown_msi_irq(entry->irq + i); > -} > -#endif /* CONFIG_PCI_MSI_ARCH_FALLBACKS */ > - > /* > * PCI 2.3 does not specify mask bits for each MSI interrupt. Attempting to > * mask all MSI interrupts by clearing the MSI enable bit does not work >