From: Robert Baldyga <r.baldyga@samsung.com>
To: balbi@ti.com
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: udc-core: call udc_stop() before gadget unbind
Date: Mon, 29 Dec 2014 08:30:04 +0100 [thread overview]
Message-ID: <54A102FC.4000307@samsung.com> (raw)
In-Reply-To: <20141223183120.GG9147@saruman>
Hi Felipe,
On 12/23/2014 07:31 PM, Felipe Balbi wrote:
> On Tue, Dec 23, 2014 at 07:34:15AM +0100, Robert Baldyga wrote:
>> On 12/22/2014 05:34 PM, Felipe Balbi wrote:
>>> On Mon, Dec 15, 2014 at 11:05:22AM +0100, Robert Baldyga wrote:
>>>> On 12/15/2014 06:13 AM, Peter Chen wrote:
>>>>> On Fri, Dec 12, 2014 at 02:17:28PM +0100, Robert Baldyga wrote:
>>>>>> As usb function drivers assumes that all usb request will be completed
>>>>>> before function unbind call, we should supply such behavior. In some
>>>>>> cases ep_disable() won't kill all request effectively, because some
>>>>>> IN requests can be in running state. In such situation it's possible
>>>>>> to have unbind function called before last request completion, which
>>>>>> can cause problems.
>>>>>
>>>>> Doesn't the function's disable/unbind should call usb_ep_dequeue to make
>>>>> sure the transfer has ended?
>>>>
>>>> USB function drivers like ECM or HID surely doesn't. It looks like
>>>> there's assumption that all requests will be completed by UDC driver.
>>>
>>> that's a bug on those drivers :-)
>>
>> So we can't make assumptions that requests will be completed in
>> ep_disable()?
>
> oh, no you can. I misread it.
>
>>>> Function ep_disable() should complete requests in hardware driver, but
>>>> at least in DWC2 driver not all requests are completed at this stage
>>>
>>> and that's a bug on dwc2 :-)
>>
>> I have already found that out. Another UDC drivers simply kill all
>> request without waiting for currently running, so I did the same in
>> DWC2. Here is my patch:
>> http://www.spinics.net/lists/linux-usb/msg118698.html
>
> should be in my pull request already.
It looks like you applied wrong patch. I meant patch titled "drivers:
usb: dwc2: remove 'force' parameter from kill_all_requests()" is the
latest and complete fix. The patch you have applied named "usb: dwc2:
gadget: kill requests with 'force' in s3c_hsotg_udc_stop()" do not solve
problem completely without changes in udc-core, which we concluded are
not acceptable.
Sorry for the mess. I understand that titles of both patches are
confusing similar.
Best regards,
Robert Baldyga
next prev parent reply other threads:[~2014-12-29 7:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-12 13:17 [PATCH] usb: gadget: udc-core: call udc_stop() before gadget unbind Robert Baldyga
2014-12-12 13:51 ` Krzysztof Opasiak
2014-12-15 5:13 ` Peter Chen
2014-12-15 10:05 ` Robert Baldyga
2014-12-22 16:34 ` Felipe Balbi
2014-12-23 6:34 ` Robert Baldyga
2014-12-23 18:31 ` Felipe Balbi
2014-12-29 7:30 ` Robert Baldyga [this message]
2014-12-29 16:39 ` Felipe Balbi
2014-12-15 16:14 ` Alan Stern
2014-12-22 16:32 ` Felipe Balbi
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=54A102FC.4000307@samsung.com \
--to=r.baldyga@samsung.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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