Commit 4749821
PCI: Enable AtomicOps only if Root Port supports them
[ Upstream commit 1ae8c4c ]
When inspecting the config space of a Connect-X physical function in an
s390 system after it was initialized by the mlx5_core device driver, we
found the function to be enabled to request AtomicOps despite the Root Port
lacking support for completing them:
00:00.1 Ethernet controller: Mellanox Technologies MT2894 Family [ConnectX-6 Lx]
Subsystem: Mellanox Technologies Device 0002
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
AtomicOpsCtl: ReqEn+
On s390 and many virtualized guests, the Endpoint is visible but the Root
Port is not. In this case, pci_enable_atomic_ops_to_root() previously
enabled AtomicOps in the Endpoint even though it can't tell whether the
Root Port supports them as a completer.
Change pci_enable_atomic_ops_to_root() to fail if there's no Root Port or
the Root Port doesn't support AtomicOps.
Fixes: 430a236 ("PCI: Add pci_enable_atomic_ops_to_root()")
Reported-by: Alexander Schmidt <alexs@linux.ibm.com>
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
[bhelgaas: commit log, check RP first to simplify flow]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260330-fix_pciatops-v7-2-f601818417e8@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent a62b3e6 commit 4749821
1 file changed
Lines changed: 20 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3674 | 3674 | | |
3675 | 3675 | | |
3676 | 3676 | | |
3677 | | - | |
3678 | | - | |
| 3677 | + | |
3679 | 3678 | | |
3680 | 3679 | | |
3681 | 3680 | | |
| |||
3705 | 3704 | | |
3706 | 3705 | | |
3707 | 3706 | | |
3708 | | - | |
3709 | | - | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
3710 | 3710 | | |
3711 | | - | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
3712 | 3714 | | |
| 3715 | + | |
| 3716 | + | |
3713 | 3717 | | |
3714 | | - | |
3715 | 3718 | | |
3716 | | - | |
3717 | | - | |
3718 | | - | |
3719 | | - | |
3720 | | - | |
3721 | | - | |
3722 | | - | |
3723 | | - | |
3724 | | - | |
3725 | | - | |
3726 | | - | |
3727 | | - | |
3728 | | - | |
3729 | | - | |
| 3719 | + | |
3730 | 3720 | | |
3731 | 3721 | | |
3732 | 3722 | | |
3733 | 3723 | | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
3734 | 3733 | | |
3735 | 3734 | | |
3736 | | - | |
| 3735 | + | |
3737 | 3736 | | |
3738 | 3737 | | |
3739 | 3738 | | |
| |||
0 commit comments