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 81404C4332F for ; Wed, 16 Nov 2022 16:16:43 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4NC7Tj6wwhz3dvh for ; Thu, 17 Nov 2022 03:16:41 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=fvHJksod; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=helgaas@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=fvHJksod; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4NC7S54DtHz3dvY for ; Thu, 17 Nov 2022 03:15:17 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BA68C61EB3; Wed, 16 Nov 2022 16:15:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7FF5C433C1; Wed, 16 Nov 2022 16:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668615314; bh=jVuqpvEFC7W6prrFUac475QeeZYTTYxuYTZUcm0S4nk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=fvHJksodCE+BmfIH4iURixL0h+Qx5bHlH1u2A1T39qpe+ZRm0gW3u9NiL/PoneJHF gBs6qQXnXxNhzk3JCdlSqhJzAeyZXOqDlCIk5tfGzK5J6NfxYqqGsIzhddwZKPhrl5 57OynNzSRecGFG2yBpWFUSfl5gJ+5eHVpQzQxC4w0mTIsuwDxjeAvrYGBypV6CylQs lPnDcFmAtgaAtuZ+n4h264NFBubzIca30hLaOzvYoIZxKbiMpOCHnPv/AcUdqIdEnI +i4S8ooMu4HgWl9ykepn/RqU1Nv5fwTeen8jc7KMRbnLel08Q1WvND13agJcsVDK5r sJTVHFkI3A8KQ== Date: Wed, 16 Nov 2022 10:15:12 -0600 From: Bjorn Helgaas To: Thomas Gleixner Subject: Re: [patch 14/39] PCI/MSI: Let the MSI core free descriptors Message-ID: <20221116161512.GA1114737@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111122014.409654736@linutronix.de> 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-pci@vger.kernel.org, Will Deacon , Lorenzo Pieralisi , Dave Jiang , Ashok Raj , Joerg Roedel , x86@kernel.org, Jason Gunthorpe , Allen Hubbe , Kevin Tian , "Ahmed S. Darwish" , Jon Mason , linuxppc-dev@lists.ozlabs.org, Alex Williamson , Bjorn Helgaas , Dan Williams , Reinette Chatre , Greg Kroah-Hartman , LKML , Marc Zyngier , Logan Gunthorpe Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Nov 11, 2022 at 02:54:37PM +0100, Thomas Gleixner wrote: > From: Ahmed S. Darwish > > Let the core do the freeing of descriptors and just keep it around for the > legacy case. > > Signed-off-by: Ahmed S. Darwish > Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas > --- > drivers/pci/msi/irqdomain.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > --- a/drivers/pci/msi/irqdomain.c > +++ b/drivers/pci/msi/irqdomain.c > @@ -24,11 +24,12 @@ void pci_msi_teardown_msi_irqs(struct pc > struct irq_domain *domain; > > domain = dev_get_msi_domain(&dev->dev); > - if (domain && irq_domain_is_hierarchy(domain)) > + if (domain && irq_domain_is_hierarchy(domain)) { > msi_domain_free_irqs_descs_locked(domain, &dev->dev); > - else > + } else { > pci_msi_legacy_teardown_msi_irqs(dev); > - msi_free_msi_descs(&dev->dev); > + msi_free_msi_descs(&dev->dev); > + } > } > > /** > @@ -170,6 +171,9 @@ struct irq_domain *pci_msi_create_irq_do > if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS) > pci_msi_domain_update_chip_ops(info); > > + /* Let the core code free MSI descriptors when freeing interrupts */ > + info->flags |= MSI_FLAG_FREE_MSI_DESCS; > + > info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS; > if (IS_ENABLED(CONFIG_GENERIC_IRQ_RESERVATION_MODE)) > info->flags |= MSI_FLAG_MUST_REACTIVATE; >