linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: f_fs: use complete() instead complete_all()
@ 2016-09-22 13:51 Daniel Wagner
  2016-09-22 14:22 ` Michal Nazarewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Wagner @ 2016-09-22 13:51 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, Daniel Wagner, Felipe Balbi, Michal Nazarewicz,
	Greg Kroah-Hartman

From: Daniel Wagner <daniel.wagner@bmw-carit.de>

There is only one waiter for the completion, therefore there
is no need to use complete_all(). Let's make that clear by
using complete() instead of complete_all().

The usage pattern of the completion is:

waiter context                          waker context
  reinit_completion()
  usb_esp_queue()
  wait_for_completion_interruptible()

					ffs_ep0_complete()
					  complete()

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/gadget/function/f_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 5c8429f..0c29039 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -211,7 +211,7 @@ static void ffs_ep0_complete(struct usb_ep *ep, struct usb_request *req)
 {
 	struct ffs_data *ffs = req->context;
 
-	complete_all(&ffs->ep0req_completion);
+	complete(&ffs->ep0req_completion);
 }
 
 static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: gadget: f_fs: use complete() instead complete_all()
  2016-09-22 13:51 [PATCH] usb: gadget: f_fs: use complete() instead complete_all() Daniel Wagner
@ 2016-09-22 14:22 ` Michal Nazarewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Nazarewicz @ 2016-09-22 14:22 UTC (permalink / raw)
  To: Daniel Wagner, linux-usb
  Cc: linux-kernel, Daniel Wagner, Felipe Balbi, Greg Kroah-Hartman

On Thu, Sep 22 2016, Daniel Wagner wrote:
> From: Daniel Wagner <daniel.wagner@bmw-carit.de>
>
> There is only one waiter for the completion, therefore there
> is no need to use complete_all(). Let's make that clear by
> using complete() instead of complete_all().
>
> The usage pattern of the completion is:
>
> waiter context                          waker context
>   reinit_completion()
>   usb_esp_queue()
>   wait_for_completion_interruptible()
>
> 					ffs_ep0_complete()
> 					  complete()
>
> Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Michal Nazarewicz <mina86@mina86.com>

Acked-by: Michal Nazarewicz <mina86@mina86.com>

> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> ---
>  drivers/usb/gadget/function/f_fs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
> index 5c8429f..0c29039 100644
> --- a/drivers/usb/gadget/function/f_fs.c
> +++ b/drivers/usb/gadget/function/f_fs.c
> @@ -211,7 +211,7 @@ static void ffs_ep0_complete(struct usb_ep *ep, struct usb_request *req)
>  {
>  	struct ffs_data *ffs = req->context;
>  
> -	complete_all(&ffs->ep0req_completion);
> +	complete(&ffs->ep0req_completion);
>  }
>  
>  static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len)
> -- 
> 2.7.4

-- 
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-22 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 13:51 [PATCH] usb: gadget: f_fs: use complete() instead complete_all() Daniel Wagner
2016-09-22 14:22 ` Michal Nazarewicz

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).