From: James Cameron <quozl@laptop.org>
To: Bing Zhao <bzhao@marvell.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Avinash Patil <patila@marvell.com>
Subject: Re: mwifiex: no wr_port available
Date: Wed, 14 May 2014 13:18:05 +1000 [thread overview]
Message-ID: <20140514031804.GN12785@us.netrek.org> (raw)
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F70D87C4D@SC-VEXCH1.marvell.com>
On Tue, May 13, 2014 at 07:52:47PM -0700, Bing Zhao wrote:
> Hi James,
>
> > G'day,
> >
> > Is there a short duration leak of wr_port in
> > mwifiex_sdio_host_to_card()?
>
> You are right. There is a leak in the error case. Thanks for
> pointing it out.
Thanks.
> > If mwifiex_host_to_card_mp_aggr fails because of is_suspended in
> > mwifiex_write_data_sync, is the wr_port ever released?
> >
> > Or maybe mp_wr_bitmap is re-read from the card when a download
> > interrupt occurs, or if an upload interrupt occurs after a command is
> > sent.
>
> A patch has been sent to address this issue.
Reviewed, thanks. Functionally identical to a patch that I've been
testing locally:
/*
* Rollback the effects of _get_wr_port above.
*/
static void mwifiex_put_wr_port(struct mwifiex_adapter *adapter, u8 port)
{
struct sdio_mmc_card *card = adapter->card;
card->mp_wr_bitmap |= (1 << port);
card->curr_wr_port = port;
}
...
if (type == MWIFIEX_TYPE_DATA) {
mwifiex_put_wr_port(adapter, port);
adapter->data_sent = false;
}
You may be interested that rd_port also has possible leak when skb
cannot be allocated. See mwifiex_process_int_status:
skb = dev_alloc_skb(rx_len);
if (!skb)
return -1;
We have a hack in OLPC production arm-3.5 kernel which restores
rd_port bit, restores int_status.
http://dev.laptop.org/git/olpc-kernel/commit/?h=arm-3.5&id=59fcaf10cce5bbdc370ec1c262b12aeb66ed1dca
--
James Cameron
http://quozl.linux.org.au/
next prev parent reply other threads:[~2014-05-14 3:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-07 12:06 mwifiex: no wr_port available James Cameron
2014-05-14 2:52 ` Bing Zhao
2014-05-14 3:18 ` James Cameron [this message]
2014-05-14 3:54 ` Bing Zhao
2014-05-14 4:26 ` James Cameron
2014-05-14 4:55 ` Bing Zhao
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=20140514031804.GN12785@us.netrek.org \
--to=quozl@laptop.org \
--cc=bzhao@marvell.com \
--cc=linux-wireless@vger.kernel.org \
--cc=patila@marvell.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox