From: Alistair <alistair@alistair23.me>
To: "Bjorn Helgaas" <helgaas@kernel.org>,
"Michał Cłapiński" <mclapinski@google.com>
Cc: Lukas Wunner <lukas@wunner.de>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH] PCI/DOE: Poll briefly for a response before sleeping
Date: Fri, 16 Oct 2026 14:19:39 +1000 [thread overview]
Message-ID: <84f476a74719089da16a4b7123fc42242bd67ae1.camel@alistair23.me> (raw)
In-Reply-To: <20261015200152.GA1793040@bhelgaas>
On Thu, 2026-10-15 at 15:01 -0500, Bjorn Helgaas wrote:
> [+cc Jonathan, Alistair, thread at
> https://lore.kernel.org/all/20260917230323.3701743-1-mclapinski@google.com
> ]
>
> On Fri, Sep 18, 2026 at 12:28:21PM -0700, Michał Cłapiński wrote:
> > On Fri, Sep 18, 2026 at 7:27 AM Lukas Wunner <lukas@wunner.de>
> > wrote:
> > >
> > > On Fri, Sep 18, 2026 at 01:03:23AM +0200, Michal Clapinski wrote:
> > > > doe_statemachine_work() waits for a response by sleeping
> > > > PCI_DOE_POLL_INTERVAL (PCI_DOE_TIMEOUT / 128) between status
> > > > reads,
> > > > which is 7 ms at HZ=1000 and 4 ms at HZ=250. Exchanges are
> > > > served from
> > > > the device's local mailbox logic and typically complete within
> > > > tens of
> > > > microseconds, so nearly all of that sleep is wasted. Every DOE-
> > > > capable
> > > > endpoint pays it once per supported feature during enumeration.
> > > >
> > > > Poll with usleep_range(20, 50) for the first ~2 ms before
> > > > falling back
> > > > to the jiffies-based wait. On an Intel Emerald Rapids system,
> > > > time spent
> > > > in pci_device_add() for a DOE-capable endpoint drops from 41.8
> > > > ms to
> > > > 14.0 ms.
> > >
> > > Polling is just a poor man's replacement for interrupts. DOE
> > > supports
> > > interrupt-driven transfers but we're not taking advantage of it
> > > so far.
> > >
> > > Perhaps you could look into adding that? It would seem more
> > > worthwhile
> > > than optimizing polling.
> >
> > Thanks for the quick response.
> >
> > This code runs during PCI device enumeration, before a driver is
> > bound, so the core doesn't really have an interrupt to work with:
> > MSI/MSI-X vectors belong to the driver, and enabling them in the
> > core would collide with its later pci_alloc_irq_vectors(); INTx
> > isn't routed yet either, since dev->irq only becomes valid via
> > acpi_pci_irq_enable() at pci_enable_device() time.
>
> Do we have to run the DOE setup code during enumeration at all?
Yeah, I think we do.
We need to probe DOE to know if the device supports CMA, at which point
we need to attest and authenticate the device.
Granted that isn't upstream yet, but in general we will need DOE at
enumeration.
> Maybe
> we can wait until a user that needs DOE functionality comes along?
We don't know who that user is until we know the DOE features is the
issue
Alistair
prev parent reply other threads:[~2026-10-16 4:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 23:03 Michal Clapinski
2026-09-18 14:27 ` Lukas Wunner
2026-09-18 19:28 ` Michał Cłapiński
2026-10-15 20:01 ` Bjorn Helgaas
2026-10-16 4:19 ` Alistair [this message]
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=84f476a74719089da16a4b7123fc42242bd67ae1.camel@alistair23.me \
--to=alistair@alistair23.me \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mclapinski@google.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
all inboxes | Powered by JetHome®