aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/tile/include/asm/cacheflush.h18
-rw-r--r--drivers/net/tile/tilepro.c8
2 files changed, 15 insertions, 11 deletions
diff --git a/arch/tile/include/asm/cacheflush.h b/arch/tile/include/asm/cacheflush.h
index 12fb0fb330ee..e925f4bb498f 100644
--- a/arch/tile/include/asm/cacheflush.h
+++ b/arch/tile/include/asm/cacheflush.h
@@ -116,22 +116,28 @@ static inline void __finv_buffer(void *buffer, size_t size)
116} 116}
117 117
118 118
119/* Invalidate a VA range, then memory fence. */ 119/* Invalidate a VA range and wait for it to be complete. */
120static inline void inv_buffer(void *buffer, size_t size) 120static inline void inv_buffer(void *buffer, size_t size)
121{ 121{
122 __inv_buffer(buffer, size); 122 __inv_buffer(buffer, size);
123 mb_incoherent(); 123 mb();
124} 124}
125 125
126/* Flush a VA range, then memory fence. */ 126/*
127static inline void flush_buffer(void *buffer, size_t size) 127 * Flush a locally-homecached VA range and wait for the evicted
128 * cachelines to hit memory.
129 */
130static inline void flush_buffer_local(void *buffer, size_t size)
128{ 131{
129 __flush_buffer(buffer, size); 132 __flush_buffer(buffer, size);
130 mb_incoherent(); 133 mb_incoherent();
131} 134}
132 135
133/* Flush & invalidate a VA range, then memory fence. */ 136/*
134static inline void finv_buffer(void *buffer, size_t size) 137 * Flush and invalidate a locally-homecached VA range and wait for the
138 * evicted cachelines to hit memory.
139 */
140static inline void finv_buffer_local(void *buffer, size_t size)
135{ 141{
136 __finv_buffer(buffer, size); 142 __finv_buffer(buffer, size);
137 mb_incoherent(); 143 mb_incoherent();
diff --git a/drivers/net/tile/tilepro.c b/drivers/net/tile/tilepro.c
index 0825db6d883f..314f7e79c640 100644
--- a/drivers/net/tile/tilepro.c
+++ b/drivers/net/tile/tilepro.c
@@ -1658,11 +1658,9 @@ static int tile_net_stop(struct net_device *dev)
1658 while (tile_net_lepp_free_comps(dev, true)) 1658 while (tile_net_lepp_free_comps(dev, true))
1659 /* loop */; 1659 /* loop */;
1660 1660
1661 /* Wipe the EPP queue. */ 1661 /* Wipe the EPP queue, and wait till the stores hit the EPP. */
1662 memset(priv->eq, 0, sizeof(lepp_queue_t)); 1662 memset(priv->eq, 0, sizeof(lepp_queue_t));
1663 1663 mb();
1664 /* Evict the EPP queue. */
1665 finv_buffer(priv->eq, EQ_SIZE);
1666 1664
1667 return 0; 1665 return 0;
1668} 1666}
@@ -2398,7 +2396,7 @@ static void tile_net_cleanup(void)
2398 struct net_device *dev = tile_net_devs[i]; 2396 struct net_device *dev = tile_net_devs[i];
2399 struct tile_net_priv *priv = netdev_priv(dev); 2397 struct tile_net_priv *priv = netdev_priv(dev);
2400 unregister_netdev(dev); 2398 unregister_netdev(dev);
2401 finv_buffer(priv->eq, EQ_SIZE); 2399 finv_buffer_remote(priv->eq, EQ_SIZE, 0);
2402 __free_pages(priv->eq_pages, EQ_ORDER); 2400 __free_pages(priv->eq_pages, EQ_ORDER);
2403 free_netdev(dev); 2401 free_netdev(dev);
2404 } 2402 }