]> git.baikalelectronics.ru Git - kernel.git/commit
NTB: Fix access to link status and control register
authorArindam Nath <arindam.nath@amd.com>
Wed, 5 Feb 2020 15:54:18 +0000 (21:24 +0530)
committerJon Mason <jdmason@kudzu.us>
Fri, 13 Mar 2020 14:04:19 +0000 (10:04 -0400)
commitd2b22e6713245a7e15d101cfbcd2f12eb9f989dd
treedfdb413825fd4ced57703b9e88f40897365e7dff
parent0e72e6dc155e047967a41f453e039f04ce420891
NTB: Fix access to link status and control register

The design of AMD NTB implementation is such that
NTB primary acts as an endpoint device and NTB
secondary is an endpoint device behind a combination
of Switch Upstream and Switch Downstream. Considering
that, the link status and control register needs to
be accessed differently based on the NTB topology.

So in the case of NTB secondary, we first get the
pointer to the Switch Downstream device for the NTB
device. Then we get the pointer to the Switch Upstream
device. Once we have that, we read the Link Status
and Control register to get the correct status of
link at the secondary.

In the case of NTB primary, simply reading the Link
Status and Control register of the NTB device itself
will suffice.

Suggested-by: Jiasen Lin <linjiasen@hygon.cn>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/amd/ntb_hw_amd.c