aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ntb/hw/amd/ntb_hw_amd.h
diff options
context:
space:
mode:
authorArindam Nath <arindam.nath@amd.com>2020-02-05 21:24:29 +0530
committerJon Mason <jdmason@kudzu.us>2020-03-13 10:04:20 -0400
commit5f0856bebc6e02a57b36cd2146f056c71862f0b6 (patch)
treec12a06b2997e2430aa440468e5be7059f50b4be2 /drivers/ntb/hw/amd/ntb_hw_amd.h
parentNTB: add helper functions to set and clear sideinfo (diff)
downloadlinux-dev-5f0856bebc6e02a57b36cd2146f056c71862f0b6.tar.xz
linux-dev-5f0856bebc6e02a57b36cd2146f056c71862f0b6.zip
NTB: return link up status correctly for PRI and SEC
Since NTB connects two physically separate systems, there can be scenarios where one system goes down while the other one remains active. In case of NTB primary, if the NTB secondary goes down, a Link-Down event is received. For the NTB secondary, if the NTB primary goes down, the PCIe hotplug mechanism ensures that the driver on the secondary side is also unloaded. But there are other scenarios to consider as well, when suppose the physical link remains active, but the driver on primary or secondary side is loaded or un-loaded. When the driver is loaded, on either side, it sets SIDE_READY bit(bit-1) of SIDE_INFO register. Similarly, when the driver is un-loaded, it resets the same bit. We consider the NTB link to be up and operational only when the driver on both sides of link are loaded and ready. But we also need to take account of Link Up and Down events which signify the physical link status. So amd_link_is_up() is modified to take care of the above scenarios. Signed-off-by: Arindam Nath <arindam.nath@amd.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb/hw/amd/ntb_hw_amd.h')
-rw-r--r--drivers/ntb/hw/amd/ntb_hw_amd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.h b/drivers/ntb/hw/amd/ntb_hw_amd.h
index 62ffdf35b683..73959c0b9972 100644
--- a/drivers/ntb/hw/amd/ntb_hw_amd.h
+++ b/drivers/ntb/hw/amd/ntb_hw_amd.h
@@ -217,5 +217,6 @@ struct amd_ntb_dev {
static void amd_set_side_info_reg(struct amd_ntb_dev *ndev, bool peer);
static void amd_clear_side_info_reg(struct amd_ntb_dev *ndev, bool peer);
+static int amd_poll_link(struct amd_ntb_dev *ndev);
#endif