Using SATA in Asus A7N8X motherboard

There is a problem with the nForce2 chipset on the motherboard that prevents the SiI3112 SATA controller from working with Linux out of the box. The symptom is that the computer locks up during disk access (usually heavy disk access).

The problem is fixed in kernel version 2.6.6.

To fix this, apply this patch to the kernel:

--- ../linux-2.6.3-mm2/arch/i386/pci/fixup.c    2004-02-20 18:01:06.000000000 +0000
+++ arch/i386/pci/fixup.c       2004-02-25 21:10:41.000000000 +0000
@@ -187,6 +187,22 @@ static void __devinit pci_fixup_transpar
                dev->transparent = 1;
 }

+/*
+ * Halt Disconnect and Stop Grant Disconnect (bit 4 at offset 0x6F)
+ * must be disabled when APIC is used (or lockups will happen).
+ */
+static void __devinit pci_fixup_nforce2_disconnect(struct pci_dev *d)
+{
+       u8 t;
+
+       pci_read_config_byte(d, 0x6F, &t);
+       if (t & 0x10) {
+               printk(KERN_INFO "PCI: disabling nForce2 Halt Disconnect"
+                                " and Stop Grant Disconnect\n");
+               pci_write_config_byte(d, 0x6F, (t & 0xef));
+       }
+}
+
 struct pci_fixup pcibios_fixups[] = {
        {
                .pass           = PCI_FIXUP_HEADER,
@@ -290,5 +306,11 @@ struct pci_fixup pcibios_fixups[] = {
                .device         = PCI_ANY_ID,
                .hook           = pci_fixup_transparent_bridge
        },
+       {
+               .pass           = PCI_FIXUP_HEADER,
+               .vendor         = PCI_VENDOR_ID_NVIDIA,
+               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE2,
+               .hook           = pci_fixup_nforce2_disconnect
+       },
        { .pass = 0 }
 };

I am currently using the patch with a stock 2.6.5 kernel and it appears to work.