Commit f2e27c8
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 15e7b2a commit f2e27c8
1 file changed
Lines changed: 20 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3850 | 3850 | | |
3851 | 3851 | | |
3852 | 3852 | | |
3853 | | - | |
3854 | | - | |
| 3853 | + | |
3855 | 3854 | | |
3856 | 3855 | | |
3857 | 3856 | | |
| |||
3881 | 3880 | | |
3882 | 3881 | | |
3883 | 3882 | | |
3884 | | - | |
3885 | | - | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
3886 | 3886 | | |
3887 | | - | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
3888 | 3890 | | |
| 3891 | + | |
| 3892 | + | |
3889 | 3893 | | |
3890 | | - | |
3891 | 3894 | | |
3892 | | - | |
3893 | | - | |
3894 | | - | |
3895 | | - | |
3896 | | - | |
3897 | | - | |
3898 | | - | |
3899 | | - | |
3900 | | - | |
3901 | | - | |
3902 | | - | |
3903 | | - | |
3904 | | - | |
3905 | | - | |
| 3895 | + | |
3906 | 3896 | | |
3907 | 3897 | | |
3908 | 3898 | | |
3909 | 3899 | | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
3910 | 3909 | | |
3911 | 3910 | | |
3912 | | - | |
| 3911 | + | |
3913 | 3912 | | |
3914 | 3913 | | |
3915 | 3914 | | |
| |||
0 commit comments