LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   usb 2.0 hdd working through usb 2.0 pcmcia card full speed in 2.4, but slow in 2.6 (http://www.linuxquestions.org/questions/linux-hardware-18/usb-2-0-hdd-working-through-usb-2-0-pcmcia-card-full-speed-in-2-4-but-slow-in-2-6-a-271226/)

chilly_willy2 12-28-2004 01:59 PM

usb 2.0 hdd working through usb 2.0 pcmcia card full speed in 2.4, but slow in 2.6
 
I'm using Arch linux with kernels 2.6.9-ARCH (supposedly vanilla) and 2.4.28 (vanilla). I have a usb2.0 ext hdd and a usb2.0 pcmcia card for my old dell c500. Hotplug is disabled. If I boot 2.4, the only modules loaded are usb-storage and scsi_mod; then I mount the hdd (mount -t vfat /dev/sda5 /mnt/usb), and it works at full speed (480 mbs). However, if I boot 2.6, I have to load ehci-hcd, uhci-hcd, and ohci-hcd, and usb-storage to mount it, but the transfer speed is only 12mbs, noticably slower than using 2.4.

Using knoppix 3.7, I get the same results, although the kernel versions aren't identical.
Here's my lspci:
Code:

00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03)
00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)
00:03.0 CardBus bridge: Texas Instruments PCI1420
00:03.1 CardBus bridge: Texas Instruments PCI1420
00:07.0 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
00:07.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:08.0 Multimedia audio controller: ESS Technology ES1983S Maestro-3i PCI Audio Accelerator (rev 10)
00:10.0 Ethernet controller: 3Com Corporation 3c556 Hurricane CardBus (rev 10)
00:10.1 Communication controller: 3Com Corporation Mini PCI 56k Winmodem (rev 10)
01:00.0 VGA compatible controller: ATI Technologies Inc Rage Mobility M3 AGP 2x (rev 02)
02:00.0 Ethernet controller: Unknown device 168c:0012 (rev 01)
06:00.0 USB Controller: NEC Corporation USB (rev 43)
06:00.1 USB Controller: NEC Corporation USB (rev 43)
06:00.2 USB Controller: NEC Corporation USB 2.0 (rev 04)

There's a fatal error in my dmesg when I use 2.6:
Code:

ehci_hcd 0000:06:00.2: NEC Corporation USB 2.0
ehci_hcd 0000:06:00.2: irq 11, pci mem c8970000
ehci_hcd 0000:06:00.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:06:00.2: USB 2.0 enabled, EHCI 1.00, driver 2004-May-10
ehci_hcd 0000:06:00.2: fatal error
ehci_hcd 0000:06:00.2: HC died; cleaning up

Any ideas? I know ehci-hcd is experimental, but why is it working with 2.4 instead of 2.6? Thanks for any help...

Attila.it 01-13-2005 06:03 AM

I have the same problem with my usb 2.0 pendrive and ext hdd.
I tried kernel 2.6.8.1, 2.6.9 and 2.6.10 (I'm using this now).

The problem seem to be that when I connect the device the ehci-hcd module pass the control of the device at the ohci-hcd module.
With the "usbtree" script you can see this.
The script is in the page http://www.linux-usb.org/usb2.html at the url http://www.linux-usb.org/usbtree

Normally the modules ohci-hcd and ehci-hcd are loaded.
I'll try with "rmmod ohci-hcd", my usb mouse stop to work but all my usb 2.0 device work at high speed (480 Mb/s).

I don't know how force the correct speed, bus, or anything else.
I'm doing other tries, I'll post you the result soon as possible.


Bye.


P.S.: Sorry for my english.

chilly_willy2 01-15-2005 11:53 AM

workaround
 
I tried the newest kernels, too, but I eventually figured our that anything older than 2.6.6 works. So, I compiled 2.6.5, and everything was good. No more ehci errors or anything. Then, I replaced my usb 2.0 pcmcia with another that I knew was Linux compatible (and cheaper!), and it works with any kernel. so, the card was a problem, but it could be resolved by using an older 2.6 kernel.

caotic 01-17-2005 02:26 AM

Re: workaround
 
Quote:

Originally posted by chilly_willy2
I tried the newest kernels, too, but I eventually figured our that anything older than 2.6.6 works. So, I compiled 2.6.5, and everything was good. No more ehci errors or anything. Then, I replaced my usb 2.0 pcmcia with another that I knew was Linux compatible (and cheaper!), and it works with any kernel. so, the card was a problem, but it could be resolved by using an older 2.6 kernel.
You could try out this Workaround:
http://sourceforge.net/mailarchive/m...sg_id=10496062

I had the same Problem with a ALI usb2 controller. The above Patch fixed the Problem for me.

Attila.it 01-19-2005 02:47 AM

I've made others test, and now I can say that my problem is different.

I don't have any error in dmesg, but all my usb 2.0 devices works in full speed mode (12 Mbit/s) and not in high speed mode (480 Mbit/s).
In Windows XP they work in high speed without problem.

After the chilly_willy2's suggestion and this post (http://www.mail-archive.com/linux-us.../msg11419.html) i'll try the kernel 2.6.5, but my problem remain.

At boot, in /var/log/messages I can read:
Code:

attila kernel: ACPI: PCI interrupt 0000:00:13.2[A] -> GSI 19 (level, low) -> IRQ 19
attila kernel: ehci_hcd 0000:00:13.2: PCI device 1002:4345 (ATI Technologies Inc)
attila kernel: ehci_hcd 0000:00:13.2: irq 19, pci mem 0xd8003000
attila kernel: ehci_hcd 0000:00:13.2: new USB bus registered, assigned bus number 1
attila kernel: ehci_hcd 0000:00:13.2: USB 2.0 initialized, EHCI 1.00, driver 26 Oct 2004
attila kernel: hub 1-0:1.0: USB hub found
attila kernel: hub 1-0:1.0: 6 ports detected
attila kernel: ACPI: PCI interrupt 0000:00:13.0[A] -> GSI 19 (level, low) -> IRQ 19
attila kernel: ohci_hcd 0000:00:13.0: PCI device 1002:4347 (ATI Technologies Inc)
attila kernel: ohci_hcd 0000:00:13.0: irq 19, pci mem 0xd8001000
attila kernel: ohci_hcd 0000:00:13.0: new USB bus registered, assigned bus number 2
attila kernel: hub 2-0:1.0: USB hub found
attila kernel: hub 2-0:1.0: 3 ports detected
attila kernel: ACPI: PCI interrupt 0000:00:13.1[A] -> GSI 19 (level, low) -> IRQ 19
attila kernel: ohci_hcd 0000:00:13.1: PCI device 1002:4348 (ATI Technologies Inc)
attila kernel: ohci_hcd 0000:00:13.1: irq 19, pci mem 0xd8002000
attila kernel: ohci_hcd 0000:00:13.1: new USB bus registered, assigned bus number 3
attila kernel: hub 3-0:1.0: USB hub found
attila kernel: hub 3-0:1.0: 3 ports detected
(my USB mouse is always connected)
attila kernel: usb 3-1: new low speed USB device using ohci_hcd and address 2
attila kernel: usbcore: registered new driver hiddev
attila kernel: input: USB HID v1.00 Mouse [USB Wheel Mouse] on usb-0000:00:13.1-1
attila kernel: usbcore: registered new driver usbhid
attila kernel: drivers/usb/input/hid-core.c: v2.0:USB HID core driver

When I connect a USB device, in /var/log/messages I can read:
Code:

attila kernel: usb 2-2: new full speed USB device using ohci_hcd and address 2
attila kernel: usb 2-2: not running at top speed; connect to a high speed hub
attila kernel: hub 2-2:1.0: USB hub found
attila kernel: hub 2-2:1.0: 1 port detected
attila kernel: usb 2-2.1: new full speed USB device using ohci_hcd and address 3
attila kernel: usb 2-2.1: not running at top speed; connect to a high speed hub
attila kernel: SCSI subsystem initialized
attila kernel: Initializing USB Mass Storage driver...
attila kernel: scsi0 : SCSI emulation for USB Mass Storage devices
attila kernel: usbcore: registered new driver usb-storage
attila kernel: USB Mass Storage support registered.
attila scsi.agent[4807]: how to add device type= at /devices/pci0000:00/0000:00:13.0/usb2/2-2/2-2.1/2-2.1:1.0/host0/target0:0:0/0:0:0:0 ??
attila kernel:  Vendor: USB 2.0  Model: Flash Disk        Rev: PROL
attila kernel:  Type:  Direct-Access                      ANSI SCSI revision: 00
attila kernel: SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
attila kernel: sda: assuming Write Enabled
attila udev[4967]: configured rule in '/etc/udev/rules.d/udev.rules' at line 127 applied, 'sda' becomes 'pendrive%n'
attila udev[4967]: creating device node '/dev/pendrive'
attila kernel: SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
attila kernel: sda: assuming Write Enabled
attila kernel:  sda:<7>usb-storage: queuecommand called
attila kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

And this is my /proc/bus/usb/devices:
Code:

T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 3
B:  Alloc= 12/900 us ( 1%), #Int=  2, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.10 ohci_hcd
S:  Product=PCI device 1002:4348 (ATI Technologies Inc)
S:  SerialNumber=0000:00:13.1
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=  2 Ivl=255ms

T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 1
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=067b ProdID=2515 Rev= 0.01
S:  Manufacturer=USB 2.0 Flash Disk
S:  Product=USB Embedded Hub
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=  1 Ivl=12ms

T:  Bus=03 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=067b ProdID=2517 Rev= 0.01
S:  Manufacturer=USB 2.0 Flash Disk
S:  Product=USB Mass Storage Device
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=05 Prot=50 Driver=usb-storage
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#=  3 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=04fc ProdID=0003 Rev= 1.01
S:  Product=USB Wheel Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=  4 Ivl=10ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 3
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.10 ohci_hcd
S:  Product=PCI device 1002:4347 (ATI Technologies Inc)
S:  SerialNumber=0000:00:13.0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=  2 Ivl=255ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 6
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.10 ehci_hcd
S:  Product=PCI device 1002:4345 (ATI Technologies Inc)
S:  SerialNumber=0000:00:13.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=  2 Ivl=256ms

The output of the usbtree script (http://www.linux-usb.org/usbtree) is:
Code:

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/3p, 12M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/1p, 12M
        |__ Port 1: Dev 4, If 0, Class=stor., Driver=usb-storage, 12M
    |__ Port 3: Dev 3, If 0, Class=HID, Driver=usbhid, 1.5M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/3p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M

And my lspci:
Code:

00:00.0 Host bridge: ATI Technologies Inc: Unknown device 5833 (rev 02)
00:01.0 PCI bridge: ATI Technologies Inc: Unknown device 5838
00:13.0 USB Controller: ATI Technologies Inc: Unknown device 4347 (rev 01)
00:13.1 USB Controller: ATI Technologies Inc: Unknown device 4348 (rev 01)
00:13.2 USB Controller: ATI Technologies Inc: Unknown device 4345 (rev 01)
00:14.0 SMBus: ATI Technologies Inc ATI SMBus (rev 18)
00:14.1 IDE interface: ATI Technologies Inc: Unknown device 4349
00:14.3 ISA bridge: ATI Technologies Inc: Unknown device 434c
00:14.4 PCI bridge: ATI Technologies Inc: Unknown device 4342
00:14.5 Multimedia audio controller: ATI Technologies Inc SoundMAX Integrated Digital Audio
00:14.6 Modem: ATI Technologies Inc: Unknown device 434d (rev 01)
01:05.0 VGA compatible controller: ATI Technologies Inc RV350 [Mobility Radeon 9600 M10]
02:03.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)
02:04.0 CardBus bridge: Texas Instruments PCI1250 PC card Cardbus Controller (rev 01)
02:04.1 CardBus bridge: Texas Instruments PCI1250 PC card Cardbus Controller (rev 01)
02:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

I use Slackware 10 with kernel 2.6.10 on a notebook Acer Aspire 1621LM (P4 2.8Ghz, Ati Radeon 9700 64Mb).

Any suggestions are very welcome.

Thanks for any help.

caotic 01-19-2005 03:37 AM

Quote:

Originally posted by Attila.it
I've made others test, and now I can say that my problem is different.

I don't have any error in dmesg, but all my usb 2.0 devices works in full speed mode (12 Mbit/s) and not in high speed mode (480 Mbit/s).
In Windows XP they work in high speed without problem.

After the chilly_willy2's suggestion and this post (http://www.mail-archive.com/linux-us.../msg11419.html) i'll try the kernel 2.6.5, but my problem remain.

CUT

The output of the usbtree script (http://www.linux-usb.org/usbtree) is:
Code:

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/3p, 12M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/1p, 12M
        |__ Port 1: Dev 4, If 0, Class=stor., Driver=usb-storage, 12M
    |__ Port 3: Dev 3, If 0, Class=HID, Driver=usbhid, 1.5M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/3p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M

I use Slackware 10 with kernel 2.6.10 on a notebook Acer Aspire 1621LM (P4 2.8Ghz, Ati Radeon 9700 64Mb).

Any suggestions are very welcome.

Thanks for any help.

If I read the usbtree-output correctly, you are using a USB-Hub. Does the Problem also exist, if you connect your Harddisk directly? Or in other words: Are you shure your Hub is a USB2.0 Hub?

Attila.it 01-19-2005 07:37 AM

This is not correct, I don't have any USB-Hub.
I think usbtree call "hub" the USB controller on the mainboard.

My notebook has 4 USB 2.0 ports, and I use one of them (i have just test all of them).

In Windows XP I can connect the USB Pendrive or the external hdd in any of the USB ports,
and they work in high speed.
In Linux they always work ok, but in full speed and without show any error.

The only way to use the high speed is to remove the ohci_hcd module with rmmod.
In this case all the devices work in high speed,
but the USB 1.1 devices (like the mouse) don't work.

Can it be a linux bug with the ATI IXP chipset ?

At the moment I don't have any other ideas...

caotic 01-19-2005 06:37 PM

Quote:

The only way to use the high speed is to remove the ohci_hcd module with rmmod.
In this case all the devices work in high speed,
but the USB 1.1 devices (like the mouse) don't work.

Can it be a linux bug with the ATI IXP chipset ?

At the moment I don't have any other ideas... [/B]
Hmm, really sounds like a bug to me. I'm not a linux developer, so I can't say wether the bug might be in the chipset or in the kernel.

It seems, your ohci-controller grabs every device that supports USB1.1 (that includes the USB2 ones) and the ehci-controller doesn't get them any more

Attila.it 01-20-2005 02:08 AM

It works !!!
 
I made it.

I don't know why it works, but it works !!!
I put this 4 lines in my rc.local:
Code:

rmmod ohci_hcd
rmmod ehci_hcd
modprobe ehci_hcd
modprobe ohci_hcd

This is a very simple and stupid solution, but now everything is fine.
It's like the usb modules were loaded in bad order.
Where can I indicate the modules' loading order ?
I searched within all the scripts in /etc/rc.d but I didn't find anything.

Another question.
Who loads the usb modules ? The kernel ? A script ?
I think the kernel is the right answer, but so, where is the error/bug ? In the kernel ? In Slackware ?

I don't know, but for the moment I'm very happy.

Thanks for help to everybody.

caotic 01-20-2005 03:35 AM

Re: It works !!!
 
Quote:

Originally posted by Attila.it
I made it.

I don't know why it works, but it works !!!
I put this 4 lines in my rc.local:
Code:

rmmod ohci_hcd
rmmod ehci_hcd
modprobe ehci_hcd
modprobe ohci_hcd

This is a very simple and stupid solution, but now everything is fine.
It's like the usb modules were loaded in bad order.
Where can I indicate the modules' loading order ?
I searched within all the scripts in /etc/rc.d but I didn't find anything.

Another question.
Who loads the usb modules ? The kernel ? A script ?
I think the kernel is the right answer, but so, where is the error/bug ? In the kernel ? In Slackware ?

I don't know, but for the moment I'm very happy.

Thanks for help to everybody.

I think it would be a good Idea to post your Problem and your Workaround at linux-usb-devel@lists.sourceforge.net
That seems to be the usb subsystem developers' mailinglist.

When the linuxkernel detects new hardware, it calls a userspaceprogramm (usually hotplug, but there are othewr programms too) which loads the correct Module for the new device.
So loading modules is done by hotplug, but the loading order of the modules is determined by the hardware detection in the kernel.
There usually also is a file to add additional modules, that are not automatically loaded, but the name of this file differs between distirbutions. I don't know wether these additional Modules are loaded before or after the automatically detected ones.

mirto 09-20-2005 09:29 AM

hi, I hv the same problem with an ati ixp chipset (toshiba a75-s229). on the 2.4.31 kernel (slack 10.2) the speed of my pendrive (dane-elec 1gb) was about 700KB/s!!!! When I updated it to 2.6.13 it downs to 90KB/s. so I did what you said rmmod .... and the speed ups to 230KB/s
My friend has a kingston pendrive with 1gb and the speed when I do that goes to 1000KB/s It sux... I'm getting very angry with this pendrive, but the chipset also has a problem...
Someone knows a module for my dane-elec pen? or why this low speed?

msbigbadwolf 02-02-2006 06:16 PM

Any idea why there is such a huge difference between kernels? Every time I do a kernel update, the speed of my USB file transfer changes (and not always for the better, I might add). It seems like you shouldn't have to do a "workaround" for every update, since updated kernels are supposedly fixing bugs like this one.


All times are GMT -5. The time now is 01:45 AM.