From: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] usbnet: runtime pm: fix out of memory
Date: Tue, 3 May 2011 09:53:44 +0200 [thread overview]
Message-ID: <201105030953.44131.oneukum@suse.de> (raw)
In-Reply-To: <20110502.155214.179953741.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Am Dienstag, 3. Mai 2011, 00:52:14 schrieb David Miller:
> From: tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> Date: Fri, 29 Apr 2011 16:37:09 +0800
>
> > From: Ming Lei <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >
> > This patch makes use of the EVENT_DEV_OPEN flag introduced recently to
> > fix one out of memory issue, which can be reproduced on omap3/4 based
> > pandaboard/beagle XM easily with steps below:
> ...
>
> Oliver please review this patch. Thanks!
>
> > - enable runtime pm
> > echo auto > /sys/devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-1/1-1.1/power/control
> >
> > - ifconfig eth0 up
> >
> > - then out of memroy happened, see [1] for kernel message.
> >
> > Follows my analysis:
> > - 'ifconfig eth0 up' brings eth0 out of suspend, and usbnet_resume
> > is called to schedule dev->bh, then rx urbs are submited to prepare for
> > recieving data;
> >
> > - some usbnet devices will produce garbage rx packets flood if
> > info->reset is not called in usbnet_open.
> >
> > - so there is no enough chances for usbnet_bh to handle and release
> > recieved skb buffers since many rx interrupts consumes cpu, so out of memory
> > for atomic allocation in rx_submit happened.
> >
> > This patch fixes the issue by simply not allowing schedule of usbnet_bh until device
> > is opened.
Do the devices in question use cdc_ether?
The problem I see with this patch is that cdc_ether uses .reset_resume = usbnet_resume
Therefore the device will not have been reset from the viewpoint of the device, yet
the device may be open, so the bug would strike again.
It seems to me that this patch is not wrong as such, but incomplete.
Regards
Oliver
--
- - -
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5
90409 Nürnberg
Germany
- - -
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-03 7:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 8:37 [PATCH] usbnet: runtime pm: fix out of memory tom.leiming-Re5JQEeQqe8AvxtiuMwx3w
2011-05-02 22:52 ` David Miller
[not found] ` <20110502.155214.179953741.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2011-05-03 7:53 ` Oliver Neukum [this message]
2011-05-04 6:59 ` Ming Lei
[not found] ` <BANLkTinZK_qjO7u+ckG_83_paVyMeyrgPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-04 7:26 ` Oliver Neukum
[not found] ` <201105040926.12355.oneukum-l3A5Bk7waGM@public.gmane.org>
2011-05-05 17:39 ` David Miller
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=201105030953.44131.oneukum@suse.de \
--to=oneukum-l3a5bk7wagm@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 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).