public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Ahmed S . Darwish" <darwi@linutronix.de>,
	Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>,
	linux-pci@vger.kernel.org, Jianmin Lv <lvjianmin@loongson.cn>,
	Huacai Chen <chenhuacai@gmail.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	loongson-kernel@lists.loongnix.cn,
	Juxin Gao <gaojuxin@loongson.cn>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: irq: Add an early parameter to limit pci irq numbers
Date: Thu, 25 May 2023 10:08:57 +0100	[thread overview]
Message-ID: <86o7m8dbh2.wl-maz@kernel.org> (raw)
In-Reply-To: <ZG4rZYBKaWrsctuH@bhelgaas>

On Wed, 24 May 2023 16:21:09 +0100,
Bjorn Helgaas <helgaas@kernel.org> wrote:
> 
> [+cc Marc, LKML]
> 
> On Wed, May 24, 2023 at 05:36:23PM +0800, Huacai Chen wrote:
> > Some platforms (such as LoongArch) cannot provide enough irq numbers as
> > many as logical cpu numbers. So we should limit pci irq numbers when
> > allocate msi/msix vectors, otherwise some device drivers may fail at
> > initialization. This patch add a cmdline parameter "pci_irq_limit=xxxx"
> > to control the limit.
> > 
> > The default pci msi/msix number limit is defined 32 for LoongArch and
> > NR_IRQS for other platforms.
> 
> The IRQ experts can chime in on this, but this doesn't feel right to
> me.  I assume arch code should set things up so only valid IRQ numbers
> can be allocated.  This doesn't seem necessarily PCI-specific, I'd
> prefer to avoid an arch #ifdef here, and I'd also prefer to avoid a
> command-line parameter that users have to discover and supply.

I'd tend to agree. The irqchip driver that provides the interrupt
numbers should perform the capping, not the core PCI code.

Furthermore, MSI allocation is never guaranteed anyway, and drivers
shouldn't expect to get all the interrupts they request. If they do,
they need fixing.

Overall, interrupt architectures that provide as few as 32 possible
interrupts for MSIs will be crippled, and there isn't much we can do
about it. This also applies to a large number of ARM systems that use
the Designware IP.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2023-05-25  9:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230524093623.3698134-1-chenhuacai@loongson.cn>
2023-05-24 15:21 ` [PATCH] pci: irq: Add an early parameter to limit pci irq numbers Bjorn Helgaas
2023-05-25  9:08   ` Marc Zyngier [this message]
2023-05-25  9:14   ` Huacai Chen
2023-05-25 21:40     ` Bjorn Helgaas
2023-05-26  8:17       ` Huacai Chen
2023-05-28 16:57     ` Manivannan Sadhasivam
2023-05-29  2:02       ` Huacai Chen
2023-05-29  5:39         ` Manivannan Sadhasivam
2023-05-29  6:52           ` Huacai Chen
     [not found]             ` <ZHeceyZ9eUC27WcE@ziepe.ca>
2023-06-01  4:19               ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86o7m8dbh2.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=chenhuacai@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=darwi@linutronix.de \
    --cc=gaojuxin@loongson.cn \
    --cc=helgaas@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=lvjianmin@loongson.cn \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox