Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [PATCH] [MUSB] musb_hdrc: disable sending PING packet in host mode.
@ 2007-12-20 14:10 Bryan Wu
       [not found] ` <200712201457.34851.david-b@pacbell.net>
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan Wu @ 2007-12-20 14:10 UTC (permalink / raw)
  To: David Brownell, Tony Lindgren, linux-omap-open-source

From: Bryan Wu <bryan.wu@analog.com>
Date: Thu, 20 Dec 2007 15:25:34 +0800
Subject: [PATCH] [MUSB] musb_hdrc: disable sending PING packet in host
mode.

Some High Speed USB stick does not answer PING pakcet correctly, so
the USB enumeration will fail in MUSB host mode.

Disable using PING packet in host mode, almost all the USB stick
enumeration is OK on Blackfin BF54x/BF52x platform. I hope this is
a common problem in other MUSB platform.

This bug is tracked here:
https://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_id=141&tracker_item_id=3778

Signed-off-by: Bryan Wu <bryan.wu@analog.com>
---
 drivers/usb/musb/musb_host.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 2ad2ed9..34a2991 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1112,6 +1112,8 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb)
                                csr = MUSB_CSR0_H_STATUSPKT
                                        | MUSB_CSR0_TXPKTRDY;
 
+                       csr |= MUSB_CSR0_H_DIS_PING;
+
                        /* flag status stage */
                        musb->ep0_stage = MUSB_EP0_STATUS;
 
-- 
1.5.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [MUSB] musb_hdrc: disable sending PING packet in host mode.
       [not found] ` <200712201457.34851.david-b@pacbell.net>
@ 2007-12-21  3:01   ` Bryan Wu
  0 siblings, 0 replies; 2+ messages in thread
From: Bryan Wu @ 2007-12-21  3:01 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-omap-open-source


On Thu, 2007-12-20 at 14:57 -0800, David Brownell wrote:
> On Thursday 20 December 2007, Bryan Wu wrote:
> > From: Bryan Wu <bryan.wu@analog.com>
> > Date: Thu, 20 Dec 2007 15:25:34 +0800
> > Subject: [PATCH] [MUSB] musb_hdrc: disable sending PING packet in host
> > mode.
> > 
> > Some High Speed USB stick does not answer PING pakcet correctly, so
> > the USB enumeration will fail in MUSB host mode.
> > 
> > Disable using PING packet in host mode, almost all the USB stick
> > enumeration is OK on Blackfin BF54x/BF52x platform. I hope this is
> > a common problem in other MUSB platform.
> > 
> > This bug is tracked here:
> > https://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_id=141&tracker_item_id=3778
> 
> The referenced PNG images aren't listed in that bug report.  :)
> 

The bug was reported by a customer and I also found a USB stick
reproducing the bug. So the PNG pictures were attached in our forum at
following URL:
https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&_forum_action=ForumMessageBrowse&thread_id=24780


> 
> > Signed-off-by: Bryan Wu <bryan.wu@analog.com>
> > ---
> >  drivers/usb/musb/musb_host.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> > index 2ad2ed9..34a2991 100644
> > --- a/drivers/usb/musb/musb_host.c
> > +++ b/drivers/usb/musb/musb_host.c
> > @@ -1112,6 +1112,8 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb)
> >                                 csr = MUSB_CSR0_H_STATUSPKT
> >                                         | MUSB_CSR0_TXPKTRDY;
> >  
> > +                       csr |= MUSB_CSR0_H_DIS_PING;
> > +
> 
> Is PING actually allowed for control endpoints?  I'm not
> entirely sure this wouldn't be a case of "make the driver
> follow the specs"... don't have time just now to check
> what the USB 2.0 spec says.
> 

Yes, according to USB 2.0 spec, the control and bulk endpoints of
High-Speed devices should answer NAK/ACK to PING packet. I think the
MUSB driver follows the spec without my patch. But some USB sticks are
not follows this, the control endpoint never answer ACK to PING, always
NAK. This endless NAK will be stopped by MUSB upper USB stack by
resetting. So this kind USB sticks can not enumerate with MUSB driver.

I test the same problem USB sticks on Linux PC host. There is no PING
for control endpoint.
Because in EHCI spec, there is a status bit named PING status bit in the
qTD.  You can found it in Section 4.11 "Ping Control" of the EHCI spec.
EHCI HCD can choose ping or not.

Do you know how to decide to ping or not in MUSB?
I have an idea: the USB_NAKLIMIT0 should be set to some value, when we
got NAK timeout interrupt, we can disable PING. When enumerating normal
USB stick, there is no NAK timeout, because PING is efficient for
handshaking. While problem USB stick will generate NAK timeout
interrupt, we disable PING for this kind of USB device enumeration.

Thanks
Regards,
-Bryan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-21  3:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-20 14:10 [PATCH] [MUSB] musb_hdrc: disable sending PING packet in host mode Bryan Wu
     [not found] ` <200712201457.34851.david-b@pacbell.net>
2007-12-21  3:01   ` Bryan Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox