linux/drivers/ntb/hw
Jiasen Lin bb81bf6215 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: a1b3695820 ("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>
2020-03-12 20:41:25 -04:00
..
amd NTB: Fix an error in get link status 2020-03-12 20:41:25 -04:00
idt NTB: fix IDT Kconfig typos/spellos 2019-09-23 17:20:40 -04:00
intel New feature to add support for NTB virtual MSI interrupts, the ability 2019-07-21 09:46:59 -07:00
mscc ntb_hw_switchtec: make ntb_mw_set_trans() work when addr == 0 2019-09-23 17:20:40 -04:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00