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 351DFC46499 for ; Fri, 5 Jul 2019 12:34:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A19021850 for ; Fri, 5 Jul 2019 12:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbfGEMei (ORCPT ); Fri, 5 Jul 2019 08:34:38 -0400 Received: from gate.crashing.org ([63.228.1.57]:40715 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727341AbfGEMei (ORCPT ); Fri, 5 Jul 2019 08:34:38 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x65CYRje024361; Fri, 5 Jul 2019 07:34:28 -0500 Message-ID: <5341a521672649389e67256fcba9236d673bfb5b.camel@kernel.crashing.org> Subject: Re: [PATCH V3] usb: gadget: storage: Remove warning message From: Benjamin Herrenschmidt To: EJ Hsu , Alan Stern Cc: Thinh Nguyen , "balbi@kernel.org" , "linux-usb@vger.kernel.org" , WK Tsai Date: Fri, 05 Jul 2019 22:34:27 +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 10:49 +0000, EJ Hsu wrote: > The change for my previous patch is as follows, and it works well on my local test. > > Thanks, > EJ > > diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c > index 982c3e8..b5f1e1e 100644 > --- a/drivers/usb/gadget/function/f_mass_storage.c > +++ b/drivers/usb/gadget/function/f_mass_storage.c > @@ -2306,7 +2306,6 @@ static void handle_exception(struct fsg_common *common) > enum fsg_state old_state; > struct fsg_lun *curlun; > unsigned int exception_req_tag; > - struct fsg_dev *fsg; > > /* > * Clear the existing signals. Anything but SIGUSR1 is converted > @@ -2413,15 +2412,9 @@ static void handle_exception(struct fsg_common *common) > break; > > case FSG_STATE_CONFIG_CHANGE: > - fsg = common->new_fsg; > - /* > - * Add a check here to double confirm if a disconnect event > - * occurs and common->new_fsg has been cleared. > - */ > - if (fsg) { > - do_set_interface(common, fsg); > + do_set_interface(common, common->new_fsg); > + if (common->new_fsg) > usb_composite_setup_continue(common->cdev); > - } > break; > > case FSG_STATE_DISCONNECT: > diff --git a/drivers/usb/gadget/function/storage_common.h b/drivers/usb/gadget/function/storage_common.h > index 12687f7..fc13921 100644 > --- a/drivers/usb/gadget/function/storage_common.h > +++ b/drivers/usb/gadget/function/storage_common.h > @@ -160,8 +160,8 @@ enum fsg_state { > FSG_STATE_NORMAL, > FSG_STATE_ABORT_BULK_OUT, > FSG_STATE_PROTOCOL_RESET, > - FSG_STATE_CONFIG_CHANGE, > FSG_STATE_DISCONNECT, > + FSG_STATE_CONFIG_CHANGE, > FSG_STATE_EXIT, > FSG_STATE_TERMINATED > }; Is this patch against some other patch ? Please send the whole thing so people don't have to go digging in archives to figure what the code looks like. The above by itself doesn't make sense and can't be reviewed. However, I have a strong suspicion that if you still need to test new_fsg before calling usb_composite_setup_continue(). Then you haven't fixed the bug that I describe. Cheers, Ben.