Message ID | 20221111132707.005001510@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp758069wru; Fri, 11 Nov 2022 06:05:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7jp2r3qPCapvLysAQl46coPxo365UqxXyLZ5poItKhFr5DPWq7cnbKA0Z4/MYroq2BHBYc X-Received: by 2002:a63:3157:0:b0:473:ef9c:e1e5 with SMTP id x84-20020a633157000000b00473ef9ce1e5mr1769590pgx.241.1668175532704; Fri, 11 Nov 2022 06:05:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175532; cv=none; d=google.com; s=arc-20160816; b=h1HJmzItPUT3Vmi+iM2AKg1m9gZRnZAiux4NEVhYUxKbAIm6k2caZ+bEEBWr92y5jf leHnNxie23wzWD9RPnIRQs+AW/ai2T0zKleDvkl/u5ZLrhfGXEuU4YEiYjtgGusFhCYY PsMw6jpf1RibGQ0TW8Z3+rvtk9rIfijzxFhIxgLvKILkdVGjG3A1ISvDpQJdkMGCWEyk +De814EI7sOTP962rt66DWA8Ti3/k3/u2lDCQpnZOt3frCUJVkmhJh4zmY33zgukgu95 yQrf2+abGwOquF9TDD1JHLp7F0g8N3nEnn++xIHMHUGsQxHbDdp/kNBE4VZmYC3LVkv7 Wm0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=7CXvgfTszY3LslvHbPboJUjb59ZlVQ1XORNlFYSydbs=; b=X0dxpuxmmpOkq1CJ6Pta6WrAZ32KbryQQttr2ofXQ4xJa/dsObKX7lC0FPYiWC53ak 8XVB+zGtGm7A0Z/A1/tmgPggFIMMXMUsxXrv4H0vShsXTrr5R90Ng7nOdIb+OkxBU+Lb rlbIADVdXgH6CKqX+kgHcW++UGs8C6pirTR4A5EGaS3PVE4Y5U/plBt17hVtZMRLcbrU O6/YQiOQZL15OuDoptLPBI6j8M6tdZwoZOYIiYkZUDAm5RbOtoQ75uMQoWydDbRRY38V U3OTAeDpF9EzcvsNi/PwyuII/OfRbpf4oiWUVGNY+x6B+LbxHf5Awr4yLMjJErCeQNAZ c8FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Agv68rl7; dkim=neutral (no key) header.i=@linutronix.de; 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 e17-20020a656891000000b0043c2e57961asi2414891pgt.799.2022.11.11.06.05.10; Fri, 11 Nov 2022 06:05:32 -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=Agv68rl7; dkim=neutral (no key) header.i=@linutronix.de; 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 S234301AbiKKODS (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Fri, 11 Nov 2022 09:03:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234112AbiKKOBx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 11 Nov 2022 09:01:53 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83228845C7; Fri, 11 Nov 2022 05:57:10 -0800 (PST) Message-ID: <20221111132707.005001510@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668175025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=7CXvgfTszY3LslvHbPboJUjb59ZlVQ1XORNlFYSydbs=; b=Agv68rl7CQm4sjgpbWZA2zBJxntMTk8mKSY602PayvrRRyQNfmK6JasYanB3VY9nVbQfDj VlX/FV//rKxxyJc2J6IZvMB/vWG26i5zPuLzap/UX0+J0tw9DaIteiN4sIleRn3ZenaAv3 9ai3s76aknsKpTN3l0Hgi3wSrImjy/D9K4IYYCA3R/qrsSEqz5QK3spbIVbb/L7SCNwK3t G+2MeXJnHh8eljbgb3LsHeb6rEBPGzLfJyLba+yd7Ba7Dk8SEqB6GRhfcJ6mfA3k2XD2XM TPs1i81pOJMIUjQjHlAiFOAzw0ooqh/fpEfnDymEhJVgRgfjeEMxg2j/N43gEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668175025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=7CXvgfTszY3LslvHbPboJUjb59ZlVQ1XORNlFYSydbs=; b=LgqWWQEySgEZ5F9eCmSn1EOhVpouemmYgUmw/9/nAKuTrgu8/zuhKwoz5e6f1YFwbyYVyh G2q5r5gIL3SLohBw== From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: x86@kernel.org, Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>, linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Marc Zyngier <maz@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jason Gunthorpe <jgg@mellanox.com>, Dave Jiang <dave.jiang@intel.com>, Alex Williamson <alex.williamson@redhat.com>, Kevin Tian <kevin.tian@intel.com>, Dan Williams <dan.j.williams@intel.com>, Logan Gunthorpe <logang@deltatee.com>, Ashok Raj <ashok.raj@intel.com>, Jon Mason <jdmason@kudzu.us>, Allen Hubbe <allenbh@gmail.com>, "Ahmed S. Darwish" <darwi@linutronix.de>, Reinette Chatre <reinette.chatre@intel.com> Subject: [patch 17/20] platform-msi: Switch to the domain id aware MSI interfaces References: <20221111131813.914374272@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Fri, 11 Nov 2022 14:57:04 +0100 (CET) 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208827392747520?= X-GMAIL-MSGID: =?utf-8?q?1749208827392747520?= |
Series |
[01/20] genirq/msi: Move IRQ_DOMAIN_MSI_NOMASK_QUIRK to MSI flags
|
|
Commit Message
Thomas Gleixner
Nov. 11, 2022, 1:57 p.m. UTC
From: Ahmed S. Darwish <darwi@linutronix.de> Switch to the new domain id aware interfaces to phase out the previous ones. No functional change. Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- drivers/base/platform-msi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
> From: Thomas Gleixner <tglx@linutronix.de> > Sent: Friday, November 11, 2022 9:57 PM > > From: Ahmed S. Darwish <darwi@linutronix.de> > > Switch to the new domain id aware interfaces to phase out the previous > ones. No functional change. > > Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de> > --- > drivers/base/platform-msi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- a/drivers/base/platform-msi.c > +++ b/drivers/base/platform-msi.c > @@ -213,7 +213,7 @@ int platform_msi_domain_alloc_irqs(struc > if (err) > return err; > > - err = msi_domain_alloc_irqs(dev->msi.domain, dev, nvec); > + err = msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, > nvec - 1); > if (err) > platform_msi_free_priv_data(dev); > Out of curiosity. Why don't we provide an unlocked version of msi_domain_alloc_irqs_all()?
On Fri, Nov 18 2022 at 08:53, Kevin Tian wrote: >> From: Thomas Gleixner <tglx@linutronix.de> >> >> - err = msi_domain_alloc_irqs(dev->msi.domain, dev, nvec); >> + err = msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, >> nvec - 1); >> if (err) >> platform_msi_free_priv_data(dev); >> > > Out of curiosity. Why don't we provide an unlocked version of > msi_domain_alloc_irqs_all()? -ENOUSER
> From: Thomas Gleixner <tglx@linutronix.de> > Sent: Friday, November 18, 2022 8:27 PM > > On Fri, Nov 18 2022 at 08:53, Kevin Tian wrote: > >> From: Thomas Gleixner <tglx@linutronix.de> > >> > >> - err = msi_domain_alloc_irqs(dev->msi.domain, dev, nvec); > >> + err = msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, > >> nvec - 1); > >> if (err) > >> platform_msi_free_priv_data(dev); > >> > > > > Out of curiosity. Why don't we provide an unlocked version of > > msi_domain_alloc_irqs_all()? > > -ENOUSER msi_domain_alloc_irqs() and msi_domain_alloc_irqs_descs_locked() are a pair. What I didn't get was why the unlocked invocation in this patch is replaced by a range-based helper while the locked invocation in previous patch16 was replaced by an all-based helper: if (domain && irq_domain_is_hierarchy(domain)) - return msi_domain_alloc_irqs_descs_locked(domain, &dev->dev, nvec); + return msi_domain_alloc_irqs_all_locked(&dev->dev, MSI_DEFAULT_DOMAIN, nvec); The reason could probably be marked out in the commit msg.
On Mon, Nov 21 2022 at 03:42, Kevin Tian wrote: >> From: Thomas Gleixner <tglx@linutronix.de> >> On Fri, Nov 18 2022 at 08:53, Kevin Tian wrote: >> > Out of curiosity. Why don't we provide an unlocked version of >> > msi_domain_alloc_irqs_all()? >> >> -ENOUSER > > msi_domain_alloc_irqs() and msi_domain_alloc_irqs_descs_locked() > are a pair. Sure, but if there is no use case why should we provide the interface? > What I didn't get was why the unlocked invocation in this patch > is replaced by a range-based helper while the locked invocation > in previous patch16 was replaced by an all-based helper: > > if (domain && irq_domain_is_hierarchy(domain)) > - return msi_domain_alloc_irqs_descs_locked(domain, &dev->dev, nvec); > + return msi_domain_alloc_irqs_all_locked(&dev->dev, MSI_DEFAULT_DOMAIN, nvec); > > The reason could probably be marked out in the commit msg. The point is that range based is obviously the better choice because it's precise. Especially for domains which let the core code allocate the MSI descriptors a precise range is required. The old interface was kinda blury there. In case of PCI/MSI[-X] the MSI descriptors are allocated by the PCI core upfront and there are allocations which have gaps in the indices, so the range is not well defined and we just keep using the existing scan all mechanism. Thanks, tglx
--- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c @@ -213,7 +213,7 @@ int platform_msi_domain_alloc_irqs(struc if (err) return err; - err = msi_domain_alloc_irqs(dev->msi.domain, dev, nvec); + err = msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, nvec - 1); if (err) platform_msi_free_priv_data(dev); @@ -227,7 +227,7 @@ EXPORT_SYMBOL_GPL(platform_msi_domain_al */ void platform_msi_domain_free_irqs(struct device *dev) { - msi_domain_free_irqs(dev->msi.domain, dev); + msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN); platform_msi_free_priv_data(dev); } EXPORT_SYMBOL_GPL(platform_msi_domain_free_irqs);