Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Wednesday, August 25, 2010 - 1:44 pm

Le mercredi 25 août 2010 à 13:25 -0700, Nikhil Sethi (निखिल सेठी) a
écrit :


reading my former patch, I believe I mistakenly used a max_t() instead
of a min_() macro :

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ca6065b..0a0dc3a 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -226,10 +226,10 @@ static int ath_rx_edma_init(struct ath_softc *sc, int nbufs)
        u32 size;
 
 
-       common->rx_bufsize = roundup(IEEE80211_MAX_MPDU_LEN +
-                                    ah->caps.rx_status_len,
-                                    min(common->cachelsz, (u16)64));
-
+       size = roundup(IEEE80211_MAX_MPDU_LEN + ah->caps.rx_status_len,
+                      min(common->cachelsz, (u16)64));
+       common->rx_bufsize = max_t(u32, size,
+                                  SKB_MAX_ORDER(NET_SKB_PAD + common->cachelsz, 0));
        ath9k_hw_set_rx_bufsize(ah, common->rx_bufsize -
                                    ah->caps.rx_status_len);
 


Please use instead this one :

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ca6065b..0a0dc3a 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -226,10 +226,10 @@ static int ath_rx_edma_init(struct ath_softc *sc, int nbufs)
        u32 size;
 
 
-       common->rx_bufsize = roundup(IEEE80211_MAX_MPDU_LEN +
-                                    ah->caps.rx_status_len,
-                                    min(common->cachelsz, (u16)64));
-
+       size = roundup(IEEE80211_MAX_MPDU_LEN + ah->caps.rx_status_len,
+                      min(common->cachelsz, (u16)64));
+       common->rx_bufsize = min_t(u32, size,
+                                  SKB_MAX_ORDER(NET_SKB_PAD + common->cachelsz, 0));
        ath9k_hw_set_rx_bufsize(ah, common->rx_bufsize -
                                    ah->caps.rx_status_len);
 



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[2.6.35-rc1] page alloc failure order:1, mode:0x4020, Michael Guntsche, (Fri Jun 4, 2:20 am)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Michael Guntsche, (Fri Jun 4, 9:16 am)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Michael Guntsche, (Sun Jun 6, 2:56 am)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Nikhil Sethi (नि ..., (Wed Aug 25, 1:25 pm)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Eric Dumazet, (Wed Aug 25, 1:44 pm)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Nikhil Sethi (नि ..., (Thu Aug 26, 10:53 am)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Nikhil Sethi (नि ..., (Sun Sep 5, 8:57 am)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Nikhil Sethi (नि ..., (Mon Nov 8, 9:25 am)
Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020, Nikhil Sethi (नि ..., (Mon Nov 8, 10:22 am)