linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: "Yang,Wei" <Wei.Yang@windriver.com>
Cc: balbi@ti.com, <mina86@mina86.com>, <andrzej.p@samsung.com>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] USB:gadget: Fix a warning while loading g_mass_storage
Date: Fri, 13 Jun 2014 09:39:52 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1406130935500.1059-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <539A98C3.8080505@windriver.com>

On Fri, 13 Jun 2014, Yang,Wei wrote:

> On 06/09/2014 02:19 PM, Wei.Yang@windriver.com wrote:
> > From: Yang Wei <Wei.Yang@windriver.com>
> >
> > While loading g_mass_storage module, the following warning
> > is triggered.
> >
> > WARNING: at drivers/usb/gadget/composite.c:
> > usb_composite_setup_continue: Unexpected call
> > Modules linked in: fat vfat minix nls_cp437 nls_iso8859_1 g_mass_storage
> > [<800179cc>] (unwind_backtrace+0x0/0x104) from [<80619608>] (dump_stack+0x20/0x24)
> > [<80619608>] (dump_stack+0x20/0x24) from [<80025100>] (warn_slowpath_common+0x64/0x74)
> > [<80025100>] (warn_slowpath_common+0x64/0x74) from [<800251cc>] (warn_slowpath_fmt+0x40/0x48)
> > [<800251cc>] (warn_slowpath_fmt+0x40/0x48) from [<7f047774>] (usb_composite_setup_continue+0xb4/0xbc [g_mass_storage])
> > [<7f047774>] (usb_composite_setup_continue+0xb4/0xbc [g_mass_storage]) from [<7f047ad4>] (handle_exception+0x358/0x3e4 [g_mass_storage])
> > [<7f047ad4>] (handle_exception+0x358/0x3e4 [g_mass_storage]) from [<7f048080>] (fsg_main_thread+0x520/0x157c [g_mass_storage])
> > [<7f048080>] (fsg_main_thread+0x520/0x157c [g_mass_storage]) from [<8004bc90>] (kthread+0x98/0x9c)
> > [<8004bc90>] (kthread+0x98/0x9c) from [<8000faec>] (kernel_thread_exit+0x0/0x8)
> >
> > The root cause is that the existing code fails to take into
> > account the possibility that common->new_fsg can change while
> > do_set_interface() is running, because the spinlock isn't held
> > at this point.
> >
> > Signed-off-by: Yang Wei <Wei.Yang@windriver.com>
> > Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> > ---
> >   drivers/usb/gadget/f_mass_storage.c |    6 ++++--
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > Hi Alan,
> >
> > Thanks for your review, there are a few changes in v3:
> >
> > 1) Fix a coding style issue.
> > 2) Refine the commit log
> >
> > Regards
> > Wei
> 
> Ping, Alan, What do you think of it?

You should not have added my "Signed-off-by:"; I did not give you 
permission to do that.

Michal's comment about common->new_fsg not being protected by the lock 
is a good one.  It would be better for the patch description to say:

	The value of common->new_fsg that gets tested after
	do_set_interface() returns needs to be the same as the value
	used by do_set_interface().

With that change, you may add

Acked-by: Alan Stern <stern@rowland.harvard.edu>

Alan Stern


  reply	other threads:[~2014-06-13 13:39 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03  9:37 [PATCH v1] USB:gadget: Fix a warning while loading g_mass_storage Wei.Yang
2014-06-03 14:48 ` Alan Stern
2014-06-04  1:20   ` Yang,Wei
2014-06-04  1:45     ` Peter Chen
2014-06-04  3:16       ` Yang,Wei
2014-06-04  4:41         ` Peter Chen
2014-06-04 13:56         ` Alan Stern
2014-06-04 18:48           ` Paul Zimmerman
2014-06-05  1:30           ` Peter Chen
2014-06-05 14:21             ` Alan Stern
2014-06-04  2:34     ` Yang,Wei
2014-06-04 12:06   ` Andrzej Pietrasiewicz
2014-06-04 15:26     ` Alan Stern
2014-06-05 10:00       ` Andrzej Pietrasiewicz
2014-06-05 18:10         ` Alan Stern
2014-06-04  4:32 ` [PATCH v2] " Wei.Yang
2014-06-05 18:08   ` Alan Stern
2014-06-09  6:02     ` Yang,Wei
2014-06-09  6:19   ` [PATCH v3] " Wei.Yang
2014-06-13  6:22     ` Yang,Wei
2014-06-13 13:39       ` Alan Stern [this message]
2014-06-14 13:10         ` Yang,Wei
2014-06-13  9:44     ` Michal Nazarewicz
2014-06-13 13:43       ` Alan Stern
2014-06-13 14:57         ` Michal Nazarewicz
2014-06-15  2:40   ` [PATCH] " Wei.Yang
2014-06-15  2:42     ` Yang,Wei
2014-06-17  5:59       ` Yang,Wei
2014-06-17 14:18         ` Alan Stern
2014-06-18  1:08           ` Yang,Wei
2014-06-18 11:44             ` Michal Nazarewicz
2014-06-18 14:22               ` Alan Stern
2014-06-19  1:48               ` Yang,Wei
2014-06-17 18:20     ` Michal Nazarewicz

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=Pine.LNX.4.44L0.1406130935500.1059-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=Wei.Yang@windriver.com \
    --cc=andrzej.p@samsung.com \
    --cc=balbi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mina86@mina86.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;
as well as URLs for NNTP newsgroup(s).