diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-03-14 18:40:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-14 18:40:39 -0400 |
commit | c05e7ac99c32d4e5d8be272c0ba95b0fdcab431b (patch) | |
tree | bc1fcf05542a924b956f68940d044bb163be1547 /drivers/net/ftmac100.c | |
parent | dcf4ae2dba541eed96afb0ba13e562defb8543e6 (diff) |
ftmac100: use GFP_ATOMIC allocations where needed
When running in softirq context, we should use GFP_ATOMIC allocations
instead of GFP_KERNEL ones.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Po-Yu Chuang <ratbert@faraday-tech.com>
Acked-by: Po-Yu Chuang <ratbert@faraday-tech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ftmac100.c')
-rw-r--r-- | drivers/net/ftmac100.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index df70368bf317..1d6f4b8d393a 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c | |||
@@ -80,7 +80,8 @@ struct ftmac100 { | |||
80 | struct mii_if_info mii; | 80 | struct mii_if_info mii; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static int ftmac100_alloc_rx_page(struct ftmac100 *priv, struct ftmac100_rxdes *rxdes); | 83 | static int ftmac100_alloc_rx_page(struct ftmac100 *priv, |
84 | struct ftmac100_rxdes *rxdes, gfp_t gfp); | ||
84 | 85 | ||
85 | /****************************************************************************** | 86 | /****************************************************************************** |
86 | * internal functions (hardware register access) | 87 | * internal functions (hardware register access) |
@@ -441,7 +442,7 @@ static bool ftmac100_rx_packet(struct ftmac100 *priv, int *processed) | |||
441 | skb->truesize += length; | 442 | skb->truesize += length; |
442 | __pskb_pull_tail(skb, min(length, 64)); | 443 | __pskb_pull_tail(skb, min(length, 64)); |
443 | 444 | ||
444 | ftmac100_alloc_rx_page(priv, rxdes); | 445 | ftmac100_alloc_rx_page(priv, rxdes, GFP_ATOMIC); |
445 | 446 | ||
446 | ftmac100_rx_pointer_advance(priv); | 447 | ftmac100_rx_pointer_advance(priv); |
447 | 448 | ||
@@ -659,13 +660,14 @@ static int ftmac100_xmit(struct ftmac100 *priv, struct sk_buff *skb, | |||
659 | /****************************************************************************** | 660 | /****************************************************************************** |
660 | * internal functions (buffer) | 661 | * internal functions (buffer) |
661 | *****************************************************************************/ | 662 | *****************************************************************************/ |
662 | static int ftmac100_alloc_rx_page(struct ftmac100 *priv, struct ftmac100_rxdes *rxdes) | 663 | static int ftmac100_alloc_rx_page(struct ftmac100 *priv, |
664 | struct ftmac100_rxdes *rxdes, gfp_t gfp) | ||
663 | { | 665 | { |
664 | struct net_device *netdev = priv->netdev; | 666 | struct net_device *netdev = priv->netdev; |
665 | struct page *page; | 667 | struct page *page; |
666 | dma_addr_t map; | 668 | dma_addr_t map; |
667 | 669 | ||
668 | page = alloc_page(GFP_KERNEL); | 670 | page = alloc_page(gfp); |
669 | if (!page) { | 671 | if (!page) { |
670 | if (net_ratelimit()) | 672 | if (net_ratelimit()) |
671 | netdev_err(netdev, "failed to allocate rx page\n"); | 673 | netdev_err(netdev, "failed to allocate rx page\n"); |
@@ -736,7 +738,7 @@ static int ftmac100_alloc_buffers(struct ftmac100 *priv) | |||
736 | for (i = 0; i < RX_QUEUE_ENTRIES; i++) { | 738 | for (i = 0; i < RX_QUEUE_ENTRIES; i++) { |
737 | struct ftmac100_rxdes *rxdes = &priv->descs->rxdes[i]; | 739 | struct ftmac100_rxdes *rxdes = &priv->descs->rxdes[i]; |
738 | 740 | ||
739 | if (ftmac100_alloc_rx_page(priv, rxdes)) | 741 | if (ftmac100_alloc_rx_page(priv, rxdes, GFP_KERNEL)) |
740 | goto err; | 742 | goto err; |
741 | } | 743 | } |
742 | 744 | ||