Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Brian Norris <briannorris@chromium.org>
Cc: sashiko@lists.linux.dev, Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, Lukas Wunner <lukas@wunner.de>,
	David Matlack <dmatlack@google.com>,
	Manivannan Sadhasivam <mani@kernel.org>
Subject: Re: [PATCH v3] PCI/portdrv: Allow probing even without child services
Date: Thu, 16 Jul 2026 12:21:39 -0500	[thread overview]
Message-ID: <20260716172139.GA11585@bhelgaas> (raw)
In-Reply-To: <algg4sOk0YM1TpXa@google.com>

On Wed, Jul 15, 2026 at 05:08:02PM -0700, Brian Norris wrote:
> On Wed, Jul 15, 2026 at 05:15:26PM -0500, Bjorn Helgaas wrote:
> > On Fri, May 08, 2026 at 05:12:19PM -0700, Brian Norris wrote:
> ...

> Thanks for looking! Can you describe what your goals are here vs my v2?
> I'm curious what you're aiming for.

I was concerned about pci_clear_master() potentially breaking a driver
for a downstream driver, but I don't think that should happen because
portdrv cannot be a module and should always probe before any
downstream device.

> ...
> > -static int pcie_port_device_register(struct pci_dev *dev)
> > +static void pcie_port_device_register(struct pci_dev *dev)
> >  {
> >  	int status, capabilities, i, nr_service;
> >  	int irqs[PCIE_PORT_DEVICE_MAXSERVICES];
> > @@ -336,12 +336,12 @@ static int pcie_port_device_register(struct pci_dev *dev)
> >  	/* Enable PCI Express port device */
> >  	status = pci_enable_device(dev);
> >  	if (status)
> > -		return status;
> > +		return;
> 
> Are you purposely ignoring pci_enable_state() failures now too? That
> wasn't part of my original proposal. This also means you have a
> potential underflow in remove(), because now a port might get through
> probe() with an enable_cnt of 0 -- then we still call
> pci_disable_device() in remove().

Good point.  pci_enable_device() enables BARs, which we only need for
MSI-X tables.  I was thinking portdrv may still be useful for power
management even if pci_enable_device() fails because we couldn't
assign space for BARs.  But that failure is pretty unlikely.

  reply	other threads:[~2026-07-16 17:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 20:36 [PATCH v3] PCI/portdrv: Allow probing even without child services Brian Norris
2026-05-08 23:30 ` sashiko-bot
2026-05-09  0:12   ` Brian Norris
2026-06-23  6:00     ` Manivannan Sadhasivam
2026-07-15 22:15     ` Bjorn Helgaas
2026-07-16  0:08       ` Brian Norris
2026-07-16 17:21         ` Bjorn Helgaas [this message]
2026-06-22 20:31 ` David Matlack

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