From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Felipe Balbi <balbi@ti.com>,
linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
Bin Liu <binmlist@gmail.com>,
Brian Hutchinson <b.hutchman@gmail.com>,
George Cherian <george.cherian@ti.com>
Subject: Re: [PATCH] usb: musb: Fix fifo reads for dm816x with musb_dsps
Date: Thu, 19 Mar 2015 21:11:06 +0300 [thread overview]
Message-ID: <550B113A.5060405@cogentembedded.com> (raw)
In-Reply-To: <20150319175549.GI31346@atomide.com>
On 03/19/2015 08:55 PM, Tony Lindgren wrote:
>>>> --- a/drivers/usb/musb/musb_dsps.c
>>>> +++ b/drivers/usb/musb/musb_dsps.c
>>>> @@ -655,6 +655,36 @@ static int dsps_musb_reset(struct musb *musb)
>>>> return !session_restart;
>>>> }
>>>>
>>>> +/* Similar to am35x, dm81xx support only 32-bit read operation */
>>>> +static void dsps_read_fifo32(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
>>>> +{
>>>> + void __iomem *fifo = hw_ep->fifo;
>>>> + u32 val;
>>>> + int i;
>>>> +
>>>> + /* Read for 32bit-aligned destination address */
>>>> + if (likely((0x03 & (unsigned long)dst) == 0) && len >= 4) {
>>>> + readsl(fifo, dst, len >> 2);
>>>> + dst += len & ~0x03;
>>>> + len &= 0x03;
>>>> + }
>>>> + /*
>>>> + * Now read the remaining 1 to 3 byte or complete length if
>>>> + * unaligned address.
>>>> + */
>>> This comment seems misplaced, it belongs before the next *if*.
>>>> + if (len > 4) {
>>>> + for (i = 0; i < (len >> 2); i++) {
>>>> + *(u32 *)dst = musb_readl(fifo, 0);
>>>> + dst += 4;
>>>> + }
>>> Not sure how this is different to using readsl().
>> Ah, the default implementation of musb_readl() uses __raw_readl().
>> So you'd probably want to keep this loop, not readsl() call.
> Not sure I follow you here..
I just wrongly thought readsl() uses readl() internally. readl() is
supposed to swap bytes when needed (BE case), while __raw_readl() is not.
> Also include/asm-generic/io.h readsl()
> uses __raw_readl()?
Looking at the arch/arm/include/asm/io.h, readsl() is equivalent to
__raw_readsl() too. Forgot about this "asymmetry".
> It seems things work with what I posted, so a readsl() loop, then
> just read the remaining 1 to 3 bytes.
In LE mode, there would have been no difference anyway.
> Regards,
> Tony
WBR, Sergei
next prev parent reply other threads:[~2015-03-19 18:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 22:48 [PATCH] usb: musb: Fix fifo reads for dm816x with musb_dsps Tony Lindgren
2015-03-19 13:30 ` Sergei Shtylyov
[not found] ` <550ACF61.5000909-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-03-19 15:45 ` Tony Lindgren
2015-03-19 17:49 ` Sergei Shtylyov
[not found] ` <550B0C3C.3080107-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-03-19 17:55 ` Tony Lindgren
2015-03-19 18:11 ` Sergei Shtylyov [this message]
[not found] ` <1426718882-27187-1-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-04-01 21:35 ` Andrew Morton
2015-04-01 21:44 ` Tony Lindgren
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=550B113A.5060405@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=b.hutchman@gmail.com \
--cc=balbi@ti.com \
--cc=binmlist@gmail.com \
--cc=george.cherian@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.