linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO
@ 2017-12-21 11:03 Lipengcheng
  2017-12-22  7:54 ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Lipengcheng @ 2017-12-21 11:03 UTC (permalink / raw)
  To: balbi@kernel.org
  Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lipengcheng

Iso transmission, the current process is that all trb(HWO=1) is handled.
Then core generate DWC3_DEPEVT_XFERNOTREADY event, Software begin  refill
trb, this will produce 0 length package, the patch is to achieve the core
consumes a trb, and then the software fill a trb. Normally, there will never
be DWC3_DEPEVT_XFERNOTREADY event and 0-length packet.

Signed-off-by: l00229106 <lpc.li@hisilicon.com>
---
 drivers/usb/dwc3/gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 981fd98..1e6c42e 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2420,7 +2420,7 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
    if (!dep->endpoint.desc)
        return;

-   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc))
+   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) || (dep->flags & DWC3_EP_TRANSFER_STARTED))
        __dwc3_gadget_kick_transfer(dep);
 }

--
2.7.4

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

* Re: [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO
  2017-12-21 11:03 [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO Lipengcheng
@ 2017-12-22  7:54 ` Felipe Balbi
  2017-12-25  2:58   ` Lipengcheng
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Balbi @ 2017-12-22  7:54 UTC (permalink / raw)
  To: Lipengcheng
  Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lipengcheng


Hi,

Lipengcheng <lpc.li@hisilicon.com> writes:

> Iso transmission, the current process is that all trb(HWO=1) is handled.
> Then core generate DWC3_DEPEVT_XFERNOTREADY event, Software begin  refill
> trb, this will produce 0 length package, the patch is to achieve the core
> consumes a trb, and then the software fill a trb. Normally, there will never
> be DWC3_DEPEVT_XFERNOTREADY event and 0-length packet.
>
> Signed-off-by: l00229106 <lpc.li@hisilicon.com>

who is 100229106??

> ---
>  drivers/usb/dwc3/gadget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 981fd98..1e6c42e 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2420,7 +2420,7 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
>     if (!dep->endpoint.desc)
>         return;
>
> -   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc))
> +   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) || (dep->flags & DWC3_EP_TRANSFER_STARTED))

this is wrong. isoc endpoints should NEVER be prestarted.

-- 
balbi

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

* RE: [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO
  2017-12-22  7:54 ` Felipe Balbi
@ 2017-12-25  2:58   ` Lipengcheng
  2018-01-08 11:50     ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Lipengcheng @ 2017-12-25  2:58 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org

Hi,

> -----Original Message-----
> From: Felipe Balbi [mailto:balbi@kernel.org]
> Sent: Friday, December 22, 2017 3:54 PM
> To: Lipengcheng
> Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org; Lipengcheng
> Subject: Re: [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO
> 
> 
> Hi,
> 
> Lipengcheng <lpc.li@hisilicon.com> writes:
> 
> > Iso transmission, the current process is that all trb(HWO=1) is handled.
> > Then core generate DWC3_DEPEVT_XFERNOTREADY event, Software begin
> > refill trb, this will produce 0 length package, the patch is to
> > achieve the core consumes a trb, and then the software fill a trb.
> > Normally, there will never be DWC3_DEPEVT_XFERNOTREADY event and 0-length packet.
> >
> > Signed-off-by: l00229106 <lpc.li@hisilicon.com>
> 
> who is 100229106??
Sorry. It is my job number. I will use Pengcheng li to replace it.
> 
> > ---
> >  drivers/usb/dwc3/gadget.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> > index 981fd98..1e6c42e 100644
> > --- a/drivers/usb/dwc3/gadget.c
> > +++ b/drivers/usb/dwc3/gadget.c
> > @@ -2420,7 +2420,7 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
> >     if (!dep->endpoint.desc)
> >         return;
> >
> > -   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc))
> > +   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) || (dep->flags &
> > + DWC3_EP_TRANSFER_STARTED))
> 
> this is wrong. isoc endpoints should NEVER be prestarted.
The main purpose is to core handle a trb and sofware re-fill the next trb in the DWC3_DEPEVT_XFERINPROGRESS interrupt. Mayebe it can be modified:
        if (!usb_endpoint_xfer_isoc(dep->endpoint.desc))
                __dwc3_gadget_kick_transfer(dep);
+       else
+               dwc3_prepare_trbs(dep);
+
> 
> --
> balbi

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

* RE: [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO
  2017-12-25  2:58   ` Lipengcheng
@ 2018-01-08 11:50     ` Felipe Balbi
  0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2018-01-08 11:50 UTC (permalink / raw)
  To: Lipengcheng; +Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]


Hi,

Lipengcheng <lpc.li@hisilicon.com> writes:
>> Lipengcheng <lpc.li@hisilicon.com> writes:
>> 
>> > Iso transmission, the current process is that all trb(HWO=1) is handled.
>> > Then core generate DWC3_DEPEVT_XFERNOTREADY event, Software begin
>> > refill trb, this will produce 0 length package, the patch is to
>> > achieve the core consumes a trb, and then the software fill a trb.
>> > Normally, there will never be DWC3_DEPEVT_XFERNOTREADY event and 0-length packet.
>> >
>> > Signed-off-by: l00229106 <lpc.li@hisilicon.com>
>> 
>> who is 100229106??
> Sorry. It is my job number. I will use Pengcheng li to replace it.

thanks

>> > ---
>> >  drivers/usb/dwc3/gadget.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> > index 981fd98..1e6c42e 100644
>> > --- a/drivers/usb/dwc3/gadget.c
>> > +++ b/drivers/usb/dwc3/gadget.c
>> > @@ -2420,7 +2420,7 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
>> >     if (!dep->endpoint.desc)
>> >         return;
>> >
>> > -   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc))
>> > +   if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) || (dep->flags &
>> > + DWC3_EP_TRANSFER_STARTED))
>> 
>> this is wrong. isoc endpoints should NEVER be prestarted.
> The main purpose is to core handle a trb and sofware re-fill the next trb in the DWC3_DEPEVT_XFERINPROGRESS interrupt. Mayebe it can be modified:
>         if (!usb_endpoint_xfer_isoc(dep->endpoint.desc))
>                 __dwc3_gadget_kick_transfer(dep);
> +       else
> +               dwc3_prepare_trbs(dep);
> +

no, this would be wrong too. Care to show me tracepoint data of what you
mean? I really can't understand what problem you're facing here.

Also, try a more recent kernel. I can't accept patches against a v4.4
kernel.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

end of thread, other threads:[~2018-01-08 11:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21 11:03 [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO Lipengcheng
2017-12-22  7:54 ` Felipe Balbi
2017-12-25  2:58   ` Lipengcheng
2018-01-08 11:50     ` Felipe Balbi

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