Recently I stumbled across this chip specific code in the 2.6 linux kernel usb drivers source code, ehci-pci.c
Code: Select all
case PCI_VENDOR_ID_VIA:
if (pdev->device == 0x3104 && (pdev->revision & 0xf0) == 0x60) {
u8 tmp;
/* The VT6212 defaults to a 1 usec EHCI sleep time which
* hogs the PCI bus *badly*. Setting bit 5 of 0x4B makes
* that sleep time use the conventional 10 usec.
*/
pci_read_config_byte(pdev, 0x4b, &tmp);
if (tmp & 0x20)
break;
pci_write_config_byte(pdev, 0x4b, tmp | 0x20);
}
break;
So checking what value the 0x4b, MAC turn around time parameter, had been set to we find it is the default, 0x09, EHCI sleep time, 1us, USB 2.0 MAC TX time, 9.# cat /proc/pci
PCI devices found:
Bus 0, device 1, function 0:
...
Bus 0, device 2, function 2:
Class 0c03: PCI device 1106:3104 (rev 101).
IRQ 14.
Master Capable. Latency=32.
Non-prefetchable 32 bit memory at 0x60110100 [0x601101ff].
Being an adventurous linux hacker, I tried poking that PCI register with the 10us EHCI sleep time value, 0x29, to see what effect this would have on system and usb performance.# hexdump /proc/bus/pci/00/02.2
0000000 1106 3104 0156 0210 2065 0c03 2008 0080 # Via VT6212
...
0000040 0000 000b 0000 0000 20a0 0900 0000 0000 # *0x4b == 0x09, Default value
...
Well it's not a golden bullet, I observe a slight increase in USB disk transfer speed. The LiDiC seems a little more resilient but still crashes if you access a usb disk or stick while it is active.# echo ')'|dd of=/proc/bus/pci/00/02.2 bs=1 seek=75 count=1 # ')' == 0x29; 0x4b == 75;
I wonder what other VT6212 or EHCI driver tweaks are possible.
Warning! Poking values into linux kernel devices can have quite adverse effects on system integrity, try this at your own risk.