[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30102591E157244384E984126FC3CB4F544AD89B@us01wembx1.internal.synopsys.com>
Date: Fri, 7 Sep 2018 23:28:07 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Anurag Kumar Vulisha <anurag.kumar.vulisha@...inx.com>,
"balbi@...nel.org" <balbi@...nel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Thinh.Nguyen@...opsys.com" <Thinh.Nguyen@...opsys.com>,
"v.anuragkumar@...il.com" <v.anuragkumar@...il.com>
Subject: Re: [PATCH v3 4/8] usb: dwc3: implement stream transfer timeout
On 9/7/2018 6:14 AM, Anurag Kumar Vulisha wrote:
> According to dwc3 databook when streams are used, it may be possible
> for the host and device become out of sync, where device may wait for
> host to issue prime transcation and host may wait for device to issue
> erdy. To avoid such deadlock, timeout needs to be implemented. After
> timeout occurs, device will first stop transfer and restart the transfer
> again. This patch does the same.
>
> Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@...inx.com>
> Reviewed-by: Thinh Nguyen <thinhn@...opsys.com>
> ---
> Changes in v3:
> 1. Added the changes suggested by "Thinh Nguyen"
>
> Changes in v2:
> 1. Changed STREAM_TIMEOUT to STREAM_TIMEOUT_MS as suggested by
> "Andy Shevchenko"
> ---
> drivers/usb/dwc3/core.h | 7 +++++++
> drivers/usb/dwc3/gadget.c | 36 ++++++++++++++++++++++++++++++++++++
> 2 files changed, 43 insertions(+)
>
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 5bfb625..0b255e97 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -633,6 +633,11 @@ struct dwc3_event_buffer {
>
> #define DWC3_TRB_NUM 256
>
> +/*
> + * Timeout value in msecs used by stream_timeout_timer when streams are enabled
> + */
> +#define STREAM_TIMEOUT_MS 50
> +
> /**
> * struct dwc3_ep - device side endpoint representation
> * @endpoint: usb endpoint
> @@ -656,6 +661,7 @@ struct dwc3_event_buffer {
> * @name: a human readable name e.g. ep1out-bulk
> * @direction: true for TX, false for RX
> * @stream_capable: true when streams are enabled
> + * @stream_timeout_timer: timer used to aviod deadlock when streams are used
Change aviod -> avoid. Also, the timer is being used when there's a
deadlock rather than to avoid it. You probably need to explain what
deadlock it is if you mentioned it here, but I think it's ok to simply
say timeout timer for streams (unless Felipe has any objection).
Thinh
Powered by blists - more mailing lists