Re: [PATCH 1/2] PCI: AtomicOps: Define valid root port capabilities
From: Leon Romanovsky
Date: Mon Nov 10 2025 - 09:02:33 EST
On Mon, Nov 10, 2025 at 02:25:05PM +0100, Gerd Bayer wrote:
> Provide the two combinations of Atomic Op Completion size attributes
> that a root port may support per PCIe Spec 7.0 section 6.15.3.1. -
> besides the trivial "No support" - as two new defines.
>
> Change documentation of pci_enable_atomic_ops_to_root() that these are
> the only ones that should be used. Also, spell out that all requested
> capabilities need to be supported at the root port for enable to
> succeed. Also emphasize that on success, this sets AtomicOpsCtl:ReqEn to
> 1, and leaves it untouched in case of failure.
>
> Suggested-by: Leon Romanovsky <leon@xxxxxxxxxx>
> Signed-off-by: Gerd Bayer <gbayer@xxxxxxxxxxxxx>
> ---
> drivers/pci/pci.c | 13 +++++++------
> include/uapi/linux/pci_regs.h | 8 ++++++++
> 2 files changed, 15 insertions(+), 6 deletions(-)
<...>
> +/* PCIe spec 7.0 6.15.3.1: Root ports may support one of 2 sets of Atomic Ops */
> +#define PCI_EXP_ROOT_PORT_ATOMIC_BASE \
> + (PCI_EXP_DEVCAP2_ATOMIC_COMP32 | \
> + PCI_EXP_DEVCAP2_ATOMIC_COMP64)
> +#define PCI_EXP_ROOT_PORT_ATOMIC_FULL \
> + (PCI_EXP_DEVCAP2_ATOMIC_COMP32 | \
> + PCI_EXP_DEVCAP2_ATOMIC_COMP64 | \
> + PCI_EXP_DEVCAP2_ATOMIC_COMP128)
Thanks for doing this.