2.4.31 - nforce chipset timer override bios bug workaround

From: Tymm Twillman
Date: Thu Jun 09 2005 - 17:40:06 EST


In the 2.4.30/31 kernels there is now a backport from the 2.6 kernels of a workaround for buggy timer overrides in the ACPI tables for many nvidia chipset based motherboards. Unfortunately the code for this on x86-64 based systems is conditionally compiled in only for non-SMP kernels. This is a patch to remove the conditional and allow the code to be compiled in for SMP kernels as well (we've seen a number of SMP motherboards which intermittently lock up during boot, and otherwise sometimes seem unstable without the workaround). Patch so far has been tested across numerous reboots and several hours uptime.

Also part of this patch is modifications to avoid referencing the variable "swiotlb" from pci-gart.c when CONFIG_SWIOTLB is not set; without modification, an x86_64 kernel without CONFIG_SWIOTLB set breaks during compilation of arch/x86_64/kernel/pci-gart.c.

All small changes & straightforward; don't think there's anything to worry about WRT enabling the override workaround code on SMP boxes, although I'd appreciate verification from someone more familiar with the setup code.

Thanks,

-Tymm diff -urN linux-2.4.31-vanilla/arch/x86_64/kernel/io_apic.c linux-2.4.31/arch/x86_64/kernel/io_apic.c
--- linux-2.4.31-vanilla/arch/x86_64/kernel/io_apic.c 2005-04-03 18:42:19.000000000 -0700
+++ linux-2.4.31/arch/x86_64/kernel/io_apic.c 2005-06-10 03:12:22.000000000 -0700
@@ -222,7 +222,6 @@

__setup("apic", ioapic_setup);

-#ifndef CONFIG_SMP
#include <asm/pci-direct.h>
#include <linux/pci_ids.h>
#include <linux/pci.h>
@@ -279,7 +278,6 @@
}
}
}
-#endif

static int __init ioapic_pirq_setup(char *str)
{
diff -urN linux-2.4.31-vanilla/arch/x86_64/kernel/pci-gart.c linux-2.4.31/arch/x86_64/kernel/pci-gart.c
--- linux-2.4.31-vanilla/arch/x86_64/kernel/pci-gart.c 2005-05-31 17:56:56.000000000 -0700
+++ linux-2.4.31/arch/x86_64/kernel/pci-gart.c 2005-06-10 04:45:54.000000000 -0700
@@ -155,7 +155,12 @@
int i;
unsigned long iommu_page;

+#ifdef CONFIG_SWIOTLB
if (hwdev == NULL || hwdev->dma_mask < 0xffffffff || (no_iommu && !swiotlb))
+#else
+ if (hwdev == NULL || hwdev->dma_mask < 0xffffffff || (no_iommu))
+
+#endif
gfp |= GFP_DMA;

/*
diff -urN linux-2.4.31-vanilla/arch/x86_64/kernel/setup.c linux-2.4.31/arch/x86_64/kernel/setup.c
--- linux-2.4.31-vanilla/arch/x86_64/kernel/setup.c 2005-04-03 18:42:19.000000000 -0700
+++ linux-2.4.31/arch/x86_64/kernel/setup.c 2005-06-10 04:57:36.000000000 -0700
@@ -51,8 +51,10 @@
int acpi_disabled;
EXPORT_SYMBOL(acpi_disabled);

+#ifdef CONFIG_SWIOTLB
int swiotlb;
EXPORT_SYMBOL(swiotlb);
+#endif

extern int phys_proc_id[NR_CPUS];

@@ -304,7 +306,7 @@
#endif

paging_init();
-#if !defined(CONFIG_SMP) && defined(CONFIG_X86_IO_APIC)
+#if defined(CONFIG_X86_IO_APIC)
extern void check_ioapic(void);
check_ioapic();
#endif