Re: [PATCH] USB: DWC3: Restart setup phase correctly if gadget halts the transfer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Jun 25, 2012 at 07:52:01PM +0530, Pratyush Anand wrote:
> On 6/25/2012 7:39 PM, Felipe Balbi wrote:
> >Hi,
> >
> >On Mon, Jun 25, 2012 at 07:16:56PM +0530, Pratyush Anand wrote:
> >>If a gadget halts control transfer stage, then that stage is stalled,
> >>but core should be ready to receive next setup packet.
> >>
> >>This patch restarts control transfer along with other software correct
> >>flag settings.
> >>
> >>Signed-off-by: Pratyush Anand<pratyush.anand@xxxxxx>
> >>Signed-off-by: Michel Sanches<michel.sanches@xxxxxx>
> >
> >have you actually experienced any issues ? I ask this because if you
> >look at dwc3_ep0_stall_and_restart() you will see that this is properly
> >handled:
> 
> Yes, I experienced one failing case.

cool.

> I receive setup packet. They are correct. So gadget goes for this
> command execution. Its a lengthy command (a read from a slow device),
> so dwc3 goes into DWC3_EP_PENDING_REQUEST.
>
> Now, gadget experiences that slow device is not working at all. So,
> it needs to stall the data IN stage. Gadget calls usb_ep_set_halt.
> 
> I do not see calling of dwc3_ep0_stall_and_restart from set_halt. Did
> I miss something?

I see... I'm confused with what would be the best fix here:

make ->complete() return error code or re-factor stall_and_restart() so
that it becomes ep0's set_halt() and set_wedge implementation. What do
you think ?

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux