From: Andrew Victor <avictor.za@gmail.com>
To: Harro Haan <hrhaan@gmail.com>
Cc: Ryan Mallon <ryan@bluewatersys.com>,
Remy Bohmer <linux@bohmer.net>,
Andrew Victor <linux@maxim.org.za>,
David Brownell <dbrownell@users.sourceforge.net>,
H Hartley Sweeten <hartleys@visionengravers.com>,
Anti Sullin <anti.sullin@artecdesign.ee>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [patch v3 2/3] at91_udc HW glitch
Date: Tue, 23 Mar 2010 22:26:39 +0200 [thread overview]
Message-ID: <cd73a99e1003231326r7623bbc0icba163f9b2e0e96e@mail.gmail.com> (raw)
In-Reply-To: <20100203143803.528679118@gmail.com>
hi,
> Add some delay to avoid reading CSR TXCOUNT too early after updating it.
>
> Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
> Signed-off-by: Harro Haan <hrhaan@gmail.com>
> Acked-by: Remy Bohmer <linux@bohmer.net>
> ---
> drivers/usb/gadget/at91_udc.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> Index: linux-2.6.31/drivers/usb/gadget/at91_udc.c
> ===================================================================
> --- linux-2.6.31.orig/drivers/usb/gadget/at91_udc.c
> +++ linux-2.6.31/drivers/usb/gadget/at91_udc.c
> @@ -366,6 +366,13 @@ rescan:
> if (is_done)
> done(ep, req, 0);
> else if (ep->is_pingpong) {
> + /*
> + * One dummy read to delay the code because of a HW glitch:
> + * CSR returns bad RXCOUNT when read too soon after updating
> + * RX_DATA_BK flags.
> + */
> + csr = __raw_readl(creg);
> +
> bufferspace -= count;
> buf += count;
> goto rescan;
I see in the data-sheet (SAM9261 / SAM9263), the following for the
UDP_ CSRx registers:
"WARNING: Due to synchronization between MCK and UDPCK, the software
application must wait for the end of the write
operation before executing another write by polling the bits which
must be set/cleared."
//! Clear flags of UDP UDP_CSR register and waits for synchronization
#define Udp_ep_clr_flag(pInterface, endpoint, flags) { \
while (pInterface->UDP_CSR[endpoint] & (flags)) \
pInterface->UDP_CSR[endpoint] &= ~(flags); \
}
//! Set flags of UDP UDP_CSR register and waits for synchronization
#define Udp_ep_set_flag(pInterface, endpoint, flags) { \
while ( (pInterface->UDP_CSR[endpoint] & (flags)) != (flags) ) \
pInterface->UDP_CSR[endpoint] |= (flags); \
}
The at91_udc driver does not seem to do that for its CSR register writes.
So I was wondering if we implement what the datasheet says, would we
still need the "fix" above.
Regards,
Andrew Victor
next parent reply other threads:[~2010-03-23 20:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100203143736.564974126@gmail.com>
[not found] ` <20100203143803.528679118@gmail.com>
2010-03-23 20:26 ` Andrew Victor [this message]
2010-03-25 12:03 ` Harro Haan
2010-03-25 13:09 ` Anti Sullin
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=cd73a99e1003231326r7623bbc0icba163f9b2e0e96e@mail.gmail.com \
--to=avictor.za@gmail.com \
--cc=anti.sullin@artecdesign.ee \
--cc=dbrownell@users.sourceforge.net \
--cc=hartleys@visionengravers.com \
--cc=hrhaan@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@bohmer.net \
--cc=linux@maxim.org.za \
--cc=ryan@bluewatersys.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®