# PIIX4 chipset not initialized

## Ruslan

When I browse my log I notice that the PIIX4 chipset tunning does not get initialized due to resource conflicts. lspci -v shows the following:

```

00:1f.1 IDE interface: Intel Corp.: Unknown device 248a (rev 02) (prog-if 8a [Master SecP PriP])

        Subsystem: CLEVO/KAPOK Computer: Unknown device 5600

        Flags: bus master, medium devsel, latency 0, IRQ 5

        I/O ports at <unassigned> [size=8]

        I/O ports at <unassigned> [size=4]

        I/O ports at <unassigned> [size=8]

        I/O ports at <unassigned> [size=4]

        I/O ports at 1860 [size=16]

        Memory at 20000000 (32-bit, non-prefetchable) [disabled] [size=1K]

```

The default mode for hard drive is DMA off and I cannot change it (disk performance is only about 7.1Mb/s according to hdparm, compared to 21Mb/s when DMA is enabled).

Any ideas how to fix this?

----------

## Guest

man hdparm

----------

## Ruslan

As I said already I cannot change the mode using hdparm and reading docs for the 10s time doesn't change it a bit... I get the following message (as root):

```

hdparm -d1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

I presume that the reason for this is that the chipset tunning is not being initialized. So the main question would be how to correctly start it rather than how to tweak the drive.

----------

## Guest

did you compile support for it in the kernel, when you 

installed?  if you did not, I would recompile your kernel 

with the support installed.

----------

## Ruslan

Yes, PIIX chipset support and chipset tunning are compiled into kernel. During boot I receive the error message when kernel tries to initialize the chipset tunning part, the chipset by itself is working ok.

----------

## Hypnos

 *Ruslan wrote:*   

> Yes, PIIX chipset support and chipset tunning are compiled into kernel. During boot I receive the error message when kernel tries to initialize the chipset tunning part, the chipset by itself is working ok.

 

I just got a P4 laptop and am having the exact same problem.  Mind you, hard disk performance has been satisfactory with normal use because the cache is flying (~330MB/s), but sustained reads are limited to 5MB/s.

Have you had any more insights?  When I tried disabling the PIIX4 tuning in the kernel, it complains that the chip exists but that I haven't enabled the functionality.  Activating/deactivating low latency, preemptive scheduling and ACPI have had no effect.

----------

## Moon

I suppose that this is related: 

https://forums.gentoo.org/viewtopic.php?t=8495

----------

## Hypnos

 *Moon wrote:*   

> I suppose that this is related: 
> 
> https://forums.gentoo.org/viewtopic.php?t=8495

 

That's cute ... according to the patch, all that is required is the listing of the latest rendition of the chipset.  I'm doing the emerge everything part of my install now, and sustained hard disk speed shouldn't affect it either way, so I'll wait until it finishes before trying out the patch.  It's very small, so I should be able to do it by hand on my custom kernel ...

I'll report back when I do; I may not get to it until tomorrow night.

Thanks!

----------

## Amorphis

I hav the same problem. Fixed it by hacking the kernel and removing resource collision detection. Don't know how dangerous this is but at least it fixed the problem (i can see movies in xine now)

It seems some BIOS aren't doing the IDE resource allocation correctly.

If you want i can help you out.

----------

## Amorphis

Also take a look at this thread.

----------

## Hypnos

 *Amorphis wrote:*   

> I hav the same problem. Fixed it by hacking the kernel and removing resource collision detection. Don't know how dangerous this is but at least it fixed the problem (i can see movies in xine now)

 

Yeah, so the patch above didn't work; I had to do it by hand due to version conflicts, but no dice.

But this makes sense -- it's not like the kernel wasn't detecting the chipset, but rather that it couldn't do anything with it.  How does one eliminate resource collision checking?  Better yet, how does one get the conflicts resolved?

PS:  I think my hard disk is crawling in WinXP also!  Are there any "hdparm" like tools out there for Windows?

----------

## Amorphis

I commented that return statement on arch/i386/kernel/pci-i386.c

```
if (!r->start && r->end) {

   printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);

   //return -EINVAL;

}
```

Not sure if this is safe but DMA is working now.

----------

## gaplo

Why don't try the mjc-sources, it is based on kernel 2.4.19-pre10-ac3.

P.S. The lastest mjc-sources with kernel-2.4.19-rc1-ac3 won't complie the NTFS module.   :Confused: 

----------

## Hypnos

 *Amorphis wrote:*   

> I commented that return statement on arch/i386/kernel/pci-i386.c
> 
> ```
> if (!r->start && r->end) {
> 
> ...

 

Yes, this works well.  Sustained reads are up to 22MB/s, up from 2-5MB/s.  DVD/DivX playback from the DVD/CDRW drive is smooth.

I _think_ it's safe; from the dmesg output, it looks like the kernel is able to work around the resource collision without any problems.

----------

## Hypnos

I should add that Linux PCI resource allocation seems to be subpar.  Comparing the results from "lspci -v" with those from the "System Information" utility on XP, I find that WinXP distributes the devices across IRQs better, with no IRQ sharing.  Linux, by contrast, has the Radeon, IDE and USB all on IRQ 11.  Technically this is not a problem, but if a driver is not totally with it (like the PIIX driver) there will be trouble.

Now if I can get my modem working ...

----------

## godxzilla

ok guys, i was SOOOOO glad when I found this, because its been haunting me for a while now.  

however, being sort of a kernel newbie, id love to get more details on what you had to do, besides just commenting out that line.  re-compile? rebuild kernel?

im not usually a "please post steps" but in this case, it would help me immensly.

thanks in advance.

Mike

----------

## kode54

I'm not sure about your hardware, but a word of caution seems in order for PIIX tuning. The speed tuning code seems to be rather ...limited. Instead of actually querying the drive for its supported mode set, it just tries the fastest UDMA mode, then falls back on MWDMA, then PIO. I forget if it uses legacy DMA mode or not.

This is not good for my CDRW drive, because I've found it leaves it in an error state where it dumps an error during boot, then the system freezes if I try to mount it. Starting with tuning support not compiled in leaves the settings as the BIOS configured them. In my case, the one IDE hard drive on the interface is left in UDMA mode 2, and the CDRW stays in PIO mode, since the BIOS only seems to autodetect or configure UDMA modes. This leaves it running sanely until startup reaches my hdparm script, which sets the drive to mwdma2, creating and removing the device node in its absense. (ide-scsi removes the hdx node)

Here are the necessary menu steps, but I wouldn't advise running with the feature enabled if have any devices that aren't capable of UDMA and won't like it if the interface forces them to UDMA mode to see if they support it, like PIIX tuning does.

Anyway:

"ATA/IDE/MFM/RLL support" -->

"IDE, ATA and ATAPI Block devices" -->

"PIIXn Tuning support"

----------

## pilla

Work-around also needed in a Dell Dimension 4500 -- works.

 *Hypnos wrote:*   

>  *Amorphis wrote:*   I commented that return statement on arch/i386/kernel/pci-i386.c
> 
> ```
> if (!r->start && r->end) {
> 
> ...

 

----------

## johnio

The only way I could get it to work was to download the latest 2.4.20 prekernel. The latest one works fine for me.

None of the <=2.4.19 based kernels seem to work however.

----------

## BLASTER_

seams dumb but if its a resource conflict possably its conflicting with some of your other hardware.. might try pulling afew things out..

----------

## slikdigit

If you're using the clevo 5600 or a laptop based on it (alienware, prostar, etc.) check out these sites

http://cpbotha.net/clevo5600/clevo5600_linux/

and

http://w1.894.telia.com/~u89404340/best5650/laptop.html

I used the DMA patch on the second site along with the gentoo sources (also did the latest acpi patch ) and it worked like a charm.

----------

## clutch

I just wanted to add that with my ASUS P4PE, I can finally enable DMA on it using the gentoo-sources and Amorphis directions.  I was getting 3.8MB/s via hdparm, and now I get over 45MB/s.

 :Smile: 

----------

## Darth_Daver

I have an ASUS P4PE, and I was also getting these errors:

 *Quote:*   

> HDIO_SET_DMA failed: Operation not permitted 
> 
> 

 

when using hdparm and 

 *Quote:*   

> PCI: Device 00:1f.1 not available because of resource collisions 
> 
> 

 

on boot.  I upgraded to the Gentoo Sources 2.4.20-r1 kernel last night.  I still get the "resource collisions" message, but DMA now works.  I went from 3.2 MB/s to 47 MB/s.  No other fixes were required.

----------

## rmsds

 *Darth_Daver wrote:*   

> I have an ASUS P4PE, and I was also getting these errors:
> 
>  *Quote:*   HDIO_SET_DMA failed: Operation not permitted 
> 
>  
> ...

 

  You say you update to the Gentoo Sources, that's not exactly the gentoo-sources package, right? This is my first Gentoo installation and I'm still not familiar with the portage/emerge/etc... methods. "gentoo-sources" current version is 2.4.19-r10, right? What should I do to upgrade? If I download the kernel I won't have the patches installed, right?

                 Thank you advance for your help!

----------

## Darth_Daver

 *rmsds wrote:*   

> 
> 
>   You say you update to the Gentoo Sources, that's not exactly the gentoo-sources package, right? This is my first Gentoo installation and I'm still not familiar with the portage/emerge/etc... methods. "gentoo-sources" current version is 2.4.19-r10, right? What should I do to upgrade? If I download the kernel I won't have the patches installed, right?
> 
>                  Thank you advance for your help!

 

The latest "stable" version of the Gentoo kernel sources is 2.4.19-r10.  The Gentoo mirror servers have a newer version that is still "masked" as "unstable".  That just means it needs more testing before it is "certified" for general use.  That newest version is sys-kernel/gentoo-sources-2.4.20-r1.  It includes all of the standard Gentoo patches for performance improvements.  This kernel has performed very well for me so far.  It is fast and stable.  There is still that one error message, and my system does not power off when I run poweroff, but I have not taken a serious look at that yet.  To override the masked status, you can run the following command.

ACCEPT_KEYWORDS=~x86 emerge -p gentoo-sources

That should tell you that it would have installed the 2.4.20 kernel sources.  The "-p" means pretend.  If it lists the wrong kernel version, you can specify the one you want like so.

ACCEPT_KEYWORDS=~x86 emerge -p gentoo-sources-2.4.20-r1

Once you get the desired result, just remove the "-p" from the command to actually complete the installation.  You may then want to create a new symbolic link from /usr/src/linux to the /usr/src/linux-2.4.20-gentoo-r1 directory.  

rm /usr/src/linux

ln -s /usr/src/linux-2.4.20-gentoo-r1 /usr/src/linux

If you have other questions on compiling the kernel from this point, search the forums or refer to an appropriate howto.

I hope this has helped you.  Good luck, and have fun.

----------

## rmsds

Thanks for your help! 

After rebooting with 2.4.20 it automatically enabled DMA!   :Very Happy: 

I  went from 5 Mb/s to 30 Mb/s.

----------

