From patchwork Thu Nov 17 15:08:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 21724 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp453257wrr; Thu, 17 Nov 2022 07:11:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf7vX4WHY7X0eR9k+A6ctDyAH50WK6MfZL7hm8pu9veoa9RU7DOCMfwnOkXo4wUmDiq4hp5u X-Received: by 2002:a17:906:3a4c:b0:7ae:4f8f:36c with SMTP id a12-20020a1709063a4c00b007ae4f8f036cmr2422607ejf.137.1668697904205; Thu, 17 Nov 2022 07:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668697904; cv=none; d=google.com; s=arc-20160816; b=aEvdNmmDBHjPE0Xu4zZwlnsd0qCISLwArlXASfrzTP/v0fhjSpd0oe5lmA72qJlyOK Mn9JUhDHpj8mANU2zl9/ZxUGNOYubEqRUje3gjptem2tCELIQ5Y3WO/N4zdD9XlX+EZs 05P82iOVMqIusTprqrGu1svTfmRQuvHc0pD+3GXVUeVj81WSgOUq6TNDQMISMzno8wVZ phdlzuwwvrory3n50zP+XxjMMu3aQ2rlCkGcA95rtSVg3OI/Hm6DOBSDkgTbic1A5cBN s99Xy9lHe6ahbY5AQGBB2HvklwtzE6OqFJHVHc1DKt8O+AUJYRzbQExbXE76N2sTcK2n sJFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=22RMjeZ9ETKCP9UZiZ2z3rOsKYgMh4RjNDTkJH0aR3c=; b=fiYI9eg1g1UZkNmxW6FpKyXQ2QNIA3q2jirykVUUBBGu8oEhbuO7qXkDBYrBr4Oz/E pyca/j7H95OwYOgNK5AUujtxa3zLuUkqSBRkNk/svYrFm7RCJgNaARyrGurSxXN9yHAZ u/PrmbALZAEM/YRYQqN6zqdqEOfPGYciEL7GW1F/txJKnyya4dNROWzNlOovMToed8lS GhON7HlJHejVkK1MJTgnSwiY0Ei5EcZPL5quVVTcHrKr2dVUI8xr+NjatJ+hhijkIcoe lJ0r5jyV41729TDKTulnCsEgjk/lxqGGFt3p0Qlary2wv/yxTy5iD1p9H+pYGy5n6f9G FMag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Mp/a9P6L"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a056402279400b00457e6752422si1094163ede.189.2022.11.17.07.11.15; Thu, 17 Nov 2022 07:11:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Mp/a9P6L"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240591AbiKQPKh (ORCPT + 99 others); Thu, 17 Nov 2022 10:10:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240430AbiKQPJ0 (ORCPT ); Thu, 17 Nov 2022 10:09:26 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 456FF781AA; Thu, 17 Nov 2022 07:08:21 -0800 (PST) Date: Thu, 17 Nov 2022 15:08:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668697700; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=22RMjeZ9ETKCP9UZiZ2z3rOsKYgMh4RjNDTkJH0aR3c=; b=Mp/a9P6LVFh0takYrqkM4/abV5yexzDPwHvVRU3sYX/Yb/13ktZscNF8aL8sJiOHuA4B6F yqev8qnBVuBVFKE3jv8JUBymuL1pQeEyAWwGvJj4OQgDuJrDON3yNwQOB4n9hxNG8R2S0t MIEKMa4TC2MOxVPJ/yyL+nX1nq3L9TrIlgVxM+CFxKLVXR6/p2DW6Ws/flIvc+tf3fcNH+ EloEKNfsJ2aZKj66ghRjcsZNyJURI+1PRkUU4RJ5+7KWmpyTOpLwPDM6h5el6+wOrBJ8qt KeQBtO4mj1RZwvCdZeOYxn1R1G4SQ7G9Qb5Mpj81Jg7A0QjuYlXo1ooMFiVqsQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668697700; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=22RMjeZ9ETKCP9UZiZ2z3rOsKYgMh4RjNDTkJH0aR3c=; b=3gwOjgQ1N3Sp+hKyG7CNtBiNWlCUngZNHKRPmN3wWRy4ti4IGWWxzEwfL0cB6Ql/6kOAqc lbkKFwScxlFK9DBQ== From: "tip-bot2 for Ahmed S. Darwish" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] PCI/MSI: Let the MSI core free descriptors Cc: "Ahmed S. Darwish" , Thomas Gleixner , Jason Gunthorpe , Bjorn Helgaas , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20221111122014.409654736@linutronix.de> References: <20221111122014.409654736@linutronix.de> MIME-Version: 1.0 Message-ID: <166869769869.4906.16348702206591791978.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208403171002781?= X-GMAIL-MSGID: =?utf-8?q?1749756573985669610?= The following commit has been merged into the irq/core branch of tip: Commit-ID: b2bdda205c0c256d6483231d0afe58a6d68fd3ed Gitweb: https://git.kernel.org/tip/b2bdda205c0c256d6483231d0afe58a6d68fd3ed Author: Ahmed S. Darwish AuthorDate: Fri, 11 Nov 2022 14:54:37 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 17 Nov 2022 15:15:19 +01:00 PCI/MSI: Let the MSI core free descriptors 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 Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20221111122014.409654736@linutronix.de --- drivers/pci/msi/irqdomain.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c index 7766fa6..edd0cc2 100644 --- a/drivers/pci/msi/irqdomain.c +++ b/drivers/pci/msi/irqdomain.c @@ -24,11 +24,12 @@ void pci_msi_teardown_msi_irqs(struct pci_dev *dev) 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_domain(struct fwnode_handle *fwnode, 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;