Linux USB
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: EJ Hsu <ejh@nvidia.com>, Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	"balbi@kernel.org" <balbi@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	WK Tsai <wtsai@nvidia.com>
Subject: Re: [PATCH V3] usb: gadget: storage: Remove warning message
Date: Sat, 06 Jul 2019 08:11:47 +1000	[thread overview]
Message-ID: <7469123f1d33e5aacdabc447cd124ca173bf350d.camel@kernel.crashing.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1907051422000.1606-100000@iolanthe.rowland.org>

On Fri, 2019-07-05 at 14:28 -0400, Alan Stern wrote:
> On Fri, 5 Jul 2019, Benjamin Herrenschmidt wrote:
> 
> > (following our conversation)
> > 
> > Here's a completely untested alternative patch (it replaces my previous
> > one) that fixes it a bit differently.
> > 
> > This time it should handle the case of a disconnect happening
> > before we have dequeued a config change.
> > 
> > This assumes that it's correct to never call
> > usb_composite_setup_continue() if an fsg_disable() happens after a
> > fsg_set_alt() and before we have processed the latter.
> 
> That should be handled okay.  If it isn't, the composite core needs to 
> be fixed.

Ok. I'll have a quick look to make sure.

 .../...

> Yes, this looks just right.  If I had thought about this a little more
> deeply earlier on, I would have come up with a patch very much like
> this.

Right, so as I grow more familiar with that code and its intent, I
agree, I'm much happier with this. Hopefully it passes my tests. I'll
tidy up as per your comments and repost properly if all goes well along
with some other things I piled up.

Cheers,
Ben.


> My only comments are cosmetic.
> 
> > ---
> >  drivers/usb/gadget/function/f_mass_storage.c | 26 ++++++++++++--------
> >  1 file changed, 16 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
> > index 043f97ad8f22..2ef029413b01 100644
> > --- a/drivers/usb/gadget/function/f_mass_storage.c
> > +++ b/drivers/usb/gadget/function/f_mass_storage.c
> 
> > @@ -2285,16 +2292,14 @@ static int do_set_interface(struct fsg_common *common, struct fsg_dev *new_fsg)
> >  static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
> >  {
> >       struct fsg_dev *fsg = fsg_from_func(f);
> 
> While you're changing this, it would be nice to add the customary blank 
> line here.
> 
> > -     fsg->common->new_fsg = fsg;
> > -     raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
> > +     __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, fsg);
> >       return USB_GADGET_DELAYED_STATUS;
> >  }
> >  
> >  static void fsg_disable(struct usb_function *f)
> >  {
> >       struct fsg_dev *fsg = fsg_from_func(f);
> 
> And here.  Otherwise:
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> 
> Alan Stern


      reply	other threads:[~2019-07-05 22:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 11:02 [PATCH V3] usb: gadget: storage: Remove warning message EJ Hsu
2019-05-10 14:29 ` Alan Stern
2019-07-02  1:58   ` Thinh Nguyen
2019-07-02 14:10     ` Alan Stern
     [not found]       ` <CY4PR1201MB0037C93EC7F81A394008C4CCAAF80@CY4PR1201MB0037.namprd12.prod.outlook.com>
2019-07-02 18:06         ` Thinh Nguyen
2019-07-03 11:20           ` EJ Hsu
2019-07-04  8:39             ` EJ Hsu
2019-07-04 16:06               ` Alan Stern
2019-07-05 10:49                 ` EJ Hsu
2019-07-05 12:28                   ` Benjamin Herrenschmidt
2019-07-05 14:30                     ` Alan Stern
2019-07-05 22:09                       ` Benjamin Herrenschmidt
2019-07-05 12:34                   ` Benjamin Herrenschmidt
2019-07-05 13:13                     ` Benjamin Herrenschmidt
2019-07-05 18:28                       ` Alan Stern
2019-07-05 22:11                         ` Benjamin Herrenschmidt [this message]

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=7469123f1d33e5aacdabc447cd124ca173bf350d.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=ejh@nvidia.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=wtsai@nvidia.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