* [PATCH 1/2] mwifiex: stop command path in suspend handler @ 2015-03-23 14:20 Avinash Patil 2015-03-23 14:20 ` [PATCH 2/2] mwifiex: recover from skb allocation failures during RX Avinash Patil 2015-03-30 8:36 ` [1/2] mwifiex: stop command path in suspend handler Kalle Valo 0 siblings, 2 replies; 5+ messages in thread From: Avinash Patil @ 2015-03-23 14:20 UTC (permalink / raw) To: linux-wireless; +Cc: akarwar, cluo, liuzy, Avinash Patil Cancel all pending commands including scan commands and stop CAC during cfg80211 suspend handler. Signed-off-by: Avinash Patil <patila@marvell.com> --- drivers/net/wireless/mwifiex/cfg80211.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index fc3bbe7..eab110b 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -2942,15 +2942,23 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy, { struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy); struct mwifiex_ds_hs_cfg hs_cfg; - int ret = 0; - struct mwifiex_private *priv = - mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA); + int i, ret = 0; + struct mwifiex_private *priv; + + for (i = 0; i < adapter->priv_num; i++) { + priv = adapter->priv[i]; + mwifiex_abort_cac(priv); + } + + mwifiex_cancel_all_pending_cmd(adapter); if (!wowlan) { dev_warn(adapter->dev, "None of the WOWLAN triggers enabled\n"); return 0; } + priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA); + if (!priv->media_connected) { dev_warn(adapter->dev, "Can not configure WOWLAN in disconnected state\n"); -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] mwifiex: recover from skb allocation failures during RX 2015-03-23 14:20 [PATCH 1/2] mwifiex: stop command path in suspend handler Avinash Patil @ 2015-03-23 14:20 ` Avinash Patil 2015-03-23 11:11 ` James Cameron 2015-03-30 8:36 ` [1/2] mwifiex: stop command path in suspend handler Kalle Valo 1 sibling, 1 reply; 5+ messages in thread From: Avinash Patil @ 2015-03-23 14:20 UTC (permalink / raw) To: linux-wireless; +Cc: akarwar, cluo, liuzy, James Cameron, Avinash Patil From: Zhaoyang Liu <liuzy@marvell.com> This patch adds recovery mechanism for SDIO RX during SKB allocation failures. For allocation failures during multiport aggregation, we skip and drop RX packets. For single port read case, we will use preallocated card->mpa_rx.buf to complete cmd53 read. Now we terminate SDIO operations only upon cmd53 failures. CC: James Cameron <quozl@laptop.org> Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> --- drivers/net/wireless/mwifiex/sdio.c | 42 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 6af7a082..d10320f 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c @@ -1317,10 +1317,14 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter, skb_deaggr = mwifiex_alloc_dma_align_buf(len_arr[pind], GFP_KERNEL | GFP_DMA); - if (!skb_deaggr) - goto error; + if (!skb_deaggr) { + dev_err(adapter->dev, "skb allocation failure drop pkt len=%d type=%d\n", + pkt_len, pkt_type); + curr_ptr += len_arr[pind]; + continue; + } + skb_put(skb_deaggr, len_arr[pind]); - card->mpa_rx.skb_arr[pind] = skb_deaggr; if ((pkt_type == MWIFIEX_TYPE_DATA || (pkt_type == MWIFIEX_TYPE_AGGR_DATA && @@ -1335,7 +1339,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter, mwifiex_decode_rx_packet(adapter, skb_deaggr, pkt_type); } else { - dev_err(adapter->dev, "wrong aggr pkt:\t" + dev_err(adapter->dev, " drop wrong aggr pkt:\t" "sdio_single_port_rx_aggr=%d\t" "type=%d len=%d max_len=%d\n", adapter->sdio_rx_aggr_enable, @@ -1352,9 +1356,18 @@ rx_curr_single: if (f_do_rx_cur) { dev_dbg(adapter->dev, "info: RX: port: %d, rx_len: %d\n", port, rx_len); + skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL | GFP_DMA); - if (!skb) - goto error; + if (!skb) { + dev_err(adapter->dev, "single skb allocated fail,\t" + "drop pkt port=%d len=%d\n", port, rx_len); + if (mwifiex_sdio_card_to_host(adapter, &pkt_type, + card->mpa_rx.buf, rx_len, + adapter->ioport + port)) + goto error; + return 0; + } + skb_put(skb, rx_len); if (mwifiex_sdio_card_to_host(adapter, &pkt_type, @@ -1363,10 +1376,11 @@ rx_curr_single: goto error; if (!adapter->sdio_rx_aggr_enable && pkt_type == MWIFIEX_TYPE_AGGR_DATA) { - dev_err(adapter->dev, "Wrong pkt type %d\t" - "Current SDIO RX Aggr not enabled\n", + dev_err(adapter->dev, "drop wrong pkt type %d\t" + "current SDIO RX Aggr not enabled\n", pkt_type); - goto error; + dev_kfree_skb_any(skb); + return 0; } mwifiex_decode_rx_packet(adapter, skb, pkt_type); @@ -1379,16 +1393,8 @@ rx_curr_single: return 0; error: - if (MP_RX_AGGR_IN_PROGRESS(card)) { - /* Multiport-aggregation transfer failed - cleanup */ - for (pind = 0; pind < card->mpa_rx.pkt_cnt; pind++) { - /* copy pkt to deaggr buf */ - skb_deaggr = card->mpa_rx.skb_arr[pind]; - if (skb_deaggr) - dev_kfree_skb_any(skb_deaggr); - } + if (MP_RX_AGGR_IN_PROGRESS(card)) MP_RX_AGGR_BUF_RESET(card); - } if (f_do_rx_cur && skb) /* Single transfer pending. Free curr buff also */ -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] mwifiex: recover from skb allocation failures during RX 2015-03-23 14:20 ` [PATCH 2/2] mwifiex: recover from skb allocation failures during RX Avinash Patil @ 2015-03-23 11:11 ` James Cameron 2015-03-30 8:52 ` Avinash Patil 0 siblings, 1 reply; 5+ messages in thread From: James Cameron @ 2015-03-23 11:11 UTC (permalink / raw) To: Avinash Patil; +Cc: linux-wireless, akarwar, cluo, liuzy On 24/03/2015, at 1:20 AM, Avinash Patil wrote: > From: Zhaoyang Liu <liuzy@marvell.com> > > This patch adds recovery mechanism for SDIO RX during SKB allocation > failures. > For allocation failures during multiport aggregation, we skip and drop RX > packets. > For single port read case, we will use preallocated card->mpa_rx.buf to > complete cmd53 read. Thanks. Dropping RX data packets is considered safe, as the peer will retry; but does your patch drop events or command responses? Last year, I tried something similar, and I found that the driver would be confused if command responses were dropped. -- James Cameron ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 2/2] mwifiex: recover from skb allocation failures during RX 2015-03-23 11:11 ` James Cameron @ 2015-03-30 8:52 ` Avinash Patil 0 siblings, 0 replies; 5+ messages in thread From: Avinash Patil @ 2015-03-30 8:52 UTC (permalink / raw) To: James Cameron Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar, Cathy Luo, Zhaoyang Liu Hi James, > -----Original Message----- > From: James Cameron [mailto:quozl@laptop.org] > Sent: Monday, March 23, 2015 4:42 PM > To: Avinash Patil > Cc: linux-wireless@vger.kernel.org; Amitkumar Karwar; Cathy Luo; Zhaoyang Liu > Subject: Re: [PATCH 2/2] mwifiex: recover from skb allocation failures during > RX > > > On 24/03/2015, at 1:20 AM, Avinash Patil wrote: > > > From: Zhaoyang Liu <liuzy@marvell.com> > > > > This patch adds recovery mechanism for SDIO RX during SKB allocation > > failures. > > For allocation failures during multiport aggregation, we skip and drop > > RX packets. > > For single port read case, we will use preallocated card->mpa_rx.buf > > to complete cmd53 read. > > Thanks. > > Dropping RX data packets is considered safe, as the peer will retry; but does > your patch drop events or command responses? > > Last year, I tried something similar, and I found that the driver would be > confused if command responses were dropped. RX packets only would be dropped after SKB allocation failures. Command response/events continue to have same handling as earlier. > -- > James Cameron -Avinash ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [1/2] mwifiex: stop command path in suspend handler 2015-03-23 14:20 [PATCH 1/2] mwifiex: stop command path in suspend handler Avinash Patil 2015-03-23 14:20 ` [PATCH 2/2] mwifiex: recover from skb allocation failures during RX Avinash Patil @ 2015-03-30 8:36 ` Kalle Valo 1 sibling, 0 replies; 5+ messages in thread From: Kalle Valo @ 2015-03-30 8:36 UTC (permalink / raw) To: Avinash Patil; +Cc: linux-wireless, akarwar, cluo, liuzy, Avinash Patil > Cancel all pending commands including scan commands and stop CAC > during cfg80211 suspend handler. > > Signed-off-by: Avinash Patil <patila@marvell.com> Thanks, 2 patches applied to wireless-drivers-next.git: 5ff46f7923b8 mwifiex: stop command path in suspend handler 4acaf048b1d2 mwifiex: recover from skb allocation failures during RX Kalle Valo ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-30 8:53 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-03-23 14:20 [PATCH 1/2] mwifiex: stop command path in suspend handler Avinash Patil 2015-03-23 14:20 ` [PATCH 2/2] mwifiex: recover from skb allocation failures during RX Avinash Patil 2015-03-23 11:11 ` James Cameron 2015-03-30 8:52 ` Avinash Patil 2015-03-30 8:36 ` [1/2] mwifiex: stop command path in suspend handler Kalle Valo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).