# NForce2 IDE lockups in 2.6?

## wildcard78

For people with NForce2 based systems, is anyone else having stability problems running 2.6.x (me, I'm running development-sources-2.6.3) with "AMD and NVidia IDE Support" enabled in the kernel? When I do, I get hard lockups mostly during the boot process. That means it just freezes - no ssh, no ping, no magic SysRq keys work to undo this -- only the power button. Right now, I have to make do with "Generic/Default IDE support," but that means no DMA and hdparm -d 1 won't work. 

If anyone else can at least confirm or deny having this problem, I would appreciate it!  Thanks in advance for any information you can share with me.

[So far, I've read that this was a problem in 2.6.0-test11 or so (thread: http://seclists.org/lists/linux-kernel/2003/Dec/0924.html), but I thought it would have been solved by now...]

----------

## pross

i got loads of lockups until recently...i now have all acpi/apm options turned OFF seems to work fro me anyway

----------

## malloc

The problem is not with the ide controller. It's an APIC (not ACPI) problem.

Either disble APIC completly or patch your kernel with 2 nforce2 patches (nforce2-apic.patch and nforce2-no-disconnect-quirk.patch) 

Search the forums and you'll find the links to them, sorry but i can't seem to remember where i got them.

----------

## wildcard78

It turns out that nforce2-apic.patch was already in 2.6.3, so all I had to do is patch in the nforce2-no-disconnect-quirk.patch and it looks like my system is more stable than it was last night.

Now, for a good test: emerge -u system   :Wink: 

Thanks again for your help.

----------

## warthog

 *wildcard78 wrote:*   

> For people with NForce2 based systems, is anyone else having stability problems running 2.6.x (me, I'm running development-sources-2.6.3) with "AMD and NVidia IDE Support" enabled in the kernel? <...>
> 
> 

 

Yes, I am having similar problems.  I've got the ASUS deluxe nForce2 MB. My first intro to the gentoo-dev-sources was 2.6.1, and I experienced random hard lockups periodically and most of my usb-peripherals stopped working (I'm trying to migrate from 2.4.22).  I upgraded to 2.6.3 recently, and now I can't get past the boot process.  It freezes at the nForce2 IDE messages.  I'm assuming I'll have to enable "Generic/Default IDE Support" to get it to boot, but I had read in another thread that this causes the instability that I was experiencing with 2.6.1, so that's why I didn't try it to begin with.

If I eventually figure it out, I'll post my solution.  Has anyone got a stable 2.6.x kernel running with their nForce2 based system   :Question:   I've been searching the forums for days...

----------

## pross

ive been using 2.6.x for ages now with no problems using the patches mentioned above...here is my ide section of .config

```

<*> ATA/ATAPI/MFM/RLL support                                                                                │ │

  │ │                                   <*>   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support                                                    │ │

  │ │                                   ---     Please see Documentation/ide.txt for help/info on IDE drives                                         │ │

  │ │                                   [ ]     Use old disk-only driver on primary interface                                                        │ │

  │ │                                   <*>     Include IDE/ATA-2 DISK support                                                                       │ │

  │ │                                   [*]       Use multi-mode by default                                                                          │ │

  │ │                                   [ ]       Auto-Geometry Resizing support                                                                     │ │

  │ │                                   <*>     Include IDE/ATAPI CDROM support                                                                      │ │

  │ │                                   < >     Include IDE/ATAPI TAPE support (EXPERIMENTAL)                                                        │ │

  │ │                                   < >     Include IDE/ATAPI FLOPPY support                                                                     │ │

  │ │                                   <*>     SCSI emulation support                                                                               │ │

  │ │                                   [ ]     IDE Taskfile Access                                                                                  │ │

  │ │                                   [*]     IDE Taskfile IO (EXPERIMENTAL)                                                                       │ │

  │ │                                   ---     IDE chipset support/bugfixes                                                                         │ │

  │ │                                   <*>     generic/default IDE chipset support                                                                  │ │

  │ │                                   [ ]     CMD640 chipset bugfix/support                                                                        │ │

  │ │                                   [ ]     PNP EIDE support                                                                                     │ │

  │ │                                   [*]     PCI IDE chipset support                                                                              │ │

  │ │                                   [*]       Sharing PCI IDE interrupts support                                                                 │ │

  │ │                                   [ ]       Boot off-board chipsets first support                                                              │ │

  │ │                                   [*]       Generic PCI IDE Chipset Support                                                                    │ │

  │ │                                   < >       OPTi 82C621 chipset enhanced support (EXPERIMENTAL)                                                │ │

  │ │                                   < >       RZ1000 chipset bugfix/support                                                                      │ │

  │ │                                   [*]       Generic PCI bus-master DMA support                                                                 │ │

  │ │                                   [ ]         Force enable legacy 2.0.X HOSTS to use DMA                                                       │ │

  │ │                                   [*]         Use PCI DMA by default when available                                                            │ │

  │ │                                   [ ]           Enable DMA only for disks                                                                      │ │

  │ │                                   < >         AEC62XX chipset support                                                                          │ │

  │ │                                   < >         ALI M15x3 chipset support                                                                        │ │

  │ │                                   <*>         AMD and nVidia IDE support                                                                       │ │

  │ │                                   < >         CMD64{3|6|8|9} chipset support                                                                   │ │

  │ │                                   < >         Compaq Triflex IDE support                                                                       │ │

  │ │                                   < >         CY82C693 chipset support                                                                         │ │

```

----------

## wildcard78

 *Quote:*   

> I upgraded to 2.6.3 recently, and now I can't get past the boot process. It freezes at the nForce2 IDE messages. I'm assuming I'll have to enable "Generic/Default IDE Support" to get it to boot, but I had read in another thread that this causes the instability that I was experiencing with 2.6.1, so that's why I didn't try it to begin with.
> 
> If I eventually figure it out, I'll post my solution. Has anyone got a stable 2.6.x kernel running with their nForce2 based system I've been searching the forums for days...

 

I found that it's not the Nforce2 IDE driver (because it still hard crashes even with the generic IDE support, although it takes longer for this to happen), but the NForce2 APIC. If you have 2.6.3, then all you need is the nforce2-disconnect-quirk.patch:

http://www.kernel.org/pub/linux/kernel/people/bart/2.6.0-test11-bart1/broken-out/nforce2-disconnect-quirk.patch

Just download it, go to /usr/src/linux, then do patch -p1 < /path/whereyousaved/nforce2-disconnect.patch and (re)compile your kernel as normal. You'll know it's working when you see the message "PCI: disabling nForce2 Halt Disconnect and Stop Grant Disconnect" in your syslog.

Once I did this, my system hasn't crashed since.

----------

## DooBeDooBeDo

Thanks wildcard  :Very Happy:  I'd been running with noapic and nolapic - however this patch fails to apply cleanly to 2.6.3-mm3 - so here's a patch which does  :Very Happy: 

```

--- ../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 }

 };

```

It looks like the structure has changed slightly since the orinal patch was made.

----------

## tactless

From my experience, it's usually the APIC. They still haven't fixed it... I've just disabled SMP (well, nForce2s only seem to do one CPU...), and it seems that all traces of APIC are gone. The remaining stability issues I attribute to the nVidia GeForce drivers (racer-bin makes the system lock up hard if I kill it violently).

Do I want APIC for any reason other than SMP?

----------

## cbradney

Keep up with lkml.. Ross Dicksons patches (mentioned above) do the job. I have perfect stability here for days and days and days on my A7N8X deluxe.

----------

## Tripnotik

Well, that patch saved my life  :Very Happy: 

I don't have any hang ups now that I used it on my 2.6.4-mm2 kernel ...

Thank you for mentionning it on this list, I was about to give up linux for a while since I never found a solution before this. 

Cheers, keep up the good work

----------

## mrhodes

Hi 

I tried to apply this patch on 2.6.5 mm-sources and it says that hunk#2 failed...

hunk one worked fine though, I guess...

Is this a problem?

----------

## cz-

mrhodes, they have changed the layout slighly, check out the patch by DooBeDooBeDo above.

----------

