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 9B973C77B7E for ; Sat, 27 May 2023 05:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231149AbjE0FrD (ORCPT ); Sat, 27 May 2023 01:47:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjE0FrB (ORCPT ); Sat, 27 May 2023 01:47:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95C98114 for ; Fri, 26 May 2023 22:47:00 -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 32E8F60F18 for ; Sat, 27 May 2023 05:47:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB3F3C433D2; Sat, 27 May 2023 05:46:54 +0000 (UTC) From: Huacai Chen To: Thomas Gleixner , Marc Zyngier , Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Xuefeng Li , Huacai Chen , Jiaxun Yang , Huacai Chen , Juxin Gao Subject: [PATCH 0/2] Add machanism to limit msi allocation for Loongson Date: Sat, 27 May 2023 13:46:31 +0800 Message-Id: <20230527054633.704916-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Loongson machines can have as many as 256 logical cpus, but the maximum of msi vectors in one irqchip is also 256 (practically that is less than 256, because pch-pic consumes some of them). Even on a 64-core machine, 256 irqs can be easily exhausted if there are several NICs (NICs usually allocate msi irqs depending on the number of online cpus). So we want to limit the msi allocation. Patch-1 adjusts the return value semanteme of msi_domain_prepare_irqs(), allowing us to modify the input "nvec" by overriding the msi_domain_ops ::msi_prepare(). Patch-2 adds a machanism to limit msi allocation: 1, Modify input "nvec" by overriding the msi_domain_ops::msi_prepare(); 2, The default limit is 256, which is compatible with the old behavior; 3, Add a cmdline parameter "loongson_msi_limit=xxx" to control the limit. Huacai Chen and Juxin Gao(2): PCI: Omit pci_disable_device() in .shutdown(). PCI: loongson: Improve the MRRS quirk for LS7A. Signed-off-by: Juxin Gao Signed-off-by: Huacai Chen --- 2.27.0