Skip to content

Commit

Permalink
NTB: handle link down event correctly
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jon Mason <[email protected]>
  • Loading branch information
amd-anath authored and jonmason committed Mar 13, 2020
1 parent fdd8281 commit 60ceafd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/ntb/hw/amd/ntb_hw_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit 60ceafd

Please sign in to comment.