aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/dmaengine.h10
-rw-r--r--net/core/dev.c13
2 files changed, 20 insertions, 3 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 64dea2ab326c..c73f1e2b59b7 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -270,8 +270,18 @@ struct dma_device {
270 270
271/* --- public DMA engine API --- */ 271/* --- public DMA engine API --- */
272 272
273#ifdef CONFIG_DMA_ENGINE
273void dmaengine_get(void); 274void dmaengine_get(void);
274void dmaengine_put(void); 275void dmaengine_put(void);
276#else
277static inline void dmaengine_get(void)
278{
279}
280static inline void dmaengine_put(void)
281{
282}
283#endif
284
275dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, 285dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
276 void *dest, void *src, size_t len); 286 void *dest, void *src, size_t len);
277dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, 287dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
diff --git a/net/core/dev.c b/net/core/dev.c
index 5f736f1ceeae..b715a55cccc4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1088,6 +1088,11 @@ int dev_open(struct net_device *dev)
1088 dev->flags |= IFF_UP; 1088 dev->flags |= IFF_UP;
1089 1089
1090 /* 1090 /*
1091 * Enable NET_DMA
1092 */
1093 dmaengine_get();
1094
1095 /*
1091 * Initialize multicasting status 1096 * Initialize multicasting status
1092 */ 1097 */
1093 dev_set_rx_mode(dev); 1098 dev_set_rx_mode(dev);
@@ -1164,6 +1169,11 @@ int dev_close(struct net_device *dev)
1164 */ 1169 */
1165 call_netdevice_notifiers(NETDEV_DOWN, dev); 1170 call_netdevice_notifiers(NETDEV_DOWN, dev);
1166 1171
1172 /*
1173 * Shutdown NET_DMA
1174 */
1175 dmaengine_put();
1176
1167 return 0; 1177 return 0;
1168} 1178}
1169 1179
@@ -5151,9 +5161,6 @@ static int __init net_dev_init(void)
5151 hotcpu_notifier(dev_cpu_callback, 0); 5161 hotcpu_notifier(dev_cpu_callback, 0);
5152 dst_init(); 5162 dst_init();
5153 dev_mcast_init(); 5163 dev_mcast_init();
5154 #ifdef CONFIG_NET_DMA
5155 dmaengine_get();
5156 #endif
5157 rc = 0; 5164 rc = 0;
5158out: 5165out:
5159 return rc; 5166 return rc;