From e35540b15215a65f868586469c30c62b01a3bab1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 2 Oct 2014 17:13:53 -0700 Subject: [PATCH] 3.16-stable patches added patches: acpi-hotplug-generate-online-uevents-for-acpi-containers.patch acpi-platform-lpss-disable-async-suspend-resume-of-lpss-devices.patch acpi-scan-correct-error-return-value-of-create_modalias.patch acpi-video-disable-native-backlight-for-thinkpad-x201s.patch acpica-update-to-gpio-region-handler-interface.patch gpio-acpi-use-pin-index-and-bit-length.patch mips-fix-mfc1-mfhc1-emulation-for-64-bit-mips-systems.patch mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch mips-zboot-add-missing-linux-string.h-include.patch --- ...e-online-uevents-for-acpi-containers.patch | 77 ++++++ ...async-suspend-resume-of-lpss-devices.patch | 41 +++ ...rror-return-value-of-create_modalias.patch | 30 ++ ...-native-backlight-for-thinkpad-x201s.patch | 43 +++ ...ate-to-gpio-region-handler-interface.patch | 260 ++++++++++++++++++ ...io-acpi-use-pin-index-and-bit-length.patch | 61 ++++ ...c1-emulation-for-64-bit-mips-systems.patch | 53 ++++ ...k-pointer-for-static-trace-in-mips32.patch | 71 +++++ ...t-add-missing-linux-string.h-include.patch | 52 ++++ queue-3.16/series | 9 + 10 files changed, 697 insertions(+) create mode 100644 queue-3.16/acpi-hotplug-generate-online-uevents-for-acpi-containers.patch create mode 100644 queue-3.16/acpi-platform-lpss-disable-async-suspend-resume-of-lpss-devices.patch create mode 100644 queue-3.16/acpi-scan-correct-error-return-value-of-create_modalias.patch create mode 100644 queue-3.16/acpi-video-disable-native-backlight-for-thinkpad-x201s.patch create mode 100644 queue-3.16/acpica-update-to-gpio-region-handler-interface.patch create mode 100644 queue-3.16/gpio-acpi-use-pin-index-and-bit-length.patch create mode 100644 queue-3.16/mips-fix-mfc1-mfhc1-emulation-for-64-bit-mips-systems.patch create mode 100644 queue-3.16/mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch create mode 100644 queue-3.16/mips-zboot-add-missing-linux-string.h-include.patch diff --git a/queue-3.16/acpi-hotplug-generate-online-uevents-for-acpi-containers.patch b/queue-3.16/acpi-hotplug-generate-online-uevents-for-acpi-containers.patch new file mode 100644 index 00000000000..da76354998b --- /dev/null +++ b/queue-3.16/acpi-hotplug-generate-online-uevents-for-acpi-containers.patch @@ -0,0 +1,77 @@ +From 8ab17fc92e49bc2b8fff9d220c19bf50ec9c1158 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Sun, 21 Sep 2014 02:58:18 +0200 +Subject: ACPI / hotplug: Generate online uevents for ACPI containers + +From: "Rafael J. Wysocki" + +commit 8ab17fc92e49bc2b8fff9d220c19bf50ec9c1158 upstream. + +Commit 46394fd01 (ACPI / hotplug: Move container-specific code out of +the core) removed the generation of "online" uevents for containers, +because "add" uevents are now generated for them automatically when +container system devices are registered. However, there are user +space tools that need to be notified when the container and all of +its children have been enumerated, which doesn't happen any more. + +For this reason, add a mechanism allowing "online" uevents to be +generated for ACPI containers after enumerating the container along +with all of its children. + +Fixes: 46394fd01 (ACPI / hotplug: Move container-specific code out of the core) +Reported-and-tested-by: Yasuaki Ishimatsu +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/container.c | 8 ++++++++ + drivers/acpi/scan.c | 3 +++ + include/acpi/acpi_bus.h | 1 + + 3 files changed, 12 insertions(+) + +--- a/drivers/acpi/container.c ++++ b/drivers/acpi/container.c +@@ -99,6 +99,13 @@ static void container_device_detach(stru + device_unregister(dev); + } + ++static void container_device_online(struct acpi_device *adev) ++{ ++ struct device *dev = acpi_driver_data(adev); ++ ++ kobject_uevent(&dev->kobj, KOBJ_ONLINE); ++} ++ + static struct acpi_scan_handler container_handler = { + .ids = container_device_ids, + .attach = container_device_attach, +@@ -106,6 +113,7 @@ static struct acpi_scan_handler containe + .hotplug = { + .enabled = true, + .demand_offline = true, ++ .notify_online = container_device_online, + }, + }; + +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -2184,6 +2184,9 @@ static void acpi_bus_attach(struct acpi_ + ok: + list_for_each_entry(child, &device->children, node) + acpi_bus_attach(child); ++ ++ if (device->handler && device->handler->hotplug.notify_online) ++ device->handler->hotplug.notify_online(device); + } + + /** +--- a/include/acpi/acpi_bus.h ++++ b/include/acpi/acpi_bus.h +@@ -118,6 +118,7 @@ struct acpi_device; + struct acpi_hotplug_profile { + struct kobject kobj; + int (*scan_dependent)(struct acpi_device *adev); ++ void (*notify_online)(struct acpi_device *adev); + bool enabled:1; + bool demand_offline:1; + }; diff --git a/queue-3.16/acpi-platform-lpss-disable-async-suspend-resume-of-lpss-devices.patch b/queue-3.16/acpi-platform-lpss-disable-async-suspend-resume-of-lpss-devices.patch new file mode 100644 index 00000000000..b5e8b15bc47 --- /dev/null +++ b/queue-3.16/acpi-platform-lpss-disable-async-suspend-resume-of-lpss-devices.patch @@ -0,0 +1,41 @@ +From 457920817e645a7dee42c2a75c81c5ed8e12ee1c Mon Sep 17 00:00:00 2001 +From: Fu Zhonghui +Date: Wed, 24 Sep 2014 22:42:26 +0200 +Subject: ACPI / platform / LPSS: disable async suspend/resume of LPSS devices + +From: Fu Zhonghui + +commit 457920817e645a7dee42c2a75c81c5ed8e12ee1c upstream. + +On some systems (Asus T100 in particular) there are strict ordering +dependencies between LPSS devices with respect to power management +that break if they suspend/resume asynchronously. + +In theory it should be possible to follow those dependencies in the +async suspend/resume case too (the ACPI tables tell as that the +dependencies are there), but since we're missing infrastructure +for that at the moment, disable async suspend/resume for all of +the LPSS devices for the time being. + +Link: http://marc.info/?l=linux-acpi&m=141158962321905&w=2 +Fixes: 8ce62f85a81f (ACPI / platform / LPSS: Enable async suspend/resume of LPSS devices) +Signed-off-by: Li Aubrey +Signed-off-by: Fu Zhonghui +[ rjw: Changelog ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/acpi_lpss.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/acpi/acpi_lpss.c ++++ b/drivers/acpi/acpi_lpss.c +@@ -392,7 +392,6 @@ static int acpi_lpss_create_device(struc + adev->driver_data = pdata; + pdev = acpi_create_platform_device(adev); + if (!IS_ERR_OR_NULL(pdev)) { +- device_enable_async_suspend(&pdev->dev); + return 1; + } + diff --git a/queue-3.16/acpi-scan-correct-error-return-value-of-create_modalias.patch b/queue-3.16/acpi-scan-correct-error-return-value-of-create_modalias.patch new file mode 100644 index 00000000000..61df5bbbbf8 --- /dev/null +++ b/queue-3.16/acpi-scan-correct-error-return-value-of-create_modalias.patch @@ -0,0 +1,30 @@ +From 98d28d0e59160d2d6cb3f6a9050723ac40f89669 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Fri, 12 Sep 2014 11:33:10 +0300 +Subject: ACPI / scan: Correct error return value of create_modalias() + +From: Mika Westerberg + +commit 98d28d0e59160d2d6cb3f6a9050723ac40f89669 upstream. + +There is a typo, it should be negative -errno instead. + +Signed-off-by: Mika Westerberg +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/scan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -128,7 +128,7 @@ static int create_modalias(struct acpi_d + list_for_each_entry(id, &acpi_dev->pnp.ids, list) { + count = snprintf(&modalias[len], size, "%s:", id->id); + if (count < 0) +- return EINVAL; ++ return -EINVAL; + if (count >= size) + return -ENOMEM; + len += count; diff --git a/queue-3.16/acpi-video-disable-native-backlight-for-thinkpad-x201s.patch b/queue-3.16/acpi-video-disable-native-backlight-for-thinkpad-x201s.patch new file mode 100644 index 00000000000..8aa10fd184d --- /dev/null +++ b/queue-3.16/acpi-video-disable-native-backlight-for-thinkpad-x201s.patch @@ -0,0 +1,43 @@ +From 789eeea128925741e0a105357bebf8855d3bcdee Mon Sep 17 00:00:00 2001 +From: Aaron Lu +Date: Fri, 19 Sep 2014 10:01:18 +0800 +Subject: ACPI / video: disable native backlight for ThinkPad X201s + +From: Aaron Lu + +commit 789eeea128925741e0a105357bebf8855d3bcdee upstream. + +The ThinkPad X201s has a working ACPI video backlight interface and is +shipped before Win8; then there is BIOS update that starts to query +_OSI("Windows 2012") and that would make our video module stop creating +backlight interface and caused problem for the user. Add it to the DMI +table to disable native backlight to fix this problem. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=81691 +Link: https://bugzilla.kernel.org/show_bug.cgi?id=51231 +Reported-and-tested-by: Yves-Alexis Perez +Signed-off-by: Aaron Lu +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/video.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -675,6 +675,14 @@ static struct dmi_system_id video_dmi_ta + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T520"), + }, + }, ++ { ++ .callback = video_disable_native_backlight, ++ .ident = "ThinkPad X201s", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), ++ }, ++ }, + + /* The native backlight controls do not work on some older machines */ + { diff --git a/queue-3.16/acpica-update-to-gpio-region-handler-interface.patch b/queue-3.16/acpica-update-to-gpio-region-handler-interface.patch new file mode 100644 index 00000000000..17c30aec1a1 --- /dev/null +++ b/queue-3.16/acpica-update-to-gpio-region-handler-interface.patch @@ -0,0 +1,260 @@ +From 75ec6e55f1384548311a13ce4fcb39c516053314 Mon Sep 17 00:00:00 2001 +From: Bob Moore +Date: Tue, 23 Sep 2014 10:35:47 +0800 +Subject: ACPICA: Update to GPIO region handler interface. + +From: Bob Moore + +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 +Signed-off-by: Lv Zheng +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -264,6 +264,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 +@@ -142,6 +142,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); + +@@ -231,25 +232,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", +- ®ion_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 */ +@@ -257,8 +265,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", ++ ®ion_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)) { + /* +@@ -271,9 +288,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 +@@ -254,6 +254,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, +@@ -415,6 +446,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 +@@ -484,6 +484,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.16/gpio-acpi-use-pin-index-and-bit-length.patch b/queue-3.16/gpio-acpi-use-pin-index-and-bit-length.patch new file mode 100644 index 00000000000..b60f5d453dc --- /dev/null +++ b/queue-3.16/gpio-acpi-use-pin-index-and-bit-length.patch @@ -0,0 +1,61 @@ +From c15d821ddb9dac9ac6b5beb75bf942f3bc3a4004 Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Tue, 23 Sep 2014 10:35:54 +0800 +Subject: gpio / ACPI: Use pin index and bit length + +From: Srinivas Pandruvada + +commit c15d821ddb9dac9ac6b5beb75bf942f3bc3a4004 upstream. + +Fix code when the operation region callback is for an gpio, which +is not at index 0 and for partial pins in a GPIO definition. +For example: +Name (GMOD, ResourceTemplate () +{ + //3 Outputs that define the Power mode of the device + GpioIo (Exclusive, PullDown, , , , "\\_SB.GPI2") {10, 11, 12} + }) +} + +If opregion callback calls is for: +- Set pin 10, then address = 0 and bit length = 1 +- Set pin 11, then address = 1 and bit length = 1 +- Set for both pin 11 and pin 12, then address = 1, bit length = 2 + +This change requires updated ACPICA gpio operation handler code to +send the pin index and bit length. + +Fixes: 473ed7be0da0 (gpio / ACPI: Add support for ACPI GPIO operation regions) +Signed-off-by: Srinivas Pandruvada +Acked-by: Mika Westerberg +Acked-by: Linus Walleij +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpiolib-acpi.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpio/gpiolib-acpi.c ++++ b/drivers/gpio/gpiolib-acpi.c +@@ -357,8 +357,10 @@ acpi_gpio_adr_space_handler(u32 function + struct gpio_chip *chip = achip->chip; + struct acpi_resource_gpio *agpio; + struct acpi_resource *ares; ++ int pin_index = (int)address; + acpi_status status; + bool pull_up; ++ int length; + int i; + + status = acpi_buffer_to_resource(achip->conn_info.connection, +@@ -380,7 +382,8 @@ acpi_gpio_adr_space_handler(u32 function + return AE_BAD_PARAMETER; + } + +- for (i = 0; i < agpio->pin_table_length; i++) { ++ length = min(agpio->pin_table_length, (u16)(pin_index + bits)); ++ for (i = pin_index; i < length; ++i) { + unsigned pin = agpio->pin_table[i]; + struct acpi_gpio_connection *conn; + struct gpio_desc *desc; diff --git a/queue-3.16/mips-fix-mfc1-mfhc1-emulation-for-64-bit-mips-systems.patch b/queue-3.16/mips-fix-mfc1-mfhc1-emulation-for-64-bit-mips-systems.patch new file mode 100644 index 00000000000..31843e22555 --- /dev/null +++ b/queue-3.16/mips-fix-mfc1-mfhc1-emulation-for-64-bit-mips-systems.patch @@ -0,0 +1,53 @@ +From c8c0da6bdf0f0d6f59fc23aab6ee373a131df82d Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Wed, 24 Sep 2014 10:45:37 +0100 +Subject: MIPS: Fix MFC1 & MFHC1 emulation for 64-bit MIPS systems + +From: Paul Burton + +commit c8c0da6bdf0f0d6f59fc23aab6ee373a131df82d upstream. + +Commit bbd426f542cb "MIPS: Simplify FP context access" modified the +SIFROMREG & SIFROMHREG macros such that they return unsigned rather +than signed 32b integers. I had believed that to be fine, but +inadvertently missed the MFC1 & MFHC1 cases which write to a struct +pt_regs regs element. On MIPS32 this is fine, but on 64 bit those +saved regs' fields are 64 bit wide. Using unsigned values caused the +32 bit value from the FP register to be zero rather than sign extended +as the architecture specifies, causing incorrect emulation of the +MFC1 & MFHc1 instructions. Fix by reintroducing the casts to signed +integers, and therefore the sign extension. + +Signed-off-by: Paul Burton +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/7848/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/math-emu/cp1emu.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/mips/math-emu/cp1emu.c ++++ b/arch/mips/math-emu/cp1emu.c +@@ -650,9 +650,9 @@ static inline int cop1_64bit(struct pt_r + #define SIFROMREG(si, x) \ + do { \ + if (cop1_64bit(xcp)) \ +- (si) = get_fpr32(&ctx->fpr[x], 0); \ ++ (si) = (int)get_fpr32(&ctx->fpr[x], 0); \ + else \ +- (si) = get_fpr32(&ctx->fpr[(x) & ~1], (x) & 1); \ ++ (si) = (int)get_fpr32(&ctx->fpr[(x) & ~1], (x) & 1); \ + } while (0) + + #define SITOREG(si, x) \ +@@ -667,7 +667,7 @@ do { \ + } \ + } while (0) + +-#define SIFROMHREG(si, x) ((si) = get_fpr32(&ctx->fpr[x], 1)) ++#define SIFROMHREG(si, x) ((si) = (int)get_fpr32(&ctx->fpr[x], 1)) + + #define SITOHREG(si, x) \ + do { \ diff --git a/queue-3.16/mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch b/queue-3.16/mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch new file mode 100644 index 00000000000..1c2d1836d0a --- /dev/null +++ b/queue-3.16/mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch @@ -0,0 +1,71 @@ +From 8a574cfa2652545eb95595d38ac2a0bb501af0ae Mon Sep 17 00:00:00 2001 +From: Markos Chandras +Date: Tue, 16 Sep 2014 15:55:12 +0100 +Subject: MIPS: mcount: Adjust stack pointer for static trace in MIPS32 + +From: Markos Chandras + +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 +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/7792/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -177,6 +184,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.16/mips-zboot-add-missing-linux-string.h-include.patch b/queue-3.16/mips-zboot-add-missing-linux-string.h-include.patch new file mode 100644 index 00000000000..32624d67064 --- /dev/null +++ b/queue-3.16/mips-zboot-add-missing-linux-string.h-include.patch @@ -0,0 +1,52 @@ +From 29593fd5a8149462ed6fad0d522234facdaee6c8 Mon Sep 17 00:00:00 2001 +From: Aurelien Jarno +Date: Sun, 20 Jul 2014 19:58:23 +0200 +Subject: MIPS: ZBOOT: add missing include + +From: Aurelien Jarno + +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 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 +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/7420/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + 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 + #include ++#include + + #include + diff --git a/queue-3.16/series b/queue-3.16/series index 7e6e124e063..75e7f578bf0 100644 --- a/queue-3.16/series +++ b/queue-3.16/series @@ -189,3 +189,12 @@ arm-dt-imx53-fix-lvds-channel-1-port.patch arm-imx-fix-.is_enabled-of-shared-gate-clock.patch arm-8165-1-alignment-don-t-break-misaligned-neon-load-store.patch arm-8178-1-fix-set_tls-for-config_kuser_helpers.patch +mips-zboot-add-missing-linux-string.h-include.patch +mips-fix-mfc1-mfhc1-emulation-for-64-bit-mips-systems.patch +mips-mcount-adjust-stack-pointer-for-static-trace-in-mips32.patch +acpica-update-to-gpio-region-handler-interface.patch +gpio-acpi-use-pin-index-and-bit-length.patch +acpi-platform-lpss-disable-async-suspend-resume-of-lpss-devices.patch +acpi-hotplug-generate-online-uevents-for-acpi-containers.patch +acpi-scan-correct-error-return-value-of-create_modalias.patch +acpi-video-disable-native-backlight-for-thinkpad-x201s.patch -- 2.47.3