]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.32 patch for powerpc
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 17:08:35 +0000 (10:08 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 17:08:35 +0000 (10:08 -0700)
and refresh a patch I forgot to.

review-2.6.32/powerpc-pseries-make-query_cpu_stopped-callable-outside-hotplug-cpu.patch [new file with mode: 0644]
review-2.6.32/series
review-2.6.32/usb-mos7840-fix-null-pointer-dereference.patch

diff --git a/review-2.6.32/powerpc-pseries-make-query_cpu_stopped-callable-outside-hotplug-cpu.patch b/review-2.6.32/powerpc-pseries-make-query_cpu_stopped-callable-outside-hotplug-cpu.patch
new file mode 100644 (file)
index 0000000..53bd59b
--- /dev/null
@@ -0,0 +1,126 @@
+From f8b67691828321f5c85bb853283aa101ae673130 Mon Sep 17 00:00:00 2001
+From: Michael Neuling <mikey@neuling.org>
+Date: Wed, 28 Apr 2010 13:39:41 +0000
+Subject: powerpc/pseries: Make query_cpu_stopped callable outside hotplug cpu
+
+From: Michael Neuling <mikey@neuling.org>
+
+commit f8b67691828321f5c85bb853283aa101ae673130 upstream.
+
+This moves query_cpu_stopped() out of the hotplug cpu code and into
+smp.c so it can called in other places and renames it to
+smp_query_cpu_stopped().
+
+It also cleans up the return values by adding some #defines
+
+Signed-off-by: Michael Neuling <mikey@neuling.org>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/platforms/pseries/hotplug-cpu.c    |   30 +++---------------------
+ arch/powerpc/platforms/pseries/plpar_wrappers.h |    8 ++++++
+ arch/powerpc/platforms/pseries/smp.c            |   22 +++++++++++++++++
+ 3 files changed, 34 insertions(+), 26 deletions(-)
+
+--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
++++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
+@@ -66,30 +66,6 @@ static void pseries_mach_cpu_die(void)
+       for(;;);
+ }
+-static int qcss_tok;  /* query-cpu-stopped-state token */
+-
+-/* Get state of physical CPU.
+- * Return codes:
+- *    0       - The processor is in the RTAS stopped state
+- *    1       - stop-self is in progress
+- *    2       - The processor is not in the RTAS stopped state
+- *    -1      - Hardware Error
+- *    -2      - Hardware Busy, Try again later.
+- */
+-static int query_cpu_stopped(unsigned int pcpu)
+-{
+-      int cpu_status, status;
+-
+-      status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
+-      if (status != 0) {
+-              printk(KERN_ERR
+-                     "RTAS query-cpu-stopped-state failed: %i\n", status);
+-              return status;
+-      }
+-
+-      return cpu_status;
+-}
+-
+ static int pseries_cpu_disable(void)
+ {
+       int cpu = smp_processor_id();
+@@ -113,8 +89,9 @@ static void pseries_cpu_die(unsigned int
+       unsigned int pcpu = get_hard_smp_processor_id(cpu);
+       for (tries = 0; tries < 25; tries++) {
+-              cpu_status = query_cpu_stopped(pcpu);
+-              if (cpu_status == 0 || cpu_status == -1)
++              cpu_status = smp_query_cpu_stopped(pcpu);
++              if (cpu_status == QCSS_STOPPED ||
++                  cpu_status == QCSS_HARDWARE_ERROR)
+                       break;
+               cpu_relax();
+       }
+@@ -256,6 +233,7 @@ static int __init pseries_cpu_hotplug_in
+ {
+       struct device_node *np;
+       const char *typep;
++      int qcss_tok;
+       for_each_node_by_name(np, "interrupt-controller") {
+               typep = of_get_property(np, "compatible", NULL);
+--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
++++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
+@@ -4,6 +4,14 @@
+ #include <asm/hvcall.h>
+ #include <asm/page.h>
++/* Get state of physical CPU from query_cpu_stopped */
++int smp_query_cpu_stopped(unsigned int pcpu);
++#define QCSS_STOPPED 0
++#define QCSS_STOPPING 1
++#define QCSS_NOT_STOPPED 2
++#define QCSS_HARDWARE_ERROR -1
++#define QCSS_HARDWARE_BUSY -2
++
+ static inline long poll_pending(void)
+ {
+       return plpar_hcall_norets(H_POLL_PENDING);
+--- a/arch/powerpc/platforms/pseries/smp.c
++++ b/arch/powerpc/platforms/pseries/smp.c
+@@ -56,6 +56,28 @@
+  */
+ static cpumask_t of_spin_map;
++/* Query where a cpu is now.  Return codes #defined in plpar_wrappers.h */
++int smp_query_cpu_stopped(unsigned int pcpu)
++{
++      int cpu_status, status;
++      int qcss_tok = rtas_token("query-cpu-stopped-state");
++
++      if (qcss_tok == RTAS_UNKNOWN_SERVICE) {
++              printk(KERN_INFO "Firmware doesn't support "
++                              "query-cpu-stopped-state\n");
++              return QCSS_HARDWARE_ERROR;
++      }
++
++      status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
++      if (status != 0) {
++              printk(KERN_ERR
++                     "RTAS query-cpu-stopped-state failed: %i\n", status);
++              return status;
++      }
++
++      return cpu_status;
++}
++
+ /**
+  * smp_startup_cpu() - start the given cpu
+  *
index 277ae9832082e8543a567d75cb08a3544e6d105c..1ba724d75baf29092a3c9729eb342680dd43de07 100644 (file)
@@ -53,6 +53,7 @@ drm-edid-fix-1024x768-85hz.patch
 drm-radeon-kms-atom-fix-typo-in-lvds-panel-info-parsing.patch
 powerpc-fix-handling-of-strncmp-with-zero-len.patch
 powerpc-pseries-only-call-start-cpu-when-a-cpu-is-stopped.patch
+powerpc-pseries-make-query_cpu_stopped-callable-outside-hotplug-cpu.patch
 powerpc-oprofile-fix-potential-buffer-overrun-in-op_model_cell.c.patch
 writeback-disable-periodic-old-data-writeback-for-dirty_writeback_centisecs.patch
 md-raid1-fix-counting-of-write-targets.patch
index 98070bab67b89a824a75416c71c76cb80a49d4bc..2c3c324046c0f17994e7a5969474a0b11fea66e8 100644 (file)
@@ -12,11 +12,13 @@ Fix null-pointer dereference on error path.
 Signed-off-by: Johan Hovold <jhovold@gmail.com>
 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
 
-diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
-index f8424d1..585b7e6 100644
+---
+ drivers/usb/serial/mos7840.c |    1 -
+ 1 file changed, 1 deletion(-)
+
 --- a/drivers/usb/serial/mos7840.c
 +++ b/drivers/usb/serial/mos7840.c
-@@ -730,7 +730,6 @@ static void mos7840_bulk_in_callback(struct urb *urb)
+@@ -714,7 +714,6 @@ static void mos7840_bulk_in_callback(str
        mos7840_port = urb->context;
        if (!mos7840_port) {
                dbg("%s", "NULL mos7840_port pointer");