Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4024650rwb; Mon, 21 Nov 2022 02:46:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf406s/zGENkRfVql2j72f+HEi27nWVDON7X7YBEFMyerSfptD6YeIgoNJIIKeX8j+fZQJun X-Received: by 2002:a17:906:a107:b0:77f:9082:73c7 with SMTP id t7-20020a170906a10700b0077f908273c7mr3060483ejy.517.1669027613970; Mon, 21 Nov 2022 02:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669027613; cv=none; d=google.com; s=arc-20160816; b=wO5lc395zxzL0xsLLxkr418foR7V0Fd7HyaKn6J827gqphZ5l80yFd/2RphFmc7/Mf expInx+RaPZi1lO7ij/DEWdYEwgu3sIod5D3NppBcbtU2NAqdX8Qly51qgs2s56JoDqZ oSn82A4oYUUWUvyhsCCc6c9mtmDS1+piLTVEfEWddl1M7tnOGwQMJn4JVVzcT028d6Gk nfuQBNT4V0px42DW994FO7RanGrQ0cSAG6OvBySyF8cOgdciGddV3SGZp5Tgu+fqHV47 eKnPBSP32/weDPld7enca2Z9VOr3zkx5Q4M6jwEZYDkT2PJv+OSpUVo+yn27ECbT2ayl EJXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=wgqTjLWFMbYTKP3B3JAejdIePhrfjaPRTiSq0SNLFX4=; b=nQS8VYRR65aKov4GNf1oink6e9+Xdk0jMWsCQak231uz30QAcP9HVwgUC9VsfLO1JB J9+3stOvSvEAIXoR59uFUGwZJv/XUzbdS6NhGITlpHAYUNl3zPsC1LxLp920cAaLuqdk Imq342YVQ7mccRbXier3bG34bMiHvQiP0IVd681CR/J+HcTvM8erM3MOxYR9yp8UzYZ3 SPmSENE47v9NFrXmt2Mknu2chevYADVRjFHJ12NkUezrqb4TVxGfeW1kGVS9uWkVewnn 1a9Q5VhxNdF8VXw1DhEhgO45PSHxWgDQbxMz1j8nl2J/2kVPy7euB1ziEviQNzGdPXtu gPpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hzthuOHJ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020aa7c594000000b00461c7ad026csi8629247edq.61.2022.11.21.02.46.29; Mon, 21 Nov 2022 02:46:53 -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=hzthuOHJ; 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 S229460AbiKUKee (ORCPT + 92 others); Mon, 21 Nov 2022 05:34:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbiKUKe3 (ORCPT ); Mon, 21 Nov 2022 05:34:29 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E05965987D; Mon, 21 Nov 2022 02:34:28 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669026867; 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: in-reply-to:in-reply-to:references:references; bh=wgqTjLWFMbYTKP3B3JAejdIePhrfjaPRTiSq0SNLFX4=; b=hzthuOHJZx7zcqf03P9EJMWfil39KpG55Fw2j07jOar5/f7qi5E2pv04xbch6uM0n+861T qxbXzlbcQd3J89VNUgm91NVA/kyYLnBrIGfLWVOX49ozmnIKc3Hy0lAAKxLDXzxmjGHcoE wuaVZcmM4gwloGcy9ugD5a3wy+KU2E8R1+0ozoi2vzTtv1gppzurFoSvfgeHM/K+rPwX0R dGWrMJf20m9K3bZ7t/SbS7zIDB/BAbclhEpxPuIOaxVcZ+8Q79sYZBJwxsljTP8jAgxtGY gqjWcUbNmoYjakGjSprwaNPseKQ43kaUgdvclGznQDtcuijNd0GLgUOeYWI5Ng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669026867; 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: in-reply-to:in-reply-to:references:references; bh=wgqTjLWFMbYTKP3B3JAejdIePhrfjaPRTiSq0SNLFX4=; b=lJv+UaovQnxg6vQ2zurZGWlXxKCY6W644sGEmVhWi5kROwaCsIcs+mTUwgka612A7lOIz2 xX+/c1fkQ8T0k/Bg== To: "Tian, Kevin" , LKML Cc: "x86@kernel.org" , Joerg Roedel , Will Deacon , "linux-pci@vger.kernel.org" , Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , "Jiang, Dave" , Alex Williamson , "Williams, Dan J" , Logan Gunthorpe , "Raj, Ashok" , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , "Chatre, Reinette" Subject: RE: [patch 17/20] platform-msi: Switch to the domain id aware MSI interfaces In-Reply-To: References: <20221111131813.914374272@linutronix.de> <20221111132707.005001510@linutronix.de> <87fsegjvn3.ffs@tglx> Date: Mon, 21 Nov 2022 11:34:26 +0100 Message-ID: <87sficiojx.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain 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 On Mon, Nov 21 2022 at 03:42, Kevin Tian wrote: >> From: Thomas Gleixner >> 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