# 2.6.9 kernel and DMA help please

## Shaoran

This is the problem:

Running gentoo, stage 3 install, on a "custom" 2.6.9 kernel.

In general, everything went fine, except:

No dma on my harddrive, and I've been trying to search around a bit. People only say that "enable VIA chipset in the kernel and you are set to go" only problem is, I know I compiled support for the VIA chipset into the kernel(Not as a module).

And I've tried virtually anything to get it working, removing generic IDE support, playing around with almost anything in the menu and so on.

Please help, what do I need to enable\disable in the kernel to get DMA support for my chipset?

(Yes, hdparm -d1 /dev/cdrom or /dev/hdc or /dev/dvd gives me operation not supported.

And yes, I did remember to move the kernel, config and system.map to /boot after kernel compile.

----------

## NeddySeagoon

Shaoran,

Please post the IDE related lines from

```
lspci
```

----------

## bet1m

witch chipset?

----------

## Shaoran

```
0000:00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) (prog-if 8a [Master SecP PriP])

Subsystem: VIA Technologies, Inc. VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE

Flags: bus master, medium devsel, latency 32, IRQ 11

I/O ports at d800 [size=16]

Capabilities: [c0] Power Management version 2
```

Is this correct?

If you need something from the .config file in the /boot directory, could someone tell me what, because it's rather large file.

----------

## NeddySeagoon

Shaoran,

You need the following settings in your kernel. Navigate to

```
Device Drivers

-> ATA/ATAPI/MFM/RLL support
```

 then choose all of the following as Y. Modules will not work, even where they are allowed.

```
ATA/ATAPI/MFM/RLL support

Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support 

Include IDE/ATA-2 DISK support 

Use multi-mode by default

generic/default IDE chipset support 

PCI IDE chipset support 

Sharing PCI IDE interrupts support

Generic PCI IDE Chipset Support

Use PCI DMA by default when available

VIA82CXXX chipset support 
```

Remake and reinstall your kernel. You should get DMA by default now unless your drive is on the IDE blacklist of drives known to not work with DMA.

----------

## Shaoran

Right, now I double-checked and triple-checked, compiled the kernel, moved it to /boot, and right now I feel like selling it, and buying a Intel Pentium 4 at work instead, because this is annoying me to no end.

*sigh* Thanks for all help.

----------

## NeddySeagoon

Shaoran,

Post the output of 

```
hdparm -i /dev/...
```

It will never work if you have a blacklisted drive. Thats for your own protection.

----------

## dsd

posting the output of "lspci -n" will help.

you should also confirm that you are running the kernel you think that you are, by running "uname -v". that will give you the date and time that your running kernel was compiled.

----------

## Shaoran

```
/dev/cdrom:

 Model=TSSTcorpDVD-ROM TS-H352A, FwRev=TS01, SerialNo=

 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }

 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=unknown, BuffSize=0kB, MaxMultSect=0

 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 *udma2 

 AdvancedPM=no

 Drive conforms to: ATA-2 X3T10 948D revision 3: 

 * signifies the current active mode
```

hdparm -i /dev/cdrom which is a symlink to /dev/hdc

```
/dev/hda:

 Model=IC35L080AVVA07-0, FwRev=VA4OA50K, SerialNo=VNC402A4G7KG2A

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52

 BuffType=DualPortCache, BuffSize=1863kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=160836480

 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 

 AdvancedPM=yes: disabled (255) WriteCache=enabled

 Drive conforms to: ATA/ATAPI-5 T13 1321D revision 1: 

 * signifies the current active mode
```

This is my first harddrive.

```
/dev/hdb:

 Model=SAMSUNG SP1614N, FwRev=TM100-23, SerialNo=0642J1FW610263

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=16383/16/63, TrkSize=34902, SectSize=554, ECCbytes=4

 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455

 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 

 AdvancedPM=no WriteCache=enabled

 Drive conforms to: (null): 

 * signifies the current active mode
```

My second harddrive.

```

/dev/hdd:

 Model=TSSTcorpCD/DVDW TS-H552B, FwRev=TS03, SerialNo=TS-H552BFirmware

 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }

 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=unknown, BuffSize=0kB, MaxMultSect=0

 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0

 IORDY=yes, tPIO={min:227,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 *udma2 

 AdvancedPM=no

 * signifies the current active mode

```

And this is my DVD-burner.

```
0000:00:00.0 Class 0600: 1106:3099

0000:00:01.0 Class 0604: 1106:b099

0000:00:0b.0 Class 0401: 1102:0002 (rev 07)

0000:00:0b.1 Class 0980: 1102:7002 (rev 07)

0000:00:0d.0 Class 0280: 14e4:4320 (rev 03)

0000:00:11.0 Class 0601: 1106:3147

0000:00:11.1 Class 0101: 1106:0571 (rev 06)

0000:00:11.2 Class 0c03: 1106:3038 (rev 23)

0000:00:11.3 Class 0c03: 1106:3038 (rev 23)

0000:01:00.0 Class 0300: 10de:0314 (rev a1)
```

Output of lspci -n.

Sorry that I have to bump this, I've been away from the computer for a while.

I am 200% certain I am running the correct kernel.

----------

## NeddySeagoon

Shaoran,

If thats the output of

```
hdparm -i <device>
```

 it shows that all your drives offer UDMS modes. If its the output of

```
hdparm -I <device>
```

It shows that UDMS is active now.

It looks like you have an 80 conductor cable on ide0 and a 40 conductor cable on ide1, since the best rate offered on ide1 is udma2.

Can you do some speed tests please. 

```
Thats hdparam -tT <device>
```

and post the results.

----------

## Shaoran

hdparm -tT /dev/hdc gives me "read failed Input\Output error" and nothing more.

----------

## NeddySeagoon

Shaoran,

If you are doing the test on a CDROM you need a disk in the drive.

I have been looking at chipset DMA problems, so a test of you hard drives would provide useful info.

----------

## Shaoran

 *NeddySeagoon wrote:*   

> Shaoran,
> 
> If you are doing the test on a CDROM you need a disk in the drive.

 

Oh.*slapsself* I knew that XD

```
/dev/cdrom:

 Timing cached reads:   852 MB in  2.00 seconds = 425.85 MB/sec

 Timing buffered disk reads:   26 MB in  3.11 seconds =   8.36 MB/sec
```

Tada.

Oh, I did the same on the /dev/hda drive, and got:

```
/dev/hda:

 Timing cached reads:   740 MB in  2.00 seconds = 369.13 MB/sec

 Timing buffered disk reads:   20 MB in  3.28 seconds =   6.10 MB/sec
```

Disturbing figures compared to the cdrom.

----------

## NeddySeagoon

Shaoran,

Its time for the silly questions now.

Are you running the kernel you think you are?

Do 

```
uname -a
```

and check the version and compile date.

Look in /boot while the boot partition is not mounted. It should be empty but its easy to 'install' a kernel and forget to mount /boot.

You don't have DMA on and its almost certainly a kernel problem.

I'll check the IDE blacklist and post back.

----------

## zinion

 *Shaoran wrote:*   

> Right, now I double-checked and triple-checked, compiled the kernel, moved it to /boot, and right now I feel like selling it, and buying a Intel Pentium 4 at work instead, because this is annoying me to no end.
> 
> *sigh* Thanks for all help.

 

Don't blame it on AMD or your board, it's working really fine here with the same chipset.

----------

## Shaoran

This is embarrasing.

I made my / partition the /boot partition, so I had copied the kernel to the wrong place.

Everything is working like a charm now, thanks for all the help.

----------

## E001754

I have the same problem, but with an Intel Chipset (i865PE / Pentium 4).

I checked my kernel, all the options that have been mentionned by NeddySeagoon are compiled in the kernel (not as modules).

My lspci is the following :

 *Quote:*   

> 
> 
> bash-2.05b# lspci
> 
> 0000:00:00.0 Host bridge: Intel Corp.: Unknown device 2570 (rev 02)
> ...

 

The hdparm -i gives the following :

 *Quote:*   

> 
> 
> /dev/hdc:
> 
>  Model=PLEXTOR DVDR PX-716A, FwRev=1.03, SerialNo=308029
> ...

 

Can anyone give a help ?

Thanks

----------

## NeddySeagoon

E001754,

Hopefully you used the Intel PIIX driver in place of the VIA on in my original list of kernel options ?

----------

## E001754

Hopefully, yes ! (I'm sorry, you could have found the bug easily if I had used the VIA driver on a Intel Mobo (but I would have wrote it to kernel.org developpers !))

----------

## E001754

I've read somewhere in the forums that upgrading to a 2.6.10 kernel could solve the problem.

I'm now running a 2.6.10-gentoo-r6 and I still can't enable my DMA on my /dev/hdc (plextor DVD) and my /dev/hdd (Teac CDRW) drives.

Is it a kernel bug or do have I to active something somewhere ?

Thanks for any help

----------

## NeddySeagoon

E001754,

Can you post the drive types from 

```
hdparm -i /dev/....
```

please.

----------

## E001754

Here it is (hdparm -i /dev/hd[c/d] and hdparm /dev/hd[c/d] :

 *Quote:*   

> 
> 
> bash-2.05b# hdparm -i /dev/hdc
> 
> /dev/hdc:
> ...

 

----------

## NeddySeagoon

E001754,

Do you have DMA working for your hard drive ?

----------

## E001754

I don't know, because my Linux hard drive is UW-SCSI !

The windows disk is a SATA drive, seen as SCSI drive, so not working with hdparm.

----------

## NeddySeagoon

E001754,

Post your 

```
lspci 
```

output and your kernel .config file and I'll look them over. If you have some web space, put them on the web and post a link here. I need to know your kernel version too.

You kernel config file will be in /usr/src/linux/.config by default.

----------

## E001754

lspci

 *Quote:*   

> 
> 
> bash-2.05b# lspci
> 
> 0000:00:00.0 Host bridge: Intel Corp.: Unknown device 2570 (rev 02)
> ...

 

uname -r

 *Quote:*   

> 
> 
> 2.6.10-gentoo-r6
> 
> 

 

/usr/src/linux/.config

 *Quote:*   

> #
> 
> # Automatically generated make config: don't edit
> 
> # Linux kernel version: 2.6.10-gentoo-r6
> ...

 

Thank you very much for the time it takes you.

Cheers

----------

## NeddySeagoon

E001754,

I've put your config into make xconfig so I can scan it quite quickly.

The only  relevant strange thing I can see is that you have both the PATA and SATA drivers for the Intel PIIX configured. Take out the SATA one, since your CD/RW is ordinary IDE.

Under Processor type and features 

Generic x86 support should be off. It produces a kernel that will run on a 386 with the instruction ordering for a P4. 

/dev/cpu/*/msr - Model-specific register support should be on (not modules)  as it cam make graphics go faster.

Use register arguments (EXPERIMENTAL) can also be a speed up but it breaks some binary kernel modules. (but nVidia is OK now)

PCI device name database is no longer needed. Its replaced by the lspci comamand. Your kerenl gets smaller.

----------

## dsd

the problem is that the IDE controller in use is actually a combined SATA/PATA controller.

are the hard disks connected through that controller, or are they separate? (i see a SCSI adapter present too)

you'll need to enable CONFIG_BLK_DEV_IDE_SATA in order for the normal ATAPI piix driver to pick up the controller device (i guess it is currently falling back to generic IDE), but this might not be the desired effect.

alternatively you can edit the ata_piix driver to allow for ATAPI devices (its just one define, i think) but again this depends on how the hard disks are configured.

----------

## E001754

Thanks for all your answers. I will try compiling again the kernel taking care of the various options (I'm typing this post at work, i will try a soon as possible).

By reading your answers, I think I can give you more informations on my system :

I have a Ultra Wide SCSI Adaptec (AHA-2940UW) with 3 disks on it (1 for the Gentoo system, 2 other in RAID0).

I have a SATA hard drive for Windows XP, that I would like to be able to use from Linux (so, that's why I'm in combined mode to use both PATA and SATA)

The DVD and CD are PATA, connected as ide#3 and ide#4 in the BIOS. The SATA unit is seen by the BIOS as ide#1.

I can access all the units, except the fact that the DMA are not active on PATA units.

I will try various kernel configs (disabling SATA, trying the CONFIG_BLK_DEV_IDE_SATA), but, how can I :

set the CONFIG_BLK_DEV_IDE_SATA ?? (where is the option in the menuconfig ??)

What is exactly to type in the ata_piix driver to 'define' the ATAPI devices ?

I have also a strange behaviour : I have to wait 30 seconds in grub for the kernel to detect my 1st PATA device (i.e the device know under IDE#3). If I don't wait 30 seconds, the kernel doesn't detect /dev/hdc, but only the /dev/hdd.

Are both problems linked ? Again, i will do some tests with the kernel options you gave me.

NeddySeagon, thanks for the other tips on the kernel.

Cheers

Luc

----------

## NeddySeagoon

E001754,

 *Quote:*   

> CONFIG_BLK_DEV_IDE_SATA 

 is under ATA/ATAPI/MFM/RLL support, where it is called 

```
Support for SATA (deprecated; conflicts with libata SATA driver)
```

This will make your Windows SATA drive apperar as /dev/hda.

----------

## E001754

It worked !!!!   :Very Happy: 

Here are my hdparm settings :

 *Quote:*   

> /dev/hdc:
> 
>  HDIO_GET_MULTCOUNT failed: Invalid argument
> 
>  IO_support   =  1 (32-bit)
> ...

 

Thanks a lot, I wouldn't have found alone.

Cheers.

Luc.

----------

