rt2x00: Use GFP_KERNEL for rx buffer allocation on USB devices
Since the RX path on USB devices is handled in process context we can use GFP_KERNEL for RX buffer allocation. This should reduce the likelihood of allocation failures. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Tested-By: Marc Dietrich <marvin24@gmx.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
0c0fdf6c80
commit
88211021a6
|
@ -1282,7 +1282,7 @@ void rt2x00lib_dmadone(struct queue_entry *entry);
|
||||||
void rt2x00lib_txdone(struct queue_entry *entry,
|
void rt2x00lib_txdone(struct queue_entry *entry,
|
||||||
struct txdone_entry_desc *txdesc);
|
struct txdone_entry_desc *txdesc);
|
||||||
void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status);
|
void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status);
|
||||||
void rt2x00lib_rxdone(struct queue_entry *entry);
|
void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mac80211 handlers.
|
* mac80211 handlers.
|
||||||
|
|
|
@ -588,7 +588,7 @@ static int rt2x00lib_rxdone_read_signal(struct rt2x00_dev *rt2x00dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rt2x00lib_rxdone(struct queue_entry *entry)
|
void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp)
|
||||||
{
|
{
|
||||||
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
|
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
|
||||||
struct rxdone_entry_desc rxdesc;
|
struct rxdone_entry_desc rxdesc;
|
||||||
|
@ -608,7 +608,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry)
|
||||||
* Allocate a new sk_buffer. If no new buffer available, drop the
|
* Allocate a new sk_buffer. If no new buffer available, drop the
|
||||||
* received frame and reuse the existing buffer.
|
* received frame and reuse the existing buffer.
|
||||||
*/
|
*/
|
||||||
skb = rt2x00queue_alloc_rxskb(entry);
|
skb = rt2x00queue_alloc_rxskb(entry, gfp);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
goto submit_entry;
|
goto submit_entry;
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
|
||||||
* rt2x00queue_alloc_rxskb - allocate a skb for RX purposes.
|
* rt2x00queue_alloc_rxskb - allocate a skb for RX purposes.
|
||||||
* @entry: The entry for which the skb will be applicable.
|
* @entry: The entry for which the skb will be applicable.
|
||||||
*/
|
*/
|
||||||
struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry);
|
struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rt2x00queue_free_skb - free a skb
|
* rt2x00queue_free_skb - free a skb
|
||||||
|
|
|
@ -92,7 +92,7 @@ bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
|
||||||
/*
|
/*
|
||||||
* Send the frame to rt2x00lib for further processing.
|
* Send the frame to rt2x00lib for further processing.
|
||||||
*/
|
*/
|
||||||
rt2x00lib_rxdone(entry);
|
rt2x00lib_rxdone(entry, GFP_ATOMIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !max_rx;
|
return !max_rx;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "rt2x00.h"
|
#include "rt2x00.h"
|
||||||
#include "rt2x00lib.h"
|
#include "rt2x00lib.h"
|
||||||
|
|
||||||
struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry)
|
struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp)
|
||||||
{
|
{
|
||||||
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
|
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
@ -68,7 +68,7 @@ struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry)
|
||||||
/*
|
/*
|
||||||
* Allocate skbuffer.
|
* Allocate skbuffer.
|
||||||
*/
|
*/
|
||||||
skb = dev_alloc_skb(frame_size + head_size + tail_size);
|
skb = __dev_alloc_skb(frame_size + head_size + tail_size, gfp);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1163,7 +1163,7 @@ static int rt2x00queue_alloc_rxskbs(struct data_queue *queue)
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
|
||||||
for (i = 0; i < queue->limit; i++) {
|
for (i = 0; i < queue->limit; i++) {
|
||||||
skb = rt2x00queue_alloc_rxskb(&queue->entries[i]);
|
skb = rt2x00queue_alloc_rxskb(&queue->entries[i], GFP_KERNEL);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
queue->entries[i].skb = skb;
|
queue->entries[i].skb = skb;
|
||||||
|
|
|
@ -358,7 +358,7 @@ static void rt2x00usb_work_rxdone(struct work_struct *work)
|
||||||
/*
|
/*
|
||||||
* Send the frame to rt2x00lib for further processing.
|
* Send the frame to rt2x00lib for further processing.
|
||||||
*/
|
*/
|
||||||
rt2x00lib_rxdone(entry);
|
rt2x00lib_rxdone(entry, GFP_KERNEL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue