Linux USB
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: EJ Hsu <ejh@nvidia.com>, Alan Stern <stern@rowland.harvard.edu>
Cc: 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: Fri, 05 Jul 2019 22:34:27 +1000	[thread overview]
Message-ID: <5341a521672649389e67256fcba9236d673bfb5b.camel@kernel.crashing.org> (raw)
In-Reply-To: <BN7PR12MB2644CE5F029CD6A5DE353D88CFF50@BN7PR12MB2644.namprd12.prod.outlook.com>

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.



  parent reply	other threads:[~2019-07-05 12:34 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 [this message]
2019-07-05 13:13                     ` Benjamin Herrenschmidt
2019-07-05 18:28                       ` Alan Stern
2019-07-05 22:11                         ` Benjamin Herrenschmidt

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=5341a521672649389e67256fcba9236d673bfb5b.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