[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <bff304461627e0d4b748973066b7f2d3c62b0b65.1580914232.git.arindam.nath@amd.com>
Date: Wed, 5 Feb 2020 21:24:25 +0530
From: Arindam Nath <arindam.nath@....com>
To: Shyam Sundar S K <Shyam-sundar.S-k@....com>,
Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>,
Allen Hubbe <allenbh@...il.com>,
Jiasen Lin <linjiasen@...on.cn>,
Sanjay R Mehta <sanju.mehta@....com>
Cc: linux-ntb@...glegroups.com, linux-kernel@...r.kernel.org,
Arindam Nath <arindam.nath@....com>
Subject: [PATCH 08/15] 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@....com>
---
drivers/ntb/hw/amd/ntb_hw_amd.c | 9 ++++++---
1 file 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);
--
2.17.1
Powered by blists - more mailing lists