From: Greg Kroah-Hartman Date: Thu, 27 Sep 2012 00:13:37 +0000 (-0700) Subject: 3.5-stable patches X-Git-Tag: v3.0.44~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7109b0b6aa5edc8fe0050e199c37023f891f125a;p=thirdparty%2Fkernel%2Fstable-queue.git 3.5-stable patches added patches: gianfar-fix-phc-index-build-failure.patch input-wacom-add-support-to-cintiq-22hd.patch iwlwifi-don-t-double-free-the-interrupt-in-failure-path.patch iwlwifi-fix-flow-handler-debug-code.patch iwlwifi-protect-sram-debugfs.patch workqueue-unbound-rebind-morphing-in-rebind_workers-should-be-atomic.patch --- diff --git a/queue-3.5/gianfar-fix-phc-index-build-failure.patch b/queue-3.5/gianfar-fix-phc-index-build-failure.patch new file mode 100644 index 00000000000..475a59678d1 --- /dev/null +++ b/queue-3.5/gianfar-fix-phc-index-build-failure.patch @@ -0,0 +1,55 @@ +From 28889b7e7818342f6c254e27b9b2c68702ab867a Mon Sep 17 00:00:00 2001 +From: Richard Cochran +Date: Thu, 20 Sep 2012 19:11:12 +0000 +Subject: gianfar: fix phc index build failure + +From: Richard Cochran + +commit 28889b7e7818342f6c254e27b9b2c68702ab867a upstream. + +This patch fixes a build failure introduced in commit 66636287 +("gianfar: Support the get_ts_info ethtool method."). Not only was a +global variable inconsistently named, but also it was not exported as +it should have been. + +This fix is also needed in stable version 3.5. + +Signed-off-by: Richard Cochran +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/freescale/gianfar_ethtool.c | 1 + + drivers/net/ethernet/freescale/gianfar_ptp.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c ++++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c +@@ -1741,6 +1741,7 @@ static int gfar_get_nfc(struct net_devic + } + + int gfar_phc_index = -1; ++EXPORT_SYMBOL(gfar_phc_index); + + static int gfar_get_ts_info(struct net_device *dev, + struct ethtool_ts_info *info) +--- a/drivers/net/ethernet/freescale/gianfar_ptp.c ++++ b/drivers/net/ethernet/freescale/gianfar_ptp.c +@@ -515,7 +515,7 @@ static int gianfar_ptp_probe(struct plat + err = PTR_ERR(etsects->clock); + goto no_clock; + } +- gfar_phc_clock = ptp_clock_index(etsects->clock); ++ gfar_phc_index = ptp_clock_index(etsects->clock); + + dev_set_drvdata(&dev->dev, etsects); + +@@ -539,7 +539,7 @@ static int gianfar_ptp_remove(struct pla + gfar_write(&etsects->regs->tmr_temask, 0); + gfar_write(&etsects->regs->tmr_ctrl, 0); + +- gfar_phc_clock = -1; ++ gfar_phc_index = -1; + ptp_clock_unregister(etsects->clock); + iounmap(etsects->regs); + release_resource(etsects->rsrc); diff --git a/queue-3.5/input-wacom-add-support-to-cintiq-22hd.patch b/queue-3.5/input-wacom-add-support-to-cintiq-22hd.patch new file mode 100644 index 00000000000..0e12a0d2477 --- /dev/null +++ b/queue-3.5/input-wacom-add-support-to-cintiq-22hd.patch @@ -0,0 +1,104 @@ +From d838c644fea603eb24811333c6e2cf4f9722bf10 Mon Sep 17 00:00:00 2001 +From: Ping Cheng +Date: Tue, 24 Jul 2012 23:54:11 -0700 +Subject: Input: wacom - add support to Cintiq 22HD + +From: Ping Cheng + +commit d838c644fea603eb24811333c6e2cf4f9722bf10 upstream. + +Signed-off-by: Ping Cheng +Signed-off-by: Dmitry Torokhov +Cc: Joseph Salisbury +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/tablet/wacom_wac.c | 21 +++++++++++++++++++-- + drivers/input/tablet/wacom_wac.h | 3 ++- + 2 files changed, 21 insertions(+), 3 deletions(-) + +--- a/drivers/input/tablet/wacom_wac.c ++++ b/drivers/input/tablet/wacom_wac.c +@@ -464,7 +464,7 @@ static void wacom_intuos_general(struct + t = (data[6] << 2) | ((data[7] >> 6) & 3); + if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || + (features->type >= INTUOS5S && features->type <= INTUOS5L) || +- features->type == WACOM_21UX2 || features->type == WACOM_24HD) { ++ (features->type >= WACOM_21UX2 && features->type <= WACOM_24HD)) { + t = (t << 1) | (data[1] & 1); + } + input_report_abs(input, ABS_PRESSURE, t); +@@ -614,7 +614,7 @@ static int wacom_intuos_irq(struct wacom + input_report_abs(input, ABS_MISC, 0); + } + } else { +- if (features->type == WACOM_21UX2) { ++ if (features->type == WACOM_21UX2 || features->type == WACOM_22HD) { + input_report_key(input, BTN_0, (data[5] & 0x01)); + input_report_key(input, BTN_1, (data[6] & 0x01)); + input_report_key(input, BTN_2, (data[6] & 0x02)); +@@ -633,6 +633,12 @@ static int wacom_intuos_irq(struct wacom + input_report_key(input, BTN_Z, (data[8] & 0x20)); + input_report_key(input, BTN_BASE, (data[8] & 0x40)); + input_report_key(input, BTN_BASE2, (data[8] & 0x80)); ++ ++ if (features->type == WACOM_22HD) { ++ input_report_key(input, KEY_PROG1, data[9] & 0x01); ++ input_report_key(input, KEY_PROG2, data[9] & 0x02); ++ input_report_key(input, KEY_PROG3, data[9] & 0x04); ++ } + } else { + input_report_key(input, BTN_0, (data[5] & 0x01)); + input_report_key(input, BTN_1, (data[5] & 0x02)); +@@ -1230,6 +1236,7 @@ void wacom_wac_irq(struct wacom_wac *wac + case CINTIQ: + case WACOM_BEE: + case WACOM_21UX2: ++ case WACOM_22HD: + case WACOM_24HD: + sync = wacom_intuos_irq(wacom_wac); + break; +@@ -1432,6 +1439,12 @@ int wacom_setup_input_capabilities(struc + wacom_setup_cintiq(wacom_wac); + break; + ++ case WACOM_22HD: ++ __set_bit(KEY_PROG1, input_dev->keybit); ++ __set_bit(KEY_PROG2, input_dev->keybit); ++ __set_bit(KEY_PROG3, input_dev->keybit); ++ /* fall through */ ++ + case WACOM_21UX2: + __set_bit(BTN_A, input_dev->keybit); + __set_bit(BTN_B, input_dev->keybit); +@@ -1855,6 +1868,9 @@ static const struct wacom_features wacom + static const struct wacom_features wacom_features_0xCC = + { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, + 63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; ++static const struct wacom_features wacom_features_0xFA = ++ { "Wacom Cintiq 22HD", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, ++ 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; + static const struct wacom_features wacom_features_0x90 = + { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, + 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; +@@ -2064,6 +2080,7 @@ const struct usb_device_id wacom_ids[] = + { USB_DEVICE_WACOM(0xEC) }, + { USB_DEVICE_WACOM(0x47) }, + { USB_DEVICE_WACOM(0xF4) }, ++ { USB_DEVICE_WACOM(0xFA) }, + { USB_DEVICE_LENOVO(0x6004) }, + { } + }; +--- a/drivers/input/tablet/wacom_wac.h ++++ b/drivers/input/tablet/wacom_wac.h +@@ -74,8 +74,9 @@ enum { + INTUOS5S, + INTUOS5, + INTUOS5L, +- WACOM_24HD, + WACOM_21UX2, ++ WACOM_22HD, ++ WACOM_24HD, + CINTIQ, + WACOM_BEE, + WACOM_MO, diff --git a/queue-3.5/iwlwifi-don-t-double-free-the-interrupt-in-failure-path.patch b/queue-3.5/iwlwifi-don-t-double-free-the-interrupt-in-failure-path.patch new file mode 100644 index 00000000000..acc050a5abe --- /dev/null +++ b/queue-3.5/iwlwifi-don-t-double-free-the-interrupt-in-failure-path.patch @@ -0,0 +1,34 @@ +From a7be50b7e30f9d77cb059a7ffdb781bb0fb92eba Mon Sep 17 00:00:00 2001 +From: Emmanuel Grumbach +Date: Tue, 18 Sep 2012 19:48:59 +0200 +Subject: iwlwifi: don't double free the interrupt in failure path + +From: Emmanuel Grumbach + +commit a7be50b7e30f9d77cb059a7ffdb781bb0fb92eba upstream. + +When the driver can't get the HW ready, we would release +the interrupt twice which made the kernel complain loudly. + +Reported-by: Brian Cockrell +Tested-by: Brian Cockrell +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Johannes Berg +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c ++++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +@@ -1437,6 +1437,7 @@ static int iwl_trans_pcie_start_hw(struc + return err; + + err_free_irq: ++ trans_pcie->irq_requested = false; + free_irq(trans_pcie->irq, trans); + error: + iwl_free_isr_ict(trans); diff --git a/queue-3.5/iwlwifi-fix-flow-handler-debug-code.patch b/queue-3.5/iwlwifi-fix-flow-handler-debug-code.patch new file mode 100644 index 00000000000..99fd43c9666 --- /dev/null +++ b/queue-3.5/iwlwifi-fix-flow-handler-debug-code.patch @@ -0,0 +1,125 @@ +From 94543a8d4fb302817014981489f15cb3b92ec3c2 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Tue, 21 Aug 2012 18:57:10 +0200 +Subject: iwlwifi: fix flow handler debug code + +From: Johannes Berg + +commit 94543a8d4fb302817014981489f15cb3b92ec3c2 upstream. + +iwl_dbgfs_fh_reg_read() can cause crashes and/or +BUG_ON in slub because the ifdefs are wrong, the +code in iwl_dump_fh() should use DEBUGFS, not +DEBUG to protect the buffer writing code. + +Also, while at it, clean up the arguments to the +function, some code and make it generally safer. + +Reported-by: Benjamin Herrenschmidt +Signed-off-by: Johannes Berg +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 2 - + drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 2 - + drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 30 +++++++++++----------- + 3 files changed, 18 insertions(+), 16 deletions(-) + +--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h ++++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h +@@ -355,7 +355,7 @@ int iwl_queue_space(const struct iwl_que + /***************************************************** + * Error handling + ******************************************************/ +-int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display); ++int iwl_dump_fh(struct iwl_trans *trans, char **buf); + void iwl_dump_csr(struct iwl_trans *trans); + + /***************************************************** +--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c ++++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +@@ -559,7 +559,7 @@ static void iwl_irq_handle_error(struct + } + + iwl_dump_csr(trans); +- iwl_dump_fh(trans, NULL, false); ++ iwl_dump_fh(trans, NULL); + + iwl_op_mode_nic_error(trans->op_mode); + } +--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c ++++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +@@ -1655,13 +1655,9 @@ static const char *get_fh_string(int cmd + #undef IWL_CMD + } + +-int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display) ++int iwl_dump_fh(struct iwl_trans *trans, char **buf) + { + int i; +-#ifdef CONFIG_IWLWIFI_DEBUG +- int pos = 0; +- size_t bufsz = 0; +-#endif + static const u32 fh_tbl[] = { + FH_RSCSR_CHNL0_STTS_WPTR_REG, + FH_RSCSR_CHNL0_RBDCB_BASE_REG, +@@ -1673,29 +1669,35 @@ int iwl_dump_fh(struct iwl_trans *trans, + FH_TSSR_TX_STATUS_REG, + FH_TSSR_TX_ERROR_REG + }; +-#ifdef CONFIG_IWLWIFI_DEBUG +- if (display) { +- bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40; ++ ++#ifdef CONFIG_IWLWIFI_DEBUGFS ++ if (buf) { ++ int pos = 0; ++ size_t bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40; ++ + *buf = kmalloc(bufsz, GFP_KERNEL); + if (!*buf) + return -ENOMEM; ++ + pos += scnprintf(*buf + pos, bufsz - pos, + "FH register values:\n"); +- for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { ++ ++ for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) + pos += scnprintf(*buf + pos, bufsz - pos, + " %34s: 0X%08x\n", + get_fh_string(fh_tbl[i]), + iwl_read_direct32(trans, fh_tbl[i])); +- } ++ + return pos; + } + #endif ++ + IWL_ERR(trans, "FH register values:\n"); +- for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { ++ for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) + IWL_ERR(trans, " %34s: 0X%08x\n", + get_fh_string(fh_tbl[i]), + iwl_read_direct32(trans, fh_tbl[i])); +- } ++ + return 0; + } + +@@ -1990,11 +1992,11 @@ static ssize_t iwl_dbgfs_fh_reg_read(str + size_t count, loff_t *ppos) + { + struct iwl_trans *trans = file->private_data; +- char *buf; ++ char *buf = NULL; + int pos = 0; + ssize_t ret = -EFAULT; + +- ret = pos = iwl_dump_fh(trans, &buf, true); ++ ret = pos = iwl_dump_fh(trans, &buf); + if (buf) { + ret = simple_read_from_buffer(user_buf, + count, ppos, buf, pos); diff --git a/queue-3.5/iwlwifi-protect-sram-debugfs.patch b/queue-3.5/iwlwifi-protect-sram-debugfs.patch new file mode 100644 index 00000000000..2e004c6fa8a --- /dev/null +++ b/queue-3.5/iwlwifi-protect-sram-debugfs.patch @@ -0,0 +1,33 @@ +From 4fc79db178f0a0ede479b4713e00df2d106028b3 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Tue, 21 Aug 2012 18:57:11 +0200 +Subject: iwlwifi: protect SRAM debugfs + +From: Johannes Berg + +commit 4fc79db178f0a0ede479b4713e00df2d106028b3 upstream. + +If the device is not started, we can't read its +SRAM and attempting to do so will cause issues. +Protect the debugfs read. + +Signed-off-by: Johannes Berg +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/iwlwifi/iwl-debugfs.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c ++++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c +@@ -128,6 +128,9 @@ static ssize_t iwl_dbgfs_sram_read(struc + const struct fw_img *img; + size_t bufsz; + ++ if (!iwl_is_ready_rf(priv)) ++ return -EAGAIN; ++ + /* default is to dump the entire data segment */ + if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { + priv->dbgfs_sram_offset = 0x800000; diff --git a/queue-3.5/series b/queue-3.5/series index c6d4c154d55..8745398ff96 100644 --- a/queue-3.5/series +++ b/queue-3.5/series @@ -207,3 +207,9 @@ drm-i915-enable-lvds-pin-pairs-before-dpll-on-gen2.patch drm-i915-hdmi-clear-audio-enable-bit-for-hot-plug.patch drm-i915-reduce-a-pin-leak-bug-into-a-warn.patch drm-nv86-fifo-suspend-fix.patch +iwlwifi-don-t-double-free-the-interrupt-in-failure-path.patch +iwlwifi-protect-sram-debugfs.patch +iwlwifi-fix-flow-handler-debug-code.patch +gianfar-fix-phc-index-build-failure.patch +workqueue-unbound-rebind-morphing-in-rebind_workers-should-be-atomic.patch +input-wacom-add-support-to-cintiq-22hd.patch diff --git a/queue-3.5/workqueue-unbound-rebind-morphing-in-rebind_workers-should-be-atomic.patch b/queue-3.5/workqueue-unbound-rebind-morphing-in-rebind_workers-should-be-atomic.patch new file mode 100644 index 00000000000..3e320ba8dc8 --- /dev/null +++ b/queue-3.5/workqueue-unbound-rebind-morphing-in-rebind_workers-should-be-atomic.patch @@ -0,0 +1,59 @@ +From 96e65306b81351b656835c15931d1d237b252f27 Mon Sep 17 00:00:00 2001 +From: Lai Jiangshan +Date: Sun, 2 Sep 2012 00:28:19 +0800 +Subject: workqueue: UNBOUND -> REBIND morphing in rebind_workers() should be atomic + +From: Lai Jiangshan + +commit 96e65306b81351b656835c15931d1d237b252f27 upstream. + +The compiler may compile the following code into TWO write/modify +instructions. + + worker->flags &= ~WORKER_UNBOUND; + worker->flags |= WORKER_REBIND; + +so the other CPU may temporarily see worker->flags which doesn't have +either WORKER_UNBOUND or WORKER_REBIND set and perform local wakeup +prematurely. + +Fix it by using single explicit assignment via ACCESS_ONCE(). + +Because idle workers have another WORKER_NOT_RUNNING flag, this bug +doesn't exist for them; however, update it to use the same pattern for +consistency. + +tj: Applied the change to idle workers too and updated comments and + patch description a bit. + +Signed-off-by: Lai Jiangshan +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/workqueue.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -3441,14 +3441,17 @@ static int __cpuinit trustee_thread(void + + for_each_busy_worker(worker, i, pos, gcwq) { + struct work_struct *rebind_work = &worker->rebind_work; ++ unsigned long worker_flags = worker->flags; + + /* + * Rebind_work may race with future cpu hotplug + * operations. Use a separate flag to mark that +- * rebinding is scheduled. ++ * rebinding is scheduled. The morphing should ++ * be atomic. + */ +- worker->flags |= WORKER_REBIND; +- worker->flags &= ~WORKER_ROGUE; ++ worker_flags |= WORKER_REBIND; ++ worker_flags &= ~WORKER_ROGUE; ++ ACCESS_ONCE(worker->flags) = worker_flags; + + /* queue rebind_work, wq doesn't matter, use the default one */ + if (test_and_set_bit(WORK_STRUCT_PENDING_BIT,