public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Debugging, Why USB is not stable
@ 2010-08-28 23:12 Gérald Kerma
  2010-08-30  9:12 ` Detlev Zundel
  0 siblings, 1 reply; 8+ messages in thread
From: Gérald Kerma @ 2010-08-28 23:12 UTC (permalink / raw)
  To: u-boot

Good evening,

I have some few problems with usb start / reset commands on last uboot.

USB hard drive are not always detected.

Is there something I missed ?

Marvell>> usb start
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 4 USB Device(s) found
       scanning bus for storage devices... 2 Storage Device(s) found

Marvell>> usb tree

Device Tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller
  |
  +-2  Hub (480 Mb/s, 100mA)
    |
    +-3  Mass Storage (480 Mb/s, 100mA)
    |    Corsair Voyager Mini 89980116200801151425232B
    |
    +-4  Mass Storage (480 Mb/s, 2mA)
         JMicron USB to ATA/ATAPI Bridge 1002170B8200

Marvell>> usb info
1: Hub,  USB Revision 2.0
 - u-boot EHCI Host Controller
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Hub,  USB Revision 2.0
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0409  Product 0x005a Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered Remote Wakeup 100mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms

3: Mass Storage,  USB Revision 2.0
 - Corsair Voyager Mini 89980116200801151425232B
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x1b1c  Product 0x0b29 Version 2.0
   Configuration: 1
   - Interfaces: 1 Bus Powered 100mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 2
     - Class Mass Storage, Transp. SCSI, Bulk only
     - Endpoint 1 In Bulk MaxPacket 512
     - Endpoint 2 Out Bulk MaxPacket 512

4: Mass Storage,  USB Revision 2.0
 - JMicron USB to ATA/ATAPI Bridge 1002170B8200
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x152d  Product 0x2338 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 2mA
   - String: "USB Mass Storage"
     Interface: 0
     - Alternate Setting 0, Endpoints: 2
     - Class Mass Storage, Transp. SCSI, Bulk only
     - String: "MSC Bulk-Only Transfer"
     - Endpoint 1 In Bulk MaxPacket 512
     - Endpoint 2 Out Bulk MaxPacket 512

Marvell>> usb start
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found

Marvell>> usb info
1: Hub,  USB Revision 2.0
 - u-boot EHCI Host Controller
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Hub,  USB Revision 2.0
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0409  Product 0x005a Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered Remote Wakeup 100mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms

3: Mass Storage,  USB Revision 2.0
 - Corsair Voyager Mini 89980116200801151425232B
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x1b1c  Product 0x0b29 Version 2.0
   Configuration: 1
   - Interfaces: 1 Bus Powered 100mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 2
     - Class Mass Storage, Transp. SCSI, Bulk only
     - Endpoint 1 In Bulk MaxPacket 512
     - Endpoint 2 Out Bulk MaxPacket 512

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

* [U-Boot] Debugging, Why USB is not stable
  2010-08-28 23:12 [U-Boot] Debugging, Why USB is not stable Gérald Kerma
@ 2010-08-30  9:12 ` Detlev Zundel
  2010-08-30  9:37   ` Bas Mevissen
  2010-08-31 18:12   ` Remy Bohmer
  0 siblings, 2 replies; 8+ messages in thread
From: Detlev Zundel @ 2010-08-30  9:12 UTC (permalink / raw)
  To: u-boot

Hi G?rald,

> I have some few problems with usb start / reset commands on last uboot.
>
> USB hard drive are not always detected.
>
> Is there something I missed ?

Only the fact that USB is a nightmare to work with.  No, honestly, we
have a continuous stream of USB related problems with the current USB
code.  As I understand it this results from the ever more diverging USB
implementation in U-Boot and e.g. in the Linux kernel.  The latter has
received a lot of work which is simply not possible by reading
datasheets and writing software according to those.  This involves a lot
of testing on literally thousands of different HW incarnations and on
working around the discovered idosyncracies of the parts.

Sometimes I get the impression that we would save a lot of headache by
starting afresh and porting the current Linux code into U-Boot thus
leverage all this, but nobody yet dared to start such a feat.

For the problem at hand, you may try to test variations on your setup,
e.g. by introducing different hubs in different combinations.  I'm
pretty sure that this will change the situation - sadly may be not for
the better.

Cheers
  Detlev

-- 
Among the  -) the .-) is king
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

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

* [U-Boot] Debugging, Why USB is not stable
  2010-08-30  9:12 ` Detlev Zundel
@ 2010-08-30  9:37   ` Bas Mevissen
  2010-08-30  9:52     ` Detlev Zundel
  2010-08-31 18:12   ` Remy Bohmer
  1 sibling, 1 reply; 8+ messages in thread
