]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Oct 2014 00:12:55 +0000 (17:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Oct 2014 00:12:55 +0000 (17:12 -0700)
added patches:
acpica-update-to-gpio-region-handler-interface.patch
mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch
mips-zboot-add-missing-linux-string.h-include.patch

queue-3.10/acpica-update-to-gpio-region-handler-interface.patch [new file with mode: 0644]
queue-3.10/mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch [new file with mode: 0644]
queue-3.10/mips-zboot-add-missing-linux-string.h-include.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/acpica-update-to-gpio-region-handler-interface.patch b/queue-3.10/acpica-update-to-gpio-region-handler-interface.patch
new file mode 100644 (file)
index 0000000..562c0c6
--- /dev/null
@@ -0,0 +1,260 @@
+From 75ec6e55f1384548311a13ce4fcb39c516053314 Mon Sep 17 00:00:00 2001
+From: Bob Moore <Robert.Moore@intel.com>
+Date: Tue, 23 Sep 2014 10:35:47 +0800
+Subject: ACPICA: Update to GPIO region handler interface.
+
+From: Bob Moore <Robert.Moore@intel.com>
+
+commit 75ec6e55f1384548311a13ce4fcb39c516053314 upstream.
+
+Changes to correct several GPIO issues:
+
+1) The update_rule in a GPIO field definition is now ignored;
+a read-modify-write operation is never performed for GPIO fields.
+(Internally, this means that the field assembly/disassembly
+code is completely bypassed for GPIO.)
+
+2) The Address parameter passed to a GPIO region handler is
+now the bit offset of the field from a previous Connection()
+operator. Thus, it becomes a "Pin Number Index" into the
+Connection() resource descriptor.
+
+3) The bit_width parameter passed to a GPIO region handler is
+now the exact bit width of the GPIO field. Thus, it can be
+interpreted as "number of pins".
+
+Overall, we can now say that the region handler interface
+to GPIO handlers is a raw "bit/pin" addressed interface, not
+a byte-addressed interface like the system_memory handler interface.
+
+Signed-off-by: Bob Moore <robert.moore@intel.com>
+Signed-off-by: Lv Zheng <lv.zheng@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/acpica/aclocal.h  |    1 
+ drivers/acpi/acpica/acobject.h |    1 
+ drivers/acpi/acpica/dsfield.c  |    2 +
+ drivers/acpi/acpica/evregion.c |   47 ++++++++++++++++++----------
+ drivers/acpi/acpica/exfield.c  |   67 +++++++++++++++++++++++++++++++++++++++++
+ drivers/acpi/acpica/exprep.c   |    2 +
+ 6 files changed, 104 insertions(+), 16 deletions(-)
+
+--- a/drivers/acpi/acpica/aclocal.h
++++ b/drivers/acpi/acpica/aclocal.h
+@@ -254,6 +254,7 @@ struct acpi_create_field_info {
+       u32 field_bit_position;
+       u32 field_bit_length;
+       u16 resource_length;
++      u16 pin_number_index;
+       u8 field_flags;
+       u8 attribute;
+       u8 field_type;
+--- a/drivers/acpi/acpica/acobject.h
++++ b/drivers/acpi/acpica/acobject.h
+@@ -263,6 +263,7 @@ struct acpi_object_region_field {
+       ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO u16 resource_length;
+       union acpi_operand_object *region_obj;  /* Containing op_region object */
+       u8 *resource_buffer;    /* resource_template for serial regions/fields */
++      u16 pin_number_index;   /* Index relative to previous Connection/Template */
+ };
+ struct acpi_object_bank_field {
+--- a/drivers/acpi/acpica/dsfield.c
++++ b/drivers/acpi/acpica/dsfield.c
+@@ -360,6 +360,7 @@ acpi_ds_get_field_names(struct acpi_crea
+                        */
+                       info->resource_buffer = NULL;
+                       info->connection_node = NULL;
++                      info->pin_number_index = 0;
+                       /*
+                        * A Connection() is either an actual resource descriptor (buffer)
+@@ -437,6 +438,7 @@ acpi_ds_get_field_names(struct acpi_crea
+                       }
+                       info->field_bit_position += info->field_bit_length;
++                      info->pin_number_index++;       /* Index relative to previous Connection() */
+                       break;
+               default:
+--- a/drivers/acpi/acpica/evregion.c
++++ b/drivers/acpi/acpica/evregion.c
+@@ -141,6 +141,7 @@ acpi_ev_address_space_dispatch(union acp
+       union acpi_operand_object *region_obj2;
+       void *region_context = NULL;
+       struct acpi_connection_info *context;
++      acpi_physical_address address;
+       ACPI_FUNCTION_TRACE(ev_address_space_dispatch);
+@@ -235,25 +236,32 @@ acpi_ev_address_space_dispatch(union acp
+       /* We have everything we need, we can invoke the address space handler */
+       handler = handler_desc->address_space.handler;
+-
+-      ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
+-                        "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
+-                        &region_obj->region.handler->address_space, handler,
+-                        ACPI_FORMAT_NATIVE_UINT(region_obj->region.address +
+-                                                region_offset),
+-                        acpi_ut_get_region_name(region_obj->region.
+-                                                space_id)));
++      address = (region_obj->region.address + region_offset);
+       /*
+        * Special handling for generic_serial_bus and general_purpose_io:
+        * There are three extra parameters that must be passed to the
+        * handler via the context:
+-       *   1) Connection buffer, a resource template from Connection() op.
+-       *   2) Length of the above buffer.
+-       *   3) Actual access length from the access_as() op.
++       *   1) Connection buffer, a resource template from Connection() op
++       *   2) Length of the above buffer
++       *   3) Actual access length from the access_as() op
++       *
++       * In addition, for general_purpose_io, the Address and bit_width fields
++       * are defined as follows:
++       *   1) Address is the pin number index of the field (bit offset from
++       *      the previous Connection)
++       *   2) bit_width is the actual bit length of the field (number of pins)
+        */
+-      if (((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) ||
+-           (region_obj->region.space_id == ACPI_ADR_SPACE_GPIO)) &&
++      if ((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) &&
++          context && field_obj) {
++
++              /* Get the Connection (resource_template) buffer */
++
++              context->connection = field_obj->field.resource_buffer;
++              context->length = field_obj->field.resource_length;
++              context->access_length = field_obj->field.access_length;
++      }
++      if ((region_obj->region.space_id == ACPI_ADR_SPACE_GPIO) &&
+           context && field_obj) {
+               /* Get the Connection (resource_template) buffer */
+@@ -261,8 +269,17 @@ acpi_ev_address_space_dispatch(union acp
+               context->connection = field_obj->field.resource_buffer;
+               context->length = field_obj->field.resource_length;
+               context->access_length = field_obj->field.access_length;
++              address = field_obj->field.pin_number_index;
++              bit_width = field_obj->field.bit_length;
+       }
++      ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
++                        "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
++                        &region_obj->region.handler->address_space, handler,
++                        ACPI_FORMAT_NATIVE_UINT(address),
++                        acpi_ut_get_region_name(region_obj->region.
++                                                space_id)));
++
+       if (!(handler_desc->address_space.handler_flags &
+             ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
+               /*
+@@ -275,9 +292,7 @@ acpi_ev_address_space_dispatch(union acp
+       /* Call the handler */
+-      status = handler(function,
+-                       (region_obj->region.address + region_offset),
+-                       bit_width, value, context,
++      status = handler(function, address, bit_width, value, context,
+                        region_obj2->extra.region_context);
+       if (ACPI_FAILURE(status)) {
+--- a/drivers/acpi/acpica/exfield.c
++++ b/drivers/acpi/acpica/exfield.c
+@@ -178,6 +178,37 @@ acpi_ex_read_data_from_field(struct acpi
+               buffer = &buffer_desc->integer.value;
+       }
++      if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
++          (obj_desc->field.region_obj->region.space_id ==
++           ACPI_ADR_SPACE_GPIO)) {
++              /*
++               * For GPIO (general_purpose_io), the Address will be the bit offset
++               * from the previous Connection() operator, making it effectively a
++               * pin number index. The bit_length is the length of the field, which
++               * is thus the number of pins.
++               */
++              ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
++                                "GPIO FieldRead [FROM]:  Pin %u Bits %u\n",
++                                obj_desc->field.pin_number_index,
++                                obj_desc->field.bit_length));
++
++              /* Lock entire transaction if requested */
++
++              acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
++
++              /* Perform the write */
++
++              status = acpi_ex_access_region(obj_desc, 0,
++                                             (u64 *)buffer, ACPI_READ);
++              acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
++              if (ACPI_FAILURE(status)) {
++                      acpi_ut_remove_reference(buffer_desc);
++              } else {
++                      *ret_buffer_desc = buffer_desc;
++              }
++              return_ACPI_STATUS(status);
++      }
++
+       ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
+                         "FieldRead [TO]:   Obj %p, Type %X, Buf %p, ByteLen %X\n",
+                         obj_desc, obj_desc->common.type, buffer,
+@@ -325,6 +356,42 @@ acpi_ex_write_data_to_field(union acpi_o
+               *result_desc = buffer_desc;
+               return_ACPI_STATUS(status);
++      } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
++                 (obj_desc->field.region_obj->region.space_id ==
++                  ACPI_ADR_SPACE_GPIO)) {
++              /*
++               * For GPIO (general_purpose_io), we will bypass the entire field
++               * mechanism and handoff the bit address and bit width directly to
++               * the handler. The Address will be the bit offset
++               * from the previous Connection() operator, making it effectively a
++               * pin number index. The bit_length is the length of the field, which
++               * is thus the number of pins.
++               */
++              if (source_desc->common.type != ACPI_TYPE_INTEGER) {
++                      return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
++              }
++
++              ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
++                                "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X  [TO]:  Pin %u Bits %u\n",
++                                acpi_ut_get_type_name(source_desc->common.
++                                                      type),
++                                source_desc->common.type,
++                                (u32)source_desc->integer.value,
++                                obj_desc->field.pin_number_index,
++                                obj_desc->field.bit_length));
++
++              buffer = &source_desc->integer.value;
++
++              /* Lock entire transaction if requested */
++
++              acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
++
++              /* Perform the write */
++
++              status = acpi_ex_access_region(obj_desc, 0,
++                                             (u64 *)buffer, ACPI_WRITE);
++              acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
++              return_ACPI_STATUS(status);
+       }
+       /* Get a pointer to the data to be written */
+--- a/drivers/acpi/acpica/exprep.c
++++ b/drivers/acpi/acpica/exprep.c
+@@ -479,6 +479,8 @@ acpi_status acpi_ex_prep_field_value(str
+                       obj_desc->field.resource_length = info->resource_length;
+               }
++              obj_desc->field.pin_number_index = info->pin_number_index;
++
+               /* Allow full data read from EC address space */
+               if ((obj_desc->field.region_obj->region.space_id ==
diff --git a/queue-3.10/mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch b/queue-3.10/mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch
new file mode 100644 (file)
index 0000000..6b21ac3
--- /dev/null
@@ -0,0 +1,71 @@
+From 8a574cfa2652545eb95595d38ac2a0bb501af0ae Mon Sep 17 00:00:00 2001
+From: Markos Chandras <markos.chandras@imgtec.com>
+Date: Tue, 16 Sep 2014 15:55:12 +0100
+Subject: MIPS: mcount: Adjust stack pointer for static trace in MIPS32
+
+From: Markos Chandras <markos.chandras@imgtec.com>
+
+commit 8a574cfa2652545eb95595d38ac2a0bb501af0ae upstream.
+
+Every mcount() call in the MIPS 32-bit kernel is done as follows:
+
+[...]
+move at, ra
+jal _mcount
+addiu sp, sp, -8
+[...]
+
+but upon returning from the mcount() function, the stack pointer
+is not adjusted properly. This is explained in details in 58b69401c797
+(MIPS: Function tracer: Fix broken function tracing).
+
+Commit ad8c396936e3 ("MIPS: Unbreak function tracer for 64-bit kernel.)
+fixed the stack manipulation for 64-bit but it didn't fix it completely
+for MIPS32.
+
+Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
+Cc: linux-mips@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/7792/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/kernel/mcount.S |   12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/arch/mips/kernel/mcount.S
++++ b/arch/mips/kernel/mcount.S
+@@ -123,7 +123,11 @@ NESTED(_mcount, PT_SIZE, ra)
+        nop
+ #endif
+       b       ftrace_stub
++#ifdef CONFIG_32BIT
++       addiu sp, sp, 8
++#else
+        nop
++#endif
+ static_trace:
+       MCOUNT_SAVE_REGS
+@@ -133,6 +137,9 @@ static_trace:
+        move   a1, AT          /* arg2: parent's return address */
+       MCOUNT_RESTORE_REGS
++#ifdef CONFIG_32BIT
++      addiu sp, sp, 8
++#endif
+       .globl ftrace_stub
+ ftrace_stub:
+       RETURN_BACK
+@@ -181,6 +188,11 @@ NESTED(ftrace_graph_caller, PT_SIZE, ra)
+       jal     prepare_ftrace_return
+        nop
+       MCOUNT_RESTORE_REGS
++#ifndef CONFIG_DYNAMIC_FTRACE
++#ifdef CONFIG_32BIT
++      addiu sp, sp, 8
++#endif
++#endif
+       RETURN_BACK
+       END(ftrace_graph_caller)
diff --git a/queue-3.10/mips-zboot-add-missing-linux-string.h-include.patch b/queue-3.10/mips-zboot-add-missing-linux-string.h-include.patch
new file mode 100644 (file)
index 0000000..32624d6
--- /dev/null
@@ -0,0 +1,52 @@
+From 29593fd5a8149462ed6fad0d522234facdaee6c8 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Sun, 20 Jul 2014 19:58:23 +0200
+Subject: MIPS: ZBOOT: add missing <linux/string.h> include
+
+From: Aurelien Jarno <aurelien@aurel32.net>
+
+commit 29593fd5a8149462ed6fad0d522234facdaee6c8 upstream.
+
+Commit dc4d7b37 (MIPS: ZBOOT: gather string functions into string.c)
+moved the string related functions into a separate file, which might
+cause the following build error, depending on the configuration:
+
+| CC      arch/mips/boot/compressed/decompress.o
+| In file included from linux/arch/mips/boot/compressed/../../../../lib/decompress_unxz.c:234:0,
+|                  from linux/arch/mips/boot/compressed/decompress.c:67:
+| linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c: In function 'fill_temp':
+| linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:162:2: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration]
+| cc1: some warnings being treated as errors
+| linux/scripts/Makefile.build:308: recipe for target 'arch/mips/boot/compressed/decompress.o' failed
+| make[6]: *** [arch/mips/boot/compressed/decompress.o] Error 1
+| linux/arch/mips/Makefile:308: recipe for target 'vmlinuz' failed
+
+It does not fail with the standard configuration, as when
+CONFIG_DYNAMIC_DEBUG is not enabled <linux/string.h> gets included in
+include/linux/dynamic_debug.h. There might be other ways for it to
+get indirectly included.
+
+We can't add the include directly in xz_dec_stream.c as some
+architectures might want to use a different version for the boot/
+directory (see for example arch/x86/boot/string.h).
+
+Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
+Cc: linux-mips@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/7420/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/boot/compressed/decompress.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/mips/boot/compressed/decompress.c
++++ b/arch/mips/boot/compressed/decompress.c
+@@ -13,6 +13,7 @@
+ #include <linux/types.h>
+ #include <linux/kernel.h>
++#include <linux/string.h>
+ #include <asm/addrspace.h>
index 52598294e7f4729b5abe1b1ba165583e9a3ecf2c..c853ea50d2e3c9deedb87f4d7326b1ff5ff77f1b 100644 (file)
@@ -65,3 +65,6 @@ arm-8128-1-abort-don-t-clear-the-exclusive-monitors.patch
 arm-8133-1-use-irq_set_affinity-with-force-false-when-migrating-irqs.patch
 arm-7897-1-kexec-use-the-right-isa-for-relocate_new_kernel.patch
 arm-8165-1-alignment-don-t-break-misaligned-neon-load-store.patch
+mips-zboot-add-missing-linux-string.h-include.patch
+mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch
+acpica-update-to-gpio-region-handler-interface.patch