diff options
author | Jiasen Lin <linjiasen@hygon.cn> | 2019-11-07 12:35:36 +0300 |
---|---|---|
committer | Jon Mason <jdmason@kudzu.us> | 2020-03-13 03:41:25 +0300 |
commit | bb81bf62151031df004864eabee0431c8b8e9064 (patch) | |
tree | 734a4d8728ef138c5bd759f0b8e39a3571106391 /drivers/visorbus | |
parent | bb6d3fb354c5ee8d6bde2d576eb7220ea09862b9 (diff) | |
download | linux-bb81bf62151031df004864eabee0431c8b8e9064.tar.xz |
NTB: Fix an error in get link status
The offset of PCIe Capability Header for AMD and HYGON NTB is 0x64,
but the macro which named "AMD_LINK_STATUS_OFFSET" is defined as 0x68.
It is offset of Device Capabilities Reg rather than Link Control Reg.
This code trigger an error in get link statsus:
cat /sys/kernel/debug/ntb_hw_amd/0000:43:00.1/info
LNK STA - 0x8fa1
Link Status - Up
Link Speed - PCI-E Gen 0
Link Width - x0
This patch use pcie_capability_read_dword to get link status.
After fix this issue, we can get link status accurately:
cat /sys/kernel/debug/ntb_hw_amd/0000:43:00.1/info
LNK STA - 0x11030042
Link Status - Up
Link Speed - PCI-E Gen 3
Link Width - x16
Fixes: a1b3695820aa4 ("NTB: Add support for AMD PCI-Express Non-Transparent Bridge")
Signed-off-by: Jiasen Lin <linjiasen@hygon.cn>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/visorbus')
0 files changed, 0 insertions, 0 deletions