From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8658C5B57D for ; Fri, 5 Jul 2019 22:12:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9789E216E3 for ; Fri, 5 Jul 2019 22:12:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726001AbfGEWMA (ORCPT ); Fri, 5 Jul 2019 18:12:00 -0400 Received: from gate.crashing.org ([63.228.1.57]:57779 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbfGEWMA (ORCPT ); Fri, 5 Jul 2019 18:12:00 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x65MBlIZ013990; Fri, 5 Jul 2019 17:11:49 -0500 Message-ID: <7469123f1d33e5aacdabc447cd124ca173bf350d.camel@kernel.crashing.org> Subject: Re: [PATCH V3] usb: gadget: storage: Remove warning message From: Benjamin Herrenschmidt To: Alan Stern Cc: EJ Hsu , Thinh Nguyen , "balbi@kernel.org" , "linux-usb@vger.kernel.org" , WK Tsai Date: Sat, 06 Jul 2019 08:11:47 +1000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.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 > > Alan Stern