linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	EJ Hsu <ejh@nvidia.com>, Alan Stern <stern@rowland.harvard.edu>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH AUTOSEL 5.1 054/141] usb: gadget: storage: Remove warning message
Date: Sun, 28 Jul 2019 11:37:29 -0400	[thread overview]
Message-ID: <20190728153729.GG8637@sasha-vm> (raw)
In-Reply-To: <CY4PR1201MB003731626E6A487A7CFC0E33AACB0@CY4PR1201MB0037.namprd12.prod.outlook.com>

On Fri, Jul 19, 2019 at 05:27:31AM +0000, Thinh Nguyen wrote:
>Hi Sasha,
>
>Sasha Levin wrote:
>> From: EJ Hsu <ejh@nvidia.com>
>>
>> [ Upstream commit e70b3f5da00119e057b7faa557753fee7f786f17 ]
>>
>> This change is to fix below warning message in following scenario:
>> usb_composite_setup_continue: Unexpected call
>>
>> When system tried to enter suspend, the fsg_disable() will be called to
>> disable fsg driver and send a signal to fsg_main_thread. However, at
>> this point, the fsg_main_thread has already been frozen and can not
>> respond to this signal. So, this signal will be pended until
>> fsg_main_thread wakes up.
>>
>> Once system resumes from suspend, fsg_main_thread will detect a signal
>> pended and do some corresponding action (in handle_exception()). Then,
>> host will send some setup requests (get descriptor, set configuration...)
>> to UDC driver trying to enumerate this device. During the handling of "set
>> configuration" request, it will try to sync up with fsg_main_thread by
>> sending a signal (which is the same as the signal sent by fsg_disable)
>> to it. In a similar manner, once the fsg_main_thread receives this
>> signal, it will call handle_exception() to handle the request.
>>
>> However, if the fsg_main_thread wakes up from suspend a little late and
>> "set configuration" request from Host arrives a little earlier,
>> fsg_main_thread might come across the request from "set configuration"
>> when it handles the signal from fsg_disable(). In this case, it will
>> handle this request as well. So, when fsg_main_thread tries to handle
>> the signal sent from "set configuration" later, there will nothing left
>> to do and warning message "Unexpected call" is printed.
>>
>> Acked-by: Alan Stern <stern@rowland.harvard.edu>
>> Signed-off-by: EJ Hsu <ejh@nvidia.com>
>> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>> ---
>>  drivers/usb/gadget/function/f_mass_storage.c | 21 ++++++++++++++------
>>  drivers/usb/gadget/function/storage_common.h |  1 +
>>  2 files changed, 16 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
>> index 043f97ad8f22..982c3e89eb0d 100644
>> --- a/drivers/usb/gadget/function/f_mass_storage.c
>> +++ b/drivers/usb/gadget/function/f_mass_storage.c
>>
>
>This patch may have issue. It was reverted upstream. Please don't queue
>to stable.

I've dropped it, thanks!

--
Thanks,
Sasha

      reply	other threads:[~2019-07-28 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190719040246.15945-1-sashal@kernel.org>
2019-07-19  4:00 ` [PATCH AUTOSEL 5.1 008/141] usb: core: hub: Disable hub-initiated U1/U2 Sasha Levin
2019-07-19  4:01 ` [PATCH AUTOSEL 5.1 052/141] usb: gadget: Zero ffs_io_data Sasha Levin
2019-07-19  4:01 ` [PATCH AUTOSEL 5.1 054/141] usb: gadget: storage: Remove warning message Sasha Levin
2019-07-19  5:27   ` Thinh Nguyen
2019-07-28 15:37     ` Sasha Levin [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=20190728153729.GG8637@sasha-vm \
    --to=sashal@kernel.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=ejh@nvidia.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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).