All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [stable] [PATCH 1/3] ath9k: Handle -ENOMEM on RX gracefully
Date: Tue, 2 Dec 2008 16:12:53 -0800	[thread overview]
Message-ID: <20081203001253.GC14943@kroah.com> (raw)
In-Reply-To: <1228251082-11677-4-git-send-email-lrodriguez@atheros.com>

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 <lrodriguez@atheros.com>
> ---
>  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
> stable at linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/stable

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: "Luis R. Rodriguez" <lrodriguez@Atheros.com>
Cc: stable@kernel.org, sfr@canb.auug.org.au,
	ath9k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [stable] [PATCH 1/3] ath9k: Handle -ENOMEM on RX gracefully
Date: Tue, 2 Dec 2008 16:12:53 -0800	[thread overview]
Message-ID: <20081203001253.GC14943@kroah.com> (raw)
In-Reply-To: <1228251082-11677-4-git-send-email-lrodriguez@atheros.com>

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 <lrodriguez@atheros.com>
> ---
>  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
> stable@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/stable

  reply	other threads:[~2008-12-03  0:12 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 20:51 [ath9k-devel] [PATCH 0/3] ath9k: several fixes ported to 2.6.27 Luis R. Rodriguez
2008-12-02 20:51 ` Luis R. Rodriguez
2008-12-02 20:51 ` Luis R. Rodriguez
2008-12-02 20:51 ` [ath9k-devel] [PATCH] ath9k: Fix SW-IOMMU bounce buffer starvation Luis R. Rodriguez
2008-12-02 20:51   ` Luis R. Rodriguez
2008-12-02 20:51   ` Luis R. Rodriguez
2008-12-02 20:51   ` [ath9k-devel] [PATCH] ath9k: correct expected max RX buffer size Luis R. Rodriguez
2008-12-02 20:51     ` Luis R. Rodriguez
2008-12-02 20:51     ` Luis R. Rodriguez
2008-12-02 20:51     ` [ath9k-devel] [PATCH 1/3] ath9k: Handle -ENOMEM on RX gracefully Luis R. Rodriguez
2008-12-02 20:51       ` Luis R. Rodriguez
2008-12-02 20:51       ` Luis R. Rodriguez
2008-12-03  0:12       ` Greg KH [this message]
2008-12-03  0:12         ` [stable] " Greg KH
2008-12-03  0:20         ` [ath9k-devel] " Luis R. Rodriguez
2008-12-03  0:20           ` Luis R. Rodriguez
2008-12-03  0:24           ` [ath9k-devel] " John W. Linville
2008-12-03  0:24             ` John W. Linville
2008-12-03 20:19             ` [ath9k-devel] " Luis R. Rodriguez
2008-12-03 20:19               ` Luis R. Rodriguez
2008-12-03 20:32               ` Greg KH
2008-12-03 20:32                 ` Greg KH
2008-12-03 21:22             ` John W. Linville
2008-12-03 21:22               ` John W. Linville
2008-12-03 22:14               ` [ath9k-devel] " Luis R. Rodriguez
2008-12-03 22:14                 ` Luis R. Rodriguez
2008-12-03 22:59                 ` Brian
2008-12-03 22:59                   ` Brian
2008-12-04  2:32                   ` Luis R. Rodriguez
2008-12-04  2:32                     ` Luis R. Rodriguez
2008-12-04  7:59                     ` [ath9k-devel] 2.6.28-rc7-wl Brian
2008-12-04  7:59                       ` 2.6.28-rc7-wl Brian
2008-12-04 19:19                       ` [ath9k-devel] 2.6.28-rc7-wl Luis R. Rodriguez
2008-12-04 19:19                         ` 2.6.28-rc7-wl Luis R. Rodriguez
     [not found]                         ` <49385507.3090705@astronomicalresearchaustralia.org>
     [not found]                           ` <20081204224300.GN5970@tesla>
     [not found]                             ` <493869E1.60207@astronomicalresearchaustralia.org>
2008-12-05  2:28                               ` [ath9k-devel] 2.6.28-rc7-wl Luis R. Rodriguez
2008-12-05  2:28                                 ` 2.6.28-rc7-wl Luis R. Rodriguez
2008-12-06  1:01                                 ` [ath9k-devel] 2.6.28-rc7-wl Brian
2008-12-06  1:16                                   ` Luis R. Rodriguez
2008-12-06  1:36                                     ` Brian
2008-12-07  1:28                                     ` Brian
2008-12-08 20:04                                       ` Luis R. Rodriguez
2008-12-03  0:13     ` [ath9k-devel] patch ath9k-correct-expected-max-rx-buffer-size.patch added to 2.6.27-stable tree gregkh at suse.de
2008-12-03  0:13   ` [ath9k-devel] patch ath9k-fix-sw-iommu-bounce-buffer-starvation.patch " gregkh at suse.de
2008-12-02 20:57 ` [ath9k-devel] [PATCH 0/3] ath9k: several fixes ported to 2.6.27 Luis R. Rodriguez
2008-12-02 20:57   ` Luis R. Rodriguez
2008-12-02 20:57   ` Luis R. Rodriguez
2008-12-02 21:27 ` [ath9k-devel] [stable] " Greg KH
2008-12-02 21:27   ` Greg KH
2008-12-02 22:13   ` [ath9k-devel] " Luis R. Rodriguez
2008-12-02 22:13     ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081203001253.GC14943@kroah.com \
    --to=greg@kroah.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.