Re: [ath9k-devel] [stable] [PATCH 1/3] ath9k: Handle -ENOMEM on RX gracefully

2008-12-03 Thread Luis R. Rodriguez
On Tue, Dec 2, 2008 at 4:24 PM, John W. Linville [EMAIL PROTECTED] wrote:
 On Tue, Dec 02, 2008 at 04:20:32PM -0800, Luis R. Rodriguez wrote:
 On Tue, Dec 2, 2008 at 4:12 PM, Greg KH [EMAIL PROTECTED] wrote:
  I don't see this patch upstream in Linus's tree.  Am I just missing it
  and if so, do you know the git commit id?

 Nope sorry, John has yet to send his pending-fixes branch to davem and
 so forth, which would contain it AFAICT. Please correct me if I'm
 wrong John.

 It has been sent, and Dave sent his pull request to Linus today
 (or maybe yesterday).  I'll try to dig-up the commit IDs tomorrow.

Greg, I see two of these patches in 2.6.27-stable review patch but the
one in this subject was not applied, any specific reason or was it
just missed?

  Luis
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [stable] [PATCH 1/3] ath9k: Handle -ENOMEM on RX gracefully

2008-12-03 Thread Greg KH
On Wed, Dec 03, 2008 at 12:19:22PM -0800, Luis R. Rodriguez wrote:
 On Tue, Dec 2, 2008 at 4:24 PM, John W. Linville [EMAIL PROTECTED] wrote:
  On Tue, Dec 02, 2008 at 04:20:32PM -0800, Luis R. Rodriguez wrote:
  On Tue, Dec 2, 2008 at 4:12 PM, Greg KH [EMAIL PROTECTED] wrote:
   I don't see this patch upstream in Linus's tree.  Am I just missing it
   and if so, do you know the git commit id?
 
  Nope sorry, John has yet to send his pending-fixes branch to davem and
  so forth, which would contain it AFAICT. Please correct me if I'm
  wrong John.
 
  It has been sent, and Dave sent his pull request to Linus today
  (or maybe yesterday).  I'll try to dig-up the commit IDs tomorrow.
 
 Greg, I see two of these patches in 2.6.27-stable review patch but the
 one in this subject was not applied, any specific reason or was it
 just missed?

It was not applied because it was not yet in Linus's tree, which is a
requirement for it to go into the 2.6.27-stable tree.

thanks,

greg k-h
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [stable] [PATCH 1/3] ath9k: Handle -ENOMEM on RX gracefully

2008-12-02 Thread Greg KH
I don't see this patch upstream in Linus's tree.  Am I just missing it
and if so, do you know the git commit id?

thanks,

greg k-h


On Tue, Dec 02, 2008 at 12:51:22PM -0800, Luis R. Rodriguez wrote:
 We would get an oops on RX on -ENOMEM by passing
 NULL to the hardware on ath_rx_buf_link(). The oops
 would look something like this:
 
 ath_rx_tasklet
 ...
 RIP: ath_rx_buf_link
 
 We correct this by handling the allocation for the next
 skb we will put in our RX tail directly on the ath_rx_tasklet()
 *prior* to sending up the last hardware processed
 skb. If we run out of memory this gauranteees we have
 skbs to work with while it simply drops new received
 frames.
 
 Signed-off-by: Luis R. Rodriguez [EMAIL PROTECTED]
 ---
  drivers/net/wireless/ath9k/recv.c |   18 ++
  1 files changed, 14 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/net/wireless/ath9k/recv.c 
 b/drivers/net/wireless/ath9k/recv.c
 index 0941589..a4f92b2 100644
 --- a/drivers/net/wireless/ath9k/recv.c
 +++ b/drivers/net/wireless/ath9k/recv.c
 @@ -441,18 +441,16 @@ static void ath_rx_requeue(struct ath_softc *sc, struct 
 sk_buff *skb)
   */
  static int ath_rx_indicate(struct ath_softc *sc,
  struct sk_buff *skb,
 +struct sk_buff *nskb,
  struct ath_recv_status *status,
  u16 keyix)
  {
   struct ath_buf *bf = ATH_RX_CONTEXT(skb)-ctx_rxbuf;
 - struct sk_buff *nskb;
   int type;
  
   /* indicate frame to the stack, which will free the old skb. */
   type = ath__rx_indicate(sc, skb, status, keyix);
  
 - /* allocate a new skb and queue it to for H/W processing */
 - nskb = ath_rxbuf_alloc(sc, sc-sc_rxbufsize);
   if (nskb != NULL) {
   bf-bf_mpdu = nskb;
   bf-bf_buf_addr = ath_skb_map_single(sc,
 @@ -741,6 +739,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
   struct ath_desc *ds;
   struct ieee80211_hdr *hdr;
   struct sk_buff *skb = NULL;
 + struct sk_buff *nskb = NULL;
   struct ath_recv_status rx_status;
   struct ath_hal *ah = sc-sc_ah;
   int type, rx_processed = 0;
 @@ -963,6 +962,17 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
*/
   if (sc-sc_rxbufsize  ds-ds_rxstat.rs_datalen)
   goto rx_next;
 +
 + /* allocate a new skb and queue it to for H/W processing */
 + nskb = ath_rxbuf_alloc(sc, sc-sc_rxbufsize);
 +
 + /* Diregard current RX'd frame and reuse the old skb */
 + if (!nskb) {
 + list_move_tail(bf-list, sc-sc_rxbuf);
 + ath_rx_buf_link(sc, bf);
 + goto rx_next;
 + }
 +
   /*
* Sync and unmap the frame.  At this point we're
* committed to passing the sk_buff somewhere so
 @@ -1052,7 +1062,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
  
   /* Pass frames up to the stack. */
  
 - type = ath_rx_indicate(sc, skb,
 + type = ath_rx_indicate(sc, skb, nskb,
   rx_status, ds-ds_rxstat.rs_keyix);
  
   /*
 -- 
 1.5.6.rc2.15.g457bb.dirty
 
 ___
 stable mailing list
 [EMAIL PROTECTED]
 http://linux.kernel.org/mailman/listinfo/stable
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel