Linux DMA for Dell Inspiron 5000


Disclaimer: Performing the procedure outlined on this page is at your own risk.
The author provides no guarantees, warranties or any liability with respect to any damages
or loss of data or any other harm resulting from performing any of the procedures outlined on this webpage.



RedHat 6.2 and the current kernel 2.2.16-3 seem to offer only limited support for the Intel PIIX4 IDE chipset of the Dell Inspiron 5000.
With the standard configuration, my machine was not using DMA for /dev/hda at all.
This resulted in slow HD data transfer rates (hdparm -t /dev/hda output was around 3.5 MB/sec).
You can check your DMA setting by executing

/sbin/hdparm -v /dev/hda

as root. My output used to be

/dev/hda:
multcount = 0 (off)
I/O support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 1559/240/63, sectors = 23579136, start = 0


Also, the boot messages didn't mention DMA when detecting hda:

May 8 03:15:59 srini kernel: hda: IBM-DARA-212000, 11513MB w/418kB Cache, CHS=1559/240/63

Not using DMA meant that the machine slowed down to the point of no use when it started swapping.
Also, when un-tar'ing files, it was basically impossible to do anything in parallel.

I'm not sure whether all Inspiron 5000's use the PIIX4 chipset, your /proc/pci file should contain an entry like

Bus 0, device 7, function 1:
IDE interface: Intel 82371AB PIIX4 IDE (rev 1).
Medium devsel. Fast back-to-back capable. Master Capable. Latency=64.
I/O at 0x1050 [0x1051].

A linux ide kernel driver patch for the PIIX4 chipset is available from http://www.linux-ide.org,
the current version as of 9/3/2000 is ide.2.2.16.all.20000805.patch.gz
After installing the patch and recompiling the kernel, the DMA on my machine works great!
Also, multitasking performance has increased considerably if one process uses a lot of disk access.
Now, the hdparm output after booting is

/dev/hda:
multcount = 0 (off)
I/O support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 1559/240/63, sectors = 23579136, start = 0


and the boot messages are

Sep 4 10:51:44 srini kernel: ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
Sep 4 10:51:44 srini kernel: PIIX4: IDE controller on PCI bus 00 dev 39
Sep 4 10:51:44 srini kernel: PIIX4: chipset revision 1
Sep 4 10:51:44 srini kernel: PIIX4: not 100% native mode: will probe irqs later
Sep 4 10:51:44 srini kernel: ide0: BM-DMA at 0x1050-0x1057, BIOS settings: hda:DMA, hdb:pio
Sep 4 10:51:44 srini kernel: ide1: BM-DMA at 0x1058-0x105f, BIOS settings: hdc:DMA, hdd:pio
Sep 4 10:51:44 srini kernel: hda: IBM-DARA-212000, ATA DISK drive
Sep 4 10:51:44 srini kernel: hdc: TOSHIBA CD-ROM XM-7002B, ATAPI CDROM drive
Sep 4 10:51:44 srini kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Sep 4 10:51:44 srini kernel: ide1 at 0x170-0x177,0x376 on irq 15
Sep 4 10:51:44 srini kernel: hda: IBM-DARA-212000, 11513MB w/418kB Cache, CHS=1559/240/63, UDMA(33)
Sep 4 10:51:44 srini kernel: hdc: ATAPI 24X CD-ROM drive, 128kB Cache, UDMA(33)

so linux is now using the PIIX4 driver and seems to detect the udma(33) mode/capabilities.
Also, running '/sbin/hdparm -t /dev/hda' now reports transfer rates between 8-12 MB/sec.

Below is a summary of how to perform the procedure of applying the patch,
compiling the kernel and most importantly, how to get pcmcia working again after compiling the new kernel.
I assume that you know how to configure and compile a standard linux kernel
(instructions for building a kernel used to be in the RedHat installation guide),
but I don't assume any knowledge about the pcmcia part of building a new kernel (this turned out to be the hard part for me).
The way I got things to work is somewhat clumsy, so please send any suggestions to frese01@hotmail.com.



Disclaimer: Performing the procedure outlined on this page is at your own risk.
The author provides no guarantees, warranties or any liability with respect to any damages
or loss of data or any other harm resulting from performing any of the procedures outlined on this webpage.



0. WARNING: Messing with kernel and HD drivers is risky





1. Get the files






2. Apply the patch






3. Configure and compile your kernel






4. Backup your old pcmcia configuration






5. Install the new pcmcia package






6. Revert to RedHat's pcmcia startup configuration





That's it. Hopefully, everything is working fine.
Please send comments to frese01@hotmail.com .




Notes


Thomas Frese
Last modified: Sun Sep 4 12:10:36 EST 2000