]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.37 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 16:57:52 +0000 (08:57 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 16:57:52 +0000 (08:57 -0800)
queue-2.6.37/acpi-wakeup-enable-button-gpes-unconditionally-during-initialization.patch [new file with mode: 0644]
queue-2.6.37/nfsd-correctly-handle-return-value-from-nfsd_map_name_to_.patch [new file with mode: 0644]
queue-2.6.37/series
queue-2.6.37/x86-hotplug-fix-powersavings-with-offlined-cores-on-amd.patch [new file with mode: 0644]

diff --git a/queue-2.6.37/acpi-wakeup-enable-button-gpes-unconditionally-during-initialization.patch b/queue-2.6.37/acpi-wakeup-enable-button-gpes-unconditionally-during-initialization.patch
new file mode 100644 (file)
index 0000000..1e1aff4
--- /dev/null
@@ -0,0 +1,50 @@
+From rjw@sisk.pl  Thu Feb 17 08:53:15 2011
+From: "Rafael J. Wysocki" <rjw@sisk.pl>
+Date: Thu, 17 Feb 2011 10:34:41 +0100
+Subject: ACPI / Wakeup: Enable button GPEs unconditionally during initialization
+To: stable@kernel.org
+Cc: Greg KH <gregkh@suse.de>
+Message-ID: <201102171034.41970.rjw@sisk.pl>
+
+
+From: Rafael J. Wysocki <rjw@sisk.pl>
+
+This is a backport of mainline kernel commit
+2a5d24286e8bdafdc272b37ec5bdd9e977b3767c.
+
+Commit 9630bdd (ACPI: Use GPE reference counting to support shared
+GPEs) introduced a suspend regression where boxes resume immediately
+after being suspended due to the lid or sleep button wakeup status
+not being cleared properly.  This happens if the GPEs corresponding
+to those devices are not enabled all the time, which apparently is
+expected by some BIOSes.
+
+To fix this problem, enable button and lid GPEs unconditionally
+during initialization and keep them enabled all the time, regardless
+of whether or not the ACPI button driver is used.
+
+References: https://bugzilla.kernel.org/show_bug.cgi?id=27372
+Reported-and-tested-by: Ferenc Wágner <wferi@niif.hu>
+Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/acpi/wakeup.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/acpi/wakeup.c
++++ b/drivers/acpi/wakeup.c
+@@ -84,8 +84,12 @@ int __init acpi_wakeup_device_init(void)
+               struct acpi_device *dev = container_of(node,
+                                                      struct acpi_device,
+                                                      wakeup_list);
+-              if (dev->wakeup.flags.always_enabled)
++              if (dev->wakeup.flags.always_enabled) {
++                      /* Button GPEs are supposed to be always enabled. */
++                      acpi_enable_gpe(dev->wakeup.gpe_device,
++                                      dev->wakeup.gpe_number);
+                       dev->wakeup.state.enabled = 1;
++              }
+       }
+       mutex_unlock(&acpi_device_lock);
+       return 0;
diff --git a/queue-2.6.37/nfsd-correctly-handle-return-value-from-nfsd_map_name_to_.patch b/queue-2.6.37/nfsd-correctly-handle-return-value-from-nfsd_map_name_to_.patch
new file mode 100644 (file)
index 0000000..3bb81ec
--- /dev/null
@@ -0,0 +1,49 @@
+From 47c85291d3dd1a51501555000b90f8e281a0458e Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Wed, 16 Feb 2011 13:08:35 +1100
+Subject: nfsd: correctly handle return value from nfsd_map_name_to_*
+
+From: NeilBrown <neilb@suse.de>
+
+commit 47c85291d3dd1a51501555000b90f8e281a0458e upstream.
+
+These functions return an nfs status, not a host_err.  So don't
+try to convert  before returning.
+
+This is a regression introduced by
+3c726023402a2f3b28f49b9d90ebf9e71151157d; I fixed up two of the callers,
+but missed these two.
+
+Reported-by: Herbert Poetzl <herbert@13thfloor.at>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nfsd/nfs4xdr.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/fs/nfsd/nfs4xdr.c
++++ b/fs/nfsd/nfs4xdr.c
+@@ -316,8 +316,8 @@ nfsd4_decode_fattr(struct nfsd4_compound
+               READ_BUF(dummy32);
+               len += (XDR_QUADLEN(dummy32) << 2);
+               READMEM(buf, dummy32);
+-              if ((host_err = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
+-                      goto out_nfserr;
++              if ((status = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
++                      return status;
+               iattr->ia_valid |= ATTR_UID;
+       }
+       if (bmval[1] & FATTR4_WORD1_OWNER_GROUP) {
+@@ -327,8 +327,8 @@ nfsd4_decode_fattr(struct nfsd4_compound
+               READ_BUF(dummy32);
+               len += (XDR_QUADLEN(dummy32) << 2);
+               READMEM(buf, dummy32);
+-              if ((host_err = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
+-                      goto out_nfserr;
++              if ((status = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
++                      return status;
+               iattr->ia_valid |= ATTR_GID;
+       }
+       if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) {
index 1a64f4c09fb748b45cae2d516bba9dd8476c4293..1aa95badb8f382e0fa1c53d9d7475113e7310c40 100644 (file)
@@ -28,3 +28,6 @@ cred-fix-memory-and-refcount-leaks-upon-security_prepare_creds-failure.patch
 staging-brcm80211-bugfix-for-softmac-crash-on-multi-cpu-configurations.patch
 security-add-cred-argument-to-security_capable.patch
 pci-use-security_capable-when-checking-capablities-during-config-space-read.patch
+acpi-wakeup-enable-button-gpes-unconditionally-during-initialization.patch
+nfsd-correctly-handle-return-value-from-nfsd_map_name_to_.patch
+x86-hotplug-fix-powersavings-with-offlined-cores-on-amd.patch
diff --git a/queue-2.6.37/x86-hotplug-fix-powersavings-with-offlined-cores-on-amd.patch b/queue-2.6.37/x86-hotplug-fix-powersavings-with-offlined-cores-on-amd.patch
new file mode 100644 (file)
index 0000000..b83b3e0
--- /dev/null
@@ -0,0 +1,91 @@
+From bp@amd64.org  Thu Feb 17 08:54:52 2011
+From: Borislav Petkov <bp@amd64.org>
+Date: Thu, 17 Feb 2011 14:57:02 +0100
+Subject: x86, hotplug: Fix powersavings with offlined cores on AMD
+To: "gregkh@suse.de" <gregkh@suse.de>
+Cc: "venki@google.com" <venki@google.com>, "a.p.zijlstra@chello.hl" <a.p.zijlstra@chello.hl>, "Herrmann3, Andreas" <Andreas.Herrmann3@amd.com>, "hpa@linux.intel.com" <hpa@linux.intel.com>, "arjan@linux.intel.com" <arjan@linux.intel.com>, "stable@kernel.org" <stable@kernel.org>, "lenb@kernel.org" <lenb@kernel.org>
+Message-ID: <20110217135702.GA31089@aftab>
+Content-Disposition: inline
+
+
+From: Borislav Petkov <borislav.petkov@amd.com>
+
+Upstream commits: 93789b32dbf355e70f18b17a82e8661677a7f7fb,
+        1c9d16e35911090dee3f9313e6af13af623d66ee
+
+ea53069231f9317062910d6e772cca4ce93de8c8 made a CPU use monitor/mwait
+when offline. This is not the optimal choice for AMD wrt to powersavings
+and we'd prefer our cores to halt (i.e. enter C1) instead. For this, the
+same selection whether to use monitor/mwait has to be used as when we
+select the idle routine for the machine.
+
+With this patch, offlining cores 1-5 on a X6 machine allows core0 to
+boost again.
+
+[ hpa: putting this in urgent since it is a (power) regression fix ]
+
+Reported-by: Andreas Herrmann <andreas.herrmann3@amd.com>
+Cc: H. Peter Anvin <hpa@linux.intel.com>
+Cc: Arjan van de Ven <arjan@linux.intel.com>
+Cc: Len Brown <lenb@kernel.org>
+Cc: Venkatesh Pallipadi <venki@google.com>
+Cc: Peter Zijlstra <a.p.zijlstra@chello.hl>
+Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
+LKML-Reference: <1295534572-10730-1-git-send-email-bp@amd64.org>
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/include/asm/cpu.h |    1 +
+ arch/x86/kernel/process.c  |    5 +++--
+ arch/x86/kernel/smpboot.c  |    3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+--- a/arch/x86/include/asm/cpu.h
++++ b/arch/x86/include/asm/cpu.h
+@@ -32,5 +32,6 @@ extern void arch_unregister_cpu(int);
+ DECLARE_PER_CPU(int, cpu_state);
++int mwait_usable(const struct cpuinfo_x86 *);
+ #endif /* _ASM_X86_CPU_H */
+--- a/arch/x86/kernel/process.c
++++ b/arch/x86/kernel/process.c
+@@ -14,6 +14,7 @@
+ #include <linux/utsname.h>
+ #include <trace/events/power.h>
+ #include <linux/hw_breakpoint.h>
++#include <asm/cpu.h>
+ #include <asm/system.h>
+ #include <asm/apic.h>
+ #include <asm/syscalls.h>
+@@ -509,13 +510,13 @@ static void poll_idle(void)
+  *
+  * idle=mwait overrides this decision and forces the usage of mwait.
+  */
+-static int __cpuinitdata force_mwait;
++static int force_mwait;
+ #define MWAIT_INFO                    0x05
+ #define MWAIT_ECX_EXTENDED_INFO               0x01
+ #define MWAIT_EDX_C1                  0xf0
+-static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
++int mwait_usable(const struct cpuinfo_x86 *c)
+ {
+       u32 eax, ebx, ecx, edx;
+--- a/arch/x86/kernel/smpboot.c
++++ b/arch/x86/kernel/smpboot.c
+@@ -1396,8 +1396,9 @@ static inline void mwait_play_dead(void)
+       unsigned int highest_subcstate = 0;
+       int i;
+       void *mwait_ptr;
++      struct cpuinfo_x86 *c = &current_cpu_data;
+-      if (!cpu_has(&current_cpu_data, X86_FEATURE_MWAIT))
++      if (!(cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)))
+               return;
+       if (!cpu_has(&current_cpu_data, X86_FEATURE_CLFLSH))
+               return;