From: Bas Mevissen @ 2010-08-30  9:37 UTC (permalink / raw)
  To: u-boot

On Mon, 30 Aug 2010 11:12:25 +0200, Detlev Zundel <dzu@denx.de> wrote:

> Sometimes I get the impression that we would save a lot of headache by
> starting afresh and porting the current Linux code into U-Boot thus
> leverage all this, but nobody yet dared to start such a feat.
> 

If somebody starts over, it would be wise to find a way to use the
Linux code unmodified or only automatically converted in U-Boot.
Otherwise, every resync is painful again and again.

With the use of wrapper functions, a few sed/awk/whatever scripts and
all kinds of macro trickery, it is should be possible to use the Linux
code without manually changing it for U-boot.

-- 
Bas

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

* [U-Boot] Debugging, Why USB is not stable
  2010-08-30  9:37   ` Bas Mevissen
@ 2010-08-30  9:52     ` Detlev Zundel
  2010-08-30 10:13       ` Bas Mevissen
  0 siblings, 1 reply; 8+ messages in thread
From: Detlev Zundel @ 2010-08-30  9:52 UTC (permalink / raw)
  To: u-boot

Hi Bas,

> On Mon, 30 Aug 2010 11:12:25 +0200, Detlev Zundel <dzu@denx.de> wrote:
>
>> Sometimes I get the impression that we would save a lot of headache by
>> starting afresh and porting the current Linux code into U-Boot thus
>> leverage all this, but nobody yet dared to start such a feat.
>> 
>
> If somebody starts over, it would be wise to find a way to use the
> Linux code unmodified or only automatically converted in U-Boot.
> Otherwise, every resync is painful again and again.

Absolutely.

> With the use of wrapper functions, a few sed/awk/whatever scripts and
> all kinds of macro trickery, it is should be possible to use the Linux
> code without manually changing it for U-boot.

In the past this turned out not to be as easy as it sounds.  The devil
lurks in the details which become apparant only when starting on the
job.  But of course if somebody accomplishes this, I cannot imagine
anyone from stopping him :)

Cheers
  Detlev

-- 
The Speedo3 is very similar to other Intel network chips, that is to say
"apparently designed on a different planet".
                               -- drivers/net/eepro100.c in Linux source
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

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

* [U-Boot] Debugging, Why USB is not stable
  2010-08-30  9:52     ` Detlev Zundel
@ 2010-08-30 10:13       ` Bas Mevissen
  2010-08-30 10:20         ` Detlev Zundel
  0 siblings, 1 reply; 8+ messages in thread
From: Bas Mevissen @ 2010-08-30 10:13 UTC (permalink / raw)
  To: u-boot

On Mon, 30 Aug 2010 11:52:30 +0200, Detlev Zundel <dzu@denx.de> wrote:

> In the past this turned out not to be as easy as it sounds.  The devil
> lurks in the details which become apparent only when starting on the
> job.  But of course if somebody accomplishes this, I cannot imagine
> anyone from stopping him :)
> 

Well, I vaguely recall a recent discussion here where a lot of changes
to imported code were requested just to fulfil the U-boot code
guidelines. That will not help particularly when the code needs to be
synced again with the origin.

And yes, nobody said it was easy :-)

-- 
Bas

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

* [U-Boot] Debugging, Why USB is not stable
  2010-08-30 10:13       ` Bas Mevissen
@ 2010-08-30 10:20         ` Detlev Zundel
  0 siblings, 0 replies; 8+ messages in thread
From: Detlev Zundel @ 2010-08-30 10:20 UTC (permalink / raw)
  To: u-boot

Hi Bas,

> On Mon, 30 Aug 2010 11:52:30 +0200, Detlev Zundel <dzu@denx.de> wrote:
>
>> In the past this turned out not to be as easy as it sounds.  The devil
>> lurks in the details which become apparent only when starting on the
>> job.  But of course if somebody accomplishes this, I cannot imagine
>> anyone from stopping him :)
>> 
>
> Well, I vaguely recall a recent discussion here where a lot of changes
> to imported code were requested just to fulfil the U-boot code
> guidelines. That will not help particularly when the code needs to be
> synced again with the origin.

For code that we import en-bloc, we explicitely make expections to
U-Boot rules[1]:

  Source files originating from different projects (for example the MTD
  subsystem or the hush shell code from the BusyBox project) may, after
  careful consideration, be exempted from these rules. For such files, the
  original coding style may be kept to ease subsequent migration to newer
  versions of those sources.

