From: Peter Chen <peter.chen@freescale.com>
To: Neil Zhang <zhangwm@marvell.com>
Cc: <balbi@ti.com>, <gregkh@linuxfoundation.org>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/6] usb: gadget: mv_udc: clear corresponding interrupt when flush fifo
Date: Tue, 25 Feb 2014 09:59:24 +0800 [thread overview]
Message-ID: <20140225015923.GE7540@shlinux1.ap.freescale.net> (raw)
In-Reply-To: <1393228996-14787-4-git-send-email-zhangwm@marvell.com>
On Mon, Feb 24, 2014 at 04:03:13PM +0800, Neil Zhang wrote:
> The interruts are useless when this endpoint is going to be flushed.
> Especially in the enumeration phase, let's take get device description
> for example.
> 1. Device doesn't ACK the status package from host in time due to irq is
> disabled by some module.
> 2. Host find no ACK in time, and send another request.
Why device does not send NAK at that time?
Besides, you can try to prime status at data stage, it can also
avoid the problem usb 2.0 8.5.3.3 "Error Handling on the Last Data
Transaction" described.
> 3. Device gets the chance to handle the interrupt, the sequence is as
> following.
> a. Flush pending requests in ep0.
> b. Queue a request in ep0 according to host's request and change
> the ep0 state to DATA_STATE_XMIT.
> c. Handle the pending interrupt for the last status package. But
> actually it will check the new added request instead of the status
> package and because of wront ep0 state, device will request an
%s/wront/wrong
Peter
> unexpected status package from host.
> d. The ep0 state is going mad.
>
> The solution is that we need clear the pending corresponding interrupt
> as well as flush
> endpoint.
>
> Signed-off-by: Neil Zhang <zhangwm@marvell.com>
> ---
> drivers/usb/gadget/mv_udc_core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
> index 657ac5c..d5a9bdf 100644
> --- a/drivers/usb/gadget/mv_udc_core.c
> +++ b/drivers/usb/gadget/mv_udc_core.c
> @@ -692,6 +692,8 @@ static void mv_ep_fifo_flush(struct usb_ep *_ep)
> }
> loops--;
> } while (readl(&udc->op_regs->epstatus) & bit_pos);
> +
> + writel(bit_pos, &udc->op_regs->epcomplete);
> }
>
> /* queues (submits) an I/O request to an endpoint */
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2014-02-25 2:54 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 8:03 [PATCH 0/6] bug fix for mv_udc_core.c Neil Zhang
2014-02-24 8:03 ` [PATCH 1/6] usb: gadget: mv_udc: remove redundant pull up in udc_start Neil Zhang
2014-02-24 8:03 ` [PATCH 2/6] usb: gadget: mv_udc: disable HW zlt for ep0 Neil Zhang
2014-02-25 1:18 ` Peter Chen
2014-02-25 4:13 ` Neil Zhang
2014-02-25 5:15 ` Peter Chen
2014-02-25 7:11 ` Neil Zhang
2014-02-25 7:46 ` Peter Chen
2014-02-25 18:12 ` Felipe Balbi
2014-02-26 1:48 ` Neil Zhang
2014-02-26 2:36 ` Peter Chen
2014-02-26 15:20 ` Felipe Balbi
2014-02-26 15:23 ` Felipe Balbi
2014-02-27 3:30 ` Peter Chen
2014-02-27 16:52 ` Felipe Balbi
2014-02-27 18:05 ` Fabio Estevam
2014-02-27 19:04 ` Felipe Balbi
2014-02-26 15:19 ` Felipe Balbi
2014-02-27 9:12 ` Neil Zhang
2014-02-24 8:03 ` [PATCH 3/6] usb: gadget: mv_udc: clear corresponding interrupt when flush fifo Neil Zhang
2014-02-25 1:59 ` Peter Chen [this message]
2014-02-25 7:26 ` Neil Zhang
2014-02-24 8:03 ` [PATCH 4/6] usb: gadget: mv_udc: check endpoint before queue dtd Neil Zhang
2014-02-24 8:03 ` [PATCH 5/6] USB: gadget: mv_udc: workaroud for missing dTD Neil Zhang
2014-02-25 4:19 ` Peter Chen
2014-02-25 7:16 ` Neil Zhang
2014-02-25 7:22 ` Peter Chen
2014-02-24 8:03 ` [PATCH 6/6] USB: gadget: mv_udc: fix corner case for missiong dTD Neil Zhang
2014-02-24 10:31 ` [PATCH 0/6] bug fix for mv_udc_core.c Matthieu CASTET
2014-02-24 12:42 ` Neil Zhang
2014-02-25 4:17 ` Peter Chen
2014-02-25 7:18 ` Neil Zhang
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=20140225015923.GE7540@shlinux1.ap.freescale.net \
--to=peter.chen@freescale.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=zhangwm@marvell.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
Powered by JetHome