-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Problem with high speed hub connected to high speed controller on a 
big endian processor


========= Problem symptom

A problem was seen when a high speed hub was plugged into a port of a high
speed controller attached to a MIPS-4km processor running uClinux upgraded
to Linux 2.4.26 plus local mods.  The high speed hub was seen, but no
interrupts were received from the high speed hub when devices were
connected to the high speed hub causing those devices to not be detected.

Polling the high speed hub showed the high speed hub was otherwise 
functional because devices connected to the high speed hub were then 
detected.

========== Problem analysis
Under certain conditions, a line of code in routine qh_schedule()
found in the file linux/drivers/usb/host/ehci-sched.c is executed which
attempts to clear the S-frame and C-frame masks in the Queue Head structure 
without taking into account qh->hw_info2 is in little endian format.

This causes the fields, High-Bandwidth Pipe Multipler, Port Number, and 
Hub Addr fields to be cleared on a big endian processor.  

"Enhanced Host Controller Interface Specification for Universal Serial Bus"
from Intel Corporation, Revision 1.0, in Table 3-20, 
indicates a High-Bandwidth Pipe Multiplier of 00b is reserved.  
A zero in this field yields undefined results.

========== Suggested patches

The following patch is suggested for Linux 2.4.26.
This patch has been tested on a MIPS-4km processor running uClinux plus 
local mods.

===== BEGIN PATCH FOR Linux 2.4.26 =====
diff -Naur linux-2.4.26/drivers/usb/host/ehci-sched.c 
linux-2.4.26-custom/drivers/usb/host/ehci-sched.c
- --- linux-2.4.26/drivers/usb/host/ehci-sched.c        2004-04-14 08:05:33.000000000 
-0500
+++ linux-2.4.26-custom/drivers/usb/host/ehci-sched.c   2004-05-30 09:35:58.000000000 
-0500
@@ -402,7 +402,7 @@
                qh->start = frame;
 
                /* reset S-frame and (maybe) C-frame masks */
- -             qh->hw_info2 &= ~0xffff;
+               qh->hw_info2 &= cpu_to_le32 (~0xffff);
                qh->hw_info2 |= cpu_to_le32 (1 << uframe) | c_mask;
        } else
                dbg ("reused previous qh %p schedule", qh);
===== END PATCH FOR Linux 2.4.26 =====

Examination of the code in Linux 2.6.6 suggests the same problem should 
exist in Linux 2.6.6.
Please note: the following change has not been tested in Linux 2.6.6.

===== BEGIN PATCH FOR Linux 2.6.6 =====
diff -Naur linux-2.6.6/drivers/usb/host/ehci-sched.c 
linux-2.6.6-custom/drivers/usb/host/ehci-sched.c
- --- linux-2.6.6/drivers/usb/host/ehci-sched.c 2004-05-09 21:32:27.000000000 -0500
+++ linux-2.6.6-custom/drivers/usb/host/ehci-sched.c    2004-05-30 09:06:41.000000000 
-0500
@@ -483,7 +483,7 @@
                qh->start = frame;
 
                /* reset S-frame and (maybe) C-frame masks */
- -             qh->hw_info2 &= ~0xffff;
+               qh->hw_info2 &= cpu_to_le32 (~0xffff);
                qh->hw_info2 |= cpu_to_le32 (1 << uframe) | c_mask;
        } else
                dbg ("reused previous qh %p schedule", qh);
===== END PATCH FOR Linux 2.6.6 =====

A special thanks to David Brownell for suggesting we try to poll the hub 
to see if the hub was otherwise functional and for giving us the starting 
point for looking for the cause of this problem.

- -- 
Rick Sewill                      Phone/FAX: +1-218-287-1075
E-mail: [EMAIL PROTECTED]    Cell Phone: +1-701-866-0266

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAugKinuq+wueL0tYRAuxQAJ90e/fDsDa2+KHAtgOmiGC+eTgKLgCdFgbX
3fNFY/4BnXN/18NoR7vcbr4=
=ymDt
-----END PGP SIGNATURE-----



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to