From 82b9ce18bf060c94bc706d3782b226ac5dd0a4ec Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 12 May 2009 12:27:13 +0000 Subject: [PATCH] enable patch for 4Bg-ram laptops and cardbus addressing --- kernel-2.6.spec | 6 +- linux-2.6-710-avoid-64bits-addr-pcmcia.patch | 69 ++++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 linux-2.6-710-avoid-64bits-addr-pcmcia.patch diff --git a/kernel-2.6.spec b/kernel-2.6.spec index 66544b011..d6a5292e2 100644 --- a/kernel-2.6.spec +++ b/kernel-2.6.spec @@ -167,9 +167,10 @@ Patch580: linux-2.6-580-show-proc-virt.patch Patch640: linux-2.6-640-netlink-audit-hack.patch Patch650: linux-2.6-650-hangcheck-reboot.patch Patch660: linux-2.6-660-nmi-watchdog-default.patch -Patch680: linux-2.6-680-htb-hysteresis-tso.patch -Patch690: linux-2.6-690-web100.patch +# Patch680: linux-2.6-680-htb-hysteresis-tso.patch +# Patch690: linux-2.6-690-web100.patch Patch700: linux-2.6-700-egre.patch +Patch710: linux-2.6-710-avoid-64bits-addr-pcmcia.patch BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -358,6 +359,7 @@ KERNEL_PREVIOUS=vanilla %ApplyPatch 650 %ApplyPatch 660 %ApplyPatch 700 +%ApplyPatch 710 # NetNS conflict-resolving patch for VINI. Will work with patch vini_pl_patch-1 but may diff --git a/linux-2.6-710-avoid-64bits-addr-pcmcia.patch b/linux-2.6-710-avoid-64bits-addr-pcmcia.patch new file mode 100644 index 000000000..d51342693 --- /dev/null +++ b/linux-2.6-710-avoid-64bits-addr-pcmcia.patch @@ -0,0 +1,69 @@ +diff -Naur linux-source-2.6.29-orig/drivers/pci/bus.c linux-source-2.6.29/drivers/pci/bus.c +--- linux-source-2.6.29-orig/drivers/pci/bus.c 2009-03-24 00:12:14.000000000 +0100 ++++ linux-source-2.6.29/drivers/pci/bus.c 2009-04-06 11:04:41.000000000 +0200 +@@ -41,6 +41,7 @@ + void *alignf_data) + { + int i, ret = -ENOMEM; ++ resource_size_t max = -1; + + type_mask |= IORESOURCE_IO | IORESOURCE_MEM; + +@@ -59,10 +60,15 @@ + !(res->flags & IORESOURCE_PREFETCH)) + continue; + ++ /* Limit address to 32 bits when requested */ ++ if ((res->flags & IORESOURCE_MEM) && ++ (res->flags & IORESOURCE_PCI_32BIT)) ++ max = (u32) -1; ++ + /* Ok, try it out.. */ + ret = allocate_resource(r, res, size, + r->start ? : min, +- -1, align, ++ max, align, + alignf, alignf_data); + if (ret == 0) + break; +diff -Naur linux-source-2.6.29-orig/drivers/pci/setup-bus.c linux-source-2.6.29/drivers/pci/setup-bus.c +--- linux-source-2.6.29-orig/drivers/pci/setup-bus.c 2009-03-24 00:12:14.000000000 +0100 ++++ linux-source-2.6.29/drivers/pci/setup-bus.c 2009-04-06 11:04:41.000000000 +0200 +@@ -429,19 +429,23 @@ + * If we have prefetchable memory support, allocate + * two regions. Otherwise, allocate one region of + * twice the size. ++ * Avoid 64bit address space, as cardbus devices can't handle it. + */ + if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0) { + b_res[2].start = 0; + b_res[2].end = pci_cardbus_mem_size - 1; +- b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH | IORESOURCE_SIZEALIGN; ++ b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH | ++ IORESOURCE_SIZEALIGN | IORESOURCE_PCI_32BIT; + + b_res[3].start = 0; + b_res[3].end = pci_cardbus_mem_size - 1; +- b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN; ++ b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN | ++ IORESOURCE_PCI_32BIT; + } else { + b_res[3].start = 0; + b_res[3].end = pci_cardbus_mem_size * 2 - 1; +- b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN; ++ b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN | ++ IORESOURCE_PCI_32BIT; + } + } + +diff -Naur linux-source-2.6.29-orig/include/linux/ioport.h linux-source-2.6.29/include/linux/ioport.h +--- linux-source-2.6.29-orig/include/linux/ioport.h 2009-03-24 00:12:14.000000000 +0100 ++++ linux-source-2.6.29/include/linux/ioport.h 2009-04-06 11:04:41.000000000 +0200 +@@ -103,6 +103,7 @@ + + /* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ + #define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ ++#define IORESOURCE_PCI_32BIT (1<<5) /* Do not use 64bit address space (for cardbus devices) */ + + /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ + extern struct resource ioport_resource; -- 2.47.0