Skip to content

Commit 60ceafd

Browse files
amd-anathjonmason
authored andcommitted
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 <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent fdd8281 commit 60ceafd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/ntb/hw/amd/ntb_hw_amd.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,12 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
551551
dev_info(dev, "Flush is done.\n");
552552
break;
553553
case AMD_PEER_RESET_EVENT:
554-
ndev->peer_sta |= AMD_PEER_RESET_EVENT;
555-
amd_ack_smu(ndev, AMD_PEER_RESET_EVENT);
554+
case AMD_LINK_DOWN_EVENT:
555+
ndev->peer_sta |= status;
556+
if (status == AMD_LINK_DOWN_EVENT)
557+
ndev->peer_sta &= ~AMD_LINK_UP_EVENT;
558+
559+
amd_ack_smu(ndev, status);
556560

557561
/* link down first */
558562
ntb_link_event(&ndev->ntb);
@@ -563,7 +567,6 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
563567
case AMD_PEER_D3_EVENT:
564568
case AMD_PEER_PMETO_EVENT:
565569
case AMD_LINK_UP_EVENT:
566-
case AMD_LINK_DOWN_EVENT:
567570
ndev->peer_sta |= status;
568571
amd_ack_smu(ndev, status);
569572

0 commit comments

Comments
 (0)