Skip to contentSkip to conversation

net: sgi: use GFP_ATOMIC under spin lock

PATCH Applied Wei Yongjun 2 participants 2 messages Feb 16, 2019 – Feb 17, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sgi: use GFP_ATOMIC under spin lock

The function meth_init_tx_ring() is called from meth_tx_timeout(), in which spin_lock is held, so we should use GFP_ATOMIC instead.

Fixes 8d4c28fbc284 ("meth: pass struct device to DMA API functions")
---
 drivers/net/ethernet/sgi/meth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sgi/meth.c +1 -1
index f425ab528224..f1271402ca21 100644
@@ -214,7 +214,7 @@ static int meth_init_tx_ring(struct meth_private *priv)
 {
 	/* Init TX ring */
 	priv->tx_ring = dma_alloc_coherent(&priv->pdev->dev,
-			TX_RING_BUFFER_SIZE, &priv->tx_ring_dma, GFP_KERNEL);
+			TX_RING_BUFFER_SIZE, &priv->tx_ring_dma, GFP_ATOMIC);
 	if (!priv->tx_ring)
 		return -ENOMEM;
 
maintainer Applied
#1 lore raw

From: Wei Yongjun <[email protected]>
Date: Sat, 16 Feb 2019 01:48:09 +0000

Quoted 5 lines

The function meth_init_tx_ring() is called from meth_tx_timeout(), in which spin_lock is held, so we should use GFP_ATOMIC instead.

Fixes 8d4c28fbc284 ("meth: pass struct device to DMA API functions")

Applied.