mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Opasiak <k.opasiak@samsung.com>
To: Robert Baldyga <r.baldyga@samsung.com>, balbi@ti.com
Cc: gregkh@linuxfoundation.org, peter.chen@freescale.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: RE: [PATCH] usb: gadget: udc-core: call udc_stop() before gadget unbind
Date: Fri, 12 Dec 2014 14:51:42 +0100	[thread overview]
Message-ID: <02eb01d01612$c35319d0$49f94d70$%opasiak@samsung.com> (raw)
In-Reply-To: <1418390248-6254-1-git-send-email-r.baldyga@samsung.com>



> -----Original Message-----
> From: Robert Baldyga [mailto:r.baldyga@samsung.com]
> Sent: Friday, December 12, 2014 2:17 PM
> To: balbi@ti.com
> Cc: gregkh@linuxfoundation.org; peter.chen@freescale.com; linux-
> usb@vger.kernel.org; linux-kernel@vger.kernel.org;
> m.szyprowski@samsung.com; k.opasiak@samsung.com; Robert Baldyga
> Subject: [PATCH] usb: gadget: udc-core: call udc_stop() before
> gadget unbind
> 
> 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.
> 
> For example unbinding f_ecm function while request on 'notify'
> endpoint
> is not completed, ends up NULL pointer dereference in unbind()
> function.
> 
> usb_gadget_udc_stop() call causes completion of all requests so if
> it's
> called before gadget unbind there is no risk that some of requests
> will
> stay uncompleted.
> 
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>

This finally solves issue described before in [1]

Tested-by: Krzysztof Opasiak <k.opasiak@samsung.com>

Footnotes:
1 - https://lkml.org/lkml/2014/12/9/283

-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
k.opasiak@samsung.com





  reply	other threads:[~2014-12-12 13:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 13:17 Robert Baldyga
2014-12-12 13:51 ` Krzysztof Opasiak [this message]
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
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='02eb01d01612$c35319d0$49f94d70$%opasiak@samsung.com' \
    --to=k.opasiak@samsung.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=peter.chen@freescale.com \
    --cc=r.baldyga@samsung.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

all inboxes | Powered by JetHome®