Re: [PATCH 6/9] pxa27x_udc: create status packet for zero length OUT requests

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

 



Vernon Sauder <vernoninhand@xxxxxxxxx> writes:

> From: Vernon Sauder <vsauder@xxxxxxxxxx>
>
>
> Signed-off-by: Vernon Sauder <vsauder@xxxxxxxxxx>
> ---
>  drivers/usb/gadget/pxa27x_udc.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
> index aa80abc..b177eae 100644
> --- a/drivers/usb/gadget/pxa27x_udc.c
> +++ b/drivers/usb/gadget/pxa27x_udc.c
> @@ -1190,9 +1190,14 @@ static int pxa_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
>  					ep0_end_in_req(ep, req);
>  			break;
>  		case OUT_DATA_STAGE:
> -			if ((length == 0) || !epout_has_pkt(ep))
> -				if (read_ep0_fifo(ep, req))
> -					ep0_end_out_req(ep, req);
> +			if (length == 0 || read_ep0_fifo(ep, req)) {
> +				if (length == 0) {
> +					/* we need to make up a status packet */
> +					udc_ep_writeb(ep, UDCDR, 0);
> +					udc_ep_writel(ep, UDCCSR, UDCCSR0_IPR);
> +				}
> +				ep0_end_out_req(ep, req);
> +			}

Well, I would tend to think that if that big error was there, the usb test tests
I ran over pxa27x_udc, especially the chapter 9 usb tests, would have shown the
problem.

And we should not write anything in OUT_DATA_STAGE, only in
OUT_STATUS_STAGE. The ep0_end_out_req() puts the udc in OUT_STATUS_STAGE, and
then in IDLE. If there was a zero length packet to send _in_ status stage, that
would be in ep0_end_out_req().

As I'm very pragmatic, would you run the usb test suite with your patch applied
and report, please ? Until then, I'm not totally convinced.

Cheers.

--
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

  Powered by Linux