]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.27 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Sun, 8 Feb 2009 20:40:14 +0000 (12:40 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 8 Feb 2009 20:40:14 +0000 (12:40 -0800)
17 files changed:
queue-2.6.27/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch [new file with mode: 0644]
queue-2.6.27/acpi-enable-bit-11-in-_pdc-to-advertise-hw-coord.patch [new file with mode: 0644]
queue-2.6.27/agp-intel-add-support-for-g41-chipset.patch [new file with mode: 0644]
queue-2.6.27/agp-intel-fix-broken-symbol-in-device-name.patch [new file with mode: 0644]
queue-2.6.27/agp-intel-reduce-extraneous-pci-posting-reads-during-init.patch [new file with mode: 0644]
queue-2.6.27/e1000-fix-bug-with-shared-interrupt-during-reset.patch [new file with mode: 0644]
queue-2.6.27/e1000-fix-pci-enable-to-honor-the-need_ioport-flag.patch [new file with mode: 0644]
queue-2.6.27/eeepc-laptop-fix-oops-when-changing-backlight-brightness-during-eeepc-laptop-init.patch [new file with mode: 0644]
queue-2.6.27/md-ensure-an-md-array-never-has-too-many-devices.patch [new file with mode: 0644]
queue-2.6.27/module-remove-over-zealous-check-in-__module_get.patch [new file with mode: 0644]
queue-2.6.27/prevent-kprobes-from-catching-spurious-page-faults.patch [new file with mode: 0644]
queue-2.6.27/series [new file with mode: 0644]
queue-2.6.27/sgi-xp-fix-writing-past-the-end-of-kzalloc-d-space.patch [new file with mode: 0644]
queue-2.6.27/shm-fix-shmctl-lockup-with-config_shmem.patch [new file with mode: 0644]
queue-2.6.27/sound-usb-audio-handle-wmaxpacketsize-for-fixed_endpoint-devices.patch [new file with mode: 0644]
queue-2.6.27/wait-prevent-exclusive-waiter-starvation.patch [new file with mode: 0644]
queue-2.6.27/x86-apic-enable-workaround-on-amd-fam10h-cpus.patch [new file with mode: 0644]

diff --git a/queue-2.6.27/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch b/queue-2.6.27/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch
new file mode 100644 (file)
index 0000000..2f72acb
--- /dev/null
@@ -0,0 +1,47 @@
+From fc5a9f8841ee87d93376ada5d73117d4d6a373ea Mon Sep 17 00:00:00 2001
+From: Holger Macht <hmacht@suse.de>
+Date: Tue, 20 Jan 2009 12:18:24 +0100
+Subject: ACPI: dock: Don't eval _STA on every show_docked sysfs read
+
+From: Holger Macht <hmacht@suse.de>
+
+commit fc5a9f8841ee87d93376ada5d73117d4d6a373ea upstream.
+
+Some devices trigger a DEVICE_CHECK on every evalutation of _STA. This
+can also be seen in commit 8b59560a3baf2e7c24e0fb92ea5d09eca92805db
+(ACPI: dock: avoid check _STA method).  If an undock is processed, the
+dock driver sends a uevent and userspace might read the show_docked
+property in sysfs. This causes an evaluation of _STA of the particular
+device which causes the dock driver to immediately dock again.
+
+In any case, evaluation of _STA (show_docked) does not necessarily mean
+that we are docked, so check with the internal device structure.
+
+http://bugzilla.kernel.org/show_bug.cgi?id=12360
+
+Signed-off-by: Holger Macht <hmacht@suse.de>
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/acpi/dock.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/acpi/dock.c
++++ b/drivers/acpi/dock.c
+@@ -691,8 +691,14 @@ fdd_out:
+ static ssize_t show_docked(struct device *dev,
+                          struct device_attribute *attr, char *buf)
+ {
+-      return snprintf(buf, PAGE_SIZE, "%d\n", dock_present(dock_station));
++      struct acpi_device *tmp;
++      struct dock_station *dock_station = *((struct dock_station **)
++              dev->platform_data);
++
++      if (ACPI_SUCCESS(acpi_bus_get_device(dock_station->handle, &tmp)))
++              return snprintf(buf, PAGE_SIZE, "1\n");
++      return snprintf(buf, PAGE_SIZE, "0\n");
+ }
+ static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
diff --git a/queue-2.6.27/acpi-enable-bit-11-in-_pdc-to-advertise-hw-coord.patch b/queue-2.6.27/acpi-enable-bit-11-in-_pdc-to-advertise-hw-coord.patch
new file mode 100644 (file)
index 0000000..2589cda
--- /dev/null
@@ -0,0 +1,44 @@
+From d96f94c604453f87fe24154b87e1e9a3a72511f8 Mon Sep 17 00:00:00 2001
+From: Pallipadi, Venkatesh <venkatesh.pallipadi@intel.com>
+Date: Mon, 2 Feb 2009 11:57:18 -0800
+Subject: ACPI: Enable bit 11 in _PDC to advertise hw coord
+
+From: Pallipadi, Venkatesh <venkatesh.pallipadi@intel.com>
+
+commit d96f94c604453f87fe24154b87e1e9a3a72511f8 upstream.
+
+Bit 11 in intel PDC definitions is meant for OS capability to handle
+hardware coordination of P-states. In Linux we have always supported
+hwardware coordination of P-states. Just let the BIOSes know that we
+support it, by setting this bit.
+
+Some BIOSes use this bit to choose between hardware or software coordination
+and without this change below, BIOSes switch to software coordination, which
+is not very optimal in terms of power consumption and extra wakeups from idle.
+
+Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/acpi/pdc_intel.h |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/include/acpi/pdc_intel.h
++++ b/include/acpi/pdc_intel.h
+@@ -14,6 +14,7 @@
+ #define ACPI_PDC_SMP_T_SWCOORD                (0x0080)
+ #define ACPI_PDC_C_C1_FFH             (0x0100)
+ #define ACPI_PDC_C_C2C3_FFH           (0x0200)
++#define ACPI_PDC_SMP_P_HWCOORD                (0x0800)
+ #define ACPI_PDC_EST_CAPABILITY_SMP   (ACPI_PDC_SMP_C1PT | \
+                                        ACPI_PDC_C_C1_HALT | \
+@@ -22,6 +23,7 @@
+ #define ACPI_PDC_EST_CAPABILITY_SWSMP (ACPI_PDC_SMP_C1PT | \
+                                        ACPI_PDC_C_C1_HALT | \
+                                        ACPI_PDC_SMP_P_SWCOORD | \
++                                       ACPI_PDC_SMP_P_HWCOORD | \
+                                        ACPI_PDC_P_FFH)
+ #define ACPI_PDC_C_CAPABILITY_SMP     (ACPI_PDC_SMP_C2C3  | \
diff --git a/queue-2.6.27/agp-intel-add-support-for-g41-chipset.patch b/queue-2.6.27/agp-intel-add-support-for-g41-chipset.patch
new file mode 100644 (file)
index 0000000..72f713c
--- /dev/null
@@ -0,0 +1,64 @@
+From a50ccc6c6623ab0e64f2109881e07c176b2d876f Mon Sep 17 00:00:00 2001
+From: Zhenyu Wang <zhenyu.z.wang@intel.com>
+Date: Mon, 17 Nov 2008 14:39:00 +0800
+Subject: agp/intel: add support for G41 chipset
+
+From: Zhenyu Wang <zhenyu.z.wang@intel.com>
+
+commit a50ccc6c6623ab0e64f2109881e07c176b2d876f upstream.
+
+Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
+Signed-off-by: Eric Anholt <eric@anholt.net>
+Signed-off-by: Dave Airlie <airlied@linux.ie>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/agp/intel-agp.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/char/agp/intel-agp.c
++++ b/drivers/char/agp/intel-agp.c
+@@ -40,6 +40,8 @@
+ #define PCI_DEVICE_ID_INTEL_Q45_IG          0x2E12
+ #define PCI_DEVICE_ID_INTEL_G45_HB          0x2E20
+ #define PCI_DEVICE_ID_INTEL_G45_IG          0x2E22
++#define PCI_DEVICE_ID_INTEL_G41_HB          0x2E30
++#define PCI_DEVICE_ID_INTEL_G41_IG          0x2E32
+ /* cover 915 and 945 variants */
+ #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \
+@@ -63,7 +65,8 @@
+ #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGD_E_HB || \
+               agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \
+               agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \
+-              agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB)
++              agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \
++              agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G41_HB)
+ extern int agp_memory_reserved;
+@@ -1196,6 +1199,7 @@ static void intel_i965_get_gtt_range(int
+       case PCI_DEVICE_ID_INTEL_IGD_E_HB:
+       case PCI_DEVICE_ID_INTEL_Q45_HB:
+       case PCI_DEVICE_ID_INTEL_G45_HB:
++      case PCI_DEVICE_ID_INTEL_G41_HB:
+               *gtt_offset = *gtt_size = MB(2);
+               break;
+       default:
+@@ -2135,6 +2139,8 @@ static const struct intel_driver_descrip
+           "Q45/Q43", NULL, &intel_i965_driver },
+       { PCI_DEVICE_ID_INTEL_G45_HB, PCI_DEVICE_ID_INTEL_G45_IG, 0,
+           "G45/G43", NULL, &intel_i965_driver },
++      { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, 0,
++          "G41", NULL, &intel_i965_driver },
+       { 0, 0, 0, NULL, NULL, NULL }
+ };
+@@ -2332,6 +2338,7 @@ static struct pci_device_id agp_intel_pc
+       ID(PCI_DEVICE_ID_INTEL_IGD_E_HB),
+       ID(PCI_DEVICE_ID_INTEL_Q45_HB),
+       ID(PCI_DEVICE_ID_INTEL_G45_HB),
++      ID(PCI_DEVICE_ID_INTEL_G41_HB),
+       { }
+ };
diff --git a/queue-2.6.27/agp-intel-fix-broken-symbol-in-device-name.patch b/queue-2.6.27/agp-intel-fix-broken-symbol-in-device-name.patch
new file mode 100644 (file)
index 0000000..8f5ed54
--- /dev/null
@@ -0,0 +1,31 @@
+From b854b2ab959e8175d75e01cf8ed452ed2624d0c8 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric@anholt.net>
+Date: Mon, 22 Dec 2008 18:56:27 -0800
+Subject: agp/intel: Fix broken ® symbol in device name.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+From: Eric Anholt <eric@anholt.net>
+
+commit b854b2ab959e8175d75e01cf8ed452ed2624d0c8 upstream.
+
+Signed-off-by: Eric Anholt <eric@anholt.net>
+Signed-off-by: Dave Airlie <airlied@linux.ie>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/agp/intel-agp.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/char/agp/intel-agp.c
++++ b/drivers/char/agp/intel-agp.c
+@@ -2132,7 +2132,7 @@ static const struct intel_driver_descrip
+       { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33",
+               NULL, &intel_g33_driver },
+       { PCI_DEVICE_ID_INTEL_GM45_HB, PCI_DEVICE_ID_INTEL_GM45_IG, 0,
+-          "Mobile Intel? GM45 Express", NULL, &intel_i965_driver },
++          "Mobile Intel® GM45 Express", NULL, &intel_i965_driver },
+       { PCI_DEVICE_ID_INTEL_IGD_E_HB, PCI_DEVICE_ID_INTEL_IGD_E_IG, 0,
+           "Intel Integrated Graphics Device", NULL, &intel_i965_driver },
+       { PCI_DEVICE_ID_INTEL_Q45_HB, PCI_DEVICE_ID_INTEL_Q45_IG, 0,
diff --git a/queue-2.6.27/agp-intel-reduce-extraneous-pci-posting-reads-during-init.patch b/queue-2.6.27/agp-intel-reduce-extraneous-pci-posting-reads-during-init.patch
new file mode 100644 (file)
index 0000000..bcd31d8
--- /dev/null
@@ -0,0 +1,54 @@
+From 44d494417278e49f5b42bd3ded1801b6d2254db8 Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp@keithp.com>
+Date: Tue, 14 Oct 2008 17:18:45 -0700
+Subject: agp/intel: Reduce extraneous PCI posting reads during init
+
+From: Keith Packard <keithp@keithp.com>
+
+commit 44d494417278e49f5b42bd3ded1801b6d2254db8 upstream.
+
+Instead of doing a posting read after each GTT entry update, do a single one
+at the end of the writes. This should reduce boot time a tiny amount by
+avoiding a lot of extra uncached reads.
+
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Signed-off-by: Eric Anholt <eric@anholt.net>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/agp/intel-agp.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/char/agp/intel-agp.c
++++ b/drivers/char/agp/intel-agp.c
+@@ -217,8 +217,8 @@ static int intel_i810_configure(void)
+       if (agp_bridge->driver->needs_scratch_page) {
+               for (i = 0; i < current_size->num_entries; i++) {
+                       writel(agp_bridge->scratch_page, intel_private.registers+I810_PTE_BASE+(i*4));
+-                      readl(intel_private.registers+I810_PTE_BASE+(i*4));     /* PCI posting. */
+               }
++              readl(intel_private.registers+I810_PTE_BASE+((i-1)*4)); /* PCI posting. */
+       }
+       global_cache_flush();
+       return 0;
+@@ -778,8 +778,8 @@ static int intel_i830_configure(void)
+       if (agp_bridge->driver->needs_scratch_page) {
+               for (i = intel_private.gtt_entries; i < current_size->num_entries; i++) {
+                       writel(agp_bridge->scratch_page, intel_private.registers+I810_PTE_BASE+(i*4));
+-                      readl(intel_private.registers+I810_PTE_BASE+(i*4));     /* PCI Posting. */
+               }
++              readl(intel_private.registers+I810_PTE_BASE+((i-1)*4)); /* PCI Posting. */
+       }
+       global_cache_flush();
+@@ -994,8 +994,8 @@ static int intel_i915_configure(void)
+       if (agp_bridge->driver->needs_scratch_page) {
+               for (i = intel_private.gtt_entries; i < current_size->num_entries; i++) {
+                       writel(agp_bridge->scratch_page, intel_private.gtt+i);
+-                      readl(intel_private.gtt+i);     /* PCI Posting. */
+               }
++              readl(intel_private.gtt+i-1);   /* PCI Posting. */
+       }
+       global_cache_flush();
diff --git a/queue-2.6.27/e1000-fix-bug-with-shared-interrupt-during-reset.patch b/queue-2.6.27/e1000-fix-bug-with-shared-interrupt-during-reset.patch
new file mode 100644 (file)
index 0000000..bdfe441
--- /dev/null
@@ -0,0 +1,44 @@
+From 15b2bee22a0390d951301b53e83df88d0350c499 Mon Sep 17 00:00:00 2001
+From: Jesse Brandeburg <jesse.brandeburg@intel.com>
+Date: Tue, 27 Jan 2009 16:41:58 -0800
+Subject: e1000: fix bug with shared interrupt during reset
+
+From: Jesse Brandeburg <jesse.brandeburg@intel.com>
+
+commit 15b2bee22a0390d951301b53e83df88d0350c499 upstream.
+
+A nasty bug was found where an MTU change (or anything else that caused a
+reset) could race with the interrupt code.  The interrupt code was entered
+by a shared interrupt during the MTU change.
+
+This change prevents the interrupt code from running while the driver is in
+the middle of its reset path.
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/e1000/e1000_main.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/e1000/e1000_main.c
++++ b/drivers/net/e1000/e1000_main.c
+@@ -31,7 +31,7 @@
+ char e1000_driver_name[] = "e1000";
+ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
+-#define DRV_VERSION "7.3.20-k3-NAPI"
++#define DRV_VERSION "7.3.21-k3-NAPI"
+ const char e1000_driver_version[] = DRV_VERSION;
+ static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
+@@ -3835,7 +3835,7 @@ static irqreturn_t e1000_intr(int irq, v
+       struct e1000_hw *hw = &adapter->hw;
+       u32 rctl, icr = er32(ICR);
+-      if (unlikely(!icr))
++      if (unlikely((!icr) || test_bit(__E1000_RESETTING, &adapter->flags)))
+               return IRQ_NONE;  /* Not our interrupt */
+       /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
diff --git a/queue-2.6.27/e1000-fix-pci-enable-to-honor-the-need_ioport-flag.patch b/queue-2.6.27/e1000-fix-pci-enable-to-honor-the-need_ioport-flag.patch
new file mode 100644 (file)
index 0000000..64d8a20
--- /dev/null
@@ -0,0 +1,32 @@
+From 4d7155b932b8129c72e2f2714890e20b2a05e0b7 Mon Sep 17 00:00:00 2001
+From: Karsten Keil <kkeil@suse.de>
+Date: Tue, 3 Feb 2009 15:18:01 -0800
+Subject: e1000: Fix PCI enable to honor the need_ioport flag
+
+From: Karsten Keil <kkeil@suse.de>
+
+commit 4d7155b932b8129c72e2f2714890e20b2a05e0b7 upstream.
+
+On machine were no IO ports are assigned the call
+to pci_enable_device() will fail, even if need_ioport
+is false, we need to use pci_enable_device_mem() here.
+
+Signed-off-by: Karsten Keil <kkeil@suse.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/e1000/e1000_main.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/e1000/e1000_main.c
++++ b/drivers/net/e1000/e1000_main.c
+@@ -927,7 +927,7 @@ static int __devinit e1000_probe(struct 
+               err = pci_enable_device(pdev);
+       } else {
+               bars = pci_select_bars(pdev, IORESOURCE_MEM);
+-              err = pci_enable_device(pdev);
++              err = pci_enable_device_mem(pdev);
+       }
+       if (err)
+               return err;
diff --git a/queue-2.6.27/eeepc-laptop-fix-oops-when-changing-backlight-brightness-during-eeepc-laptop-init.patch b/queue-2.6.27/eeepc-laptop-fix-oops-when-changing-backlight-brightness-during-eeepc-laptop-init.patch
new file mode 100644 (file)
index 0000000..576c2c0
--- /dev/null
@@ -0,0 +1,65 @@
+From 7695fb04aca62e2d8a7ca6ede50f6211e1d71e53 Mon Sep 17 00:00:00 2001
+From: Darren Salt <linux@youmustbejoking.demon.co.uk>
+Date: Sat, 7 Feb 2009 01:02:07 -0500
+Subject: eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init
+
+From: Darren Salt <linux@youmustbejoking.demon.co.uk>
+
+commit 7695fb04aca62e2d8a7ca6ede50f6211e1d71e53 upstream.
+
+I got the following oops while changing the backlight brightness during
+startup.  When it happens, it prevents use of the hotkeys, Fn-Fx, and the
+lid button.
+
+It's a clear use-before-init, as I verified by testing with an
+appropriately-placed "else printk".
+
+BUG: unable to handle kernel NULL pointer dereference at 00000000
+*pde = 00000000
+Oops: 0002 [#1] PREEMPT SMP
+Pid: 160, comm: kacpi_notify Not tainted (2.6.28.1-eee901 #4) 901
+EIP: 0060:[<c0264e68>]  [<c0264e68>] eeepc_hotk_notify+26/da
+EFLAGS: 00010246 CPU: 1
+Using defaults from ksymoops -t elf32-i386 -a i386
+EAX: 00000009 EBX: 00000000 ECX: 00000009 EDX: f70dbf64
+ESI: 00000029 EDI: f7335188 EBP: c02112c9 ESP: f70dbf80
+ DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
+ f70731e0 f73acd50 c02164ac f7335180 f70aa040 c02112e6 f733518c c012b62f
+ f70aa044 f70aa040 c012bdba f70aa04c 00000000 c012be6e 00000000 f70bdf80
+ c012e198 f70dbfc4 f70dbfc4 f70aa040 c012bdba 00000000 c012e0c9 c012e091
+Call Trace:
+ [<c02164ac>] ? acpi_ev_notify_dispatch+4c/55
+ [<c02112e6>] ? acpi_os_execute_deferred+1d/25
+ [<c012b62f>] ? run_workqueue+71/f1
+ [<c012bdba>] ? worker_thread+0/bf
+ [<c012be6e>] ? worker_thread+b4/bf
+ [<c012e198>] ? autoremove_wake_function+0/2b
+ [<c012bdba>] ? worker_thread+0/bf
+ [<c012e0c9>] ? kthread+38/5f
+ [<c012e091>] ? kthread+0/5f
+ [<c0103abf>] ? kernel_thread_helper+7/10
+Code: 00 00 00 00 c3 83 3d 60 5c 50 c0 00 56 89 d6 53 0f 84 c4 00 00 00 8d 42
+e0 83 f8 0f 77 0f 8b 1d 68 5c 50 c0 89 d8 e8 a9 fa ff ff <89> 03 8b 1d 60 5c
+50 c0 89 f2 83 e2 7f 0f b7 4c 53 10 8d 41 01
+
+Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/misc/eeepc-laptop.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/misc/eeepc-laptop.c
++++ b/drivers/misc/eeepc-laptop.c
+@@ -381,7 +381,8 @@ static void notify_wlan(u32 *event)
+ static void notify_brn(void)
+ {
+       struct backlight_device *bd = eeepc_backlight_device;
+-      bd->props.brightness = read_brightness(bd);
++      if (bd)
++              bd->props.brightness = read_brightness(bd);
+ }
+ static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
diff --git a/queue-2.6.27/md-ensure-an-md-array-never-has-too-many-devices.patch b/queue-2.6.27/md-ensure-an-md-array-never-has-too-many-devices.patch
new file mode 100644 (file)
index 0000000..0781cd3
--- /dev/null
@@ -0,0 +1,88 @@
+From de01dfadf25bf83cfe3d85c163005c4320532658 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Fri, 6 Feb 2009 18:02:46 +1100
+Subject: md: Ensure an md array never has too many devices.
+
+From: NeilBrown <neilb@suse.de>
+
+commit de01dfadf25bf83cfe3d85c163005c4320532658 upstream.
+
+Each different metadata format supported by md supports a
+different maximum number of devices.
+We really should be enforcing this maximum in the kernel, but
+we aren't quite doing that properly.
+
+We currently only enforce it at the 'hot_add' point, which is an
+older interface which is not used by current userspace.
+
+We need to also enforce it at 'add_new_disk' time for active arrays
+and at 'do_md_run' time when starting a new array.
+
+So move the test from 'hot_add' into 'bind_rdev_to_array' which is
+called from both 'hot_add' and 'add_new_disk, and add a new
+test in 'analyse_sbs' which is called from 'do_md_run'.
+
+This bug (or missing feature) has been around "forever" and so
+the patch is suitable for any -stable that is currently maintained.
+
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/md/md.c |   24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+--- a/drivers/md/md.c
++++ b/drivers/md/md.c
+@@ -1454,6 +1454,11 @@ static int bind_rdev_to_array(mdk_rdev_t
+               if (find_rdev_nr(mddev, rdev->desc_nr))
+                       return -EBUSY;
+       }
++      if (mddev->max_disks && rdev->desc_nr >= mddev->max_disks) {
++              printk(KERN_WARNING "md: %s: array is limited to %d devices\n",
++                     mdname(mddev), mddev->max_disks);
++              return -EBUSY;
++      }
+       bdevname(rdev->bdev,b);
+       while ( (s=strchr(b, '/')) != NULL)
+               *s = '!';
+@@ -2362,6 +2367,15 @@ static void analyze_sbs(mddev_t * mddev)
+       i = 0;
+       rdev_for_each(rdev, tmp, mddev) {
++              if (rdev->desc_nr >= mddev->max_disks ||
++                  i > mddev->max_disks) {
++                      printk(KERN_WARNING
++                             "md: %s: %s: only %d devices permitted\n",
++                             mdname(mddev), bdevname(rdev->bdev, b),
++                             mddev->max_disks);
++                      kick_rdev_from_array(rdev);
++                      continue;
++              }
+               if (rdev != freshest)
+                       if (super_types[mddev->major_version].
+                           validate_super(mddev, rdev)) {
+@@ -4450,13 +4464,6 @@ static int hot_add_disk(mddev_t * mddev,
+        * noticed in interrupt contexts ...
+        */
+-      if (rdev->desc_nr == mddev->max_disks) {
+-              printk(KERN_WARNING "%s: can not hot-add to full array!\n",
+-                      mdname(mddev));
+-              err = -EBUSY;
+-              goto abort_unbind_export;
+-      }
+-
+       rdev->raid_disk = -1;
+       md_update_sb(mddev, 1);
+@@ -4470,9 +4477,6 @@ static int hot_add_disk(mddev_t * mddev,
+       md_new_event(mddev);
+       return 0;
+-abort_unbind_export:
+-      unbind_rdev_from_array(rdev);
+-
+ abort_export:
+       export_rdev(rdev);
+       return err;
diff --git a/queue-2.6.27/module-remove-over-zealous-check-in-__module_get.patch b/queue-2.6.27/module-remove-over-zealous-check-in-__module_get.patch
new file mode 100644 (file)
index 0000000..b3c410c
--- /dev/null
@@ -0,0 +1,37 @@
+From 7f9a50a5b89b87f8e754f59ae9968da28be618a5 Mon Sep 17 00:00:00 2001
+From: Rusty Russell <rusty@rustcorp.com.au>
+Date: Sat, 7 Feb 2009 18:15:56 +1030
+Subject: module: remove over-zealous check in __module_get()
+
+From: Rusty Russell <rusty@rustcorp.com.au>
+
+commit 7f9a50a5b89b87f8e754f59ae9968da28be618a5 upstream.
+
+Impact: fix spurious BUG_ON() triggered under load
+
+module_refcount() isn't reliable outside stop_machine(), as demonstrated
+by Karsten Keil <kkeil@suse.de>, networking can trigger it under load
+(an inc on one cpu and dec on another while module_refcount() is tallying
+ can give false results, for example).
+
+Almost noone should be using __module_get, but that's another issue.
+
+Cc: Karsten Keil <kkeil@suse.de>
+Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/linux/module.h |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/include/linux/module.h
++++ b/include/linux/module.h
+@@ -387,7 +387,6 @@ void symbol_put_addr(void *addr);
+ static inline void __module_get(struct module *module)
+ {
+       if (module) {
+-              BUG_ON(module_refcount(module) == 0);
+               local_inc(&module->ref[get_cpu()].count);
+               put_cpu();
+       }
diff --git a/queue-2.6.27/prevent-kprobes-from-catching-spurious-page-faults.patch b/queue-2.6.27/prevent-kprobes-from-catching-spurious-page-faults.patch
new file mode 100644 (file)
index 0000000..a1a953f
--- /dev/null
@@ -0,0 +1,51 @@
+From 9be260a646bf76fa418ee519afa10196b3164681 Mon Sep 17 00:00:00 2001
+From: Masami Hiramatsu <mhiramat@redhat.com>
+Date: Thu, 5 Feb 2009 17:12:39 -0500
+Subject: prevent kprobes from catching spurious page faults
+
+From: Masami Hiramatsu <mhiramat@redhat.com>
+
+commit 9be260a646bf76fa418ee519afa10196b3164681 upstream.
+
+Prevent kprobes from catching spurious faults which will cause infinite
+recursive page-fault and memory corruption by stack overflow.
+
+Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/mm/fault.c |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/mm/fault.c
++++ b/arch/x86/mm/fault.c
+@@ -607,8 +607,6 @@ void __kprobes do_page_fault(struct pt_r
+       si_code = SEGV_MAPERR;
+-      if (notify_page_fault(regs))
+-              return;
+       if (unlikely(kmmio_fault(regs, address)))
+               return;
+@@ -638,6 +636,9 @@ void __kprobes do_page_fault(struct pt_r
+               if (spurious_fault(address, error_code))
+                       return;
++              /* kprobes don't want to hook the spurious faults. */
++              if (notify_page_fault(regs))
++                      return;
+               /*
+                * Don't take the mm semaphore here. If we fixup a prefetch
+                * fault we could otherwise deadlock.
+@@ -645,6 +646,9 @@ void __kprobes do_page_fault(struct pt_r
+               goto bad_area_nosemaphore;
+       }
++      /* kprobes don't want to hook the spurious faults. */
++      if (notify_page_fault(regs))
++              return;
+ #ifdef CONFIG_X86_32
+       /* It's safe to allow irq's after cr2 has been saved and the vmalloc
diff --git a/queue-2.6.27/series b/queue-2.6.27/series
new file mode 100644 (file)
index 0000000..e762970
--- /dev/null
@@ -0,0 +1,16 @@
+acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch
+acpi-enable-bit-11-in-_pdc-to-advertise-hw-coord.patch
+agp-intel-add-support-for-g41-chipset.patch
+agp-intel-fix-broken-symbol-in-device-name.patch
+agp-intel-reduce-extraneous-pci-posting-reads-during-init.patch
+e1000-fix-bug-with-shared-interrupt-during-reset.patch
+e1000-fix-pci-enable-to-honor-the-need_ioport-flag.patch
+eeepc-laptop-fix-oops-when-changing-backlight-brightness-during-eeepc-laptop-init.patch
+md-ensure-an-md-array-never-has-too-many-devices.patch
+module-remove-over-zealous-check-in-__module_get.patch
+prevent-kprobes-from-catching-spurious-page-faults.patch
+sgi-xp-fix-writing-past-the-end-of-kzalloc-d-space.patch
+shm-fix-shmctl-lockup-with-config_shmem.patch
+sound-usb-audio-handle-wmaxpacketsize-for-fixed_endpoint-devices.patch
+wait-prevent-exclusive-waiter-starvation.patch
+x86-apic-enable-workaround-on-amd-fam10h-cpus.patch
diff --git a/queue-2.6.27/sgi-xp-fix-writing-past-the-end-of-kzalloc-d-space.patch b/queue-2.6.27/sgi-xp-fix-writing-past-the-end-of-kzalloc-d-space.patch
new file mode 100644 (file)
index 0000000..e735827
--- /dev/null
@@ -0,0 +1,79 @@
+From 361916a943cd9dbda1c0b00879d0225cc919d868 Mon Sep 17 00:00:00 2001
+From: Dean Nelson <dcn@sgi.com>
+Date: Wed, 4 Feb 2009 15:12:24 -0800
+Subject: sgi-xp: fix writing past the end of kzalloc()'d space
+
+From: Dean Nelson <dcn@sgi.com>
+
+commit 361916a943cd9dbda1c0b00879d0225cc919d868 upstream.
+
+A missing type cast results in writing way beyond the end of a kzalloc()'d
+memory segment resulting in slab corruption. But it seems like the better
+solution is to define ->recv_msg_slots as a 'void *' rather than a
+'struct xpc_notify_mq_msg_uv *' and add the type cast.
+
+Signed-off-by: Dean Nelson <dcn@sgi.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/misc/sgi-xp/xpc.h    |    5 +++--
+ drivers/misc/sgi-xp/xpc_uv.c |   11 +++++------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+--- a/drivers/misc/sgi-xp/xpc.h
++++ b/drivers/misc/sgi-xp/xpc.h
+@@ -3,7 +3,7 @@
+  * License.  See the file "COPYING" in the main directory of this archive
+  * for more details.
+  *
+- * Copyright (c) 2004-2008 Silicon Graphics, Inc.  All Rights Reserved.
++ * Copyright (c) 2004-2009 Silicon Graphics, Inc.  All Rights Reserved.
+  */
+ /*
+@@ -502,7 +502,8 @@ struct xpc_channel_uv {
+                                               /* partition's notify mq */
+       struct xpc_send_msg_slot_uv *send_msg_slots;
+-      struct xpc_notify_mq_msg_uv *recv_msg_slots;
++      void *recv_msg_slots;   /* each slot will hold a xpc_notify_mq_msg_uv */
++                              /* structure plus the user's payload */
+       struct xpc_fifo_head_uv msg_slot_free_list;
+       struct xpc_fifo_head_uv recv_msg_list;  /* deliverable payloads */
+--- a/drivers/misc/sgi-xp/xpc_uv.c
++++ b/drivers/misc/sgi-xp/xpc_uv.c
+@@ -3,7 +3,7 @@
+  * License.  See the file "COPYING" in the main directory of this archive
+  * for more details.
+  *
+- * Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
++ * Copyright (c) 2008-2009 Silicon Graphics, Inc.  All Rights Reserved.
+  */
+ /*
+@@ -825,8 +825,8 @@ xpc_allocate_recv_msg_slot_uv(struct xpc
+                       continue;
+               for (entry = 0; entry < nentries; entry++) {
+-                      msg_slot = ch_uv->recv_msg_slots + entry *
+-                          ch->entry_size;
++                      msg_slot = ch_uv->recv_msg_slots +
++                          entry * ch->entry_size;
+                       msg_slot->hdr.msg_slot_number = entry;
+               }
+@@ -1123,9 +1123,8 @@ xpc_handle_notify_mq_msg_uv(struct xpc_p
+       /* we're dealing with a normal message sent via the notify_mq */
+       ch_uv = &ch->sn.uv;
+-      msg_slot = (struct xpc_notify_mq_msg_uv *)((u64)ch_uv->recv_msg_slots +
+-                  (msg->hdr.msg_slot_number % ch->remote_nentries) *
+-                  ch->entry_size);
++      msg_slot = ch_uv->recv_msg_slots +
++          (msg->hdr.msg_slot_number % ch->remote_nentries) * ch->entry_size;
+       BUG_ON(msg->hdr.msg_slot_number != msg_slot->hdr.msg_slot_number);
+       BUG_ON(msg_slot->hdr.size != 0);
diff --git a/queue-2.6.27/shm-fix-shmctl-lockup-with-config_shmem.patch b/queue-2.6.27/shm-fix-shmctl-lockup-with-config_shmem.patch
new file mode 100644 (file)
index 0000000..be496f6
--- /dev/null
@@ -0,0 +1,50 @@
+From a68e61e8ff2d46327a37b69056998b47745db6fa Mon Sep 17 00:00:00 2001
+From: Tony Battersby <tonyb@cybernetics.com>
+Date: Wed, 4 Feb 2009 15:12:04 -0800
+Subject: shm: fix shmctl(SHM_INFO) lockup with !CONFIG_SHMEM
+
+From: Tony Battersby <tonyb@cybernetics.com>
+
+commit a68e61e8ff2d46327a37b69056998b47745db6fa upstream.
+
+shm_get_stat() assumes that the inode is a "struct shmem_inode_info",
+which is incorrect for !CONFIG_SHMEM (see fs/ramfs/inode.c:
+ramfs_get_inode() vs.  mm/shmem.c: shmem_get_inode()).
+
+This bad assumption can cause shmctl(SHM_INFO) to lockup when
+shm_get_stat() tries to spin_lock(&info->lock).  Users of !CONFIG_SHMEM
+may encounter this lockup simply by invoking the 'ipcs' command.
+
+Reported by Jiri Olsa back in February 2008:
+http://lkml.org/lkml/2008/2/29/74
+
+Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
+Cc: Jiri Kosina <jkosina@suse.cz>
+Reported-by: Jiri Olsa <olsajiri@gmail.com>
+Cc: Hugh Dickins <hugh@veritas.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ ipc/shm.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/ipc/shm.c
++++ b/ipc/shm.c
+@@ -565,11 +565,15 @@ static void shm_get_stat(struct ipc_name
+                       struct hstate *h = hstate_file(shp->shm_file);
+                       *rss += pages_per_huge_page(h) * mapping->nrpages;
+               } else {
++#ifdef CONFIG_SHMEM
+                       struct shmem_inode_info *info = SHMEM_I(inode);
+                       spin_lock(&info->lock);
+                       *rss += inode->i_mapping->nrpages;
+                       *swp += info->swapped;
+                       spin_unlock(&info->lock);
++#else
++                      *rss += inode->i_mapping->nrpages;
++#endif
+               }
+               total++;
diff --git a/queue-2.6.27/sound-usb-audio-handle-wmaxpacketsize-for-fixed_endpoint-devices.patch b/queue-2.6.27/sound-usb-audio-handle-wmaxpacketsize-for-fixed_endpoint-devices.patch
new file mode 100644 (file)
index 0000000..d508b2c
--- /dev/null
@@ -0,0 +1,33 @@
+From 894dcd78782842924527598b0b764c9b4e679e21 Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Fri, 6 Feb 2009 08:13:07 +0100
+Subject: sound: usb-audio: handle wMaxPacketSize for FIXED_ENDPOINT devices
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit 894dcd78782842924527598b0b764c9b4e679e21 upstream.
+
+For audio devices that do not have proper audio descriptors (e.g.,
+Edirol UA-20), we use hardcoded parameters from our quirks list.
+However, we must still read the maximum packet size from the standard
+endpoint descriptor; otherwise, we might use packets that are too big
+and therefore rejected by the USB core.
+
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/usb/usbaudio.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/usb/usbaudio.c
++++ b/sound/usb/usbaudio.c
+@@ -2958,6 +2958,7 @@ static int create_fixed_stream_quirk(str
+               return -EINVAL;
+       }
+       alts = &iface->altsetting[fp->altset_idx];
++      fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
+       usb_set_interface(chip->dev, fp->iface, 0);
+       init_usb_pitch(chip->dev, fp->iface, alts, fp);
+       init_usb_sample_rate(chip->dev, fp->iface, alts, fp, fp->rate_max);
diff --git a/queue-2.6.27/wait-prevent-exclusive-waiter-starvation.patch b/queue-2.6.27/wait-prevent-exclusive-waiter-starvation.patch
new file mode 100644 (file)
index 0000000..a717a97
--- /dev/null
@@ -0,0 +1,193 @@
+From 777c6c5f1f6e757ae49ecca2ed72d6b1f523c007 Mon Sep 17 00:00:00 2001
+From: Johannes Weiner <hannes@cmpxchg.org>
+Date: Wed, 4 Feb 2009 15:12:14 -0800
+Subject: wait: prevent exclusive waiter starvation
+
+From: Johannes Weiner <hannes@cmpxchg.org>
+
+commit 777c6c5f1f6e757ae49ecca2ed72d6b1f523c007 upstream.
+
+With exclusive waiters, every process woken up through the wait queue must
+ensure that the next waiter down the line is woken when it has finished.
+
+Interruptible waiters don't do that when aborting due to a signal.  And if
+an aborting waiter is concurrently woken up through the waitqueue, noone
+will ever wake up the next waiter.
+
+This has been observed with __wait_on_bit_lock() used by
+lock_page_killable(): the first contender on the queue was aborting when
+the actual lock holder woke it up concurrently.  The aborted contender
+didn't acquire the lock and therefor never did an unlock followed by
+waking up the next waiter.
+
+Add abort_exclusive_wait() which removes the process' wait descriptor from
+the waitqueue, iff still queued, or wakes up the next waiter otherwise.
+It does so under the waitqueue lock.  Racing with a wake up means the
+aborting process is either already woken (removed from the queue) and will
+wake up the next waiter, or it will remove itself from the queue and the
+concurrent wake up will apply to the next waiter after it.
+
+Use abort_exclusive_wait() in __wait_event_interruptible_exclusive() and
+__wait_on_bit_lock() when they were interrupted by other means than a wake
+up through the queue.
+
+[akpm@linux-foundation.org: coding-style fixes]
+Reported-by: Chris Mason <chris.mason@oracle.com>
+Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
+Mentored-by: Oleg Nesterov <oleg@redhat.com>
+Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Cc: Matthew Wilcox <matthew@wil.cx>
+Cc: Chuck Lever <cel@citi.umich.edu>
+Cc: Nick Piggin <nickpiggin@yahoo.com.au>
+Cc: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/linux/wait.h |   11 +++++++--
+ kernel/sched.c       |    4 +--
+ kernel/wait.c        |   59 ++++++++++++++++++++++++++++++++++++++++++++-------
+ 3 files changed, 63 insertions(+), 11 deletions(-)
+
+--- a/include/linux/wait.h
++++ b/include/linux/wait.h
+@@ -141,6 +141,8 @@ static inline void __remove_wait_queue(w
+       list_del(&old->task_list);
+ }
++void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
++                      int nr_exclusive, int sync, void *key);
+ void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
+ extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode);
+ extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
+@@ -342,16 +344,19 @@ do {                                                                     \
+       for (;;) {                                                      \
+               prepare_to_wait_exclusive(&wq, &__wait,                 \
+                                       TASK_INTERRUPTIBLE);            \
+-              if (condition)                                          \
++              if (condition) {                                        \
++                      finish_wait(&wq, &__wait);                      \
+                       break;                                          \
++              }                                                       \
+               if (!signal_pending(current)) {                         \
+                       schedule();                                     \
+                       continue;                                       \
+               }                                                       \
+               ret = -ERESTARTSYS;                                     \
++              abort_exclusive_wait(&wq, &__wait,                      \
++                              TASK_INTERRUPTIBLE, NULL);              \
+               break;                                                  \
+       }                                                               \
+-      finish_wait(&wq, &__wait);                                      \
+ } while (0)
+ #define wait_event_interruptible_exclusive(wq, condition)             \
+@@ -440,6 +445,8 @@ extern long interruptible_sleep_on_timeo
+ void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
+ void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
+ void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
++void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait,
++                      unsigned int mode, void *key);
+ int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
+ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
+--- a/kernel/sched.c
++++ b/kernel/sched.c
+@@ -4556,8 +4556,8 @@ EXPORT_SYMBOL(default_wake_function);
+  * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns
+  * zero in this (rare) case, and we handle it by continuing to scan the queue.
+  */
+-static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
+-                           int nr_exclusive, int sync, void *key)
++void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
++                      int nr_exclusive, int sync, void *key)
+ {
+       wait_queue_t *curr, *next;
+--- a/kernel/wait.c
++++ b/kernel/wait.c
+@@ -101,6 +101,15 @@ prepare_to_wait_exclusive(wait_queue_hea
+ }
+ EXPORT_SYMBOL(prepare_to_wait_exclusive);
++/*
++ * finish_wait - clean up after waiting in a queue
++ * @q: waitqueue waited on
++ * @wait: wait descriptor
++ *
++ * Sets current thread back to running state and removes
++ * the wait descriptor from the given waitqueue if still
++ * queued.
++ */
+ void finish_wait(wait_queue_head_t *q, wait_queue_t *wait)
+ {
+       unsigned long flags;
+@@ -127,6 +136,39 @@ void finish_wait(wait_queue_head_t *q, w
+ }
+ EXPORT_SYMBOL(finish_wait);
++/*
++ * abort_exclusive_wait - abort exclusive waiting in a queue
++ * @q: waitqueue waited on
++ * @wait: wait descriptor
++ * @state: runstate of the waiter to be woken
++ * @key: key to identify a wait bit queue or %NULL
++ *
++ * Sets current thread back to running state and removes
++ * the wait descriptor from the given waitqueue if still
++ * queued.
++ *
++ * Wakes up the next waiter if the caller is concurrently
++ * woken up through the queue.
++ *
++ * This prevents waiter starvation where an exclusive waiter
++ * aborts and is woken up concurrently and noone wakes up
++ * the next waiter.
++ */
++void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait,
++                      unsigned int mode, void *key)
++{
++      unsigned long flags;
++
++      __set_current_state(TASK_RUNNING);
++      spin_lock_irqsave(&q->lock, flags);
++      if (!list_empty(&wait->task_list))
++              list_del_init(&wait->task_list);
++      else if (waitqueue_active(q))
++              __wake_up_common(q, mode, 1, 0, key);
++      spin_unlock_irqrestore(&q->lock, flags);
++}
++EXPORT_SYMBOL(abort_exclusive_wait);
++
+ int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
+ {
+       int ret = default_wake_function(wait, mode, sync, key);
+@@ -187,17 +229,20 @@ int __sched
+ __wait_on_bit_lock(wait_queue_head_t *wq, struct wait_bit_queue *q,
+                       int (*action)(void *), unsigned mode)
+ {
+-      int ret = 0;
+-
+       do {
++              int ret;
++
+               prepare_to_wait_exclusive(wq, &q->wait, mode);
+-              if (test_bit(q->key.bit_nr, q->key.flags)) {
+-                      if ((ret = (*action)(q->key.flags)))
+-                              break;
+-              }
++              if (!test_bit(q->key.bit_nr, q->key.flags))
++                      continue;
++              ret = action(q->key.flags);
++              if (!ret)
++                      continue;
++              abort_exclusive_wait(wq, &q->wait, mode, &q->key);
++              return ret;
+       } while (test_and_set_bit(q->key.bit_nr, q->key.flags));
+       finish_wait(wq, &q->wait);
+-      return ret;
++      return 0;
+ }
+ EXPORT_SYMBOL(__wait_on_bit_lock);
diff --git a/queue-2.6.27/x86-apic-enable-workaround-on-amd-fam10h-cpus.patch b/queue-2.6.27/x86-apic-enable-workaround-on-amd-fam10h-cpus.patch
new file mode 100644 (file)
index 0000000..5524a08
--- /dev/null
@@ -0,0 +1,37 @@
+From 858770619debfb9269add63e4ba8b7c6b5538dd1 Mon Sep 17 00:00:00 2001
+From: Borislav Petkov <borislav.petkov@amd.com>
+Date: Tue, 3 Feb 2009 16:24:22 +0100
+Subject: x86: APIC: enable workaround on AMD Fam10h CPUs
+
+From: Borislav Petkov <borislav.petkov@amd.com>
+
+commit 858770619debfb9269add63e4ba8b7c6b5538dd1 upstream.
+
+Impact: fix to enable APIC for AMD Fam10h on chipsets with a missing/b0rked
+       ACPI MP table (MADT)
+
+Booting a 32bit kernel on an AMD Fam10h CPU running on chipsets with
+missing/b0rked MP table leads to a hang pretty early in the boot process
+due to the APIC not being initialized. Fix that by falling back to the
+default APIC base address in 32bit code, as it is done in the 64bit
+codepath.
+
+Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/apic_32.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/apic_32.c
++++ b/arch/x86/kernel/apic_32.c
+@@ -1115,7 +1115,7 @@ static int __init detect_init_APIC(void)
+       switch (boot_cpu_data.x86_vendor) {
+       case X86_VENDOR_AMD:
+               if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
+-                  (boot_cpu_data.x86 == 15))
++                  (boot_cpu_data.x86 >= 15))
+                       break;
+               goto no_apic;
+       case X86_VENDOR_INTEL: