# Adaptec USB PCI card

## sjorge

Hi all,

I've turned an old computer I had laying around into a little home server.

My dad asked if I could hook up his toshiba 250gb externel HD to it and share it over samba, I said sure I can...

anyway long story short...

Using onboard USB controle (USB 1.1) I get bad bad speeds on the disk +- 900kb/s as is to be expected

I had an Adaptec USB PCI card laying around (3x USB 2 + 2x Firewire 400).

I recompiled the kernel with ohci_hcd and ehci_hcd but its not working.

I take ages for it to finaly see the drive and when it does it keeps on disapearing for no aperent reason

lspci -vnn gives me this

 *Quote:*   

> 03:08.0 USB Controller [0c03]: NEC Corporation USB [1033:0035] (rev 41) (prog-if 10 [OHCI])
> 
>         Subsystem: Adaptec Unknown device [9004:0235]
> 
>         Flags: bus master, medium devsel, latency 32, IRQ 17
> ...

 

Here is what dmesg holds:

 *Quote:*   

> 
> 
> usb 5-2: new high speed USB device using ehci_hcd and address 2
> 
> usb 5-2: configuration #1 chosen from 1 choice
> ...

 

any ideas?

----------

## NeddySeagoon

sjorge,

How is the external drive powered ?

Down the USB cable?

Thats often a problem, if it has its own power brick, it should be OK.

Poor quality USB cable from the drive to the PC?

Swap it out to test.

Sight of your /proc/bus/usb/devices file with the drive connected will be useful.

----------

## sjorge

NeddySeagoon,

It has a exernal power source.

I also tested the with another USB cable... same problem (note the drive works fine when using one of the 4 onboard USB 1.0 port but very very slow)

/proc/bus/usb/devices

 *Quote:*   

> 
> 
> T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 5
> 
> B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
> ...

 

----------

## NeddySeagoon

sjorge,

The speed difference is related to the 12 Mbit/sec and 480Mbit/sec signalling speed between USB 1 and USB 2.

Some usb storage devices need an entry in the quirks table but google always knows about that and your device is not mentioned.

As you are noy using any of the USB 1 hardware (or would like not to), remove the OHCI-HCD and UHCI-HCD modules from the kernel.

If they are already loadable modules, its suffcent to unload OHCI-HCD UHCI-HCD and EHCI-HCD then reload EHCI-HCD.

This ensures there is no interference between the drivers. OHCI-HCD and UHCI-HCD are a known source of issues if they are loaded at the same time.

----------

## sjorge

NeddySeagoon,

Would only removing ohci_hcd be enough? (use by the PCI card)

I do plan on using the USB 1's (onboard -> uhci_hcd) later on for a printer.

If I need to remove both I'll have to I'll lose the onboards.

----------

## NeddySeagoon

sjorge,

Try it - if you make the drivers as modules, you can test with the modprobe command.

----------

## sjorge

NeddySeagoon,

I just tried with only ehci_hcd, I moved over 10gb of files without errors at full speed!

I'll reintroduce uhci_hcd and try again, I hope it will still be ok  :Smile: 

----------

## sjorge

Alas! I was mistaken  :Sad: 

While doing the backup of my dad computer it gave the same error again! (only had ehci_hcd loaded).

----------

## NeddySeagoon

sjorge,

It may be a driver and IRQ sharing issue. 

PCI card drivers are suppoed to be written to share IRQs but there are both broken drivers and broken hardware that make that fail.

Nomally, only the first few PCI slots (max 4) have unique IRQ assignments. Slots are counted going left from the AGP slot.

Look in /proc/interrupts to see if your USB card has an IRQ to itself. If not, move it to another slot. If you need to, temporarally remove other PCI cards so you can test in this condition.

As you do not have on board USB 2, your motherboard is likely to be too old to have a APIC (Advainced Peripheral Interrupt Controller).

This device provides more IRQ channels and is another way to address IRQ sharing. We can look at that in depth if you can demonstate that having an IRQ to itself would fix the problem.

The good news is that you have proved its not a USB cable problem.

----------

## sjorge

Hi NeddySeagoon,

First I want to thank you for sticking with me through all this! really appreciated!

here is the /proc/interrupts output with the PCI in place

 *Quote:*   

>            CPU0
> 
>   0:    7799671   IO-APIC-edge      timer
> 
>   1:          2   IO-APIC-edge      i8042
> ...

 

I'll try and get one tonight (when I'm home) with it removed.

I do know for a fact its in the bottom PCI slot because it was farthest away from the GPU.

And like you said this PC is quite old yet... 7-8 years IIRC, it used to run windows me but was unused in the closet for a few years and I though id recycle it  :Smile: 

----------

## sjorge

here is one with the PCI in the top most slot.

I only have 3 and one is blue (where the old medion modem card was located which I've now removed aswel)

 *Quote:*   

> sjorge@cygnus ~ $ cat /proc/interrupts
> 
>            CPU0
> 
>   0:      56659   IO-APIC-edge      timer
> ...

 

Still goes MIA when using one of the PCI's USB ports with it in its new location

----------

## NeddySeagoon

sjorge,

In your first post, you have 

```
18: 0 IO-APIC-fasteoi ehci_hcd:usb1
```

 which shows the card has an irq to itself.

In the second post, its

```
19: 699 IO-APIC-fasteoi ehci_hcd:usb1, uhci_hcd:usb2 
```

Unless your system is a multi CPU box, I'm surprised such an old system has a working APIC, which is what 

```
IO-APIC
```

 claims its using.

Providing its only a single CPU system, add noapic to your kernel line in grub.conf and reboot.

This will switch the APIC to legacy mode, where it will emulate a XT-PIC. That will rule out a broken APIC not being detected by the kernel.

----------

## sjorge

NeddySeagoon,

Its a single cpu system,

Will 'noapic' also work if I haven't used genkernel? or do I have to recompile and turn of something?

----------

## NeddySeagoon

sjorge,

noapic and all the things listed in /usr/src/linux/Documentation/kernel-params.txt (and its references) work regardless of how the kernel was compiled, provided the code the parameter affects is in the kernel.

----------

## sjorge

Sry for the very very late reply.

I'm rebooting now with the new kernel parameter.

I'll report back how it went in a few minutes

No joy

 *Quote:*   

> 
> 
> Apr 20 12:04:33 cygnus sd 1:0:0:1: [sda] Assuming drive cache: write through
> 
> Apr 20 12:04:33 cygnus sda: sda1
> ...

 

Thanks for all the help, I think I'm going to trow the towel in the ring and just keep using it at USB1 speeds

----------

