mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Zeng Tao <prime.zeng@hisilicon.com>, balbi@kernel.org
Cc: liangshengjun@hisilicon.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: gadget: fix miss isoc issue introduced by IRQ latency
Date: Fri, 14 Dec 2018 14:17:47 +0300	[thread overview]
Message-ID: <67af347c-39fb-a11c-ab95-7741c58b6dd6@cogentembedded.com> (raw)
In-Reply-To: <1544805179-2248-1-git-send-email-prime.zeng@hisilicon.com>

Hello!

On 12/14/2018 07:32 PM, Zeng Tao wrote:

> If it's a busy system, some times when we start an isoc transfer, the
> framenumber get from the event buffer may be already elasped, in this

   Frame number? Else my spell checker trips. :-)

>  case, we will get all the packets dropped due to miss isoc. And we turn

   Remove the leading space, please.

> into transfer nothing, to fix this issue, we need to fix the framenumber
> to make sure that it's not out of date.
> 
> Signed-off-by: Liang Shengjun <liangshengjun@hisilicon.com>
> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
[...]
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 9f92ee0..b63bd72 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1263,6 +1263,15 @@ static int __dwc3_gadget_get_frame(struct dwc3 *dwc)
>  	return DWC3_DSTS_SOFFN(reg);
>  }
>  
> +static bool __dwc3_gadget_target_frame_elapsed(struct dwc3_ep *dep)
> +{
> +	u16 cframe =  __dwc3_gadget_get_frame(dep->dwc);
> +	u16 eframe = dep->frame_number & DWC3_EVENT_PRAM_SOFFN_MASK;
> +
> +	return (((eframe - cframe) & DWC3_EVENT_PRAM_SOFFN_MASK)
> +		> DWC3_EVENT_PRAM_MAX_SOFFN / 2);

   Please leave > on the previous line.
   And you surely know that the outer parens are unnecessary? :-)

[...]

MBR, Sergei

  parent reply	other threads:[~2018-12-14 11:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 16:32 Zeng Tao
2018-12-14  8:51 ` Felipe Balbi
2018-12-14  9:11   ` Zengtao (B)
2018-12-14 11:23     ` Felipe Balbi
2018-12-14 21:42       ` Thinh Nguyen
2018-12-17  1:45         ` Zengtao (B)
2018-12-17 20:12           ` Thinh Nguyen
2018-12-14 11:17 ` Sergei Shtylyov [this message]
2018-12-17  1:54   ` Zengtao (B)

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=67af347c-39fb-a11c-ab95-7741c58b6dd6@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=liangshengjun@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=prime.zeng@hisilicon.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®