From: Bjorn Helgaas <helgaas@kernel.org>
To: Alistair Francis <alistair@alistair23.me>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
Jonathan.Cameron@huawei.com, lukas@wunner.de,
alex.williamson@redhat.com, christian.koenig@amd.com,
kch@nvidia.com, gregkh@linuxfoundation.org, logang@deltatee.com,
linux-kernel@vger.kernel.org, alistair23@gmail.com,
chaitanyak@nvidia.com, rdunlap@infradead.org
Subject: Re: [PATCH v16 3/4] PCI/DOE: Expose the DOE features via sysfs
Date: Wed, 5 Mar 2025 14:05:00 -0600 [thread overview]
Message-ID: <20250305200500.GA267333@bhelgaas> (raw)
In-Reply-To: <20250227043404.2452562-3-alistair@alistair23.me>
On Thu, Feb 27, 2025 at 02:34:02PM +1000, Alistair Francis wrote:
> The PCIe 6 specification added support for the Data Object
> Exchange (DOE).
> +++ b/drivers/pci/probe.c
> @@ -2662,6 +2662,9 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
> WARN_ON(ret < 0);
>
> pci_npem_create(dev);
> +
> + ret = pci_doe_sysfs_init(dev);
> + WARN_ON(ret < 0);
IIUC the "doe_features" directory is added implicitly by
device_add_attrs() in device_add(), but the *contents* of that
directory can't be done that way because they're dynamic, based on the
DOE features we discovered.
I see that we WARN_ON() for device_add() failure, but it doesn't
really seem like much of an error handling strategy in either case.
I think we'll just get a stack trace that's alarming and probably not
useful.
I think it might be more useful to use pci_warn() at the interesting
places that might fail inside pci_doe_sysfs_init(), e.g., where we
know the name of the relevant feature, and make pci_doe_sysfs_init()
itself void.
next prev parent reply other threads:[~2025-03-05 20:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 4:34 [PATCH v16 1/4] PCI/DOE: Rename DOE protocol to feature Alistair Francis
2025-02-27 4:34 ` [PATCH v16 2/4] PCI/DOE: Rename Discovery Response Data Object Contents to type Alistair Francis
2025-02-27 4:34 ` [PATCH v16 3/4] PCI/DOE: Expose the DOE features via sysfs Alistair Francis
2025-03-05 19:41 ` Bjorn Helgaas
2025-03-05 20:05 ` Bjorn Helgaas [this message]
2025-03-06 7:28 ` Alistair Francis
2025-02-27 4:34 ` [PATCH v16 4/4] PCI/DOE: Allow enabling DOE without CXL Alistair Francis
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=20250305200500.GA267333@bhelgaas \
--to=helgaas@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=alistair23@gmail.com \
--cc=alistair@alistair23.me \
--cc=bhelgaas@google.com \
--cc=chaitanyak@nvidia.com \
--cc=christian.koenig@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=lukas@wunner.de \
--cc=rdunlap@infradead.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