Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Vincent Liu <vincent.liu@nutanix.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"dakr@kernel.org" <dakr@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH v2] driver core: Check drivers_autoprobe for all added devices
Date: Wed, 15 Oct 2025 11:53:26 -0500	[thread overview]
Message-ID: <20251015165326.GA945703@bhelgaas> (raw)
In-Reply-To: <7C5EF578-B0CA-4FCB-86F7-470EDD27240D@nutanix.com>

On Wed, Oct 15, 2025 at 10:23:20AM +0000, Vincent Liu wrote:
> On 14 Oct 2025, at 21:07, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > 
> >> In particular for the PCI devices, only
> >> hot-plugged PCIe devices/VFs should be affected as the default value of
> >> pci/drivers_autoprobe remains 1 and can only be cleared from userland.
> > 
> > I'm not sure what this last sentence is telling us.  Does
> > "pci/drivers_autoprobe" refer to struct pci_sriov.drivers_autoprobe?
> > If so, can you elaborate on the connection with struct
> > subsys_private.drivers_autoprobe, which this patch tests?  I don't see
> > anything in this patch related to pci_sriov.
> 
> No this patch has nothing to do with pci_sriov.drivers_autoprobe, this is
> generic for all (pci) devices. pci/drivers_autoprobe refers to the
> drivers_autoprobe sysfs attribute on the pci bus.
> 
> The last sentence is saying that this setting should only affect hot-plugged
> devices because I think there is no way for pci/drivers_autoprobe to be 0 
> for cold plugged devices? But thinking more about this, I don’t think this
> adds much value to the commit message because the drivers_autoprobe
> is not intended for cold-plugged devices anyway. I’ll remove it.
> 
> > As far as I can tell, this patch is generic with respect to
> > conventional PCI vs PCIe.  If so, I'd use "PCI" everywhere instead of
> > a mix of PCI and PCIe.
> 
> Yes you are right, this is generic. I used PCIe purely because of the
> “hot-plugging”, but happy to use PCI everywhere.
> 
> > Add "()" after function names to make them easily recognizable as
> > functions.
> > 
> > s/respsect/respect/
> > s/but this should be the/which is the/  # maybe? not sure what you intend
> 
> Ok.
> 
> Below is a rephrased commit message to incorporate the feedback.
> 
> Thanks,
> Vincent
> 
> -- >8 --
> 
> Subject: [PATCH v2] driver core: Check drivers_autoprobe for all added devices
> 
> When a device is hot-plugged, the drivers_autoprobe sysfs attribute is
> not checked (at least for PCI devices). This means that
> drivers_autoprobe is not working as intended, e.g. hot-plugged PCI
> devices will still be autoprobed and bound to drivers even with
> drivers_autoprobe disabled.
> 
> Make sure all devices check drivers_autoprobe by pushing the
> drivers_autoprobe check into device_initial_probe(). This will only
> affect devices on the PCI bus for now as device_initial_probe() is only
> called by pci_bus_add_device() and bus_probe_device(), but
> bus_probe_device() already checks for autoprobe, so callers of
> bus_probe_device() should not observe changes on autoprobing.
> 
> Any future callers of device_initial_probe() will respect the
> drivers_autoprobe sysfs attribute, which is the intended purpose of
> drivers_autoprobe.
> 
> Signed-off-by: Vincent Liu <vincent.liu@nutanix.com>
> 
> Link: https://lore.kernel.org/20251001151508.1684592-1-vincent.liu@nutanix.com

Thanks, that reads much better to me.

  reply	other threads:[~2025-10-15 16:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20251001151508.1684592-1-vincent.liu@nutanix.com>
     [not found] ` <2025100209-hefty-catalyst-e5b2@gregkh>
2025-10-02 12:04   ` [PATCH] driver core: PCI: Check drivers_autoprobe for all added devices Vincent Liu
2025-10-13 18:14 ` [PATCH v2] driver core: " Vincent Liu
2025-10-14  5:14   ` Greg KH
2025-10-14 12:10     ` Vincent Liu
2025-10-21 12:49       ` Vincent Liu
2025-10-22 10:32         ` Greg KH
2025-10-14 20:07   ` Bjorn Helgaas
2025-10-15 10:23     ` Vincent Liu
2025-10-15 16:53       ` Bjorn Helgaas [this message]
2025-10-22 12:07 ` [PATCH v3] " Vincent Liu
2025-11-04 13:16   ` Vincent Liu
2025-11-20 17:00 ` [PATCH v3 RESEND] " Vincent Liu

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=20251015165326.GA945703@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=dakr@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=vincent.liu@nutanix.com \
    /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