Commit db805e9
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 134c619 commit db805e9
1 file changed
Lines changed: 20 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3818 | 3818 | | |
3819 | 3819 | | |
3820 | 3820 | | |
3821 | | - | |
3822 | | - | |
| 3821 | + | |
3823 | 3822 | | |
3824 | 3823 | | |
3825 | 3824 | | |
| |||
3849 | 3848 | | |
3850 | 3849 | | |
3851 | 3850 | | |
3852 | | - | |
3853 | | - | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
3854 | 3854 | | |
3855 | | - | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
3856 | 3858 | | |
| 3859 | + | |
| 3860 | + | |
3857 | 3861 | | |
3858 | | - | |
3859 | 3862 | | |
3860 | | - | |
3861 | | - | |
3862 | | - | |
3863 | | - | |
3864 | | - | |
3865 | | - | |
3866 | | - | |
3867 | | - | |
3868 | | - | |
3869 | | - | |
3870 | | - | |
3871 | | - | |
3872 | | - | |
3873 | | - | |
| 3863 | + | |
3874 | 3864 | | |
3875 | 3865 | | |
3876 | 3866 | | |
3877 | 3867 | | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
3878 | 3877 | | |
3879 | 3878 | | |
3880 | | - | |
| 3879 | + | |
3881 | 3880 | | |
3882 | 3881 | | |
3883 | 3882 | | |
| |||
0 commit comments