From: Greg Kroah-Hartman Date: Wed, 30 Apr 2014 00:39:47 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v3.4.89~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0fde615bca4a4d7e288c4fb347ee94dcef52c74;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: acpica-restore-code-that-repairs-null-package-elements-in-return-values.patch kvm-s390-optimize-ucontrol-path.patch mei-fix-memory-leak-of-pending-write-cb-objects.patch mei-ignore-client-writing-state-during-cb-completion.patch mei-me-do-not-load-the-driver-if-the-fw-doesn-t-support-mei-interface.patch s390-bitops-atomic-add-missing-memory-barriers.patch s390-cio-fix-driver-callback-initialization-for-ccw-consoles.patch s390-fix-control-register-update.patch spi-dw-don-t-call-kfree-for-memory-allocated-by-devm_kzalloc.patch spi-efm32-use-vendor-device-scheme-for-compatible-string.patch --- diff --git a/queue-3.14/acpica-restore-code-that-repairs-null-package-elements-in-return-values.patch b/queue-3.14/acpica-restore-code-that-repairs-null-package-elements-in-return-values.patch new file mode 100644 index 00000000000..089507bfb63 --- /dev/null +++ b/queue-3.14/acpica-restore-code-that-repairs-null-package-elements-in-return-values.patch @@ -0,0 +1,71 @@ +From 61db45ca21630f5ab7f678d54c5d969c21647854 Mon Sep 17 00:00:00 2001 +From: Lv Zheng +Date: Wed, 26 Feb 2014 10:29:40 +0800 +Subject: ACPICA: Restore code that repairs NULL package elements in return values. + +From: Lv Zheng + +commit 61db45ca21630f5ab7f678d54c5d969c21647854 upstream. + +The original code was lost accidently, it was not generated along with the +following commit of mechanism improvements and thus not get merged: + + Commit: d5a36100f62fa6db5541344e08b361b34e9114c5 + Subject: ACPICA: Add mechanism for early object repairs on a per-name basis + + Adds the framework to allow object repairs very early in the + return object analysis. Enables repairs like string->unicode, + etc. + +This patch restores the implementation of the NULL element repair code for +ACPI_RTYPE_NONE. In the original design, ACPI_RTYPE_NONE is defined to +collect simple NULL object repairs. +Lv Zheng. + +Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=67901 +Signed-off-by: Lv Zheng +Signed-off-by: Bob Moore +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/acpica/nsrepair.c | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) + +--- a/drivers/acpi/acpica/nsrepair.c ++++ b/drivers/acpi/acpica/nsrepair.c +@@ -207,13 +207,30 @@ acpi_ns_simple_repair(struct acpi_evalua + * this predefined name. Either one return value is expected, or none, + * for both methods and other objects. + * +- * Exit now if there is no return object. Warning if one was expected. ++ * Try to fix if there was no return object. Warning if failed to fix. + */ + if (!return_object) { + if (expected_btypes && (!(expected_btypes & ACPI_RTYPE_NONE))) { +- ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, +- ACPI_WARN_ALWAYS, +- "Missing expected return value")); ++ if (package_index != ACPI_NOT_PACKAGE_ELEMENT) { ++ ACPI_WARN_PREDEFINED((AE_INFO, ++ info->full_pathname, ++ ACPI_WARN_ALWAYS, ++ "Found unexpected NULL package element")); ++ ++ status = ++ acpi_ns_repair_null_element(info, ++ expected_btypes, ++ package_index, ++ return_object_ptr); ++ if (ACPI_SUCCESS(status)) { ++ return (AE_OK); /* Repair was successful */ ++ } ++ } else { ++ ACPI_WARN_PREDEFINED((AE_INFO, ++ info->full_pathname, ++ ACPI_WARN_ALWAYS, ++ "Missing expected return value")); ++ } + + return (AE_AML_NO_RETURN_VALUE); + } diff --git a/queue-3.14/kvm-s390-optimize-ucontrol-path.patch b/queue-3.14/kvm-s390-optimize-ucontrol-path.patch new file mode 100644 index 00000000000..2eba38078b6 --- /dev/null +++ b/queue-3.14/kvm-s390-optimize-ucontrol-path.patch @@ -0,0 +1,36 @@ +From 2955c83f72801245afd0fe5c560cc75b82bea9aa Mon Sep 17 00:00:00 2001 +From: Christian Borntraeger +Date: Thu, 6 Mar 2014 16:01:38 +0100 +Subject: KVM: s390: Optimize ucontrol path + +From: Christian Borntraeger + +commit 2955c83f72801245afd0fe5c560cc75b82bea9aa upstream. + +Since commit 7c470539c95630c1f2a10f109e96f249730b75eb +(s390/kvm: avoid automatic sie reentry) we will run through the C code +of KVM on host interrupts instead of just reentering the guest. This +will result in additional ucontrol exits (at least HZ per second). Let +handle a 0 intercept in the kernel and dont return to userspace, +even if in ucontrol mode. + +Signed-off-by: Christian Borntraeger +Reviewed-by: Cornelia Huck +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kvm/kvm-s390.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/s390/kvm/kvm-s390.c ++++ b/arch/s390/kvm/kvm-s390.c +@@ -753,7 +753,8 @@ static int vcpu_post_run(struct kvm_vcpu + + if (rc == 0) { + if (kvm_is_ucontrol(vcpu->kvm)) +- rc = -EOPNOTSUPP; ++ /* Don't exit for host interrupts. */ ++ rc = vcpu->arch.sie_block->icptcode ? -EOPNOTSUPP : 0; + else + rc = kvm_handle_sie_intercept(vcpu); + } diff --git a/queue-3.14/mei-fix-memory-leak-of-pending-write-cb-objects.patch b/queue-3.14/mei-fix-memory-leak-of-pending-write-cb-objects.patch new file mode 100644 index 00000000000..ee4c741d733 --- /dev/null +++ b/queue-3.14/mei-fix-memory-leak-of-pending-write-cb-objects.patch @@ -0,0 +1,171 @@ +From cc99ecfdac01215594c73907726b12f251c21e20 Mon Sep 17 00:00:00 2001 +From: Tomas Winkler +Date: Mon, 10 Mar 2014 15:10:40 +0200 +Subject: mei: fix memory leak of pending write cb objects + +From: Tomas Winkler + +commit cc99ecfdac01215594c73907726b12f251c21e20 upstream. + +Write callbacks are released on the write completed path but +when file handler is closed before the writes are +completed those are left dangling on write and write_waiting queues. + +We add mei_io_list_free function to perform this task + +Also move static functions to client.c form client.h + +Signed-off-by: Tomas Winkler +Signed-off-by: Alexander Usyskin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/mei/client.c | 76 +++++++++++++++++++++++++++++++++------------- + drivers/misc/mei/client.h | 18 ---------- + 2 files changed, 55 insertions(+), 39 deletions(-) + +--- a/drivers/misc/mei/client.c ++++ b/drivers/misc/mei/client.c +@@ -74,23 +74,69 @@ int mei_me_cl_by_id(struct mei_device *d + + + /** +- * mei_io_list_flush - removes list entry belonging to cl. ++ * mei_cl_cmp_id - tells if the clients are the same + * +- * @list: An instance of our list structure +- * @cl: host client ++ * @cl1: host client 1 ++ * @cl2: host client 2 ++ * ++ * returns true - if the clients has same host and me ids ++ * false - otherwise ++ */ ++static inline bool mei_cl_cmp_id(const struct mei_cl *cl1, ++ const struct mei_cl *cl2) ++{ ++ return cl1 && cl2 && ++ (cl1->host_client_id == cl2->host_client_id) && ++ (cl1->me_client_id == cl2->me_client_id); ++} ++ ++/** ++ * mei_io_list_flush - removes cbs belonging to cl. ++ * ++ * @list: an instance of our list structure ++ * @cl: host client, can be NULL for flushing the whole list ++ * @free: whether to free the cbs + */ +-void mei_io_list_flush(struct mei_cl_cb *list, struct mei_cl *cl) ++static void __mei_io_list_flush(struct mei_cl_cb *list, ++ struct mei_cl *cl, bool free) + { + struct mei_cl_cb *cb; + struct mei_cl_cb *next; + ++ /* enable removing everything if no cl is specified */ + list_for_each_entry_safe(cb, next, &list->list, list) { +- if (cb->cl && mei_cl_cmp_id(cl, cb->cl)) ++ if (!cl || (cb->cl && mei_cl_cmp_id(cl, cb->cl))) { + list_del(&cb->list); ++ if (free) ++ mei_io_cb_free(cb); ++ } + } + } + + /** ++ * mei_io_list_flush - removes list entry belonging to cl. ++ * ++ * @list: An instance of our list structure ++ * @cl: host client ++ */ ++static inline void mei_io_list_flush(struct mei_cl_cb *list, struct mei_cl *cl) ++{ ++ __mei_io_list_flush(list, cl, false); ++} ++ ++ ++/** ++ * mei_io_list_free - removes cb belonging to cl and free them ++ * ++ * @list: An instance of our list structure ++ * @cl: host client ++ */ ++static inline void mei_io_list_free(struct mei_cl_cb *list, struct mei_cl *cl) ++{ ++ __mei_io_list_flush(list, cl, true); ++} ++ ++/** + * mei_io_cb_free - free mei_cb_private related memory + * + * @cb: mei callback struct +@@ -196,8 +242,8 @@ int mei_cl_flush_queues(struct mei_cl *c + + cl_dbg(dev, cl, "remove list entry belonging to cl\n"); + mei_io_list_flush(&cl->dev->read_list, cl); +- mei_io_list_flush(&cl->dev->write_list, cl); +- mei_io_list_flush(&cl->dev->write_waiting_list, cl); ++ mei_io_list_free(&cl->dev->write_list, cl); ++ mei_io_list_free(&cl->dev->write_waiting_list, cl); + mei_io_list_flush(&cl->dev->ctrl_wr_list, cl); + mei_io_list_flush(&cl->dev->ctrl_rd_list, cl); + mei_io_list_flush(&cl->dev->amthif_cmd_list, cl); +@@ -942,20 +988,8 @@ void mei_cl_all_wakeup(struct mei_device + */ + void mei_cl_all_write_clear(struct mei_device *dev) + { +- struct mei_cl_cb *cb, *next; +- struct list_head *list; +- +- list = &dev->write_list.list; +- list_for_each_entry_safe(cb, next, list, list) { +- list_del(&cb->list); +- mei_io_cb_free(cb); +- } +- +- list = &dev->write_waiting_list.list; +- list_for_each_entry_safe(cb, next, list, list) { +- list_del(&cb->list); +- mei_io_cb_free(cb); +- } ++ mei_io_list_free(&dev->write_list, NULL); ++ mei_io_list_free(&dev->write_waiting_list, NULL); + } + + +--- a/drivers/misc/mei/client.h ++++ b/drivers/misc/mei/client.h +@@ -45,8 +45,6 @@ static inline void mei_io_list_init(stru + { + INIT_LIST_HEAD(&list->list); + } +-void mei_io_list_flush(struct mei_cl_cb *list, struct mei_cl *cl); +- + /* + * MEI Host Client Functions + */ +@@ -61,22 +59,6 @@ int mei_cl_unlink(struct mei_cl *cl); + int mei_cl_flush_queues(struct mei_cl *cl); + struct mei_cl_cb *mei_cl_find_read_cb(struct mei_cl *cl); + +-/** +- * mei_cl_cmp_id - tells if file private data have same id +- * +- * @fe1: private data of 1. file object +- * @fe2: private data of 2. file object +- * +- * returns true - if ids are the same and not NULL +- */ +-static inline bool mei_cl_cmp_id(const struct mei_cl *cl1, +- const struct mei_cl *cl2) +-{ +- return cl1 && cl2 && +- (cl1->host_client_id == cl2->host_client_id) && +- (cl1->me_client_id == cl2->me_client_id); +-} +- + + int mei_cl_flow_ctrl_creds(struct mei_cl *cl); + diff --git a/queue-3.14/mei-ignore-client-writing-state-during-cb-completion.patch b/queue-3.14/mei-ignore-client-writing-state-during-cb-completion.patch new file mode 100644 index 00000000000..ec574dc6d98 --- /dev/null +++ b/queue-3.14/mei-ignore-client-writing-state-during-cb-completion.patch @@ -0,0 +1,53 @@ +From 34ec43661fe8f1977dd0f05353302ae2ed10aabb Mon Sep 17 00:00:00 2001 +From: Alexander Usyskin +Date: Tue, 1 Apr 2014 23:50:41 +0300 +Subject: mei: ignore client writing state during cb completion + +From: Alexander Usyskin + +commit 34ec43661fe8f1977dd0f05353302ae2ed10aabb upstream. + +Ignore client writing state during cb completion to fix a memory +leak. + +When moving cbs to the completion list we should not look at +writing_state as this state can be already overwritten by next +write, the fact that a cb is on the write waiting list means +that it was already written to the HW and we can safely complete it. + +Same pays for wait in poll handler, we do not have to check the state +wake is done after completion list processing. + +Signed-off-by: Alexander Usyskin +Signed-off-by: Tomas Winkler +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/mei/interrupt.c | 3 +-- + drivers/misc/mei/main.c | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/misc/mei/interrupt.c ++++ b/drivers/misc/mei/interrupt.c +@@ -428,8 +428,7 @@ int mei_irq_write_handler(struct mei_dev + + cl->status = 0; + list_del(&cb->list); +- if (MEI_WRITING == cl->writing_state && +- cb->fop_type == MEI_FOP_WRITE && ++ if (cb->fop_type == MEI_FOP_WRITE && + cl != &dev->iamthif_cl) { + cl_dbg(dev, cl, "MEI WRITE COMPLETE\n"); + cl->writing_state = MEI_WRITE_COMPLETE; +--- a/drivers/misc/mei/main.c ++++ b/drivers/misc/mei/main.c +@@ -653,8 +653,7 @@ static unsigned int mei_poll(struct file + goto out; + } + +- if (MEI_WRITE_COMPLETE == cl->writing_state) +- mask |= (POLLIN | POLLRDNORM); ++ mask |= (POLLIN | POLLRDNORM); + + out: + mutex_unlock(&dev->device_lock); diff --git a/queue-3.14/mei-me-do-not-load-the-driver-if-the-fw-doesn-t-support-mei-interface.patch b/queue-3.14/mei-me-do-not-load-the-driver-if-the-fw-doesn-t-support-mei-interface.patch new file mode 100644 index 00000000000..2116e4f62f7 --- /dev/null +++ b/queue-3.14/mei-me-do-not-load-the-driver-if-the-fw-doesn-t-support-mei-interface.patch @@ -0,0 +1,84 @@ +From 5e6533a6f52f1a8283b2f818f5828be99a417dd6 Mon Sep 17 00:00:00 2001 +From: Tomas Winkler +Date: Tue, 25 Mar 2014 21:25:18 +0200 +Subject: mei: me: do not load the driver if the FW doesn't support MEI interface + +From: Tomas Winkler + +commit 5e6533a6f52f1a8283b2f818f5828be99a417dd6 upstream. + +NM and SPS FW types that may run on ME device on server platforms +do not have valid MEI/HECI interface and driver should not +be bound to it as this might lead to system hung. +In practice not all BIOSes effectively hide such devices from the +OS and in some cases it is not possible. + +We determine FW type by examining Host FW status registers in order to +unbind the driver. +In this patch we are adding check for ME on Cougar Point, Lynx Point +Devices + +Signed-off-by: Tomas Winkler +Tested-by: Nikola Ciprich +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/mei/hw-me-regs.h | 5 +++++ + drivers/misc/mei/pci-me.c | 30 +++++++++++++++++++++++------- + 2 files changed, 28 insertions(+), 7 deletions(-) + +--- a/drivers/misc/mei/hw-me-regs.h ++++ b/drivers/misc/mei/hw-me-regs.h +@@ -115,6 +115,11 @@ + #define MEI_DEV_ID_LPT_HR 0x8CBA /* Lynx Point H Refresh */ + + #define MEI_DEV_ID_WPT_LP 0x9CBA /* Wildcat Point LP */ ++ ++/* Host Firmware Status Registers in PCI Config Space */ ++#define PCI_CFG_HFS_1 0x40 ++#define PCI_CFG_HFS_2 0x48 ++ + /* + * MEI HW Section + */ +--- a/drivers/misc/mei/pci-me.c ++++ b/drivers/misc/mei/pci-me.c +@@ -100,15 +100,31 @@ static bool mei_me_quirk_probe(struct pc + const struct pci_device_id *ent) + { + u32 reg; +- if (ent->device == MEI_DEV_ID_PBG_1) { +- pci_read_config_dword(pdev, 0x48, ®); +- /* make sure that bit 9 is up and bit 10 is down */ +- if ((reg & 0x600) == 0x200) { +- dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n"); +- return false; +- } ++ /* Cougar Point || Patsburg */ ++ if (ent->device == MEI_DEV_ID_CPT_1 || ++ ent->device == MEI_DEV_ID_PBG_1) { ++ pci_read_config_dword(pdev, PCI_CFG_HFS_2, ®); ++ /* make sure that bit 9 (NM) is up and bit 10 (DM) is down */ ++ if ((reg & 0x600) == 0x200) ++ goto no_mei; + } ++ ++ /* Lynx Point */ ++ if (ent->device == MEI_DEV_ID_LPT_H || ++ ent->device == MEI_DEV_ID_LPT_W || ++ ent->device == MEI_DEV_ID_LPT_HR) { ++ /* Read ME FW Status check for SPS Firmware */ ++ pci_read_config_dword(pdev, PCI_CFG_HFS_1, ®); ++ /* if bits [19:16] = 15, running SPS Firmware */ ++ if ((reg & 0xf0000) == 0xf0000) ++ goto no_mei; ++ } ++ + return true; ++ ++no_mei: ++ dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n"); ++ return false; + } + /** + * mei_probe - Device Initialization Routine diff --git a/queue-3.14/s390-bitops-atomic-add-missing-memory-barriers.patch b/queue-3.14/s390-bitops-atomic-add-missing-memory-barriers.patch new file mode 100644 index 00000000000..ab0a7a83053 --- /dev/null +++ b/queue-3.14/s390-bitops-atomic-add-missing-memory-barriers.patch @@ -0,0 +1,366 @@ +From 0ccc8b7ac86053388e793bad20bd26bd777752eb Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Thu, 20 Mar 2014 08:55:00 +0100 +Subject: s390/bitops,atomic: add missing memory barriers + +From: Heiko Carstens + +commit 0ccc8b7ac86053388e793bad20bd26bd777752eb upstream. + +When reworking the bitops and atomic ops I missed that those instructions +that got atomic behaviour only perform a "specific-operand-serialization" +instead of a full "serialization". +The compare-and-swap instruction used before performs a full serialization +before and after the instruction is executed, which means it has full +memory barrier semantics. +In order to give the new bitops and atomic ops functions also full memory +barrier semantics add a "bcr 14,0" before and after each of those new +instructions which performs full serialization as well. + +This restores memory barrier semantics for bitops and atomic ops functions +which return values, like e.g. atomic_add_return(), but not for functions +which do not return a value, like e.g. atomic_add(). +This is consistent to other architectures and what common code requires. + +Signed-off-by: Heiko Carstens +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/include/asm/atomic.h | 70 ++++++++++++++++++++++++----------------- + arch/s390/include/asm/bitops.h | 41 +++++++++++++----------- + 2 files changed, 65 insertions(+), 46 deletions(-) + +--- a/arch/s390/include/asm/atomic.h ++++ b/arch/s390/include/asm/atomic.h +@@ -15,23 +15,29 @@ + + #include + #include ++#include + #include + + #define ATOMIC_INIT(i) { (i) } + ++#define __ATOMIC_NO_BARRIER "\n" ++ + #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES + + #define __ATOMIC_OR "lao" + #define __ATOMIC_AND "lan" + #define __ATOMIC_ADD "laa" ++#define __ATOMIC_BARRIER "bcr 14,0\n" + +-#define __ATOMIC_LOOP(ptr, op_val, op_string) \ ++#define __ATOMIC_LOOP(ptr, op_val, op_string, __barrier) \ + ({ \ + int old_val; \ + \ + typecheck(atomic_t *, ptr); \ + asm volatile( \ ++ __barrier \ + op_string " %0,%2,%1\n" \ ++ __barrier \ + : "=d" (old_val), "+Q" ((ptr)->counter) \ + : "d" (op_val) \ + : "cc", "memory"); \ +@@ -43,8 +49,9 @@ + #define __ATOMIC_OR "or" + #define __ATOMIC_AND "nr" + #define __ATOMIC_ADD "ar" ++#define __ATOMIC_BARRIER "\n" + +-#define __ATOMIC_LOOP(ptr, op_val, op_string) \ ++#define __ATOMIC_LOOP(ptr, op_val, op_string, __barrier) \ + ({ \ + int old_val, new_val; \ + \ +@@ -82,7 +89,7 @@ static inline void atomic_set(atomic_t * + + static inline int atomic_add_return(int i, atomic_t *v) + { +- return __ATOMIC_LOOP(v, i, __ATOMIC_ADD) + i; ++ return __ATOMIC_LOOP(v, i, __ATOMIC_ADD, __ATOMIC_BARRIER) + i; + } + + static inline void atomic_add(int i, atomic_t *v) +@@ -94,12 +101,10 @@ static inline void atomic_add(int i, ato + : "+Q" (v->counter) + : "i" (i) + : "cc", "memory"); +- } else { +- atomic_add_return(i, v); ++ return; + } +-#else +- atomic_add_return(i, v); + #endif ++ __ATOMIC_LOOP(v, i, __ATOMIC_ADD, __ATOMIC_NO_BARRIER); + } + + #define atomic_add_negative(_i, _v) (atomic_add_return(_i, _v) < 0) +@@ -115,12 +120,12 @@ static inline void atomic_add(int i, ato + + static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) + { +- __ATOMIC_LOOP(v, ~mask, __ATOMIC_AND); ++ __ATOMIC_LOOP(v, ~mask, __ATOMIC_AND, __ATOMIC_NO_BARRIER); + } + + static inline void atomic_set_mask(unsigned int mask, atomic_t *v) + { +- __ATOMIC_LOOP(v, mask, __ATOMIC_OR); ++ __ATOMIC_LOOP(v, mask, __ATOMIC_OR, __ATOMIC_NO_BARRIER); + } + + #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) +@@ -157,19 +162,24 @@ static inline int __atomic_add_unless(at + + #ifdef CONFIG_64BIT + ++#define __ATOMIC64_NO_BARRIER "\n" ++ + #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES + + #define __ATOMIC64_OR "laog" + #define __ATOMIC64_AND "lang" + #define __ATOMIC64_ADD "laag" ++#define __ATOMIC64_BARRIER "bcr 14,0\n" + +-#define __ATOMIC64_LOOP(ptr, op_val, op_string) \ ++#define __ATOMIC64_LOOP(ptr, op_val, op_string, __barrier) \ + ({ \ + long long old_val; \ + \ + typecheck(atomic64_t *, ptr); \ + asm volatile( \ ++ __barrier \ + op_string " %0,%2,%1\n" \ ++ __barrier \ + : "=d" (old_val), "+Q" ((ptr)->counter) \ + : "d" (op_val) \ + : "cc", "memory"); \ +@@ -181,8 +191,9 @@ static inline int __atomic_add_unless(at + #define __ATOMIC64_OR "ogr" + #define __ATOMIC64_AND "ngr" + #define __ATOMIC64_ADD "agr" ++#define __ATOMIC64_BARRIER "\n" + +-#define __ATOMIC64_LOOP(ptr, op_val, op_string) \ ++#define __ATOMIC64_LOOP(ptr, op_val, op_string, __barrier) \ + ({ \ + long long old_val, new_val; \ + \ +@@ -220,17 +231,32 @@ static inline void atomic64_set(atomic64 + + static inline long long atomic64_add_return(long long i, atomic64_t *v) + { +- return __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD) + i; ++ return __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD, __ATOMIC64_BARRIER) + i; ++} ++ ++static inline void atomic64_add(long long i, atomic64_t *v) ++{ ++#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES ++ if (__builtin_constant_p(i) && (i > -129) && (i < 128)) { ++ asm volatile( ++ "agsi %0,%1\n" ++ : "+Q" (v->counter) ++ : "i" (i) ++ : "cc", "memory"); ++ return; ++ } ++#endif ++ __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD, __ATOMIC64_NO_BARRIER); + } + + static inline void atomic64_clear_mask(unsigned long mask, atomic64_t *v) + { +- __ATOMIC64_LOOP(v, ~mask, __ATOMIC64_AND); ++ __ATOMIC64_LOOP(v, ~mask, __ATOMIC64_AND, __ATOMIC64_NO_BARRIER); + } + + static inline void atomic64_set_mask(unsigned long mask, atomic64_t *v) + { +- __ATOMIC64_LOOP(v, mask, __ATOMIC64_OR); ++ __ATOMIC64_LOOP(v, mask, __ATOMIC64_OR, __ATOMIC64_NO_BARRIER); + } + + #define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) +@@ -334,25 +360,13 @@ static inline void atomic64_clear_mask(u + } while (atomic64_cmpxchg(v, old, new) != old); + } + +-#endif /* CONFIG_64BIT */ +- + static inline void atomic64_add(long long i, atomic64_t *v) + { +-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES +- if (__builtin_constant_p(i) && (i > -129) && (i < 128)) { +- asm volatile( +- "agsi %0,%1\n" +- : "+Q" (v->counter) +- : "i" (i) +- : "cc", "memory"); +- } else { +- atomic64_add_return(i, v); +- } +-#else + atomic64_add_return(i, v); +-#endif + } + ++#endif /* CONFIG_64BIT */ ++ + static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u) + { + long long c, old; +--- a/arch/s390/include/asm/bitops.h ++++ b/arch/s390/include/asm/bitops.h +@@ -47,14 +47,18 @@ + + #include + #include ++#include ++ ++#define __BITOPS_NO_BARRIER "\n" + + #ifndef CONFIG_64BIT + + #define __BITOPS_OR "or" + #define __BITOPS_AND "nr" + #define __BITOPS_XOR "xr" ++#define __BITOPS_BARRIER "\n" + +-#define __BITOPS_LOOP(__addr, __val, __op_string) \ ++#define __BITOPS_LOOP(__addr, __val, __op_string, __barrier) \ + ({ \ + unsigned long __old, __new; \ + \ +@@ -67,7 +71,7 @@ + " jl 0b" \ + : "=&d" (__old), "=&d" (__new), "+Q" (*(__addr))\ + : "d" (__val) \ +- : "cc"); \ ++ : "cc", "memory"); \ + __old; \ + }) + +@@ -78,17 +82,20 @@ + #define __BITOPS_OR "laog" + #define __BITOPS_AND "lang" + #define __BITOPS_XOR "laxg" ++#define __BITOPS_BARRIER "bcr 14,0\n" + +-#define __BITOPS_LOOP(__addr, __val, __op_string) \ ++#define __BITOPS_LOOP(__addr, __val, __op_string, __barrier) \ + ({ \ + unsigned long __old; \ + \ + typecheck(unsigned long *, (__addr)); \ + asm volatile( \ ++ __barrier \ + __op_string " %0,%2,%1\n" \ ++ __barrier \ + : "=d" (__old), "+Q" (*(__addr)) \ + : "d" (__val) \ +- : "cc"); \ ++ : "cc", "memory"); \ + __old; \ + }) + +@@ -97,8 +104,9 @@ + #define __BITOPS_OR "ogr" + #define __BITOPS_AND "ngr" + #define __BITOPS_XOR "xgr" ++#define __BITOPS_BARRIER "\n" + +-#define __BITOPS_LOOP(__addr, __val, __op_string) \ ++#define __BITOPS_LOOP(__addr, __val, __op_string, __barrier) \ + ({ \ + unsigned long __old, __new; \ + \ +@@ -111,7 +119,7 @@ + " jl 0b" \ + : "=&d" (__old), "=&d" (__new), "+Q" (*(__addr))\ + : "d" (__val) \ +- : "cc"); \ ++ : "cc", "memory"); \ + __old; \ + }) + +@@ -149,12 +157,12 @@ static inline void set_bit(unsigned long + "oi %0,%b1\n" + : "+Q" (*caddr) + : "i" (1 << (nr & 7)) +- : "cc"); ++ : "cc", "memory"); + return; + } + #endif + mask = 1UL << (nr & (BITS_PER_LONG - 1)); +- __BITOPS_LOOP(addr, mask, __BITOPS_OR); ++ __BITOPS_LOOP(addr, mask, __BITOPS_OR, __BITOPS_NO_BARRIER); + } + + static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr) +@@ -170,12 +178,12 @@ static inline void clear_bit(unsigned lo + "ni %0,%b1\n" + : "+Q" (*caddr) + : "i" (~(1 << (nr & 7))) +- : "cc"); ++ : "cc", "memory"); + return; + } + #endif + mask = ~(1UL << (nr & (BITS_PER_LONG - 1))); +- __BITOPS_LOOP(addr, mask, __BITOPS_AND); ++ __BITOPS_LOOP(addr, mask, __BITOPS_AND, __BITOPS_NO_BARRIER); + } + + static inline void change_bit(unsigned long nr, volatile unsigned long *ptr) +@@ -191,12 +199,12 @@ static inline void change_bit(unsigned l + "xi %0,%b1\n" + : "+Q" (*caddr) + : "i" (1 << (nr & 7)) +- : "cc"); ++ : "cc", "memory"); + return; + } + #endif + mask = 1UL << (nr & (BITS_PER_LONG - 1)); +- __BITOPS_LOOP(addr, mask, __BITOPS_XOR); ++ __BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_NO_BARRIER); + } + + static inline int +@@ -206,8 +214,7 @@ test_and_set_bit(unsigned long nr, volat + unsigned long old, mask; + + mask = 1UL << (nr & (BITS_PER_LONG - 1)); +- old = __BITOPS_LOOP(addr, mask, __BITOPS_OR); +- barrier(); ++ old = __BITOPS_LOOP(addr, mask, __BITOPS_OR, __BITOPS_BARRIER); + return (old & mask) != 0; + } + +@@ -218,8 +225,7 @@ test_and_clear_bit(unsigned long nr, vol + unsigned long old, mask; + + mask = ~(1UL << (nr & (BITS_PER_LONG - 1))); +- old = __BITOPS_LOOP(addr, mask, __BITOPS_AND); +- barrier(); ++ old = __BITOPS_LOOP(addr, mask, __BITOPS_AND, __BITOPS_BARRIER); + return (old & ~mask) != 0; + } + +@@ -230,8 +236,7 @@ test_and_change_bit(unsigned long nr, vo + unsigned long old, mask; + + mask = 1UL << (nr & (BITS_PER_LONG - 1)); +- old = __BITOPS_LOOP(addr, mask, __BITOPS_XOR); +- barrier(); ++ old = __BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_BARRIER); + return (old & mask) != 0; + } + diff --git a/queue-3.14/s390-cio-fix-driver-callback-initialization-for-ccw-consoles.patch b/queue-3.14/s390-cio-fix-driver-callback-initialization-for-ccw-consoles.patch new file mode 100644 index 00000000000..3079c4dd816 --- /dev/null +++ b/queue-3.14/s390-cio-fix-driver-callback-initialization-for-ccw-consoles.patch @@ -0,0 +1,137 @@ +From 2253e8d79237c69086ded391e6767afe16972527 Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Mon, 27 Jan 2014 13:26:10 +0100 +Subject: s390/cio: fix driver callback initialization for ccw consoles + +From: Sebastian Ott + +commit 2253e8d79237c69086ded391e6767afe16972527 upstream. + +ccw consoles are in use before they can be properly registered with +the driver core. For devices which are in use by a device driver we +rely on the ccw_device's pointer to the driver callbacks to be valid. +For ccw consoles this pointer is NULL until they are registered later +during boot and we dereferenced this pointer. This worked by +chance on 64 bit builds (cdev->drv was NULL but the optional callback +cdev->drv->path_event was also NULL by coincidence) and was unnoticed +until we received reports about boot failures on 31 bit systems. +Fix it by initializing the driver pointer for ccw consoles. + +Reported-by: Mike Frysinger +Reported-by: Heiko Carstens +Reviewed-by: Peter Oberparleiter +Signed-off-by: Sebastian Ott +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/include/asm/ccwdev.h | 2 +- + drivers/s390/char/con3215.c | 2 +- + drivers/s390/char/con3270.c | 6 +----- + drivers/s390/char/raw3270.c | 10 +++++++++- + drivers/s390/char/raw3270.h | 2 +- + drivers/s390/cio/device.c | 3 ++- + 6 files changed, 15 insertions(+), 10 deletions(-) + +--- a/arch/s390/include/asm/ccwdev.h ++++ b/arch/s390/include/asm/ccwdev.h +@@ -219,7 +219,7 @@ extern void ccw_device_get_id(struct ccw + #define to_ccwdev(n) container_of(n, struct ccw_device, dev) + #define to_ccwdrv(n) container_of(n, struct ccw_driver, driver) + +-extern struct ccw_device *ccw_device_probe_console(void); ++extern struct ccw_device *ccw_device_probe_console(struct ccw_driver *); + extern void ccw_device_wait_idle(struct ccw_device *); + extern int ccw_device_force_console(struct ccw_device *); + +--- a/drivers/s390/char/con3215.c ++++ b/drivers/s390/char/con3215.c +@@ -922,7 +922,7 @@ static int __init con3215_init(void) + raw3215_freelist = req; + } + +- cdev = ccw_device_probe_console(); ++ cdev = ccw_device_probe_console(&raw3215_ccw_driver); + if (IS_ERR(cdev)) + return -ENODEV; + +--- a/drivers/s390/char/con3270.c ++++ b/drivers/s390/char/con3270.c +@@ -576,7 +576,6 @@ static struct console con3270 = { + static int __init + con3270_init(void) + { +- struct ccw_device *cdev; + struct raw3270 *rp; + void *cbuf; + int i; +@@ -591,10 +590,7 @@ con3270_init(void) + cpcmd("TERM AUTOCR OFF", NULL, 0, NULL); + } + +- cdev = ccw_device_probe_console(); +- if (IS_ERR(cdev)) +- return -ENODEV; +- rp = raw3270_setup_console(cdev); ++ rp = raw3270_setup_console(); + if (IS_ERR(rp)) + return PTR_ERR(rp); + +--- a/drivers/s390/char/raw3270.c ++++ b/drivers/s390/char/raw3270.c +@@ -776,16 +776,24 @@ raw3270_setup_device(struct ccw_device * + } + + #ifdef CONFIG_TN3270_CONSOLE ++/* Tentative definition - see below for actual definition. */ ++static struct ccw_driver raw3270_ccw_driver; ++ + /* + * Setup 3270 device configured as console. + */ +-struct raw3270 __init *raw3270_setup_console(struct ccw_device *cdev) ++struct raw3270 __init *raw3270_setup_console(void) + { ++ struct ccw_device *cdev; + unsigned long flags; + struct raw3270 *rp; + char *ascebc; + int rc; + ++ cdev = ccw_device_probe_console(&raw3270_ccw_driver); ++ if (IS_ERR(cdev)) ++ return ERR_CAST(cdev); ++ + rp = kzalloc(sizeof(struct raw3270), GFP_KERNEL | GFP_DMA); + ascebc = kzalloc(256, GFP_KERNEL); + rc = raw3270_setup_device(cdev, rp, ascebc); +--- a/drivers/s390/char/raw3270.h ++++ b/drivers/s390/char/raw3270.h +@@ -190,7 +190,7 @@ raw3270_put_view(struct raw3270_view *vi + wake_up(&raw3270_wait_queue); + } + +-struct raw3270 *raw3270_setup_console(struct ccw_device *cdev); ++struct raw3270 *raw3270_setup_console(void); + void raw3270_wait_cons_dev(struct raw3270 *); + + /* Notifier for device addition/removal */ +--- a/drivers/s390/cio/device.c ++++ b/drivers/s390/cio/device.c +@@ -1609,7 +1609,7 @@ out_unlock: + return rc; + } + +-struct ccw_device *ccw_device_probe_console(void) ++struct ccw_device *ccw_device_probe_console(struct ccw_driver *drv) + { + struct io_subchannel_private *io_priv; + struct ccw_device *cdev; +@@ -1631,6 +1631,7 @@ struct ccw_device *ccw_device_probe_cons + kfree(io_priv); + return cdev; + } ++ cdev->drv = drv; + set_io_private(sch, io_priv); + ret = ccw_device_console_enable(cdev, sch); + if (ret) { diff --git a/queue-3.14/s390-fix-control-register-update.patch b/queue-3.14/s390-fix-control-register-update.patch new file mode 100644 index 00000000000..e73bfc5fb1c --- /dev/null +++ b/queue-3.14/s390-fix-control-register-update.patch @@ -0,0 +1,32 @@ +From a8a934e44f2bd0ed613e1aa0471e3478c6a9228a Mon Sep 17 00:00:00 2001 +From: Martin Schwidefsky +Date: Tue, 1 Apr 2014 13:45:33 +0200 +Subject: s390: fix control register update + +From: Martin Schwidefsky + +commit a8a934e44f2bd0ed613e1aa0471e3478c6a9228a upstream. + +The git commit c63badebfebacdba827ab1cc1d420fc81bd8d818 +"s390: optimize control register update" broke the update for +control register 0. After the update do the lctlg from the correct +value. + +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/ptrace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/s390/kernel/ptrace.c ++++ b/arch/s390/kernel/ptrace.c +@@ -64,7 +64,7 @@ void update_cr_regs(struct task_struct * + if (task->thread.per_flags & PER_FLAG_NO_TE) + cr_new &= ~(1UL << 55); + if (cr_new != cr) +- __ctl_load(cr, 0, 0); ++ __ctl_load(cr_new, 0, 0); + /* Set or clear transaction execution TDC bits 62 and 63. */ + __ctl_store(cr, 2, 2); + cr_new = cr & ~3UL; diff --git a/queue-3.14/series b/queue-3.14/series index 5c69df6d812..e08c58d9bb5 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -26,3 +26,13 @@ alsa-ice1712-fix-boundary-checks-in-pcm-pointer-ops.patch alsa-hda-fix-silent-speaker-output-due-to-mute-led-fixup.patch alsa-hda-realtek-add-support-of-alc288-codec.patch alsa-hda-realtek-add-headset-mic-support-for-dell-machine.patch +acpica-restore-code-that-repairs-null-package-elements-in-return-values.patch +spi-efm32-use-vendor-device-scheme-for-compatible-string.patch +spi-dw-don-t-call-kfree-for-memory-allocated-by-devm_kzalloc.patch +s390-cio-fix-driver-callback-initialization-for-ccw-consoles.patch +kvm-s390-optimize-ucontrol-path.patch +s390-bitops-atomic-add-missing-memory-barriers.patch +s390-fix-control-register-update.patch +mei-fix-memory-leak-of-pending-write-cb-objects.patch +mei-me-do-not-load-the-driver-if-the-fw-doesn-t-support-mei-interface.patch +mei-ignore-client-writing-state-during-cb-completion.patch diff --git a/queue-3.14/spi-dw-don-t-call-kfree-for-memory-allocated-by-devm_kzalloc.patch b/queue-3.14/spi-dw-don-t-call-kfree-for-memory-allocated-by-devm_kzalloc.patch new file mode 100644 index 00000000000..b88560e6198 --- /dev/null +++ b/queue-3.14/spi-dw-don-t-call-kfree-for-memory-allocated-by-devm_kzalloc.patch @@ -0,0 +1,45 @@ +From c63f5da00845143de621e991ea186be0829647ee Mon Sep 17 00:00:00 2001 +From: Axel Lin +Date: Tue, 25 Mar 2014 12:44:13 +0800 +Subject: spi: dw: Don't call kfree for memory allocated by devm_kzalloc + +From: Axel Lin + +commit c63f5da00845143de621e991ea186be0829647ee upstream. + +With devm_kzalloc, the memory is automatically freed when spi_device detach from +the bus. + +Fixes: commit 43f627ac9de42 (spi: dw: fix memory leak on error path) +Signed-off-by: Axel Lin +Acked-by: Baruch Siach +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-dw.c | 7 ------- + 1 file changed, 7 deletions(-) + +--- a/drivers/spi/spi-dw.c ++++ b/drivers/spi/spi-dw.c +@@ -671,12 +671,6 @@ static int dw_spi_setup(struct spi_devic + return 0; + } + +-static void dw_spi_cleanup(struct spi_device *spi) +-{ +- struct chip_data *chip = spi_get_ctldata(spi); +- kfree(chip); +-} +- + static int init_queue(struct dw_spi *dws) + { + INIT_LIST_HEAD(&dws->queue); +@@ -806,7 +800,6 @@ int dw_spi_add_host(struct device *dev, + master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16); + master->bus_num = dws->bus_num; + master->num_chipselect = dws->num_cs; +- master->cleanup = dw_spi_cleanup; + master->setup = dw_spi_setup; + master->transfer = dw_spi_transfer; + diff --git a/queue-3.14/spi-efm32-use-vendor-device-scheme-for-compatible-string.patch b/queue-3.14/spi-efm32-use-vendor-device-scheme-for-compatible-string.patch new file mode 100644 index 00000000000..b87771ce640 --- /dev/null +++ b/queue-3.14/spi-efm32-use-vendor-device-scheme-for-compatible-string.patch @@ -0,0 +1,58 @@ +From 12f6dd860cf8bf036c0bec38c00a53da71bcd43a Mon Sep 17 00:00:00 2001 +From: Uwe Kleine-König +Date: Tue, 25 Mar 2014 15:51:50 +0100 +Subject: spi: efm32: use $vendor,$device scheme for compatible string +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +commit 12f6dd860cf8bf036c0bec38c00a53da71bcd43a upstream. + +Wolfram Sang pointed out that "efm32,$device" is non-standard. So use the +common scheme and prefix device with "efm32-". The old compatible string +is left in place until arch/arm/boot/dts/efm32* is fixed. + +Signed-off-by: Uwe Kleine-König +Acked-by: Wolfram Sang +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/devicetree/bindings/spi/efm32-spi.txt | 4 ++-- + drivers/spi/spi-efm32.c | 3 +++ + 2 files changed, 5 insertions(+), 2 deletions(-) + +--- a/Documentation/devicetree/bindings/spi/efm32-spi.txt ++++ b/Documentation/devicetree/bindings/spi/efm32-spi.txt +@@ -3,7 +3,7 @@ + Required properties: + - #address-cells: see spi-bus.txt + - #size-cells: see spi-bus.txt +-- compatible: should be "efm32,spi" ++- compatible: should be "energymicro,efm32-spi" + - reg: Offset and length of the register set for the controller + - interrupts: pair specifying rx and tx irq + - clocks: phandle to the spi clock +@@ -15,7 +15,7 @@ Example: + spi1: spi@0x4000c400 { /* USART1 */ + #address-cells = <1>; + #size-cells = <0>; +- compatible = "efm32,spi"; ++ compatible = "energymicro,efm32-spi"; + reg = <0x4000c400 0x400>; + interrupts = <15 16>; + clocks = <&cmu 20>; +--- a/drivers/spi/spi-efm32.c ++++ b/drivers/spi/spi-efm32.c +@@ -487,6 +487,9 @@ static int efm32_spi_remove(struct platf + + static const struct of_device_id efm32_spi_dt_ids[] = { + { ++ .compatible = "energymicro,efm32-spi", ++ }, { ++ /* doesn't follow the "vendor,device" scheme, don't use */ + .compatible = "efm32,spi", + }, { + /* sentinel */