Commit 2465b87c authored by Arindam Nath's avatar Arindam Nath Committed by Jon Mason

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: default avatarArindam Nath <arindam.nath@amd.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
parent 5cafa485
...@@ -541,8 +541,6 @@ static void amd_ack_smu(struct amd_ntb_dev *ndev, u32 bit) ...@@ -541,8 +541,6 @@ static void amd_ack_smu(struct amd_ntb_dev *ndev, u32 bit)
reg = readl(mmio + AMD_SMUACK_OFFSET); reg = readl(mmio + AMD_SMUACK_OFFSET);
reg |= bit; reg |= bit;
writel(reg, mmio + AMD_SMUACK_OFFSET); writel(reg, mmio + AMD_SMUACK_OFFSET);
ndev->peer_sta |= bit;
} }
static void amd_handle_event(struct amd_ntb_dev *ndev, int vec) 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) ...@@ -560,9 +558,11 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
status &= AMD_EVENT_INTMASK; status &= AMD_EVENT_INTMASK;
switch (status) { switch (status) {
case AMD_PEER_FLUSH_EVENT: case AMD_PEER_FLUSH_EVENT:
ndev->peer_sta |= AMD_PEER_FLUSH_EVENT;
dev_info(dev, "Flush is done.\n"); dev_info(dev, "Flush is done.\n");
break; break;
case AMD_PEER_RESET_EVENT: case AMD_PEER_RESET_EVENT:
ndev->peer_sta |= AMD_PEER_RESET_EVENT;
amd_ack_smu(ndev, AMD_PEER_RESET_EVENT); amd_ack_smu(ndev, AMD_PEER_RESET_EVENT);
/* link down first */ /* link down first */
...@@ -575,6 +575,7 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec) ...@@ -575,6 +575,7 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
case AMD_PEER_PMETO_EVENT: case AMD_PEER_PMETO_EVENT:
case AMD_LINK_UP_EVENT: case AMD_LINK_UP_EVENT:
case AMD_LINK_DOWN_EVENT: case AMD_LINK_DOWN_EVENT:
ndev->peer_sta |= status;
amd_ack_smu(ndev, status); amd_ack_smu(ndev, status);
/* link down */ /* link down */
...@@ -588,6 +589,7 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec) ...@@ -588,6 +589,7 @@ static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
if (status & 0x1) if (status & 0x1)
dev_info(dev, "Wakeup is done.\n"); dev_info(dev, "Wakeup is done.\n");
ndev->peer_sta |= AMD_PEER_D0_EVENT;
amd_ack_smu(ndev, AMD_PEER_D0_EVENT); amd_ack_smu(ndev, AMD_PEER_D0_EVENT);
/* start a timer to poll link status */ /* start a timer to poll link status */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment