From: "Dan Williams (nvidia)" <djbw@kernel.org>
To: Lukas Wunner <lukas@wunner.de>, Dan Williams <djbw@kernel.org>,
Ashish Kalra <ashish.kalra@amd.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Cc: Vivaik Balasubrawmanian <vivaik.balasubrawmanian@intel.com>,
John Allen <john.allen@amd.com>,
Bjorn Helgaas <helgaas@kernel.org>,
linux-coco@lists.linux.dev, linux-pci@vger.kernel.org,
Jonathan Cameron <jic23@kernel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
Yilun Xu <yilun.xu@linux.intel.com>,
Zhenzhong Duan <zhenzhong.duan@intel.com>,
Alexey Kardashevskiy <aik@amd.com>
Subject: Re: [PATCH] PCI/TSM: Resume device to D0 for CMA-SPDM operation
Date: Tue, 16 Jun 2026 10:34:31 -0700 [thread overview]
Message-ID: <6a3189272d3ce_9b8551008b@djbw-dev.notmuch> (raw)
In-Reply-To: <7bdfaf14d7e5a466f3f650150c688a60e947a7a9.1781527060.git.lukas@wunner.de>
Lukas Wunner wrote:
> Per PCIe r7.0 sec 6.31.3, CMA-SPDM operation in non-D0 states is optional.
> The spec does not define a way to determine if it's supported, so resume
> to D0 unconditionally for the duration of a CMA-SPDM exchange. Vivaik has
> talked to Windows engineers and they said that Windows does the same.
>
> Note that for plain DOE operation, it is sufficient for the device to be
> in D3hot and its parents in D0 because config space remains accessible in
> D3hot. So CMA-SPDM goes beyond the requirements of plain DOE and hence
> resuming to D0 needs to (only) be done in code paths which use DOE
> specifically for CMA-SPDM.
>
> The pattern used herein for runtime resume is the best practice introduced
> by commit ef8057b07c72 ("PM: runtime: Wrapper macros for ACQUIRE()/
> ACQUIRE_ERR()").
>
> Fixes: 3225f52cde56 ("PCI/TSM: Establish Secure Sessions and Link Encryption")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: stable@vger.kernel.org # v6.19+
> Cc: Vivaik Balasubrawmanian <vivaik.balasubrawmanian@intel.com>
> ---
> We're in the merge window for v7.2 and this isn't super urgent,
> so it's targeting v7.3 via tsm.git/next.
>
> Technically I'd have permission to apply myself,
> but I wouldn't want to without acks from Dan and AMD!
> Thanks for taking a look!
Thanks, Lukas. A few questions:
This says Fixes, but I assume it is based on inspection and not a
report?
There are no upstream usages of pci_tsm_doe_transfer() yet, but the ones
in flight would suffer from the "D0 -> D3hot -> D0 -> D3hot" bounce that
you described to sashiko. I.e. the runtime acquire should be done at a
higher level.
I think the natural place to add PM_RUNTIME_ACQUIRE() that covers all
cases is withing pci_tsm_connect() and pci_tsm_disconnect().
I also think failure to power manage the device in the disconnect path
should not be fatal to performing the rest of the cleanup.
prev parent reply other threads:[~2026-06-16 17:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 13:19 [PATCH] PCI/TSM: Resume device to D0 for CMA-SPDM operation Lukas Wunner
2026-06-15 13:42 ` sashiko-bot
2026-06-15 15:37 ` Lukas Wunner
2026-06-16 12:57 ` Jonathan Cameron
2026-06-16 17:34 ` Dan Williams (nvidia) [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=6a3189272d3ce_9b8551008b@djbw-dev.notmuch \
--to=djbw@kernel.org \
--cc=aik@amd.com \
--cc=aneesh.kumar@kernel.org \
--cc=ashish.kalra@amd.com \
--cc=helgaas@kernel.org \
--cc=jic23@kernel.org \
--cc=john.allen@amd.com \
--cc=linux-coco@lists.linux.dev \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=thomas.lendacky@amd.com \
--cc=vivaik.balasubrawmanian@intel.com \
--cc=yilun.xu@linux.intel.com \
--cc=zhenzhong.duan@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.