From: Greg Kroah-Hartman Date: Sat, 4 Jun 2016 19:30:47 +0000 (-0700) Subject: 4.6-stable patches X-Git-Tag: v3.14.72~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01094b4a3a67900d98a898f513b5821718febcf8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.6-stable patches added patches: aacraid-fix-for-aac_command_thread-hang.patch aacraid-fix-for-kdump-driver-hang.patch aacraid-relinquish-cpu-during-timeout-wait.patch aacraid-start-adapter-after-updating-number-of-msix-vectors.patch affs-fix-remount-failure-when-there-are-no-options-changed.patch arm-dts-at91-fix-typo-in-sama5d2-pin_pd24-description.patch arm-dts-exynos-add-interrupt-line-to-max8997-pmic-on-exynos4210-trats.patch arm-dts-imx35-restore-existing-used-clock-enumeration.patch arm-mvebu-fix-gpio-config-on-the-linksys-boards.patch arm-sun4i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch arm-sun7i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch asoc-ak4642-enable-cache-usage-to-fix-crashes-on-resume.patch ath10k-fix-debugfs-pktlog_filter-write.patch ath10k-fix-firmware-assert-in-monitor-mode.patch ath10k-fix-kernel-panic-move-arvifs-list-head-init-before-htt-init.patch ath10k-fix-rx_channel-during-hw-reconfigure.patch ath5k-change-led-pin-configuration-for-compaq-c700-laptop.patch ath9k-add-a-module-parameter-to-invert-led-polarity.patch ath9k-fix-led-polarity-for-some-mini-pci-ar9220-mb92-cards.patch clk-at91-fix-check-of-clk_register-returned-value.patch clk-bcm2835-correctly-enable-fractional-clock-support.patch clk-bcm2835-divider-value-has-to-be-1-or-more.patch clk-bcm2835-fix-pll-poweron.patch clk-bcm2835-pll_off-should-only-update-cm_pll_anarst.patch cpuidle-fix-cpuidle_state_is_coupled-argument-in-cpuidle_enter.patch cpuidle-indicate-when-a-device-has-been-unregistered.patch hwmon-ads7828-enable-internal-reference.patch hwrng-exynos-fix-unbalanced-pm-runtime-put-on-timeout-error-path.patch input-uinput-handle-compat-ioctl-for-ui_set_phys.patch input-xpad-move-pending-clear-to-the-correct-location.patch input-xpad-prevent-spurious-input-from-wired-xbox-360-controllers.patch media-v4l2-compat-ioctl32-fix-missing-reserved-field-copy-in-put_v4l2_create32.patch mfd-intel-lpss-save-register-context-on-suspend.patch mfd-intel_quark_i2c_gpio-remove-clock-tree-on-error-path.patch mfd-intel_soc_pmic_core-terminate-panel-control-gpio-lookup-table-correctly.patch pci-disable-all-bar-sizing-for-devices-with-non-compliant-bars.patch pinctrl-exynos5440-use-off-stack-memory-for-pinctrl_gpio_range.patch pkcs-7-fix-missing-break-on-oid_sha224-case.patch pm-runtime-fix-error-path-in-pm_runtime_force_resume.patch regulator-try-to-resolve-regulators-supplies-on-registration.patch revert-lpfc-delete-unnecessary-checks-before-the-function-call-mempool_destroy.patch rtlwifi-btcoexist-implement-antenna-selection.patch rtlwifi-fix-logic-error-in-enter-exit-power-save-mode.patch rtlwifi-pci-use-dev_kfree_skb_irq-instead-of-kfree_skb-in-rtl_pci_reset_trx_ring.patch rtlwifi-rtl8723be-add-antenna-select-module-parameter.patch --- diff --git a/queue-4.6/aacraid-fix-for-aac_command_thread-hang.patch b/queue-4.6/aacraid-fix-for-aac_command_thread-hang.patch new file mode 100644 index 00000000000..533218e6fce --- /dev/null +++ b/queue-4.6/aacraid-fix-for-aac_command_thread-hang.patch @@ -0,0 +1,47 @@ +From fc4bf75ea300a5e62a2419f89dd0e22189dd7ab7 Mon Sep 17 00:00:00 2001 +From: Raghava Aditya Renukunta +Date: Mon, 25 Apr 2016 23:31:57 -0700 +Subject: aacraid: Fix for aac_command_thread hang + +From: Raghava Aditya Renukunta + +commit fc4bf75ea300a5e62a2419f89dd0e22189dd7ab7 upstream. + +Typically under error conditions, it is possible for aac_command_thread() +to miss the wakeup from kthread_stop() and go back to sleep, causing it +to hang aac_shutdown. + +In the observed scenario, the adapter is not functioning correctly and so +aac_fib_send() never completes (or time-outs depending on how it was +called). Shortly after aac_command_thread() starts it performs +aac_fib_send(SendHostTime) which hangs. When aac_probe_one +/aac_get_adapter_info send time outs, kthread_stop is called which breaks +the command thread out of it's hang. + +The code will still go back to sleep in schedule_timeout() without +checking kthread_should_stop() so it causes aac_probe_one to hang until +the schedule_timeout() which is 30 minutes. + +Fixed by: Adding another kthread_should_stop() before schedule_timeout() +Signed-off-by: Raghava Aditya Renukunta +Reviewed-by: Johannes Thumshirn +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/aacraid/commsup.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -1996,6 +1996,10 @@ int aac_command_thread(void *data) + if (difference <= 0) + difference = 1; + set_current_state(TASK_INTERRUPTIBLE); ++ ++ if (kthread_should_stop()) ++ break; ++ + schedule_timeout(difference); + + if (kthread_should_stop()) diff --git a/queue-4.6/aacraid-fix-for-kdump-driver-hang.patch b/queue-4.6/aacraid-fix-for-kdump-driver-hang.patch new file mode 100644 index 00000000000..9f13b7c169b --- /dev/null +++ b/queue-4.6/aacraid-fix-for-kdump-driver-hang.patch @@ -0,0 +1,86 @@ +From 78cbccd3bd683c295a44af8050797dc4a41376ff Mon Sep 17 00:00:00 2001 +From: Raghava Aditya Renukunta +Date: Mon, 25 Apr 2016 23:32:37 -0700 +Subject: aacraid: Fix for KDUMP driver hang + +From: Raghava Aditya Renukunta + +commit 78cbccd3bd683c295a44af8050797dc4a41376ff upstream. + +When KDUMP is triggered the driver first talks to the firmware in INTX +mode, but the adapter firmware is still in MSIX mode. Therefore the first +driver command hangs since the driver is waiting for an INTX response and +firmware gives a MSIX response. If when the OS is installed on a RAID +drive created by the adapter KDUMP will hang since the driver does not +receive a response in sync mode. + +Fixed by: Change the firmware to INTX mode if it is in MSIX mode before +sending the first sync command. + +Signed-off-by: Raghava Aditya Renukunta +Reviewed-by: Johannes Thumshirn +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/aacraid/aacraid.h | 1 + + drivers/scsi/aacraid/comminit.c | 24 ++++++++++++++++++++++++ + 2 files changed, 25 insertions(+) + +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -29,6 +29,7 @@ enum { + #define AAC_INT_MODE_MSI (1<<1) + #define AAC_INT_MODE_AIF (1<<2) + #define AAC_INT_MODE_SYNC (1<<3) ++#define AAC_INT_MODE_MSIX (1<<16) + + #define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb + #define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa +--- a/drivers/scsi/aacraid/comminit.c ++++ b/drivers/scsi/aacraid/comminit.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -47,6 +48,20 @@ struct aac_common aac_config = { + .irq_mod = 1 + }; + ++static inline int aac_is_msix_mode(struct aac_dev *dev) ++{ ++ u32 status; ++ ++ status = src_readl(dev, MUnit.OMR); ++ return (status & AAC_INT_MODE_MSIX); ++} ++ ++static inline void aac_change_to_intx(struct aac_dev *dev) ++{ ++ aac_src_access_devreg(dev, AAC_DISABLE_MSIX); ++ aac_src_access_devreg(dev, AAC_ENABLE_INTX); ++} ++ + static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long commsize, unsigned long commalign) + { + unsigned char *base; +@@ -427,6 +442,15 @@ struct aac_dev *aac_init_adapter(struct + dev->comm_interface = AAC_COMM_PRODUCER; + dev->raw_io_interface = dev->raw_io_64 = 0; + ++ ++ /* ++ * Enable INTX mode, if not done already Enabled ++ */ ++ if (aac_is_msix_mode(dev)) { ++ aac_change_to_intx(dev); ++ dev_info(&dev->pdev->dev, "Changed firmware to INTX mode"); ++ } ++ + if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES, + 0, 0, 0, 0, 0, 0, + status+0, status+1, status+2, status+3, NULL)) && diff --git a/queue-4.6/aacraid-relinquish-cpu-during-timeout-wait.patch b/queue-4.6/aacraid-relinquish-cpu-during-timeout-wait.patch new file mode 100644 index 00000000000..95b874f6ffe --- /dev/null +++ b/queue-4.6/aacraid-relinquish-cpu-during-timeout-wait.patch @@ -0,0 +1,46 @@ +From 07beca2be24cc710461c0b131832524c9ee08910 Mon Sep 17 00:00:00 2001 +From: Raghava Aditya Renukunta +Date: Mon, 25 Apr 2016 23:31:26 -0700 +Subject: aacraid: Relinquish CPU during timeout wait + +From: Raghava Aditya Renukunta + +commit 07beca2be24cc710461c0b131832524c9ee08910 upstream. + +aac_fib_send has a special function case for initial commands during +driver initialization using wait < 0(pseudo sync mode). In this case, +the command does not sleep but rather spins checking for timeout.This +loop is calls cpu_relax() in an attempt to allow other processes/threads +to use the CPU, but this function does not relinquish the CPU and so the +command will hog the processor. This was observed in a KDUMP +"crashkernel" and that prevented the "command thread" (which is +responsible for completing the command from being timed out) from +starting because it could not get the CPU. + +Fixed by replacing "cpu_relax()" call with "schedule()" +Signed-off-by: Raghava Aditya Renukunta +Reviewed-by: Johannes Thumshirn +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/aacraid/commsup.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -637,10 +637,10 @@ int aac_fib_send(u16 command, struct fib + } + return -EFAULT; + } +- /* We used to udelay() here but that absorbed +- * a CPU when a timeout occured. Not very +- * useful. */ +- cpu_relax(); ++ /* ++ * Allow other processes / CPUS to use core ++ */ ++ schedule(); + } + } else if (down_interruptible(&fibptr->event_wait)) { + /* Do nothing ... satisfy diff --git a/queue-4.6/aacraid-start-adapter-after-updating-number-of-msix-vectors.patch b/queue-4.6/aacraid-start-adapter-after-updating-number-of-msix-vectors.patch new file mode 100644 index 00000000000..1f5d578ed0a --- /dev/null +++ b/queue-4.6/aacraid-start-adapter-after-updating-number-of-msix-vectors.patch @@ -0,0 +1,33 @@ +From 116d77fea02e2a5aded7d29ba4c692774cb339f1 Mon Sep 17 00:00:00 2001 +From: Raghava Aditya Renukunta +Date: Mon, 25 Apr 2016 23:31:12 -0700 +Subject: aacraid: Start adapter after updating number of MSIX vectors + +From: Raghava Aditya Renukunta + +commit 116d77fea02e2a5aded7d29ba4c692774cb339f1 upstream. + +The adapter has to be started after updating the number of MSIX Vectors + +Fixes: ecc479e00db8 (aacraid: Set correct MSIX count for EEH recovery) +Signed-off-by: Raghava Aditya Renukunta +Reviewed-by: Johannes Thumshirn +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/aacraid/linit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/aacraid/linit.c ++++ b/drivers/scsi/aacraid/linit.c +@@ -1431,8 +1431,8 @@ static int aac_acquire_resources(struct + /* After EEH recovery or suspend resume, max_msix count + * may change, therfore updating in init as well. + */ +- aac_adapter_start(dev); + dev->init->Sa_MSIXVectors = cpu_to_le32(dev->max_msix); ++ aac_adapter_start(dev); + } + return 0; + diff --git a/queue-4.6/affs-fix-remount-failure-when-there-are-no-options-changed.patch b/queue-4.6/affs-fix-remount-failure-when-there-are-no-options-changed.patch new file mode 100644 index 00000000000..19a55216ebb --- /dev/null +++ b/queue-4.6/affs-fix-remount-failure-when-there-are-no-options-changed.patch @@ -0,0 +1,54 @@ +From 01d6e08711bf90bc4d7ead14a93a0cbd73b1896a Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Tue, 24 May 2016 22:48:33 +0200 +Subject: affs: fix remount failure when there are no options changed + +From: Mikulas Patocka + +commit 01d6e08711bf90bc4d7ead14a93a0cbd73b1896a upstream. + +Commit c8f33d0bec99 ("affs: kstrdup() memory handling") checks if the +kstrdup function returns NULL due to out-of-memory condition. + +However, if we are remounting a filesystem with no change to +filesystem-specific options, the parameter data is NULL. In this case, +kstrdup returns NULL (because it was passed NULL parameter), although no +out of memory condition exists. The mount syscall then fails with +ENOMEM. + +This patch fixes the bug. We fail with ENOMEM only if data is non-NULL. + +The patch also changes the call to replace_mount_options - if we didn't +pass any filesystem-specific options, we don't call +replace_mount_options (thus we don't erase existing reported options). + +Fixes: c8f33d0bec99 ("affs: kstrdup() memory handling") +Signed-off-by: Mikulas Patocka +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/affs/super.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/fs/affs/super.c ++++ b/fs/affs/super.c +@@ -528,7 +528,7 @@ affs_remount(struct super_block *sb, int + char *prefix = NULL; + + new_opts = kstrdup(data, GFP_KERNEL); +- if (!new_opts) ++ if (data && !new_opts) + return -ENOMEM; + + pr_debug("%s(flags=0x%x,opts=\"%s\")\n", __func__, *flags, data); +@@ -546,7 +546,8 @@ affs_remount(struct super_block *sb, int + } + + flush_delayed_work(&sbi->sb_work); +- replace_mount_options(sb, new_opts); ++ if (new_opts) ++ replace_mount_options(sb, new_opts); + + sbi->s_flags = mount_flags; + sbi->s_mode = mode; diff --git a/queue-4.6/arm-dts-at91-fix-typo-in-sama5d2-pin_pd24-description.patch b/queue-4.6/arm-dts-at91-fix-typo-in-sama5d2-pin_pd24-description.patch new file mode 100644 index 00000000000..d3fcc47c631 --- /dev/null +++ b/queue-4.6/arm-dts-at91-fix-typo-in-sama5d2-pin_pd24-description.patch @@ -0,0 +1,35 @@ +From b1f3a3b03eb5f61b4051e2da9aa15653e705e111 Mon Sep 17 00:00:00 2001 +From: Florian Vallee +Date: Tue, 19 Apr 2016 17:50:05 +0200 +Subject: ARM: dts: at91: fix typo in sama5d2 PIN_PD24 description + +From: Florian Vallee + +commit b1f3a3b03eb5f61b4051e2da9aa15653e705e111 upstream. + +Fix a typo on PIN_PD24 for UTXD2 and FLEXCOM4_IO3 which were +wrongly linked to PIN_PD23). + +Signed-off-by: Florian Vallee +Fixes: 7f16cb676c00 ("ARM: at91/dt: add sama5d2 pinmux") +[nicolas.ferre@atmel.com: add commit message, changed subject] +Signed-off-by: Nicolas Ferre +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/sama5d2-pinfunc.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/sama5d2-pinfunc.h ++++ b/arch/arm/boot/dts/sama5d2-pinfunc.h +@@ -837,8 +837,8 @@ + #define PIN_PD23__ISC_FIELD PINMUX_PIN(PIN_PD23, 6, 4) + #define PIN_PD24 120 + #define PIN_PD24__GPIO PINMUX_PIN(PIN_PD24, 0, 0) +-#define PIN_PD24__UTXD2 PINMUX_PIN(PIN_PD23, 1, 2) +-#define PIN_PD24__FLEXCOM4_IO3 PINMUX_PIN(PIN_PD23, 3, 3) ++#define PIN_PD24__UTXD2 PINMUX_PIN(PIN_PD24, 1, 2) ++#define PIN_PD24__FLEXCOM4_IO3 PINMUX_PIN(PIN_PD24, 3, 3) + #define PIN_PD25 121 + #define PIN_PD25__GPIO PINMUX_PIN(PIN_PD25, 0, 0) + #define PIN_PD25__SPI1_SPCK PINMUX_PIN(PIN_PD25, 1, 3) diff --git a/queue-4.6/arm-dts-exynos-add-interrupt-line-to-max8997-pmic-on-exynos4210-trats.patch b/queue-4.6/arm-dts-exynos-add-interrupt-line-to-max8997-pmic-on-exynos4210-trats.patch new file mode 100644 index 00000000000..870839e5774 --- /dev/null +++ b/queue-4.6/arm-dts-exynos-add-interrupt-line-to-max8997-pmic-on-exynos4210-trats.patch @@ -0,0 +1,32 @@ +From 330d12764e15f6e3e94ff34cda29db96d2589c24 Mon Sep 17 00:00:00 2001 +From: Marek Szyprowski +Date: Fri, 6 May 2016 09:27:16 +0200 +Subject: ARM: dts: exynos: Add interrupt line to MAX8997 PMIC on exynos4210-trats + +From: Marek Szyprowski + +commit 330d12764e15f6e3e94ff34cda29db96d2589c24 upstream. + +MAX8997 PMIC requires interrupt and fails probing without it. + +Signed-off-by: Marek Szyprowski +Fixes: d105f0b1215d ("ARM: dts: Add basic dts file for Samsung Trats board") +[k.kozlowski: Write commit message, add CC-stable] +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/exynos4210-trats.dts | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/boot/dts/exynos4210-trats.dts ++++ b/arch/arm/boot/dts/exynos4210-trats.dts +@@ -298,6 +298,8 @@ + compatible = "maxim,max8997-pmic"; + + reg = <0x66>; ++ interrupt-parent = <&gpx0>; ++ interrupts = <7 0>; + + max8997,pmic-buck1-uses-gpio-dvs; + max8997,pmic-buck2-uses-gpio-dvs; diff --git a/queue-4.6/arm-dts-imx35-restore-existing-used-clock-enumeration.patch b/queue-4.6/arm-dts-imx35-restore-existing-used-clock-enumeration.patch new file mode 100644 index 00000000000..27a7ce78d40 --- /dev/null +++ b/queue-4.6/arm-dts-imx35-restore-existing-used-clock-enumeration.patch @@ -0,0 +1,57 @@ +From 3397c2c45b1b6f54834dfeae30a73046f33ca943 Mon Sep 17 00:00:00 2001 +From: Alexander Kurz +Date: Thu, 14 Apr 2016 23:30:49 +0200 +Subject: ARM: dts: imx35: restore existing used clock enumeration + +From: Alexander Kurz + +commit 3397c2c45b1b6f54834dfeae30a73046f33ca943 upstream. + +A new element got inserted into enum mx35_clks with commit 3713e3f5e927 +("clk: imx35: define two clocks for rtc"). This insertion shifted most +nummerical clock assignments to a new nummerical value which in turn +rendered most hardcoded nummeric values in imx35.dtsi incorrect. + +Restore the existing order by moving the newly introduced clock to the +end of the enum. Update the dts documentation accordingly. + +Signed-off-by: Alexander Kurz +Fixes: 3713e3f5e927 ("clk: imx35: define two clocks for rtc") +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/devicetree/bindings/clock/imx35-clock.txt | 1 + + drivers/clk/imx/clk-imx35.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/Documentation/devicetree/bindings/clock/imx35-clock.txt ++++ b/Documentation/devicetree/bindings/clock/imx35-clock.txt +@@ -94,6 +94,7 @@ clocks and IDs. + csi_sel 79 + iim_gate 80 + gpu2d_gate 81 ++ ckli_gate 82 + + Examples: + +--- a/drivers/clk/imx/clk-imx35.c ++++ b/drivers/clk/imx/clk-imx35.c +@@ -66,7 +66,7 @@ static const char *std_sel[] = {"ppll", + static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"}; + + enum mx35_clks { +- ckih, ckil, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg, ++ ckih, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg, + arm_per_div, ahb_per_div, ipg_per, uart_sel, uart_div, esdhc_sel, + esdhc1_div, esdhc2_div, esdhc3_div, spdif_sel, spdif_div_pre, + spdif_div_post, ssi_sel, ssi1_div_pre, ssi1_div_post, ssi2_div_pre, +@@ -79,7 +79,7 @@ enum mx35_clks { + rtc_gate, rtic_gate, scc_gate, sdma_gate, spba_gate, spdif_gate, + ssi1_gate, ssi2_gate, uart1_gate, uart2_gate, uart3_gate, usbotg_gate, + wdog_gate, max_gate, admux_gate, csi_gate, csi_div, csi_sel, iim_gate, +- gpu2d_gate, clk_max ++ gpu2d_gate, ckil, clk_max + }; + + static struct clk *clk[clk_max]; diff --git a/queue-4.6/arm-mvebu-fix-gpio-config-on-the-linksys-boards.patch b/queue-4.6/arm-mvebu-fix-gpio-config-on-the-linksys-boards.patch new file mode 100644 index 00000000000..a90e1eb8a7a --- /dev/null +++ b/queue-4.6/arm-mvebu-fix-gpio-config-on-the-linksys-boards.patch @@ -0,0 +1,68 @@ +From 9800917cf92f5b5fe5cae706cb70db8d014f663c Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Fri, 31 Jul 2015 20:42:00 +0200 +Subject: ARM: mvebu: fix GPIO config on the Linksys boards + +From: Imre Kaloz + +commit 9800917cf92f5b5fe5cae706cb70db8d014f663c upstream. + +Some of the GPIO configs were wrong in the submitted DTS files, +this patch fixes all affected boards. + +Signed-off-by: Imre Kaloz +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Gregory CLEMENT + +--- + arch/arm/boot/dts/armada-385-linksys.dtsi | 6 +++--- + arch/arm/boot/dts/armada-xp-linksys-mamba.dts | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/arm/boot/dts/armada-385-linksys.dtsi ++++ b/arch/arm/boot/dts/armada-385-linksys.dtsi +@@ -245,7 +245,7 @@ + button@2 { + label = "Factory Reset Button"; + linux,code = ; +- gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; + +@@ -260,7 +260,7 @@ + }; + + sata { +- gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; ++ gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + }; +@@ -313,7 +313,7 @@ + + &pinctrl { + keys_pin: keys-pin { +- marvell,pins = "mpp24", "mpp47"; ++ marvell,pins = "mpp24", "mpp29"; + marvell,function = "gpio"; + }; + +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -304,13 +304,13 @@ + button@1 { + label = "WPS"; + linux,code = ; +- gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; ++ gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; + }; + + button@2 { + label = "Factory Reset Button"; + linux,code = ; +- gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; ++ gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; + }; + }; + diff --git a/queue-4.6/arm-sun4i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch b/queue-4.6/arm-sun4i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch new file mode 100644 index 00000000000..083f4154aca --- /dev/null +++ b/queue-4.6/arm-sun4i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch @@ -0,0 +1,33 @@ +From bec38aaafd9ec1463dd3857f02bc029707e4213d Mon Sep 17 00:00:00 2001 +From: Priit Laes +Date: Thu, 24 Mar 2016 21:52:16 +0200 +Subject: ARM: sun4i: dt: Enable dram gate 5 (tve0 clock) for simplefb TV output + +From: Priit Laes + +commit bec38aaafd9ec1463dd3857f02bc029707e4213d upstream. + +Seems like dram_gate 5 was forgotten when DRAM gate driver was added. + +Enable it. + +Fixes: 82f8582feef4 (ARM: dts: sun4i: Add DRAM gates) +Signed-off-by: Priit Laes +Signed-off-by: Maxime Ripard +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/sun4i-a10.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/sun4i-a10.dtsi ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi +@@ -96,7 +96,7 @@ + allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; + clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, + <&ahb_gates 44>, <&ahb_gates 46>, +- <&dram_gates 25>, <&dram_gates 26>; ++ <&dram_gates 5>, <&dram_gates 25>, <&dram_gates 26>; + status = "disabled"; + }; + }; diff --git a/queue-4.6/arm-sun7i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch b/queue-4.6/arm-sun7i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch new file mode 100644 index 00000000000..aa08e8ecdcd --- /dev/null +++ b/queue-4.6/arm-sun7i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch @@ -0,0 +1,36 @@ +From 4b8ccef22fb547007ac38c4e5a28a773adee1e6e Mon Sep 17 00:00:00 2001 +From: Priit Laes +Date: Thu, 24 Mar 2016 21:52:17 +0200 +Subject: ARM: sun7i: dt: Enable dram gate 5 (tve0 clock) for simplefb TV output + +From: Priit Laes + +commit 4b8ccef22fb547007ac38c4e5a28a773adee1e6e upstream. + +Seems like dram_gate 5 was forgotten when DRAM gating driver was added. + +Add it. + +Fixes: 0b4bf5a5200b (ARM: dts: sun7i: Add DRAM gates) +Signed-off-by: Priit Laes +Signed-off-by: Maxime Ripard +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/sun7i-a20.dtsi | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/sun7i-a20.dtsi ++++ b/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -85,8 +85,9 @@ + compatible = "allwinner,simple-framebuffer", + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0-tve0"; +- clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, +- <&ahb_gates 44>, <&dram_gates 26>; ++ clocks = <&pll5 1>, ++ <&ahb_gates 34>, <&ahb_gates 36>, <&ahb_gates 44>, ++ <&dram_gates 5>, <&dram_gates 26>; + status = "disabled"; + }; + }; diff --git a/queue-4.6/asoc-ak4642-enable-cache-usage-to-fix-crashes-on-resume.patch b/queue-4.6/asoc-ak4642-enable-cache-usage-to-fix-crashes-on-resume.patch new file mode 100644 index 00000000000..6b967c25a5b --- /dev/null +++ b/queue-4.6/asoc-ak4642-enable-cache-usage-to-fix-crashes-on-resume.patch @@ -0,0 +1,51 @@ +From d3030d11961a8c103cf07aed59905276ddfc06c2 Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Wed, 18 May 2016 18:30:39 +0100 +Subject: ASoC: ak4642: Enable cache usage to fix crashes on resume + +From: Mark Brown + +commit d3030d11961a8c103cf07aed59905276ddfc06c2 upstream. + +The ak4642 driver is using a regmap cache sync to restore the +configuration of the chip on resume but (as Peter observed) does not +actually define a register cache which means that the resume is never +going to work and we trigger asserts in regmap. Fix this by enabling +caching. + +Reported-by: Geert Uytterhoeven +Reported-by: Peter Ujfalusi +Tested-by: Geert Uytterhoeven +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/ak4642.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/sound/soc/codecs/ak4642.c ++++ b/sound/soc/codecs/ak4642.c +@@ -560,6 +560,7 @@ static const struct regmap_config ak4642 + .max_register = FIL1_3, + .reg_defaults = ak4642_reg, + .num_reg_defaults = NUM_AK4642_REG_DEFAULTS, ++ .cache_type = REGCACHE_RBTREE, + }; + + static const struct regmap_config ak4643_regmap = { +@@ -568,6 +569,7 @@ static const struct regmap_config ak4643 + .max_register = SPK_MS, + .reg_defaults = ak4643_reg, + .num_reg_defaults = ARRAY_SIZE(ak4643_reg), ++ .cache_type = REGCACHE_RBTREE, + }; + + static const struct regmap_config ak4648_regmap = { +@@ -576,6 +578,7 @@ static const struct regmap_config ak4648 + .max_register = EQ_FBEQE, + .reg_defaults = ak4648_reg, + .num_reg_defaults = ARRAY_SIZE(ak4648_reg), ++ .cache_type = REGCACHE_RBTREE, + }; + + static const struct ak4642_drvdata ak4642_drvdata = { diff --git a/queue-4.6/ath10k-fix-debugfs-pktlog_filter-write.patch b/queue-4.6/ath10k-fix-debugfs-pktlog_filter-write.patch new file mode 100644 index 00000000000..b22a0b17a6b --- /dev/null +++ b/queue-4.6/ath10k-fix-debugfs-pktlog_filter-write.patch @@ -0,0 +1,38 @@ +From 9ddc486aa09a3413a6c492fcf160ce61bfccb7b1 Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Fri, 11 Mar 2016 11:46:39 +0530 +Subject: ath10k: fix debugfs pktlog_filter write + +From: Anilkumar Kolli + +commit 9ddc486aa09a3413a6c492fcf160ce61bfccb7b1 upstream. + +It is observed that, we are disabling the packet log if we write same +value to the pktlog_filter for the second time. Always enable pktlogs +on non zero filter. + +Fixes: 90174455ae05 ("ath10k: add support to configure pktlog filter") +Signed-off-by: Anilkumar Kolli +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath10k/debug.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath10k/debug.c ++++ b/drivers/net/wireless/ath/ath10k/debug.c +@@ -2019,7 +2019,12 @@ static ssize_t ath10k_write_pktlog_filte + goto out; + } + +- if (filter && (filter != ar->debug.pktlog_filter)) { ++ if (filter == ar->debug.pktlog_filter) { ++ ret = count; ++ goto out; ++ } ++ ++ if (filter) { + ret = ath10k_wmi_pdev_pktlog_enable(ar, filter); + if (ret) { + ath10k_warn(ar, "failed to enable pktlog filter %x: %d\n", diff --git a/queue-4.6/ath10k-fix-firmware-assert-in-monitor-mode.patch b/queue-4.6/ath10k-fix-firmware-assert-in-monitor-mode.patch new file mode 100644 index 00000000000..0017798d740 --- /dev/null +++ b/queue-4.6/ath10k-fix-firmware-assert-in-monitor-mode.patch @@ -0,0 +1,46 @@ +From 8a75fc54745fd3ce9062ab1cc6429a9da9ac2a68 Mon Sep 17 00:00:00 2001 +From: Rajkumar Manoharan +Date: Wed, 2 Mar 2016 20:13:52 +0530 +Subject: ath10k: fix firmware assert in monitor mode + +From: Rajkumar Manoharan + +commit 8a75fc54745fd3ce9062ab1cc6429a9da9ac2a68 upstream. + +commit 166de3f1895d ("ath10k: remove supported chain mask") had revealed +an issue on monitor mode. Configuring NSS upon monitor interface +creation is causing target assert in all qca9888x and qca6174 firmware. +Firmware assert issue can be reproduced by below sequence even after +reverting commit 166de3f1895d ("ath10k: remove supported chain mask"). + +ip link set wlan0 down +iw wlan0 set type monitor +iw phy0 set antenna 7 +ip link set wlan0 up + +This issue is originally reported on qca9888 with 10.1 firmware. + +Fixes: 5572a95b4b ("ath10k: apply chainmask settings to vdev on creation") +Reported-by: Janusz Dziedzic +Signed-off-by: Rajkumar Manoharan +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath10k/mac.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -4489,7 +4489,10 @@ static int ath10k_add_interface(struct i + goto err_vdev_delete; + } + +- if (ar->cfg_tx_chainmask) { ++ /* Configuring number of spatial stream for monitor interface is causing ++ * target assert in qca9888 and qca6174. ++ */ ++ if (ar->cfg_tx_chainmask && (vif->type != NL80211_IFTYPE_MONITOR)) { + u16 nss = get_nss_from_chainmask(ar->cfg_tx_chainmask); + + vdev_param = ar->wmi.vdev_param->nss; diff --git a/queue-4.6/ath10k-fix-kernel-panic-move-arvifs-list-head-init-before-htt-init.patch b/queue-4.6/ath10k-fix-kernel-panic-move-arvifs-list-head-init-before-htt-init.patch new file mode 100644 index 00000000000..de9169ccbeb --- /dev/null +++ b/queue-4.6/ath10k-fix-kernel-panic-move-arvifs-list-head-init-before-htt-init.patch @@ -0,0 +1,63 @@ +From 4ad24a9d83bd4bf0a85e95bf144e18d3fda4fbf1 Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Tue, 26 Apr 2016 21:35:48 +0530 +Subject: ath10k: fix kernel panic, move arvifs list head init before htt init + +From: Anilkumar Kolli + +commit 4ad24a9d83bd4bf0a85e95bf144e18d3fda4fbf1 upstream. + +It is observed that while loading and unloading ath10k modules +in an infinite loop, before ath10k_core_start() completion HTT +rx frames are received, while processing these frames, +dereferencing the arvifs list code is getting hit before +initilizing the arvifs list, causing a kernel panic. + +This patch initilizes the arvifs list before initilizing htt. + +Fixes the below issue: + [] (ath10k_htt_rx_pktlog_completion_handler+0x278/0xd08 [ath10k_core]) + [] (ath10k_htt_rx_pktlog_completion_handler [ath10k_core]) + [] (ath10k_htt_txrx_compl_task+0x5f4/0xeb0 [ath10k_core]) + [] (ath10k_htt_txrx_compl_task [ath10k_core]) + [] (tasklet_action+0x8c/0xec) + [] (tasklet_action) + [] (__do_softirq+0xf8/0x228) + [] (__do_softirq) [] (run_ksoftirqd+0x30/0x90) + Code: e5954ad8 e2899008 e1540009 0a00000d (e5943008) + ---[ end trace 71de5c2e011dbf56 ]--- + Kernel panic - not syncing: Fatal exception in interrupt + +Fixes: 500ff9f9389d ("ath10k: implement chanctx API") +Signed-off-by: Anilkumar Kolli +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath10k/core.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -1723,6 +1723,10 @@ int ath10k_core_start(struct ath10k *ar, + goto err_hif_stop; + } + ++ ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1; ++ ++ INIT_LIST_HEAD(&ar->arvifs); ++ + /* we don't care about HTT in UTF mode */ + if (mode == ATH10K_FIRMWARE_MODE_NORMAL) { + status = ath10k_htt_setup(&ar->htt); +@@ -1736,10 +1740,6 @@ int ath10k_core_start(struct ath10k *ar, + if (status) + goto err_hif_stop; + +- ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1; +- +- INIT_LIST_HEAD(&ar->arvifs); +- + return 0; + + err_hif_stop: diff --git a/queue-4.6/ath10k-fix-rx_channel-during-hw-reconfigure.patch b/queue-4.6/ath10k-fix-rx_channel-during-hw-reconfigure.patch new file mode 100644 index 00000000000..a3ea19a9b84 --- /dev/null +++ b/queue-4.6/ath10k-fix-rx_channel-during-hw-reconfigure.patch @@ -0,0 +1,42 @@ +From 1ce8c1484e80010a6e4b9611c65668ff77556f45 Mon Sep 17 00:00:00 2001 +From: Rajkumar Manoharan +Date: Thu, 7 Apr 2016 12:11:54 +0530 +Subject: ath10k: fix rx_channel during hw reconfigure + +From: Rajkumar Manoharan + +commit 1ce8c1484e80010a6e4b9611c65668ff77556f45 upstream. + +Upon firmware assert, restart work will be triggered so that mac80211 +will reconfigure the driver. An issue is reported that after restart +work, survey dump data do not contain in-use (SURVEY_INFO_IN_USE) info +for operating channel. During reconfigure, since mac80211 already has +valid channel context for given radio, channel context iteration return +num_chanctx > 0. Hence rx_channel is always NULL. Fix this by assigning +channel context to rx_channel when driver restart is in progress. + +Signed-off-by: Rajkumar Manoharan +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath10k/mac.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -6453,7 +6453,13 @@ ath10k_mac_update_rx_channel(struct ath1 + def = &vifs[0].new_ctx->def; + + ar->rx_channel = def->chan; +- } else if (ctx && ath10k_mac_num_chanctxs(ar) == 0) { ++ } else if ((ctx && ath10k_mac_num_chanctxs(ar) == 0) || ++ (ctx && (ar->state == ATH10K_STATE_RESTARTED))) { ++ /* During driver restart due to firmware assert, since mac80211 ++ * already has valid channel context for given radio, channel ++ * context iteration return num_chanctx > 0. So fix rx_channel ++ * when restart is in progress. ++ */ + ar->rx_channel = ctx->def.chan; + } else { + ar->rx_channel = NULL; diff --git a/queue-4.6/ath5k-change-led-pin-configuration-for-compaq-c700-laptop.patch b/queue-4.6/ath5k-change-led-pin-configuration-for-compaq-c700-laptop.patch new file mode 100644 index 00000000000..961a59c261a --- /dev/null +++ b/queue-4.6/ath5k-change-led-pin-configuration-for-compaq-c700-laptop.patch @@ -0,0 +1,38 @@ +From 7b9bc799a445aea95f64f15e0083cb19b5789abe Mon Sep 17 00:00:00 2001 +From: Joseph Salisbury +Date: Mon, 14 Mar 2016 14:51:48 -0400 +Subject: ath5k: Change led pin configuration for compaq c700 laptop + +From: Joseph Salisbury + +commit 7b9bc799a445aea95f64f15e0083cb19b5789abe upstream. + +BugLink: http://bugs.launchpad.net/bugs/972604 + +Commit 09c9bae26b0d3c9472cb6ae45010460a2cee8b8d ("ath5k: add led pin +configuration for compaq c700 laptop") added a pin configuration for the Compaq +c700 laptop. However, the polarity of the led pin is reversed. It should be +red for wifi off and blue for wifi on, but it is the opposite. This bug was +reported in the following bug report: +http://pad.lv/972604 + +Fixes: 09c9bae26b0d3c9472cb6ae45010460a2cee8b8d ("ath5k: add led pin configuration for compaq c700 laptop") +Signed-off-by: Joseph Salisbury +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath5k/led.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath5k/led.c ++++ b/drivers/net/wireless/ath/ath5k/led.c +@@ -77,7 +77,7 @@ static const struct pci_device_id ath5k_ + /* HP Compaq CQ60-206US (ddreggors@jumptv.com) */ + { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137a), ATH_LED(3, 1) }, + /* HP Compaq C700 (nitrousnrg@gmail.com) */ +- { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) }, ++ { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 0) }, + /* LiteOn AR5BXB63 (magooz@salug.it) */ + { ATH_SDEVICE(PCI_VENDOR_ID_ATHEROS, 0x3067), ATH_LED(3, 0) }, + /* IBM-specific AR5212 (all others) */ diff --git a/queue-4.6/ath9k-add-a-module-parameter-to-invert-led-polarity.patch b/queue-4.6/ath9k-add-a-module-parameter-to-invert-led-polarity.patch new file mode 100644 index 00000000000..c2a48cc061a --- /dev/null +++ b/queue-4.6/ath9k-add-a-module-parameter-to-invert-led-polarity.patch @@ -0,0 +1,51 @@ +From cd84042ce9040ad038e958bc67a46fcfc015c736 Mon Sep 17 00:00:00 2001 +From: "Vittorio Gambaletta (VittGam)" +Date: Mon, 11 Apr 2016 04:48:54 +0200 +Subject: ath9k: Add a module parameter to invert LED polarity. + +From: Vittorio Gambaletta (VittGam) + +commit cd84042ce9040ad038e958bc67a46fcfc015c736 upstream. + +The LED can be active high instead of active low on some hardware. + +Add the led_active_high module parameter. It defaults to -1 to obey +platform data as before. + +Setting the parameter to 1 or 0 will force the LED respectively +active high or active low. + +Cc: +Cc: +Cc: +Signed-off-by: Vittorio Gambaletta +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath9k/init.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -49,6 +49,10 @@ int ath9k_led_blink; + module_param_named(blink, ath9k_led_blink, int, 0444); + MODULE_PARM_DESC(blink, "Enable LED blink on activity"); + ++static int ath9k_led_active_high = -1; ++module_param_named(led_active_high, ath9k_led_active_high, int, 0444); ++MODULE_PARM_DESC(led_active_high, "Invert LED polarity"); ++ + static int ath9k_btcoex_enable; + module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); + MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); +@@ -600,6 +604,9 @@ static int ath9k_init_softc(u16 devid, s + if (ret) + return ret; + ++ if (ath9k_led_active_high != -1) ++ ah->config.led_active_high = ath9k_led_active_high == 1; ++ + /* + * Enable WLAN/BT RX Antenna diversity only when: + * diff --git a/queue-4.6/ath9k-fix-led-polarity-for-some-mini-pci-ar9220-mb92-cards.patch b/queue-4.6/ath9k-fix-led-polarity-for-some-mini-pci-ar9220-mb92-cards.patch new file mode 100644 index 00000000000..1f6615f1eb2 --- /dev/null +++ b/queue-4.6/ath9k-fix-led-polarity-for-some-mini-pci-ar9220-mb92-cards.patch @@ -0,0 +1,45 @@ +From 0f9edcdd88a993914fa1d1dc369b35dc503979db Mon Sep 17 00:00:00 2001 +From: "Vittorio Gambaletta (VittGam)" +Date: Mon, 11 Apr 2016 04:48:55 +0200 +Subject: ath9k: Fix LED polarity for some Mini PCI AR9220 MB92 cards. + +From: Vittorio Gambaletta (VittGam) + +commit 0f9edcdd88a993914fa1d1dc369b35dc503979db upstream. + +The Wistron DNMA-92 and Compex WLM200NX have inverted LED polarity +(active high instead of active low). + +The same PCI Subsystem ID is used by both cards, which are based on +the same Atheros MB92 design. + +Cc: +Cc: +Cc: +Signed-off-by: Vittorio Gambaletta +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath9k/pci.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/net/wireless/ath/ath9k/pci.c ++++ b/drivers/net/wireless/ath/ath9k/pci.c +@@ -28,6 +28,16 @@ static const struct pci_device_id ath_pc + { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ + { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ + { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ ++ ++#ifdef CONFIG_ATH9K_PCOEM ++ /* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */ ++ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, ++ 0x0029, ++ PCI_VENDOR_ID_ATHEROS, ++ 0x2096), ++ .driver_data = ATH9K_PCI_LED_ACT_HI }, ++#endif ++ + { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ + + #ifdef CONFIG_ATH9K_PCOEM diff --git a/queue-4.6/clk-at91-fix-check-of-clk_register-returned-value.patch b/queue-4.6/clk-at91-fix-check-of-clk_register-returned-value.patch new file mode 100644 index 00000000000..fb8cc206cef --- /dev/null +++ b/queue-4.6/clk-at91-fix-check-of-clk_register-returned-value.patch @@ -0,0 +1,35 @@ +From cb0ceaf77d93964a0d00477c79f4499123f6159c Mon Sep 17 00:00:00 2001 +From: Vladimir Zapolskiy +Date: Tue, 8 Mar 2016 01:41:29 +0200 +Subject: clk: at91: fix check of clk_register() returned value + +From: Vladimir Zapolskiy + +commit cb0ceaf77d93964a0d00477c79f4499123f6159c upstream. + +The clk_register() function returns a valid pointer to struct clk or +ERR_PTR() error code, this makes a check for returned NULL value +useless and may lead to oops on error path. + +Signed-off-by: Vladimir Zapolskiy +Acked-by: Alexandre Belloni +Acked-by: Boris Brezillon +Fixes: bcc5fd49a0fd ("clk: at91: add a driver for the h32mx clock") +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/at91/clk-h32mx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/clk/at91/clk-h32mx.c ++++ b/drivers/clk/at91/clk-h32mx.c +@@ -114,7 +114,7 @@ static void __init of_sama5d4_clk_h32mx_ + h32mxclk->regmap = regmap; + + clk = clk_register(NULL, &h32mxclk->hw); +- if (!clk) { ++ if (IS_ERR(clk)) { + kfree(h32mxclk); + return; + } diff --git a/queue-4.6/clk-bcm2835-correctly-enable-fractional-clock-support.patch b/queue-4.6/clk-bcm2835-correctly-enable-fractional-clock-support.patch new file mode 100644 index 00000000000..6e3dc8fecbc --- /dev/null +++ b/queue-4.6/clk-bcm2835-correctly-enable-fractional-clock-support.patch @@ -0,0 +1,138 @@ +From 959ca92a3235fc4b17c1e18483fc390b3d612254 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Mon, 29 Feb 2016 11:39:21 +0000 +Subject: clk: bcm2835: correctly enable fractional clock support + +From: Martin Sperl + +commit 959ca92a3235fc4b17c1e18483fc390b3d612254 upstream. + +The current driver calculates the clock divider with +fractional support enabled. + +But it does not enable fractional support in the +control register itself resulting in an integer only divider, +but in clk_set_rate responds back the fractionally divided +clock frequency. + +This patch enables fractional support in the control register +whenever there is a fractional bit set in the requested clock divider. + +Mash clock limits are are also handled for the PWM clock +applying the correct divider limits (2 and max_int) applicable to +basic fractional divider support (mash order of 1). + +It also adds locking to protect the read/modify/write cycle of +the register modification. + +Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the +audio domain clocks") + +Signed-off-by: Martin Sperl +Signed-off-by: Eric Anholt +Reviewed-by: Eric Anholt +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/bcm/clk-bcm2835.c | 45 ++++++++++++++++++++++++++++++++++++------ + 1 file changed, 39 insertions(+), 6 deletions(-) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -51,6 +51,7 @@ + #define CM_GNRICCTL 0x000 + #define CM_GNRICDIV 0x004 + # define CM_DIV_FRAC_BITS 12 ++# define CM_DIV_FRAC_MASK GENMASK(CM_DIV_FRAC_BITS - 1, 0) + + #define CM_VPUCTL 0x008 + #define CM_VPUDIV 0x00c +@@ -128,6 +129,7 @@ + # define CM_GATE BIT(CM_GATE_BIT) + # define CM_BUSY BIT(7) + # define CM_BUSYD BIT(8) ++# define CM_FRAC BIT(9) + # define CM_SRC_SHIFT 0 + # define CM_SRC_BITS 4 + # define CM_SRC_MASK 0xf +@@ -644,6 +646,7 @@ struct bcm2835_clock_data { + u32 frac_bits; + + bool is_vpu_clock; ++ bool is_mash_clock; + }; + + static const char *const bcm2835_clock_per_parents[] = { +@@ -825,6 +828,7 @@ static const struct bcm2835_clock_data b + .div_reg = CM_PWMDIV, + .int_bits = 12, + .frac_bits = 12, ++ .is_mash_clock = true, + }; + + struct bcm2835_pll { +@@ -1184,7 +1188,7 @@ static u32 bcm2835_clock_choose_div(stru + GENMASK(CM_DIV_FRAC_BITS - data->frac_bits, 0) >> 1; + u64 temp = (u64)parent_rate << CM_DIV_FRAC_BITS; + u64 rem; +- u32 div; ++ u32 div, mindiv, maxdiv; + + rem = do_div(temp, rate); + div = temp; +@@ -1194,11 +1198,23 @@ static u32 bcm2835_clock_choose_div(stru + div += unused_frac_mask + 1; + div &= ~unused_frac_mask; + +- /* clamp to min divider of 1 */ +- div = max_t(u32, div, 1 << CM_DIV_FRAC_BITS); +- /* clamp to the highest possible fractional divider */ +- div = min_t(u32, div, GENMASK(data->int_bits + CM_DIV_FRAC_BITS - 1, +- CM_DIV_FRAC_BITS - data->frac_bits)); ++ /* different clamping limits apply for a mash clock */ ++ if (data->is_mash_clock) { ++ /* clamp to min divider of 2 */ ++ mindiv = 2 << CM_DIV_FRAC_BITS; ++ /* clamp to the highest possible integer divider */ ++ maxdiv = (BIT(data->int_bits) - 1) << CM_DIV_FRAC_BITS; ++ } else { ++ /* clamp to min divider of 1 */ ++ mindiv = 1 << CM_DIV_FRAC_BITS; ++ /* clamp to the highest possible fractional divider */ ++ maxdiv = GENMASK(data->int_bits + CM_DIV_FRAC_BITS - 1, ++ CM_DIV_FRAC_BITS - data->frac_bits); ++ } ++ ++ /* apply the clamping limits */ ++ div = max_t(u32, div, mindiv); ++ div = min_t(u32, div, maxdiv); + + return div; + } +@@ -1292,9 +1308,26 @@ static int bcm2835_clock_set_rate(struct + struct bcm2835_cprman *cprman = clock->cprman; + const struct bcm2835_clock_data *data = clock->data; + u32 div = bcm2835_clock_choose_div(hw, rate, parent_rate, false); ++ u32 ctl; ++ ++ spin_lock(&cprman->regs_lock); ++ ++ /* ++ * Setting up frac support ++ * ++ * In principle it is recommended to stop/start the clock first, ++ * but as we set CLK_SET_RATE_GATE during registration of the ++ * clock this requirement should be take care of by the ++ * clk-framework. ++ */ ++ ctl = cprman_read(cprman, data->ctl_reg) & ~CM_FRAC; ++ ctl |= (div & CM_DIV_FRAC_MASK) ? CM_FRAC : 0; ++ cprman_write(cprman, data->ctl_reg, ctl); + + cprman_write(cprman, data->div_reg, div); + ++ spin_unlock(&cprman->regs_lock); ++ + return 0; + } + diff --git a/queue-4.6/clk-bcm2835-divider-value-has-to-be-1-or-more.patch b/queue-4.6/clk-bcm2835-divider-value-has-to-be-1-or-more.patch new file mode 100644 index 00000000000..f3cc03fa421 --- /dev/null +++ b/queue-4.6/clk-bcm2835-divider-value-has-to-be-1-or-more.patch @@ -0,0 +1,41 @@ +From 997f16bd5d2e9b3456027f96fcadfe1e2bf12f4e Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Mon, 29 Feb 2016 11:39:20 +0000 +Subject: clk: bcm2835: divider value has to be 1 or more + +From: Martin Sperl + +commit 997f16bd5d2e9b3456027f96fcadfe1e2bf12f4e upstream. + +Current clamping of a normal divider allows a value < 1 to be valid. + +A divider of < 1 would actually only be possible if we had a PLL... + +So this patch clamps the divider to 1. + +Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the +audio domain clocks") + +Signed-off-by: Martin Sperl +Signed-off-by: Eric Anholt +Reviewed-by: Eric Anholt +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/bcm/clk-bcm2835.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -1194,8 +1194,9 @@ static u32 bcm2835_clock_choose_div(stru + div += unused_frac_mask + 1; + div &= ~unused_frac_mask; + +- /* Clamp to the limits. */ +- div = max(div, unused_frac_mask + 1); ++ /* clamp to min divider of 1 */ ++ div = max_t(u32, div, 1 << CM_DIV_FRAC_BITS); ++ /* clamp to the highest possible fractional divider */ + div = min_t(u32, div, GENMASK(data->int_bits + CM_DIV_FRAC_BITS - 1, + CM_DIV_FRAC_BITS - data->frac_bits)); + diff --git a/queue-4.6/clk-bcm2835-fix-pll-poweron.patch b/queue-4.6/clk-bcm2835-fix-pll-poweron.patch new file mode 100644 index 00000000000..434e552f50f --- /dev/null +++ b/queue-4.6/clk-bcm2835-fix-pll-poweron.patch @@ -0,0 +1,36 @@ +From e708b383f4b94feca2e0d5d06e1cfc13cdfea100 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 13 Apr 2016 13:05:03 -0700 +Subject: clk: bcm2835: Fix PLL poweron + +From: Eric Anholt + +commit e708b383f4b94feca2e0d5d06e1cfc13cdfea100 upstream. + +In poweroff, we set the reset bit and the power down bit, but only +managed to unset the reset bit for poweron. This meant that if HDMI +did -EPROBE_DEFER after it had grabbed its clocks, we'd power down the +PLLH (that had been on at boot time) and never recover. + +Signed-off-by: Eric Anholt +Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks") +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/bcm/clk-bcm2835.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -921,6 +921,10 @@ static int bcm2835_pll_on(struct clk_hw + const struct bcm2835_pll_data *data = pll->data; + ktime_t timeout; + ++ cprman_write(cprman, data->a2w_ctrl_reg, ++ cprman_read(cprman, data->a2w_ctrl_reg) & ++ ~A2W_PLL_CTRL_PWRDN); ++ + /* Take the PLL out of reset. */ + cprman_write(cprman, data->cm_ctrl_reg, + cprman_read(cprman, data->cm_ctrl_reg) & ~CM_PLL_ANARST); diff --git a/queue-4.6/clk-bcm2835-pll_off-should-only-update-cm_pll_anarst.patch b/queue-4.6/clk-bcm2835-pll_off-should-only-update-cm_pll_anarst.patch new file mode 100644 index 00000000000..91b3e3cf465 --- /dev/null +++ b/queue-4.6/clk-bcm2835-pll_off-should-only-update-cm_pll_anarst.patch @@ -0,0 +1,47 @@ +From 6727f086cfe4ddcc651eb2bf4301abfcf619be06 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Mon, 29 Feb 2016 11:39:17 +0000 +Subject: clk: bcm2835: pll_off should only update CM_PLL_ANARST + +From: Martin Sperl + +commit 6727f086cfe4ddcc651eb2bf4301abfcf619be06 upstream. + +bcm2835_pll_off is currently assigning CM_PLL_ANARST to the control +register, which may lose the other bits that are currently set by the +clock dividers. + +It also now locks during the read/modify/write cycle of both +registers. + +Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the +audio domain clocks") + +Signed-off-by: Martin Sperl +Signed-off-by: Eric Anholt +Reviewed-by: Eric Anholt +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/bcm/clk-bcm2835.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -910,8 +910,14 @@ static void bcm2835_pll_off(struct clk_h + struct bcm2835_cprman *cprman = pll->cprman; + const struct bcm2835_pll_data *data = pll->data; + +- cprman_write(cprman, data->cm_ctrl_reg, CM_PLL_ANARST); +- cprman_write(cprman, data->a2w_ctrl_reg, A2W_PLL_CTRL_PWRDN); ++ spin_lock(&cprman->regs_lock); ++ cprman_write(cprman, data->cm_ctrl_reg, ++ cprman_read(cprman, data->cm_ctrl_reg) | ++ CM_PLL_ANARST); ++ cprman_write(cprman, data->a2w_ctrl_reg, ++ cprman_read(cprman, data->a2w_ctrl_reg) | ++ A2W_PLL_CTRL_PWRDN); ++ spin_unlock(&cprman->regs_lock); + } + + static int bcm2835_pll_on(struct clk_hw *hw) diff --git a/queue-4.6/cpuidle-fix-cpuidle_state_is_coupled-argument-in-cpuidle_enter.patch b/queue-4.6/cpuidle-fix-cpuidle_state_is_coupled-argument-in-cpuidle_enter.patch new file mode 100644 index 00000000000..bc7cca05019 --- /dev/null +++ b/queue-4.6/cpuidle-fix-cpuidle_state_is_coupled-argument-in-cpuidle_enter.patch @@ -0,0 +1,61 @@ +From e7387da52028b072489c45efeb7a916c0205ebd2 Mon Sep 17 00:00:00 2001 +From: Daniel Lezcano +Date: Tue, 17 May 2016 16:54:00 +0200 +Subject: cpuidle: Fix cpuidle_state_is_coupled() argument in cpuidle_enter() + +From: Daniel Lezcano + +commit e7387da52028b072489c45efeb7a916c0205ebd2 upstream. + +Commit 0b89e9aa2856 (cpuidle: delay enabling interrupts until all +coupled CPUs leave idle) rightfully fixed a regression by letting +the coupled idle state framework to handle local interrupt enabling +when the CPU is exiting an idle state. + +The current code checks if the idle state is coupled and, if so, it +will let the coupled code to enable interrupts. This way, it can +decrement the ready-count before handling the interrupt. This +mechanism prevents the other CPUs from waiting for a CPU which is +handling interrupts. + +But the check is done against the state index returned by the back +end driver's ->enter functions which could be different from the +initial index passed as parameter to the cpuidle_enter_state() +function. + + entered_state = target_state->enter(dev, drv, index); + + [ ... ] + + if (!cpuidle_state_is_coupled(drv, entered_state)) + local_irq_enable(); + + [ ... ] + +If the 'index' is referring to a coupled idle state but the +'entered_state' is *not* coupled, then the interrupts are enabled +again. All CPUs blocked on the sync barrier may busy loop longer +if the CPU has interrupts to handle before decrementing the +ready-count. That's consuming more energy than saving. + +Fixes: 0b89e9aa2856 (cpuidle: delay enabling interrupts until all coupled CPUs leave idle) +Signed-off-by: Daniel Lezcano +[ rjw: Subject & changelog ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpuidle/cpuidle.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/cpuidle/cpuidle.c ++++ b/drivers/cpuidle/cpuidle.c +@@ -214,7 +214,7 @@ int cpuidle_enter_state(struct cpuidle_d + tick_broadcast_exit(); + } + +- if (!cpuidle_state_is_coupled(drv, entered_state)) ++ if (!cpuidle_state_is_coupled(drv, index)) + local_irq_enable(); + + diff = ktime_to_us(ktime_sub(time_end, time_start)); diff --git a/queue-4.6/cpuidle-indicate-when-a-device-has-been-unregistered.patch b/queue-4.6/cpuidle-indicate-when-a-device-has-been-unregistered.patch new file mode 100644 index 00000000000..18dd753bf72 --- /dev/null +++ b/queue-4.6/cpuidle-indicate-when-a-device-has-been-unregistered.patch @@ -0,0 +1,40 @@ +From c998c07836f985b24361629dc98506ec7893e7a0 Mon Sep 17 00:00:00 2001 +From: Dave Gerlach +Date: Tue, 5 Apr 2016 14:05:38 -0500 +Subject: cpuidle: Indicate when a device has been unregistered + +From: Dave Gerlach + +commit c998c07836f985b24361629dc98506ec7893e7a0 upstream. + +Currently the 'registered' member of the cpuidle_device struct is set +to 1 during cpuidle_register_device. In this same function there are +checks to see if the device is already registered to prevent duplicate +calls to register the device, but this value is never set to 0 even on +unregister of the device. Because of this, any attempt to call +cpuidle_register_device after a call to cpuidle_unregister_device will +fail which shouldn't be the case. + +To prevent this, set registered to 0 when the device is unregistered. + +Fixes: c878a52d3c7c (cpuidle: Check if device is already registered) +Signed-off-by: Dave Gerlach +Acked-by: Daniel Lezcano +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpuidle/cpuidle.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/cpuidle/cpuidle.c ++++ b/drivers/cpuidle/cpuidle.c +@@ -433,6 +433,8 @@ static void __cpuidle_unregister_device( + list_del(&dev->device_list); + per_cpu(cpuidle_devices, dev->cpu) = NULL; + module_put(drv->owner); ++ ++ dev->registered = 0; + } + + static void __cpuidle_device_init(struct cpuidle_device *dev) diff --git a/queue-4.6/hwmon-ads7828-enable-internal-reference.patch b/queue-4.6/hwmon-ads7828-enable-internal-reference.patch new file mode 100644 index 00000000000..46241ba9922 --- /dev/null +++ b/queue-4.6/hwmon-ads7828-enable-internal-reference.patch @@ -0,0 +1,52 @@ +From 7a18afe8097731b8ffb6cb5b2b3b418ded77c105 Mon Sep 17 00:00:00 2001 +From: Akshay Bhat +Date: Mon, 18 Apr 2016 15:47:53 -0400 +Subject: hwmon: (ads7828) Enable internal reference + +From: Akshay Bhat + +commit 7a18afe8097731b8ffb6cb5b2b3b418ded77c105 upstream. + +On ads7828 the internal reference defaults to off upon power up. When +using internal reference, it needs to be turned on and the voltage needs +to settle before normal conversion cycle can be started. Hence perform a +dummy read in the probe to enable the internal reference allowing the +voltage to settle before performing a normal read. + +Without this fix, the first read from the ADC when using internal +reference always returns incorrect data. + +Signed-off-by: Akshay Bhat +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/ads7828.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/hwmon/ads7828.c ++++ b/drivers/hwmon/ads7828.c +@@ -120,6 +120,7 @@ static int ads7828_probe(struct i2c_clie + unsigned int vref_mv = ADS7828_INT_VREF_MV; + bool diff_input = false; + bool ext_vref = false; ++ unsigned int regval; + + data = devm_kzalloc(dev, sizeof(struct ads7828_data), GFP_KERNEL); + if (!data) +@@ -154,6 +155,15 @@ static int ads7828_probe(struct i2c_clie + if (!diff_input) + data->cmd_byte |= ADS7828_CMD_SD_SE; + ++ /* ++ * Datasheet specifies internal reference voltage is disabled by ++ * default. The internal reference voltage needs to be enabled and ++ * voltage needs to settle before getting valid ADC data. So perform a ++ * dummy read to enable the internal reference voltage. ++ */ ++ if (!ext_vref) ++ regmap_read(data->regmap, data->cmd_byte, ®val); ++ + hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, + data, + ads7828_groups); diff --git a/queue-4.6/hwrng-exynos-fix-unbalanced-pm-runtime-put-on-timeout-error-path.patch b/queue-4.6/hwrng-exynos-fix-unbalanced-pm-runtime-put-on-timeout-error-path.patch new file mode 100644 index 00000000000..f44a969e006 --- /dev/null +++ b/queue-4.6/hwrng-exynos-fix-unbalanced-pm-runtime-put-on-timeout-error-path.patch @@ -0,0 +1,56 @@ +From f1925d78d7b710a1179828d53e918295f5f5d222 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 14 Mar 2016 09:07:13 +0900 +Subject: hwrng: exynos - Fix unbalanced PM runtime put on timeout error path + +From: Krzysztof Kozlowski + +commit f1925d78d7b710a1179828d53e918295f5f5d222 upstream. + +In case of timeout during read operation, the exit path lacked PM +runtime put. This could lead to unbalanced runtime PM usage counter thus +leaving the device in an active state. + +Fixes: d7fd6075a205 ("hwrng: exynos - Add timeout for waiting on init done") +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/hw_random/exynos-rng.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/drivers/char/hw_random/exynos-rng.c ++++ b/drivers/char/hw_random/exynos-rng.c +@@ -89,6 +89,7 @@ static int exynos_read(struct hwrng *rng + struct exynos_rng, rng); + u32 *data = buf; + int retry = 100; ++ int ret = 4; + + pm_runtime_get_sync(exynos_rng->dev); + +@@ -97,17 +98,20 @@ static int exynos_read(struct hwrng *rng + while (!(exynos_rng_readl(exynos_rng, + EXYNOS_PRNG_STATUS_OFFSET) & PRNG_DONE) && --retry) + cpu_relax(); +- if (!retry) +- return -ETIMEDOUT; ++ if (!retry) { ++ ret = -ETIMEDOUT; ++ goto out; ++ } + + exynos_rng_writel(exynos_rng, PRNG_DONE, EXYNOS_PRNG_STATUS_OFFSET); + + *data = exynos_rng_readl(exynos_rng, EXYNOS_PRNG_OUT1_OFFSET); + ++out: + pm_runtime_mark_last_busy(exynos_rng->dev); + pm_runtime_put_sync_autosuspend(exynos_rng->dev); + +- return 4; ++ return ret; + } + + static int exynos_rng_probe(struct platform_device *pdev) diff --git a/queue-4.6/input-uinput-handle-compat-ioctl-for-ui_set_phys.patch b/queue-4.6/input-uinput-handle-compat-ioctl-for-ui_set_phys.patch new file mode 100644 index 00000000000..6d0c4e19e31 --- /dev/null +++ b/queue-4.6/input-uinput-handle-compat-ioctl-for-ui_set_phys.patch @@ -0,0 +1,39 @@ +From affa80bd97f7ca282d1faa91667b3ee9e4c590e6 Mon Sep 17 00:00:00 2001 +From: Ricky Liang +Date: Fri, 20 May 2016 10:58:59 -0700 +Subject: Input: uinput - handle compat ioctl for UI_SET_PHYS + +From: Ricky Liang + +commit affa80bd97f7ca282d1faa91667b3ee9e4c590e6 upstream. + +When running a 32-bit userspace on a 64-bit kernel, the UI_SET_PHYS +ioctl needs to be treated with special care, as it has the pointer +size encoded in the command. + +Signed-off-by: Ricky Liang +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/misc/uinput.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/input/misc/uinput.c ++++ b/drivers/input/misc/uinput.c +@@ -981,9 +981,15 @@ static long uinput_ioctl(struct file *fi + } + + #ifdef CONFIG_COMPAT ++ ++#define UI_SET_PHYS_COMPAT _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t) ++ + static long uinput_compat_ioctl(struct file *file, + unsigned int cmd, unsigned long arg) + { ++ if (cmd == UI_SET_PHYS_COMPAT) ++ cmd = UI_SET_PHYS; ++ + return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg)); + } + #endif diff --git a/queue-4.6/input-xpad-move-pending-clear-to-the-correct-location.patch b/queue-4.6/input-xpad-move-pending-clear-to-the-correct-location.patch new file mode 100644 index 00000000000..c02330eb2df --- /dev/null +++ b/queue-4.6/input-xpad-move-pending-clear-to-the-correct-location.patch @@ -0,0 +1,37 @@ +From 4efc6939a83c54fb3417541be48991afd0290ba3 Mon Sep 17 00:00:00 2001 +From: Pavel Rojtberg +Date: Fri, 27 May 2016 16:22:25 -0700 +Subject: Input: xpad - move pending clear to the correct location + +From: Pavel Rojtberg + +commit 4efc6939a83c54fb3417541be48991afd0290ba3 upstream. + +otherwise we lose ff commands: https://github.com/paroj/xpad/issues/27 + +Signed-off-by: Pavel Rojtberg +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/joystick/xpad.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/input/joystick/xpad.c ++++ b/drivers/input/joystick/xpad.c +@@ -756,6 +756,7 @@ static bool xpad_prepare_next_out_packet + if (packet) { + memcpy(xpad->odata, packet->data, packet->len); + xpad->irq_out->transfer_buffer_length = packet->len; ++ packet->pending = false; + return true; + } + +@@ -797,7 +798,6 @@ static void xpad_irq_out(struct urb *urb + switch (status) { + case 0: + /* success */ +- xpad->out_packets[xpad->last_out_packet].pending = false; + xpad->irq_out_active = xpad_prepare_next_out_packet(xpad); + break; + diff --git a/queue-4.6/input-xpad-prevent-spurious-input-from-wired-xbox-360-controllers.patch b/queue-4.6/input-xpad-prevent-spurious-input-from-wired-xbox-360-controllers.patch new file mode 100644 index 00000000000..3b646f645b4 --- /dev/null +++ b/queue-4.6/input-xpad-prevent-spurious-input-from-wired-xbox-360-controllers.patch @@ -0,0 +1,53 @@ +From 1ff5fa3c6732f08e01ae12f12286d4728c9e4d86 Mon Sep 17 00:00:00 2001 +From: Cameron Gutman +Date: Fri, 27 May 2016 16:23:50 -0700 +Subject: Input: xpad - prevent spurious input from wired Xbox 360 controllers + +From: Cameron Gutman + +commit 1ff5fa3c6732f08e01ae12f12286d4728c9e4d86 upstream. + +After initially connecting a wired Xbox 360 controller or sending it +a command to change LEDs, a status/response packet is interpreted as +controller input. This causes the state of buttons represented in +byte 2 of the controller data packet to be incorrect until the next +valid input packet. Wireless Xbox 360 controllers are not affected. + +Writing a new value to the LED device while holding the Start button +and running jstest is sufficient to reproduce this bug. An event will +come through with the Start button released. + +Xboxdrv also won't attempt to read controller input from a packet +where byte 0 is non-zero. It also checks that byte 1 is 0x14, but +that value differs between wired and wireless controllers and this +code is shared by both. I think just checking byte 0 is enough to +eliminate unwanted packets. + +The following are some examples of 3-byte status packets I saw: +01 03 02 +02 03 00 +03 03 03 +08 03 00 + +Signed-off-by: Cameron Gutman +Signed-off-by: Pavel Rojtberg +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/joystick/xpad.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/input/joystick/xpad.c ++++ b/drivers/input/joystick/xpad.c +@@ -457,6 +457,10 @@ static void xpad_process_packet(struct u + static void xpad360_process_packet(struct usb_xpad *xpad, struct input_dev *dev, + u16 cmd, unsigned char *data) + { ++ /* valid pad data */ ++ if (data[0] != 0x00) ++ return; ++ + /* digital pad */ + if (xpad->mapping & MAP_DPAD_TO_BUTTONS) { + /* dpad as buttons (left, right, up, down) */ diff --git a/queue-4.6/media-v4l2-compat-ioctl32-fix-missing-reserved-field-copy-in-put_v4l2_create32.patch b/queue-4.6/media-v4l2-compat-ioctl32-fix-missing-reserved-field-copy-in-put_v4l2_create32.patch new file mode 100644 index 00000000000..d8e838fc91f --- /dev/null +++ b/queue-4.6/media-v4l2-compat-ioctl32-fix-missing-reserved-field-copy-in-put_v4l2_create32.patch @@ -0,0 +1,36 @@ +From baf43c6eace43868e490f18560287fa3481b2159 Mon Sep 17 00:00:00 2001 +From: Tiffany Lin +Date: Mon, 14 Mar 2016 08:16:14 -0300 +Subject: [media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32 + +From: Tiffany Lin + +commit baf43c6eace43868e490f18560287fa3481b2159 upstream. + +In v4l2-compliance utility, test VIDIOC_CREATE_BUFS will check whether reserved +filed of v4l2_create_buffers filled with zero +Reserved field is filled with zero in v4l_create_bufs. +This patch copy reserved field of v4l2_create_buffer from kernel space to user +space + +Signed-off-by: Tiffany Lin +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c ++++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +@@ -280,7 +280,8 @@ static int put_v4l2_format32(struct v4l2 + static int put_v4l2_create32(struct v4l2_create_buffers *kp, struct v4l2_create_buffers32 __user *up) + { + if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_create_buffers32)) || +- copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format))) ++ copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format)) || ++ copy_to_user(up->reserved, kp->reserved, sizeof(kp->reserved))) + return -EFAULT; + return __put_v4l2_format32(&kp->format, &up->format); + } diff --git a/queue-4.6/mfd-intel-lpss-save-register-context-on-suspend.patch b/queue-4.6/mfd-intel-lpss-save-register-context-on-suspend.patch new file mode 100644 index 00000000000..8b703ee3ea2 --- /dev/null +++ b/queue-4.6/mfd-intel-lpss-save-register-context-on-suspend.patch @@ -0,0 +1,73 @@ +From 41a3da2b8e1639d983192e3650670df4ecc94cf7 Mon Sep 17 00:00:00 2001 +From: Heikki Krogerus +Date: Mon, 18 Apr 2016 15:14:56 +0300 +Subject: mfd: intel-lpss: Save register context on suspend + +From: Heikki Krogerus + +commit 41a3da2b8e1639d983192e3650670df4ecc94cf7 upstream. + +All configurations are lost and the registers will have +default values when the hardware is suspended and resumed, +so saving the private register space context on suspend, and +restoring it on resume. + +Fixes: 4b45efe85263 (mfd: Add support for Intel Sunrisepoint LPSS devices) +Signed-off-by: Heikki Krogerus +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/intel-lpss.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +--- a/drivers/mfd/intel-lpss.c ++++ b/drivers/mfd/intel-lpss.c +@@ -34,6 +34,7 @@ + #define LPSS_DEV_SIZE 0x200 + #define LPSS_PRIV_OFFSET 0x200 + #define LPSS_PRIV_SIZE 0x100 ++#define LPSS_PRIV_REG_COUNT (LPSS_PRIV_SIZE / 4) + #define LPSS_IDMA64_OFFSET 0x800 + #define LPSS_IDMA64_SIZE 0x800 + +@@ -76,6 +77,7 @@ struct intel_lpss { + struct mfd_cell *cell; + struct device *dev; + void __iomem *priv; ++ u32 priv_ctx[LPSS_PRIV_REG_COUNT]; + int devid; + u32 caps; + u32 active_ltr; +@@ -493,6 +495,16 @@ EXPORT_SYMBOL_GPL(intel_lpss_prepare); + + int intel_lpss_suspend(struct device *dev) + { ++ struct intel_lpss *lpss = dev_get_drvdata(dev); ++ unsigned int i; ++ ++ /* Save device context */ ++ for (i = 0; i < LPSS_PRIV_REG_COUNT; i++) ++ lpss->priv_ctx[i] = readl(lpss->priv + i * 4); ++ ++ /* Put the device into reset state */ ++ writel(0, lpss->priv + LPSS_PRIV_RESETS); ++ + return 0; + } + EXPORT_SYMBOL_GPL(intel_lpss_suspend); +@@ -500,8 +512,13 @@ EXPORT_SYMBOL_GPL(intel_lpss_suspend); + int intel_lpss_resume(struct device *dev) + { + struct intel_lpss *lpss = dev_get_drvdata(dev); ++ unsigned int i; + +- intel_lpss_init_dev(lpss); ++ intel_lpss_deassert_reset(lpss); ++ ++ /* Restore device context */ ++ for (i = 0; i < LPSS_PRIV_REG_COUNT; i++) ++ writel(lpss->priv_ctx[i], lpss->priv + i * 4); + + return 0; + } diff --git a/queue-4.6/mfd-intel_quark_i2c_gpio-remove-clock-tree-on-error-path.patch b/queue-4.6/mfd-intel_quark_i2c_gpio-remove-clock-tree-on-error-path.patch new file mode 100644 index 00000000000..05d05de043b --- /dev/null +++ b/queue-4.6/mfd-intel_quark_i2c_gpio-remove-clock-tree-on-error-path.patch @@ -0,0 +1,89 @@ +From 7f0c5ae18d649ed2f4978cbf07c02a0ff732f23e Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Fri, 19 Feb 2016 10:42:10 +0200 +Subject: mfd: intel_quark_i2c_gpio: Remove clock tree on error path + +From: Andy Shevchenko + +commit 7f0c5ae18d649ed2f4978cbf07c02a0ff732f23e upstream. + +There is a potential resource leak in case when ->probe() fails. We have to +unregister and remove clock tree which is done here. + +This is a follow up to previously pushed commit c4726abce63b ("mfd: +intel_quark_i2c_gpio: Use clkdev_create()") that prevents double free() when +clkdev_drop() followed by kfree() in devm_kcalloc() release stage. + +I leave Fixes tag here, but the backporting will require to backport the commit +c4726abce63b ("mfd: intel_quark_i2c_gpio: Use clkdev_create()") first. + +Fixes: 60ae5b9f5cdd (mfd: intel_quark_i2c_gpio: Add Intel Quark X1000 I2C-GPIO MFD Driver) +Signed-off-by: Andy Shevchenko +Acked-by: Stephen Boyd +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/intel_quark_i2c_gpio.c | 25 +++++++++++++++++-------- + 1 file changed, 17 insertions(+), 8 deletions(-) + +--- a/drivers/mfd/intel_quark_i2c_gpio.c ++++ b/drivers/mfd/intel_quark_i2c_gpio.c +@@ -139,6 +139,7 @@ static int intel_quark_register_i2c_clk( + INTEL_QUARK_I2C_CONTROLLER_CLK); + + if (!quark_mfd->i2c_clk_lookup) { ++ clk_unregister(quark_mfd->i2c_clk); + dev_err(&pdev->dev, "Fixed clk register failed\n"); + return -ENOMEM; + } +@@ -150,7 +151,7 @@ static void intel_quark_unregister_i2c_c + { + struct intel_quark_mfd *quark_mfd = dev_get_drvdata(&pdev->dev); + +- if (!quark_mfd->i2c_clk || !quark_mfd->i2c_clk_lookup) ++ if (!quark_mfd->i2c_clk_lookup) + return; + + clkdev_drop(quark_mfd->i2c_clk_lookup); +@@ -246,25 +247,33 @@ static int intel_quark_mfd_probe(struct + quark_mfd = devm_kzalloc(&pdev->dev, sizeof(*quark_mfd), GFP_KERNEL); + if (!quark_mfd) + return -ENOMEM; ++ + quark_mfd->pdev = pdev; ++ dev_set_drvdata(&pdev->dev, quark_mfd); + + ret = intel_quark_register_i2c_clk(quark_mfd); + if (ret) + return ret; + +- dev_set_drvdata(&pdev->dev, quark_mfd); +- + ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_cells[1]); + if (ret) +- return ret; ++ goto err_unregister_i2c_clk; + + ret = intel_quark_gpio_setup(pdev, &intel_quark_mfd_cells[0]); + if (ret) +- return ret; ++ goto err_unregister_i2c_clk; ++ ++ ret = mfd_add_devices(&pdev->dev, 0, intel_quark_mfd_cells, ++ ARRAY_SIZE(intel_quark_mfd_cells), NULL, 0, ++ NULL); ++ if (ret) ++ goto err_unregister_i2c_clk; ++ ++ return 0; + +- return mfd_add_devices(&pdev->dev, 0, intel_quark_mfd_cells, +- ARRAY_SIZE(intel_quark_mfd_cells), NULL, 0, +- NULL); ++err_unregister_i2c_clk: ++ intel_quark_unregister_i2c_clk(pdev); ++ return ret; + } + + static void intel_quark_mfd_remove(struct pci_dev *pdev) diff --git a/queue-4.6/mfd-intel_soc_pmic_core-terminate-panel-control-gpio-lookup-table-correctly.patch b/queue-4.6/mfd-intel_soc_pmic_core-terminate-panel-control-gpio-lookup-table-correctly.patch new file mode 100644 index 00000000000..dff06acb391 --- /dev/null +++ b/queue-4.6/mfd-intel_soc_pmic_core-terminate-panel-control-gpio-lookup-table-correctly.patch @@ -0,0 +1,36 @@ +From 36e6d081cfb2cb64e6d8e5121cffb1e62f894d36 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Fri, 22 Apr 2016 22:38:55 +0300 +Subject: mfd: intel_soc_pmic_core: Terminate panel control GPIO lookup table correctly +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit 36e6d081cfb2cb64e6d8e5121cffb1e62f894d36 upstream. + +GPIO lookup tables are supposed to be zero terminated. Let's do that +and avoid accidentally walking off the end. + +Fixes: 61dd2ca2d44e ("mfd: intel_soc_pmic_core: Add lookup table for Panel Control as GPIO signal") +Signed-off-by: Ville Syrjälä +Acked-by: Linus Walleij +Acked-by: Daniel Vetter +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/intel_soc_pmic_core.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mfd/intel_soc_pmic_core.c ++++ b/drivers/mfd/intel_soc_pmic_core.c +@@ -35,6 +35,7 @@ static struct gpiod_lookup_table panel_g + .table = { + /* Panel EN/DISABLE */ + GPIO_LOOKUP("gpio_crystalcove", 94, "panel", GPIO_ACTIVE_HIGH), ++ { }, + }, + }; + diff --git a/queue-4.6/pci-disable-all-bar-sizing-for-devices-with-non-compliant-bars.patch b/queue-4.6/pci-disable-all-bar-sizing-for-devices-with-non-compliant-bars.patch new file mode 100644 index 00000000000..a8e086fad47 --- /dev/null +++ b/queue-4.6/pci-disable-all-bar-sizing-for-devices-with-non-compliant-bars.patch @@ -0,0 +1,60 @@ +From ad67b437f187ea818b2860524d10f878fadfdd99 Mon Sep 17 00:00:00 2001 +From: Prarit Bhargava +Date: Wed, 11 May 2016 12:27:16 -0400 +Subject: PCI: Disable all BAR sizing for devices with non-compliant BARs + +From: Prarit Bhargava + +commit ad67b437f187ea818b2860524d10f878fadfdd99 upstream. + +b84106b4e229 ("PCI: Disable IO/MEM decoding for devices with non-compliant +BARs") disabled BAR sizing for BARs 0-5 of devices that don't comply with +the PCI spec. But it didn't do anything for expansion ROM BARs, so we +still try to size them, resulting in warnings like this on Broadwell-EP: + + pci 0000:ff:12.0: BAR 6: failed to assign [mem size 0x00000001 pref] + +Move the non-compliant BAR check from __pci_read_base() up to +pci_read_bases() so it applies to the expansion ROM BAR as well as +to BARs 0-5. + +Note that direct callers of __pci_read_base(), like sriov_init(), will now +bypass this check. We haven't had reports of devices with broken SR-IOV +BARs yet. + +[bhelgaas: changelog] +Fixes: b84106b4e229 ("PCI: Disable IO/MEM decoding for devices with non-compliant BARs") +Signed-off-by: Prarit Bhargava +Signed-off-by: Bjorn Helgaas +CC: Thomas Gleixner +CC: Ingo Molnar +CC: "H. Peter Anvin" +CC: Andi Kleen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/probe.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/pci/probe.c ++++ b/drivers/pci/probe.c +@@ -179,9 +179,6 @@ int __pci_read_base(struct pci_dev *dev, + u16 orig_cmd; + struct pci_bus_region region, inverted_region; + +- if (dev->non_compliant_bars) +- return 0; +- + mask = type ? PCI_ROM_ADDRESS_MASK : ~0; + + /* No printks while decoding is disabled! */ +@@ -322,6 +319,9 @@ static void pci_read_bases(struct pci_de + { + unsigned int pos, reg; + ++ if (dev->non_compliant_bars) ++ return; ++ + for (pos = 0; pos < howmany; pos++) { + struct resource *res = &dev->resource[pos]; + reg = PCI_BASE_ADDRESS_0 + (pos << 2); diff --git a/queue-4.6/pinctrl-exynos5440-use-off-stack-memory-for-pinctrl_gpio_range.patch b/queue-4.6/pinctrl-exynos5440-use-off-stack-memory-for-pinctrl_gpio_range.patch new file mode 100644 index 00000000000..69f69c1e4dc --- /dev/null +++ b/queue-4.6/pinctrl-exynos5440-use-off-stack-memory-for-pinctrl_gpio_range.patch @@ -0,0 +1,72 @@ +From 71324fdc72ef0163e57631aa814a9a81e9e4770b Mon Sep 17 00:00:00 2001 +From: Andrew Jeffery +Date: Wed, 20 Apr 2016 11:24:17 +0930 +Subject: pinctrl: exynos5440: Use off-stack memory for pinctrl_gpio_range + +From: Andrew Jeffery + +commit 71324fdc72ef0163e57631aa814a9a81e9e4770b upstream. + +The range is registered into a linked list which can be referenced +throughout the lifetime of the driver. Ensure the range's memory is useful +for the same lifetime by adding it to the driver's private data structure. + +The bug was introduced in the driver's initial commit, which was present in +v3.10. + +Fixes: f0b9a7e521fa ("pinctrl: exynos5440: add pinctrl driver for Samsung EXYNOS5440 SoC") +Signed-off-by: Andrew Jeffery +Acked-by: Tomasz Figa +Reviewed-by: Krzysztof Kozlowski +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +--- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c ++++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c +@@ -107,6 +107,7 @@ struct exynos5440_pmx_func { + * @nr_groups: number of pin groups available. + * @pmx_functions: list of pin functions parsed from device tree. + * @nr_functions: number of pin functions available. ++ * @range: gpio range to register with pinctrl + */ + struct exynos5440_pinctrl_priv_data { + void __iomem *reg_base; +@@ -117,6 +118,7 @@ struct exynos5440_pinctrl_priv_data { + unsigned int nr_groups; + const struct exynos5440_pmx_func *pmx_functions; + unsigned int nr_functions; ++ struct pinctrl_gpio_range range; + }; + + /** +@@ -742,7 +744,6 @@ static int exynos5440_pinctrl_register(s + struct pinctrl_desc *ctrldesc; + struct pinctrl_dev *pctl_dev; + struct pinctrl_pin_desc *pindesc, *pdesc; +- struct pinctrl_gpio_range grange; + char *pin_names; + int pin, ret; + +@@ -794,12 +795,12 @@ static int exynos5440_pinctrl_register(s + return PTR_ERR(pctl_dev); + } + +- grange.name = "exynos5440-pctrl-gpio-range"; +- grange.id = 0; +- grange.base = 0; +- grange.npins = EXYNOS5440_MAX_PINS; +- grange.gc = priv->gc; +- pinctrl_add_gpio_range(pctl_dev, &grange); ++ priv->range.name = "exynos5440-pctrl-gpio-range"; ++ priv->range.id = 0; ++ priv->range.base = 0; ++ priv->range.npins = EXYNOS5440_MAX_PINS; ++ priv->range.gc = priv->gc; ++ pinctrl_add_gpio_range(pctl_dev, &priv->range); + return 0; + } + diff --git a/queue-4.6/pkcs-7-fix-missing-break-on-oid_sha224-case.patch b/queue-4.6/pkcs-7-fix-missing-break-on-oid_sha224-case.patch new file mode 100644 index 00000000000..61a4919e875 --- /dev/null +++ b/queue-4.6/pkcs-7-fix-missing-break-on-oid_sha224-case.patch @@ -0,0 +1,32 @@ +From 06af9b0f4949b85b20107e6d75f5eba15111d220 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Fri, 18 Mar 2016 15:51:31 +0000 +Subject: PKCS#7: fix missing break on OID_sha224 case + +From: Colin Ian King + +commit 06af9b0f4949b85b20107e6d75f5eba15111d220 upstream. + +The OID_sha224 case is missing a break and it falls through +to the -ENOPKG error default. Since HASH_ALGO_SHA224 seems +to be supported, this looks like an unintentional missing break. + +Fixes: 07f081fb5057 ("PKCS#7: Add OIDs for sha224, sha284 and sha512 hash algos and use them") +Signed-off-by: Colin Ian King +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + crypto/asymmetric_keys/pkcs7_parser.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/crypto/asymmetric_keys/pkcs7_parser.c ++++ b/crypto/asymmetric_keys/pkcs7_parser.c +@@ -237,6 +237,7 @@ int pkcs7_sig_note_digest_algo(void *con + break; + case OID_sha224: + ctx->sinfo->sig.hash_algo = "sha224"; ++ break; + default: + printk("Unsupported digest algo: %u\n", ctx->last_oid); + return -ENOPKG; diff --git a/queue-4.6/pm-runtime-fix-error-path-in-pm_runtime_force_resume.patch b/queue-4.6/pm-runtime-fix-error-path-in-pm_runtime_force_resume.patch new file mode 100644 index 00000000000..324e83d35b1 --- /dev/null +++ b/queue-4.6/pm-runtime-fix-error-path-in-pm_runtime_force_resume.patch @@ -0,0 +1,47 @@ +From 0ae3aeefabbeef26294e7a349b51f1c761d46c9f Mon Sep 17 00:00:00 2001 +From: Ulf Hansson +Date: Fri, 8 Apr 2016 13:10:23 +0200 +Subject: PM / Runtime: Fix error path in pm_runtime_force_resume() + +From: Ulf Hansson + +commit 0ae3aeefabbeef26294e7a349b51f1c761d46c9f upstream. + +As pm_runtime_set_active() may fail because the device's parent isn't +active, we can end up executing the ->runtime_resume() callback for the +device when it isn't allowed. + +Fix this by invoking pm_runtime_set_active() before running the callback +and let's also deal with the error code. + +Fixes: 37f204164dfb (PM: Add pm_runtime_suspend|resume_force functions) +Signed-off-by: Ulf Hansson +Reviewed-by: Linus Walleij +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/power/runtime.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/base/power/runtime.c ++++ b/drivers/base/power/runtime.c +@@ -1506,11 +1506,16 @@ int pm_runtime_force_resume(struct devic + goto out; + } + +- ret = callback(dev); ++ ret = pm_runtime_set_active(dev); + if (ret) + goto out; + +- pm_runtime_set_active(dev); ++ ret = callback(dev); ++ if (ret) { ++ pm_runtime_set_suspended(dev); ++ goto out; ++ } ++ + pm_runtime_mark_last_busy(dev); + out: + pm_runtime_enable(dev); diff --git a/queue-4.6/regulator-try-to-resolve-regulators-supplies-on-registration.patch b/queue-4.6/regulator-try-to-resolve-regulators-supplies-on-registration.patch new file mode 100644 index 00000000000..aa64c30dccb --- /dev/null +++ b/queue-4.6/regulator-try-to-resolve-regulators-supplies-on-registration.patch @@ -0,0 +1,67 @@ +From 5e3ca2b349b1e2c80b060b51bbf2af37448fad85 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Wed, 23 Mar 2016 20:59:34 -0300 +Subject: regulator: Try to resolve regulators supplies on registration + +From: Javier Martinez Canillas + +commit 5e3ca2b349b1e2c80b060b51bbf2af37448fad85 upstream. + +Commit 6261b06de565 ("regulator: Defer lookup of supply to regulator_get") +moved the regulator supplies lookup logic from the regulators registration +to the regulators get time. + +Unfortunately, that changed the behavior of the regulator core since now a +parent supply with a child regulator marked as always-on, won't be enabled +unless a client driver attempts to get the child regulator during boot. + +This patch tries to resolve the parent supply for the already registered +regulators each time that a new regulator is registered. So the regulators +that have child regulators marked as always on will be enabled regardless +if a driver gets the child regulator or not. + +That was the behavior before the mentioned commit, since parent supplies +were looked up at regulator registration time instead of during child get. + +Since regulator_resolve_supply() checks for rdev->supply, most of the times +it will be a no-op. Errors aren't checked to keep the possible out of order +dependencies which was the motivation for the mentioned commit. + +Also, the supply being available will be enforced on regulator get anyways +in case the resolve fails on regulators registration. + +Fixes: 6261b06de565 ("regulator: Defer lookup of supply to regulator_get") +Suggested-by: Mark Brown +Signed-off-by: Javier Martinez Canillas +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/regulator/core.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -3840,6 +3840,11 @@ static void rdev_init_debugfs(struct reg + &rdev->bypass_count); + } + ++static int regulator_register_resolve_supply(struct device *dev, void *data) ++{ ++ return regulator_resolve_supply(dev_to_rdev(dev)); ++} ++ + /** + * regulator_register - register regulator + * @regulator_desc: regulator to register +@@ -3986,6 +3991,10 @@ regulator_register(const struct regulato + } + + rdev_init_debugfs(rdev); ++ ++ /* try to resolve regulators supply since a new one was registered */ ++ class_for_each_device(®ulator_class, NULL, NULL, ++ regulator_register_resolve_supply); + out: + mutex_unlock(®ulator_list_mutex); + kfree(config); diff --git a/queue-4.6/revert-lpfc-delete-unnecessary-checks-before-the-function-call-mempool_destroy.patch b/queue-4.6/revert-lpfc-delete-unnecessary-checks-before-the-function-call-mempool_destroy.patch new file mode 100644 index 00000000000..21499658f87 --- /dev/null +++ b/queue-4.6/revert-lpfc-delete-unnecessary-checks-before-the-function-call-mempool_destroy.patch @@ -0,0 +1,41 @@ +From d65c8fff867a6450c58ce31572e883148a445ddf Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Mon, 9 May 2016 21:39:43 -0400 +Subject: Revert "lpfc: Delete unnecessary checks before the function call mempool_destroy" + +From: Martin K. Petersen + +commit d65c8fff867a6450c58ce31572e883148a445ddf upstream. + +This reverts commit 9be321819c43417432a8376428b90fe3fe3a3510 which +caused a regression on hardware using the SLI3 interface. + +Reported-by: Dick Kennedy +Signed-off-by: Martin K. Petersen +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/lpfc/lpfc_mem.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_mem.c ++++ b/drivers/scsi/lpfc/lpfc_mem.c +@@ -231,13 +231,15 @@ lpfc_mem_free(struct lpfc_hba *phba) + if (phba->lpfc_hbq_pool) + pci_pool_destroy(phba->lpfc_hbq_pool); + phba->lpfc_hbq_pool = NULL; +- mempool_destroy(phba->rrq_pool); ++ ++ if (phba->rrq_pool) ++ mempool_destroy(phba->rrq_pool); + phba->rrq_pool = NULL; + + /* Free NLP memory pool */ + mempool_destroy(phba->nlp_mem_pool); + phba->nlp_mem_pool = NULL; +- if (phba->sli_rev == LPFC_SLI_REV4) { ++ if (phba->sli_rev == LPFC_SLI_REV4 && phba->active_rrq_pool) { + mempool_destroy(phba->active_rrq_pool); + phba->active_rrq_pool = NULL; + } diff --git a/queue-4.6/rtlwifi-btcoexist-implement-antenna-selection.patch b/queue-4.6/rtlwifi-btcoexist-implement-antenna-selection.patch new file mode 100644 index 00000000000..1992098ca16 --- /dev/null +++ b/queue-4.6/rtlwifi-btcoexist-implement-antenna-selection.patch @@ -0,0 +1,129 @@ +From baa1702290953295e421f0f433e2b1ff4815827c Mon Sep 17 00:00:00 2001 +From: Larry Finger +Date: Wed, 16 Mar 2016 13:33:35 -0500 +Subject: rtlwifi: btcoexist: Implement antenna selection + +From: Larry Finger + +commit baa1702290953295e421f0f433e2b1ff4815827c upstream. + +The previous patch added an option to rtl8723be to manually select the +antenna for those cases when only a single antenna is present, and the +on-board EEPROM is incorrectly programmed. This patch implements the +necessary changes in the Bluetooth coexistence driver. + +Signed-off-by: Larry Finger +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c | 9 ++- + drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 27 +++++++++- + drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 2 + drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 5 + + 4 files changed, 38 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c ++++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c +@@ -1203,7 +1203,6 @@ static void btc8723b2ant_set_ant_path(st + + /* Force GNT_BT to low */ + btcoexist->btc_write_1byte_bitmask(btcoexist, 0x765, 0x18, 0x0); +- btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0); + + if (board_info->btdm_ant_pos == BTC_ANTENNA_AT_MAIN_PORT) { + /* tell firmware "no antenna inverse" */ +@@ -1211,19 +1210,25 @@ static void btc8723b2ant_set_ant_path(st + h2c_parameter[1] = 1; /* ext switch type */ + btcoexist->btc_fill_h2c(btcoexist, 0x65, 2, + h2c_parameter); ++ btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0); + } else { + /* tell firmware "antenna inverse" */ + h2c_parameter[0] = 1; + h2c_parameter[1] = 1; /* ext switch type */ + btcoexist->btc_fill_h2c(btcoexist, 0x65, 2, + h2c_parameter); ++ btcoexist->btc_write_2byte(btcoexist, 0x948, 0x280); + } + } + + /* ext switch setting */ + if (use_ext_switch) { + /* fixed internal switch S1->WiFi, S0->BT */ +- btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0); ++ if (board_info->btdm_ant_pos == BTC_ANTENNA_AT_MAIN_PORT) ++ btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0); ++ else ++ btcoexist->btc_write_2byte(btcoexist, 0x948, 0x280); ++ + switch (antpos_type) { + case BTC_ANT_WIFI_AT_MAIN: + /* ext switch main at wifi */ +--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c ++++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +@@ -965,13 +965,38 @@ void exhalbtc_set_chip_type(u8 chip_type + } + } + +-void exhalbtc_set_ant_num(u8 type, u8 ant_num) ++void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num) + { + if (BT_COEX_ANT_TYPE_PG == type) { + gl_bt_coexist.board_info.pg_ant_num = ant_num; + gl_bt_coexist.board_info.btdm_ant_num = ant_num; ++ /* The antenna position: ++ * Main (default) or Aux for pgAntNum=2 && btdmAntNum =1. ++ * The antenna position should be determined by ++ * auto-detect mechanism. ++ * The following is assumed to main, ++ * and those must be modified ++ * if y auto-detect mechanism is ready ++ */ ++ if ((gl_bt_coexist.board_info.pg_ant_num == 2) && ++ (gl_bt_coexist.board_info.btdm_ant_num == 1)) ++ gl_bt_coexist.board_info.btdm_ant_pos = ++ BTC_ANTENNA_AT_MAIN_PORT; ++ else ++ gl_bt_coexist.board_info.btdm_ant_pos = ++ BTC_ANTENNA_AT_MAIN_PORT; + } else if (BT_COEX_ANT_TYPE_ANTDIV == type) { + gl_bt_coexist.board_info.btdm_ant_num = ant_num; ++ gl_bt_coexist.board_info.btdm_ant_pos = ++ BTC_ANTENNA_AT_MAIN_PORT; ++ } else if (type == BT_COEX_ANT_TYPE_DETECTED) { ++ gl_bt_coexist.board_info.btdm_ant_num = ant_num; ++ if (rtlpriv->cfg->mod_params->ant_sel == 1) ++ gl_bt_coexist.board_info.btdm_ant_pos = ++ BTC_ANTENNA_AT_AUX_PORT; ++ else ++ gl_bt_coexist.board_info.btdm_ant_pos = ++ BTC_ANTENNA_AT_MAIN_PORT; + } + } + +--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h ++++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +@@ -535,7 +535,7 @@ void exhalbtc_set_bt_patch_version(u16 b + void exhalbtc_update_min_bt_rssi(char bt_rssi); + void exhalbtc_set_bt_exist(bool bt_exist); + void exhalbtc_set_chip_type(u8 chip_type); +-void exhalbtc_set_ant_num(u8 type, u8 ant_num); ++void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num); + void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist); + void exhalbtc_signal_compensation(struct btc_coexist *btcoexist, + u8 *rssi_wifi, u8 *rssi_bt); +--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c ++++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c +@@ -72,7 +72,10 @@ void rtl_btc_init_hal_vars(struct rtl_pr + __func__, bt_type); + exhalbtc_set_chip_type(bt_type); + +- exhalbtc_set_ant_num(BT_COEX_ANT_TYPE_PG, ant_num); ++ if (rtlpriv->cfg->mod_params->ant_sel == 1) ++ exhalbtc_set_ant_num(rtlpriv, BT_COEX_ANT_TYPE_DETECTED, 1); ++ else ++ exhalbtc_set_ant_num(rtlpriv, BT_COEX_ANT_TYPE_PG, ant_num); + } + + void rtl_btc_init_hw_config(struct rtl_priv *rtlpriv) diff --git a/queue-4.6/rtlwifi-fix-logic-error-in-enter-exit-power-save-mode.patch b/queue-4.6/rtlwifi-fix-logic-error-in-enter-exit-power-save-mode.patch new file mode 100644 index 00000000000..9af4bccf9ba --- /dev/null +++ b/queue-4.6/rtlwifi-fix-logic-error-in-enter-exit-power-save-mode.patch @@ -0,0 +1,38 @@ +From 873ffe154ae074c46ed2d72dbd9a2a99f06f55b4 Mon Sep 17 00:00:00 2001 +From: wang yanqing +Date: Tue, 3 May 2016 00:38:36 +0800 +Subject: rtlwifi: Fix logic error in enter/exit power-save mode + +From: wang yanqing + +commit 873ffe154ae074c46ed2d72dbd9a2a99f06f55b4 upstream. + +In commit a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and +rtl_lps_enter() to use work queue"), the tests for enter/exit +power-save mode were inverted. With this change applied, the +wifi connection becomes much more stable. + +Fixes: a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue") +Signed-off-by: Wang YanQing +Acked-by: Larry Finger +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/realtek/rtlwifi/base.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/realtek/rtlwifi/base.c ++++ b/drivers/net/wireless/realtek/rtlwifi/base.c +@@ -1660,9 +1660,9 @@ void rtl_watchdog_wq_callback(void *data + if (((rtlpriv->link_info.num_rx_inperiod + + rtlpriv->link_info.num_tx_inperiod) > 8) || + (rtlpriv->link_info.num_rx_inperiod > 2)) +- rtl_lps_enter(hw); +- else + rtl_lps_leave(hw); ++ else ++ rtl_lps_enter(hw); + } + + rtlpriv->link_info.num_rx_inperiod = 0; diff --git a/queue-4.6/rtlwifi-pci-use-dev_kfree_skb_irq-instead-of-kfree_skb-in-rtl_pci_reset_trx_ring.patch b/queue-4.6/rtlwifi-pci-use-dev_kfree_skb_irq-instead-of-kfree_skb-in-rtl_pci_reset_trx_ring.patch new file mode 100644 index 00000000000..e55187dbfe8 --- /dev/null +++ b/queue-4.6/rtlwifi-pci-use-dev_kfree_skb_irq-instead-of-kfree_skb-in-rtl_pci_reset_trx_ring.patch @@ -0,0 +1,83 @@ +From cf968937d27751296920e6b82ffa89735e3a0023 Mon Sep 17 00:00:00 2001 +From: wang yanqing +Date: Sat, 7 May 2016 00:33:53 +0800 +Subject: rtlwifi: pci: use dev_kfree_skb_irq instead of kfree_skb in rtl_pci_reset_trx_ring + +From: wang yanqing + +commit cf968937d27751296920e6b82ffa89735e3a0023 upstream. + +We can't use kfree_skb in irq disable context, because spin_lock_irqsave +make sure we are always in irq disable context, use dev_kfree_skb_irq +instead of kfree_skb is better than dev_kfree_skb_any. + +This patch fix below kernel warning: +[ 7612.095528] ------------[ cut here ]------------ +[ 7612.095546] WARNING: CPU: 3 PID: 4460 at kernel/softirq.c:150 __local_bh_enable_ip+0x58/0x80() +[ 7612.095550] Modules linked in: rtl8723be x86_pkg_temp_thermal btcoexist rtl_pci rtlwifi rtl8723_common +[ 7612.095567] CPU: 3 PID: 4460 Comm: ifconfig Tainted: G W 4.4.0+ #4 +[ 7612.095570] Hardware name: LENOVO 20DFA04FCD/20DFA04FCD, BIOS J5ET48WW (1.19 ) 08/27/2015 +[ 7612.095574] 00000000 00000000 da37fc70 c12ce7c5 00000000 da37fca0 c104cc59 c19d4454 +[ 7612.095584] 00000003 0000116c c19d4784 00000096 c10508a8 c10508a8 00000200 c1b42400 +[ 7612.095594] f29be780 da37fcb0 c104ccad 00000009 00000000 da37fcbc c10508a8 f21f08b8 +[ 7612.095604] Call Trace: +[ 7612.095614] [] dump_stack+0x41/0x5c +[ 7612.095620] [] warn_slowpath_common+0x89/0xc0 +[ 7612.095628] [] ? __local_bh_enable_ip+0x58/0x80 +[ 7612.095634] [] ? __local_bh_enable_ip+0x58/0x80 +[ 7612.095640] [] warn_slowpath_null+0x1d/0x20 +[ 7612.095646] [] __local_bh_enable_ip+0x58/0x80 +[ 7612.095653] [] destroy_conntrack+0x64/0xa0 +[ 7612.095660] [] nf_conntrack_destroy+0xf/0x20 +[ 7612.095665] [] skb_release_head_state+0x55/0xa0 +[ 7612.095670] [] skb_release_all+0xb/0x20 +[ 7612.095674] [] __kfree_skb+0xb/0x60 +[ 7612.095679] [] kfree_skb+0x30/0x70 +[ 7612.095686] [] ? rtl_pci_reset_trx_ring+0x22d/0x370 [rtl_pci] +[ 7612.095692] [] rtl_pci_reset_trx_ring+0x22d/0x370 [rtl_pci] +[ 7612.095698] [] rtl_pci_start+0x19/0x190 [rtl_pci] +[ 7612.095705] [] rtl_op_start+0x56/0x90 [rtlwifi] +[ 7612.095712] [] drv_start+0x36/0xc0 +[ 7612.095717] [] ieee80211_do_open+0x2d3/0x890 +[ 7612.095725] [] ? call_netdevice_notifiers_info+0x2e/0x60 +[ 7612.095730] [] ieee80211_open+0x4d/0x50 +[ 7612.095736] [] __dev_open+0xa3/0x130 +[ 7612.095742] [] ? _raw_spin_unlock_bh+0x13/0x20 +[ 7612.095748] [] __dev_change_flags+0x89/0x140 +[ 7612.095753] [] ? selinux_capable+0xd/0x10 +[ 7612.095759] [] dev_change_flags+0x29/0x60 +[ 7612.095765] [] devinet_ioctl+0x553/0x670 +[ 7612.095772] [] ? _copy_to_user+0x28/0x40 +[ 7612.095777] [] inet_ioctl+0x85/0xb0 +[ 7612.095783] [] sock_ioctl+0x67/0x260 +[ 7612.095788] [] ? sock_fasync+0x80/0x80 +[ 7612.095795] [] do_vfs_ioctl+0x6b/0x550 +[ 7612.095800] [] ? selinux_file_ioctl+0x102/0x1e0 +[ 7612.095807] [] ? timekeeping_suspend+0x294/0x320 +[ 7612.095813] [] ? __hrtimer_run_queues+0x14a/0x210 +[ 7612.095820] [] ? security_file_ioctl+0x34/0x50 +[ 7612.095827] [] SyS_ioctl+0x70/0x80 +[ 7612.095832] [] do_fast_syscall_32+0x84/0x120 +[ 7612.095839] [] sysenter_past_esp+0x36/0x55 +[ 7612.095844] ---[ end trace 97e9c637a20e8348 ]--- + +Signed-off-by: Wang YanQing +Acked-by: Larry Finger +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/realtek/rtlwifi/pci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/realtek/rtlwifi/pci.c ++++ b/drivers/net/wireless/realtek/rtlwifi/pci.c +@@ -1573,7 +1573,7 @@ int rtl_pci_reset_trx_ring(struct ieee80 + true, + HW_DESC_TXBUFF_ADDR), + skb->len, PCI_DMA_TODEVICE); +- kfree_skb(skb); ++ dev_kfree_skb_irq(skb); + ring->idx = (ring->idx + 1) % ring->entries; + } + ring->idx = 0; diff --git a/queue-4.6/rtlwifi-rtl8723be-add-antenna-select-module-parameter.patch b/queue-4.6/rtlwifi-rtl8723be-add-antenna-select-module-parameter.patch new file mode 100644 index 00000000000..cbdebd740e7 --- /dev/null +++ b/queue-4.6/rtlwifi-rtl8723be-add-antenna-select-module-parameter.patch @@ -0,0 +1,88 @@ +From c18d8f5095715c56bb3cd9cba64242542632054b Mon Sep 17 00:00:00 2001 +From: Larry Finger +Date: Wed, 16 Mar 2016 13:33:34 -0500 +Subject: rtlwifi: rtl8723be: Add antenna select module parameter + +From: Larry Finger + +commit c18d8f5095715c56bb3cd9cba64242542632054b upstream. + +A number of new laptops have been delivered with only a single antenna. +In principle, this is OK; however, a problem arises when the on-board +EEPROM is programmed to use the other antenna connection. The option +of opening the computer and moving the connector is not always possible +as it will void the warranty in some cases. In addition, this solution +breaks the Windows driver when the box dual boots Linux and Windows. + +A fix involving a new module parameter has been developed. This commit +adds the new parameter and implements the changes needed for the driver. + +Signed-off-by: Larry Finger +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 5 +++++ + drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c | 3 +++ + drivers/net/wireless/realtek/rtlwifi/wifi.h | 3 +++ + 3 files changed, 11 insertions(+) + +--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c ++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +@@ -2684,6 +2684,7 @@ void rtl8723be_read_bt_coexist_info_from + bool auto_load_fail, u8 *hwinfo) + { + struct rtl_priv *rtlpriv = rtl_priv(hw); ++ struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params; + u8 value; + u32 tmpu_32; + +@@ -2702,6 +2703,10 @@ void rtl8723be_read_bt_coexist_info_from + rtlpriv->btcoexist.btc_info.ant_num = ANT_X2; + } + ++ /* override ant_num / ant_path */ ++ if (mod_params->ant_sel) ++ rtlpriv->btcoexist.btc_info.ant_num = ++ (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1); + } + + void rtl8723be_bt_reg_init(struct ieee80211_hw *hw) +--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c ++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c +@@ -273,6 +273,7 @@ static struct rtl_mod_params rtl8723be_m + .msi_support = false, + .disable_watchdog = false, + .debug = DBG_EMERG, ++ .ant_sel = 0, + }; + + static struct rtl_hal_cfg rtl8723be_hal_cfg = { +@@ -394,6 +395,7 @@ module_param_named(fwlps, rtl8723be_mod_ + module_param_named(msi, rtl8723be_mod_params.msi_support, bool, 0444); + module_param_named(disable_watchdog, rtl8723be_mod_params.disable_watchdog, + bool, 0444); ++module_param_named(ant_sel, rtl8723be_mod_params.ant_sel, int, 0444); + MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); + MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); + MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); +@@ -402,6 +404,7 @@ MODULE_PARM_DESC(msi, "Set to 1 to use M + MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); + MODULE_PARM_DESC(disable_watchdog, + "Set to 1 to disable the watchdog (default 0)\n"); ++MODULE_PARM_DESC(ant_sel, "Set to 1 or 2 to force antenna number (default 0)\n"); + + static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); + +--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h ++++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h +@@ -2246,6 +2246,9 @@ struct rtl_mod_params { + + /* default 0: 1 means do not disable interrupts */ + bool int_clear; ++ ++ /* select antenna */ ++ int ant_sel; + }; + + struct rtl_hal_usbint_cfg { diff --git a/queue-4.6/series b/queue-4.6/series index 217675541df..52d8f713051 100644 --- a/queue-4.6/series +++ b/queue-4.6/series @@ -24,3 +24,48 @@ mips-fix-sigreturn-via-vdso-on-micromips-kernel.patch mips-build-micromips-vdso-for-micromips-kernels.patch mips-lib-mark-intrinsics-notrace.patch mips-vdso-build-with-fno-strict-aliasing.patch +affs-fix-remount-failure-when-there-are-no-options-changed.patch +asoc-ak4642-enable-cache-usage-to-fix-crashes-on-resume.patch +input-uinput-handle-compat-ioctl-for-ui_set_phys.patch +input-xpad-move-pending-clear-to-the-correct-location.patch +input-xpad-prevent-spurious-input-from-wired-xbox-360-controllers.patch +arm-sun4i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch +arm-sun7i-dt-enable-dram-gate-5-tve0-clock-for-simplefb-tv-output.patch +arm-mvebu-fix-gpio-config-on-the-linksys-boards.patch +arm-dts-at91-fix-typo-in-sama5d2-pin_pd24-description.patch +arm-dts-exynos-add-interrupt-line-to-max8997-pmic-on-exynos4210-trats.patch +arm-dts-imx35-restore-existing-used-clock-enumeration.patch +ath9k-add-a-module-parameter-to-invert-led-polarity.patch +ath9k-fix-led-polarity-for-some-mini-pci-ar9220-mb92-cards.patch +ath10k-fix-debugfs-pktlog_filter-write.patch +ath10k-fix-firmware-assert-in-monitor-mode.patch +ath10k-fix-rx_channel-during-hw-reconfigure.patch +ath10k-fix-kernel-panic-move-arvifs-list-head-init-before-htt-init.patch +ath5k-change-led-pin-configuration-for-compaq-c700-laptop.patch +hwrng-exynos-fix-unbalanced-pm-runtime-put-on-timeout-error-path.patch +rtlwifi-rtl8723be-add-antenna-select-module-parameter.patch +rtlwifi-btcoexist-implement-antenna-selection.patch +rtlwifi-fix-logic-error-in-enter-exit-power-save-mode.patch +rtlwifi-pci-use-dev_kfree_skb_irq-instead-of-kfree_skb-in-rtl_pci_reset_trx_ring.patch +revert-lpfc-delete-unnecessary-checks-before-the-function-call-mempool_destroy.patch +aacraid-start-adapter-after-updating-number-of-msix-vectors.patch +aacraid-relinquish-cpu-during-timeout-wait.patch +aacraid-fix-for-aac_command_thread-hang.patch +aacraid-fix-for-kdump-driver-hang.patch +regulator-try-to-resolve-regulators-supplies-on-registration.patch +hwmon-ads7828-enable-internal-reference.patch +mfd-intel_quark_i2c_gpio-remove-clock-tree-on-error-path.patch +mfd-intel-lpss-save-register-context-on-suspend.patch +mfd-intel_soc_pmic_core-terminate-panel-control-gpio-lookup-table-correctly.patch +pm-runtime-fix-error-path-in-pm_runtime_force_resume.patch +cpuidle-indicate-when-a-device-has-been-unregistered.patch +cpuidle-fix-cpuidle_state_is_coupled-argument-in-cpuidle_enter.patch +clk-bcm2835-fix-pll-poweron.patch +clk-at91-fix-check-of-clk_register-returned-value.patch +clk-bcm2835-pll_off-should-only-update-cm_pll_anarst.patch +clk-bcm2835-divider-value-has-to-be-1-or-more.patch +clk-bcm2835-correctly-enable-fractional-clock-support.patch +pinctrl-exynos5440-use-off-stack-memory-for-pinctrl_gpio_range.patch +pci-disable-all-bar-sizing-for-devices-with-non-compliant-bars.patch +media-v4l2-compat-ioctl32-fix-missing-reserved-field-copy-in-put_v4l2_create32.patch +pkcs-7-fix-missing-break-on-oid_sha224-case.patch