public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: musb: only write CLRDATATOG when appropriate
Date: Fri, 13 Aug 2010 14:25:05 +0400	[thread overview]
Message-ID: <4C651D81.2030004@mvista.com> (raw)
In-Reply-To: <AANLkTim65w1jXt+7mCaTQ97ENR=9AHC8nWBDQ=dsP4=E@mail.gmail.com>

Hello.

Remy Bohmer wrote:

>>> Mike Frysinger wrote:
>>>> --- a/drivers/usb/musb/musb_hcd.c
>>>> +++ b/drivers/usb/musb/musb_hcd.c
>>>>        } else {
>>>> -               if (!toggle)
>>>> -                       writew(MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr);
>>>> -               else {
>>>> +               if (!toggle) {
>>>> +                       csr = readw(&musbr->txcsr);
>>>> +                       if (csr & MUSB_TXCSR_MODE)
>>>> +                               csr = MUSB_RXCSR_CLRDATATOG;

>>>   Clearing RXCSR when FIFO is in TX mode?

    I meant to say "clearing RX toggle".

>> unless i missed something, that is what Linux is doing.

> Can Linux be wrong too?

>> musb_host.c:musb_rx_reinit()
>>        csr = musb_readw(ep->regs, MUSB_RXCSR);
>>        if (csr & MUSB_RXCSR_RXPKTRDY)
>>            WARNING("rx%d, packet/%d ready?\n", ep->epnum,
>>                musb_readw(ep->regs, MUSB_RXCOUNT));
>>
>>        csr = musb_readw(ep->regs, MUSB_TXCSR);
>>        if (csr & MUSB_TXCSR_MODE)
>>            musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
>>        else
>>            musb_h_flush_rxfifo(ep, 0);

>> although i see that i need to also extend the MUSB_TXCSR_MODE define
>> for Blackfin musb ports in u-boot.  but this shouldnt affect
>> non-Blackfin musb ports.  i'll send a sep patch for that.
>> -mike

> Sergei, do you agree that I apply this patch?

    Well, if it's based on the Linux code... although it still does look 
wrong... I don't know. :-)

> Kind regards,

> Remy

WBR, Sergei

  parent reply	other threads:[~2010-08-13 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09 18:58 [U-Boot] [PATCH] usb: musb: only write CLRDATATOG when appropriate Mike Frysinger
2010-08-10 10:26 ` Sergei Shtylyov
2010-08-10 20:37   ` Mike Frysinger
2010-08-12 18:04     ` Remy Bohmer
2010-08-12 19:43       ` Mike Frysinger
2010-08-13 10:25       ` Sergei Shtylyov [this message]
2010-10-11  8:47         ` Mike Frysinger
2010-10-13 10:12           ` Remy Bohmer
2010-08-12 18:08 ` Remy Bohmer
2010-08-12 19:42   ` Mike Frysinger

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=4C651D81.2030004@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=u-boot@lists.denx.de \
    /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