Skip to content

Commit 2465b87

Browse files
amd-anathjonmason
authored andcommitted
NTB: set peer_sta within event handler itself
amd_ack_smu() should only set the corresponding bits into SMUACK register. Setting the bitmask of peer_sta should be done within the event handler. They are two different things, and so should be handled differently and at different places. Signed-off-by: Arindam Nath <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent 5cafa48 commit 2465b87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/ntb/hw/amd/ntb_hw_amd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,6 @@ static void amd_ack_smu(struct amd_ntb_dev *ndev, u32 bit)
541541
reg = readl(mmio + AMD_SMUACK_OFFSET);
542542
reg |= bit;
543543
writel(reg, mmio + AMD_SMUACK_OFFSET);
544-
545-
ndev->peer_sta |= bit;
546544
}
547545

548546
static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
@@ -560,9 +558,11 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
560558
status &= AMD_EVENT_INTMASK;
561559
switch (status) {
562560
case AMD_PEER_FLUSH_EVENT:
561+
ndev->peer_sta |= AMD_PEER_FLUSH_EVENT;
563562
dev_info(dev, "Flush is done.\n");
564563
break;
565564
case AMD_PEER_RESET_EVENT:
565+
ndev->peer_sta |= AMD_PEER_RESET_EVENT;
566566
amd_ack_smu(ndev, AMD_PEER_RESET_EVENT);
567567

568568
/* link down first */
@@ -575,6 +575,7 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
575575
case AMD_PEER_PMETO_EVENT:
576576
case AMD_LINK_UP_EVENT:
577577
case AMD_LINK_DOWN_EVENT:
578+
ndev->peer_sta |= status;
578579
amd_ack_smu(ndev, status);
579580

580581
/* link down */
@@ -588,6 +589,7 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
588589
if (status & 0x1)
589590
dev_info(dev, "Wakeup is done.\n");
590591

592+
ndev->peer_sta |= AMD_PEER_D0_EVENT;
591593
amd_ack_smu(ndev, AMD_PEER_D0_EVENT);
592594

593595
/* start a timer to poll link status */

0 commit comments

Comments
 (0)