Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: Brian Norris <briannorris@chromium.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	linux-pci@vger.kernel.org, David Matlack <dmatlack@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] PCI/portdrv: Allow probing even without child services
Date: Thu, 23 Jul 2026 16:56:33 -0500	[thread overview]
Message-ID: <20260723215633.GA864671@bhelgaas> (raw)
In-Reply-To: <amG0XebAYI-4eDIN@wunner.de>

On Thu, Jul 23, 2026 at 08:27:41AM +0200, Lukas Wunner wrote:
> On Wed, Jul 22, 2026 at 04:09:42PM -0700, Brian Norris wrote:
> > +++ b/drivers/pci/pcie/portdrv.c
> > @@ -330,7 +330,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
> >   */
> >  static int pcie_port_device_register(struct pci_dev *dev)
> >  {
> > -	int status, capabilities, i, nr_service;
> > +	int status, capabilities, i;
> >  	int irqs[PCIE_PORT_DEVICE_MAXSERVICES];
> 
> Nit:  Move the amended line below the irqs[] declaration to sustain
> inverse Christmas tree ordering.

I moved this locally.

> Otherwise this is
> Reviewed-by: Lukas Wunner <lukas@wunner.de>
> 
> One caveat, I note there is a pre-existing issue on Loongson LS7A,
> which (according to 62b6dee1b44a) suffers from a defect wherein
> disabling bus mastering prevents forwarding of MMIO requests downstream.
> This happens right now (and continues to happen after the present patch)
> if the error path in pcie_port_device_register() is taken.
> 
> I also note that pci_enable_device() is only called because per
> 1ce5e83063bf, it was necessary in 2009 for legacy interrupt initialization
> "on some architectures", which sounds fairly vague to me.  In any case,
> it seems to suggest that pci_disable_device() should be called if
> pcie_init_service_irqs() fails.  Right now that is done, after the patch
> it isn't.  I guess portdrv would have to remember on probe whether
> pci_enable_device() was called and only then call pci_disable_device()
> on remove.  I guess it would be possible to abuse dev_set_drvdata()
> to store this status bit (as a fake pointer).  Then again, I'm not
> sure pci_enable_device() is still necessary for legacy interrupt
> initalization today.  I guess "legacy interrupt" refers to INTx.
> A lot has changed in generic and PCI irq code since 2009.
> I assume we otherwise don't have a need to access BARs on PCIe ports
> currently, but perhaps new port services may come along which do?

I think we also need pci_enable_device() so MSI-X configuration can
access the BAR.

  reply	other threads:[~2026-07-23 21:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 23:09 [PATCH v4] PCI/portdrv: Allow probing even without child services Brian Norris
2026-07-22 23:20 ` sashiko-bot
2026-07-23  6:27 ` Lukas Wunner
2026-07-23 21:56   ` Bjorn Helgaas [this message]
2026-07-23 21:58 ` Bjorn Helgaas

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=20260723215633.GA864671@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=briannorris@chromium.org \
    --cc=dmatlack@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mani@kernel.org \
    /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