summaryrefslogtreecommitdiffstats
path: root/drivers/ntb
diff options
context:
space:
mode:
authorArindam Nath <arindam.nath@amd.com>2020-02-05 16:54:25 +0100
committerJon Mason <jdmason@kudzu.us>2020-03-13 15:04:20 +0100
commit60ceafd151d62eba6c19c27e617269567082a17d (patch)
tree7c9de910d02c30782c3da0ca2e782826d7ad8467 /drivers/ntb
parentNTB: remove handling of peer_sta from amd_link_is_up (diff)
downloadlinux-60ceafd151d62eba6c19c27e617269567082a17d.tar.xz
linux-60ceafd151d62eba6c19c27e617269567082a17d.zip
NTB: handle link down event correctly
Link-Up and Link-Down are mutually exclusive events. So when we receive a Link-Down event, we should also clear the bitmask for Link-Up event in peer_sta. Signed-off-by: Arindam Nath <arindam.nath@amd.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb')
-rw-r--r--drivers/ntb/hw/amd/ntb_hw_amd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c
index e964442ae2c3..d933a1dffdc6 100644
--- a/drivers/ntb/hw/amd/ntb_hw_amd.c
+++ b/drivers/ntb/hw/amd/ntb_hw_amd.c
@@ -551,8 +551,12 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
dev_info(dev, "Flush is done.\n");
break;
case AMD_PEER_RESET_EVENT:
- ndev->peer_sta |= AMD_PEER_RESET_EVENT;
- amd_ack_smu(ndev, AMD_PEER_RESET_EVENT);
+ case AMD_LINK_DOWN_EVENT:
+ ndev->peer_sta |= status;
+ if (status == AMD_LINK_DOWN_EVENT)
+ ndev->peer_sta &= ~AMD_LINK_UP_EVENT;
+
+ amd_ack_smu(ndev, status);
/* link down first */
ntb_link_event(&ndev->ntb);
@@ -563,7 +567,6 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
case AMD_PEER_D3_EVENT:
case AMD_PEER_PMETO_EVENT:
case AMD_LINK_UP_EVENT:
- case AMD_LINK_DOWN_EVENT:
ndev->peer_sta |= status;
amd_ack_smu(ndev, status);