> And yes, nobody said it was easy :-)

Well, at least I thought it at one moment in the past :)

Cheers
  Detlev

[1] http://www.denx.de/wiki/U-Boot/CodingStyle

-- 
Paul Simon sang "Fifty Ways to Lose Your Lover", because quite
frankly, "A Million Ways to Tell a Developer He Is a D*ckhead"
doesn't scan nearly as well.  But I'm sure he thought about it.
                            -- linux/Documentation/ManagementStyle
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

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

* [U-Boot] Debugging, Why USB is not stable
  2010-08-30  9:12 ` Detlev Zundel
  2010-08-30  9:37   ` Bas Mevissen
@ 2010-08-31 18:12   ` Remy Bohmer
  2010-09-01 15:15     ` Detlev Zundel
  1 sibling, 1 reply; 8+ messages in thread
From: Remy Bohmer @ 2010-08-31 18:12 UTC (permalink / raw)
  To: u-boot

Hi Detlev,

2010/8/30 Detlev Zundel <dzu@denx.de>:
> Hi G?rald,
>
>> I have some few problems with usb start / reset commands on last uboot.
>>
>> USB hard drive are not always detected.
>>
>> Is there something I missed ?
>
> Only the fact that USB is a nightmare to work with. ?No, honestly, we
> have a continuous stream of USB related problems with the current USB
> code.

This is not what I notice on the amount of fixes that are posted on the list...
The only fixes I have seen the last year or two were related to newly
added host-controller support. Apart from that it is quite silent in
the u-boot-usb tree...
But, anyway. I know it has some stability issues, although it is now
much better compared to a year ago...

>?As I understand it this results from the ever more diverging USB
> implementation in U-Boot and e.g. in the Linux kernel.

Indeed, It has diverged that much that I did not succeed in finding
the real origin of the code...

> Sometimes I get the impression that we would save a lot of headache by
> starting afresh and porting the current Linux code into U-Boot thus
> leverage all this, but nobody yet dared to start such a feat.

Hey... I have dared to start it!
(But it is a real pain to do it properly, and I stopped half way due
to lack of time...)

Kind regards,

Remy

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

* [U-Boot] Debugging, Why USB is not stable
  2010-08-31 18:12   ` Remy Bohmer
@ 2010-09-01 15:15     ` Detlev Zundel
  0 siblings, 0 replies; 8+ messages in thread
From: Detlev Zundel @ 2010-09-01 15:15 UTC (permalink / raw)
  To: u-boot

Hi Remy,

>> Only the fact that USB is a nightmare to work with. ?No, honestly, we
>> have a continuous stream of USB related problems with the current USB
>> code.
>
> This is not what I notice on the amount of fixes that are posted on the list...

Most problems go without a fix if there is an easy hardware replacement.
Even diagnosing such a problem is usually too expensive for customers.

> The only fixes I have seen the last year or two were related to newly
> added host-controller support. Apart from that it is quite silent in
> the u-boot-usb tree...
> But, anyway. I know it has some stability issues, although it is now
> much better compared to a year ago...

Yes it is and without a question I greatly appreciate your work for the
USB part.

>>?As I understand it this results from the ever more diverging USB
>> implementation in U-Boot and e.g. in the Linux kernel.
>
> Indeed, It has diverged that much that I did not succeed in finding
> the real origin of the code...
>
>> Sometimes I get the impression that we would save a lot of headache by
>> starting afresh and porting the current Linux code into U-Boot thus
>> leverage all this, but nobody yet dared to start such a feat.
>
> Hey... I have dared to start it!
> (But it is a real pain to do it properly, and I stopped half way due
> to lack of time...)

I can understand that also.  My intention of the mail was to transport
my personal view of the whole area.  USB problems in my experience have
a very high cost even to diagnose, let alone fix.

Cheers
  Detlev

-- 
Test applications  with a variety of tools.  Don't assume everything works if
you've tested  with only  one client.  Also, assume the low end of technology
for clients and don't create applications which can only be used by Graphical
User Interfaces.                                       -- RFC 1855
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

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

end of thread, other threads:[~2010-09-01 15:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-28 23:12 [U-Boot] Debugging, Why USB is not stable Gérald Kerma
2010-08-30  9:12 ` Detlev Zundel
2010-08-30  9:37   ` Bas Mevissen
2010-08-30  9:52     ` Detlev Zundel
2010-08-30 10:13       ` Bas Mevissen
2010-08-30 10:20         ` Detlev Zundel
2010-08-31 18:12   ` Remy Bohmer
2010-09-01 15:15     ` Detlev Zundel

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