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 CFB9BC77B7E for ; Sun, 28 May 2023 07:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbjE1HsD (ORCPT ); Sun, 28 May 2023 03:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjE1Hry (ORCPT ); Sun, 28 May 2023 03:47:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36691BB for ; Sun, 28 May 2023 00:47:42 -0700 (PDT) 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 E43916172A for ; Sun, 28 May 2023 07:47:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 564C5C433D2; Sun, 28 May 2023 07:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685260061; bh=2qF1OaojqXLKDA+R55LxCuD9W57csEkZL3bochaCK/8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KGb6vZToWKaFqs6Bimvn/FjWSxYXAh0hOpzszWOMbkwhdplW0l57o0ZIgezqT0ICi NCb5oLHnj3H538FoCkMPBEcTCcskh9fQZwFlndY8nF5iMPUL2H+90jOXJI9n7mCEmA hDAiXBD1o7Pi6dxIq71nnGO6rgcT2j92PFHeIDZLiSmkxfC707eSvGK9glc8d0XkUz IO3W3rCMlrt0tTRnunonNwJsL6VTXW2fOHCWtPbYgQ8yxlc7y7BEvIjQ8bWq28k/ME 6VVUtsmHCMRZlAy1lkjtI0uP/j+BcqSays9j1Z/8bJBFuzI+/xicWBQOfKqlPogzdO ZRltbbLAKqhnA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q3B7q-000qbm-VY; Sun, 28 May 2023 08:47:39 +0100 Date: Sun, 28 May 2023 08:47:38 +0100 Message-ID: <86fs7gdhid.wl-maz@kernel.org> From: Marc Zyngier To: Thomas Gleixner Cc: Huacai Chen , Bjorn Helgaas , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Xuefeng Li , Huacai Chen , Jiaxun Yang Subject: Re: [PATCH 1/2] genirq/msi, platform-msi: Adjust return value of msi_domain_prepare_irqs() In-Reply-To: <87pm6llvm6.ffs@tglx> References: <20230527054633.704916-1-chenhuacai@loongson.cn> <20230527054633.704916-2-chenhuacai@loongson.cn> <87pm6llvm6.ffs@tglx> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: tglx@linutronix.de, chenhuacai@loongson.cn, bhelgaas@google.com, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, lixuefeng@loongson.cn, chenhuacai@gmail.com, jiaxun.yang@flygoat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 27 May 2023 15:03:29 +0100, Thomas Gleixner wrote: > > On Sat, May 27 2023 at 13:46, Huacai Chen wrote: > > Adjust the return value semanteme of msi_domain_prepare_irqs(), which > > allows us to modify the input nvec by overriding the msi_domain_ops:: > > msi_prepare(). This is necessary for the later patch. > > > > Before: > > 0 on success, others on error. > > > > After: > > = 0: Success; > >> 0: The modified nvec; > > < 0: Error code. > > This explains what the patch does, but provides zero justification for > this nor any analysis why this is correct for the existing use cases. > > That longsoon MSI domain is a PCI MSI domain. PCI/MSI has already a > mechanism to return the actual possible number of vectors if the > underlying space is exhausted. > > Why is that not sufficient for your problem at hand? I've already made that point, but it seems that the argument is falling on deaf ears. Being able to allocate MSIs is not a guarantee, and is always opportunistic. If some drivers badly fail because the they don't get the number of MSIs they need, then they need fixing. I really don't see the point in papering over this at the lowest level of the stack. M. -- Without deviation from the norm, progress is not possible.