aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ntb/ntb_hw.c
diff options
context:
space:
mode:
authorJon Mason <jon.mason@intel.com>2013-10-03 20:24:03 -0400
committerJon Mason <jon.mason@intel.com>2013-11-20 11:57:33 -0500
commit78958433db077b339f3a039890148561086574e4 (patch)
treee35bac402cba779d8d838752b7feb6454489289f /drivers/ntb/ntb_hw.c
parent58b889206ea4ba75a57986e223da647f91ba1a19 (diff)
NTB: Enable Snoop on Primary Side
Enable Snoop from Primary to Secondary side on BAR23 and BAR45 on all TLPs. Previously, Snoop was only enabled from Secondary to Primary side. This can have a performance improvement on some workloads. Also, make the code more obvious about how the link is being enabled. Signed-off-by: Jon Mason <jon.mason@intel.com>
Diffstat (limited to 'drivers/ntb/ntb_hw.c')
-rw-r--r--drivers/ntb/ntb_hw.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c
index 391c377a5d38..80505aeecf9e 100644
--- a/drivers/ntb/ntb_hw.c
+++ b/drivers/ntb/ntb_hw.c
@@ -1316,10 +1316,16 @@ static void ntb_hw_link_up(struct ntb_device *ndev)
1316{ 1316{
1317 if (ndev->conn_type == NTB_CONN_TRANSPARENT) 1317 if (ndev->conn_type == NTB_CONN_TRANSPARENT)
1318 ntb_link_event(ndev, NTB_LINK_UP); 1318 ntb_link_event(ndev, NTB_LINK_UP);
1319 else 1319 else {
1320 u32 ntb_cntl;
1321
1320 /* Let's bring the NTB link up */ 1322 /* Let's bring the NTB link up */
1321 writel(NTB_CNTL_BAR23_SNOOP | NTB_CNTL_BAR45_SNOOP, 1323 ntb_cntl = readl(ndev->reg_ofs.lnk_cntl);
1322 ndev->reg_ofs.lnk_cntl); 1324 ntb_cntl &= ~(NTB_CNTL_LINK_DISABLE | NTB_CNTL_CFG_LOCK);
1325 ntb_cntl |= NTB_CNTL_P2S_BAR23_SNOOP | NTB_CNTL_S2P_BAR23_SNOOP;
1326 ntb_cntl |= NTB_CNTL_P2S_BAR45_SNOOP | NTB_CNTL_S2P_BAR45_SNOOP;
1327 writel(ntb_cntl, ndev->reg_ofs.lnk_cntl);
1328 }
1323} 1329}
1324 1330
1325static void ntb_hw_link_down(struct ntb_device *ndev) 1331static void ntb_hw_link_down(struct ntb_device *ndev)
@@ -1333,8 +1339,9 @@ static void ntb_hw_link_down(struct ntb_device *ndev)
1333 1339
1334 /* Bring NTB link down */ 1340 /* Bring NTB link down */
1335 ntb_cntl = readl(ndev->reg_ofs.lnk_cntl); 1341 ntb_cntl = readl(ndev->reg_ofs.lnk_cntl);
1336 ntb_cntl &= ~(NTB_CNTL_BAR23_SNOOP | NTB_CNTL_BAR45_SNOOP); 1342 ntb_cntl &= ~(NTB_CNTL_P2S_BAR23_SNOOP | NTB_CNTL_S2P_BAR23_SNOOP);
1337 ntb_cntl |= NTB_CNTL_LINK_DISABLE; 1343 ntb_cntl &= ~(NTB_CNTL_P2S_BAR45_SNOOP | NTB_CNTL_S2P_BAR45_SNOOP);
1344 ntb_cntl |= NTB_CNTL_LINK_DISABLE | NTB_CNTL_CFG_LOCK;
1338 writel(ntb_cntl, ndev->reg_ofs.lnk_cntl); 1345 writel(ntb_cntl, ndev->reg_ofs.lnk_cntl);
1339} 1346}
1340 1347