From 0fc72c525ff2c6298ae5f4205086b6d4d1f11b34 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 1 Jul 2018 11:01:59 +0200 Subject: [PATCH] 4.9-stable patches added patches: 1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch asoc-cirrus-i2s-fix-lrclk-configuration.patch asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch mips-ftrace-fix-static-function-graph-tracing.patch serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch --- ...because-of-upper-lower-case-mismatch.patch | 35 ++++++ ...c-cirrus-i2s-fix-lrclk-configuration.patch | 80 ++++++++++++++ ...rrus-i2s-fix-tx-rx-linctrldata-setup.patch | 85 ++++++++++++++ ...ol_data-paths-list-before-freeing-it.patch | 38 +++++++ ...pg-mssr-stop-using-printk-format-pcr.patch | 79 +++++++++++++ ...remove-atomic-unsafe-support-for-pcr.patch | 80 ++++++++++++++ ...e-unmapped-by-gap-size-for-__iounmap.patch | 56 ++++++++++ ...ce-fix-static-function-graph-tracing.patch | 80 ++++++++++++++ ...qsave-instead-of-open-coding-version.patch | 104 ++++++++++++++++++ queue-4.9/series | 11 ++ ...enly-use-sigbus-in-do_unaligned_user.patch | 39 +++++++ ...speed-or-full-speed-device-timed-out.patch | 37 +++++++ 12 files changed, 724 insertions(+) create mode 100644 queue-4.9/1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch create mode 100644 queue-4.9/asoc-cirrus-i2s-fix-lrclk-configuration.patch create mode 100644 queue-4.9/asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch create mode 100644 queue-4.9/asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch create mode 100644 queue-4.9/clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch create mode 100644 queue-4.9/lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch create mode 100644 queue-4.9/m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch create mode 100644 queue-4.9/mips-ftrace-fix-static-function-graph-tracing.patch create mode 100644 queue-4.9/serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch create mode 100644 queue-4.9/signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch create mode 100644 queue-4.9/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch diff --git a/queue-4.9/1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch b/queue-4.9/1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch new file mode 100644 index 00000000000..e2da77f25f7 --- /dev/null +++ b/queue-4.9/1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch @@ -0,0 +1,35 @@ +From 065c09563c872e52813a17218c52cd642be1dca6 Mon Sep 17 00:00:00 2001 +From: Ingo Flaschberger +Date: Tue, 1 May 2018 16:10:33 +0200 +Subject: 1wire: family module autoload fails because of upper/lower case mismatch. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ingo Flaschberger + +commit 065c09563c872e52813a17218c52cd642be1dca6 upstream. + +1wire family module autoload fails because of upper/lower +  case mismatch. + +Signed-off-by: Ingo Flaschberger +Acked-by: Evgeniy Polyakov +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/w1/w1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/w1/w1.c ++++ b/drivers/w1/w1.c +@@ -741,7 +741,7 @@ int w1_attach_slave_device(struct w1_mas + + /* slave modules need to be loaded in a context with unlocked mutex */ + mutex_unlock(&dev->mutex); +- request_module("w1-family-0x%02x", rn->family); ++ request_module("w1-family-0x%02X", rn->family); + mutex_lock(&dev->mutex); + + spin_lock(&w1_flock); diff --git a/queue-4.9/asoc-cirrus-i2s-fix-lrclk-configuration.patch b/queue-4.9/asoc-cirrus-i2s-fix-lrclk-configuration.patch new file mode 100644 index 00000000000..37236559132 --- /dev/null +++ b/queue-4.9/asoc-cirrus-i2s-fix-lrclk-configuration.patch @@ -0,0 +1,80 @@ +From 2d534113be9a2aa532a1ae127a57e83558aed358 Mon Sep 17 00:00:00 2001 +From: Alexander Sverdlin +Date: Sat, 28 Apr 2018 22:51:38 +0200 +Subject: ASoC: cirrus: i2s: Fix LRCLK configuration + +From: Alexander Sverdlin + +commit 2d534113be9a2aa532a1ae127a57e83558aed358 upstream. + +The bit responsible for LRCLK polarity is i2s_tlrs (0), not i2s_trel (2) +(refer to "EP93xx User's Guide"). + +Previously card drivers which specified SND_SOC_DAIFMT_NB_IF actually got +SND_SOC_DAIFMT_NB_NF, an adaptation is necessary to retain the old +behavior. + +Signed-off-by: Alexander Sverdlin +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/cirrus/edb93xx.c | 2 +- + sound/soc/cirrus/ep93xx-i2s.c | 8 ++++---- + sound/soc/cirrus/snappercl15.c | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +--- a/sound/soc/cirrus/edb93xx.c ++++ b/sound/soc/cirrus/edb93xx.c +@@ -67,7 +67,7 @@ static struct snd_soc_dai_link edb93xx_d + .cpu_dai_name = "ep93xx-i2s", + .codec_name = "spi0.0", + .codec_dai_name = "cs4271-hifi", +- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, + .ops = &edb93xx_ops, + }; +--- a/sound/soc/cirrus/ep93xx-i2s.c ++++ b/sound/soc/cirrus/ep93xx-i2s.c +@@ -213,24 +213,24 @@ static int ep93xx_i2s_set_dai_fmt(struct + switch (fmt & SND_SOC_DAIFMT_INV_MASK) { + case SND_SOC_DAIFMT_NB_NF: + /* Negative bit clock, lrclk low on left word */ +- clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_REL); ++ clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_LRS); + break; + + case SND_SOC_DAIFMT_NB_IF: + /* Negative bit clock, lrclk low on right word */ + clk_cfg &= ~EP93XX_I2S_CLKCFG_CKP; +- clk_cfg |= EP93XX_I2S_CLKCFG_REL; ++ clk_cfg |= EP93XX_I2S_CLKCFG_LRS; + break; + + case SND_SOC_DAIFMT_IB_NF: + /* Positive bit clock, lrclk low on left word */ + clk_cfg |= EP93XX_I2S_CLKCFG_CKP; +- clk_cfg &= ~EP93XX_I2S_CLKCFG_REL; ++ clk_cfg &= ~EP93XX_I2S_CLKCFG_LRS; + break; + + case SND_SOC_DAIFMT_IB_IF: + /* Positive bit clock, lrclk low on right word */ +- clk_cfg |= EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_REL; ++ clk_cfg |= EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_LRS; + break; + } + +--- a/sound/soc/cirrus/snappercl15.c ++++ b/sound/soc/cirrus/snappercl15.c +@@ -72,7 +72,7 @@ static struct snd_soc_dai_link snappercl + .codec_dai_name = "tlv320aic23-hifi", + .codec_name = "tlv320aic23-codec.0-001a", + .platform_name = "ep93xx-i2s", +- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, + .ops = &snappercl15_ops, + }; diff --git a/queue-4.9/asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch b/queue-4.9/asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch new file mode 100644 index 00000000000..26de25e7ce8 --- /dev/null +++ b/queue-4.9/asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch @@ -0,0 +1,85 @@ +From 5d302ed3cc80564fb835bed5fdba1e1250ecc9e5 Mon Sep 17 00:00:00 2001 +From: Alexander Sverdlin +Date: Sat, 28 Apr 2018 22:51:39 +0200 +Subject: ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alexander Sverdlin + +commit 5d302ed3cc80564fb835bed5fdba1e1250ecc9e5 upstream. + +According to "EP93xx User’s Guide", I2STXLinCtrlData and I2SRXLinCtrlData +registers actually have different format. The only currently used bit +(Left_Right_Justify) has different position. Fix this and simplify the +whole setup taking into account the fact that both registers have zero +default value. + +The practical effect of the above is repaired SND_SOC_DAIFMT_RIGHT_J +support (currently unused). + +Signed-off-by: Alexander Sverdlin +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/cirrus/ep93xx-i2s.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +--- a/sound/soc/cirrus/ep93xx-i2s.c ++++ b/sound/soc/cirrus/ep93xx-i2s.c +@@ -51,7 +51,9 @@ + #define EP93XX_I2S_WRDLEN_24 (1 << 0) + #define EP93XX_I2S_WRDLEN_32 (2 << 0) + +-#define EP93XX_I2S_LINCTRLDATA_R_JUST (1 << 2) /* Right justify */ ++#define EP93XX_I2S_RXLINCTRLDATA_R_JUST BIT(1) /* Right justify */ ++ ++#define EP93XX_I2S_TXLINCTRLDATA_R_JUST BIT(2) /* Right justify */ + + #define EP93XX_I2S_CLKCFG_LRS (1 << 0) /* lrclk polarity */ + #define EP93XX_I2S_CLKCFG_CKP (1 << 1) /* Bit clock polarity */ +@@ -170,25 +172,25 @@ static int ep93xx_i2s_set_dai_fmt(struct + unsigned int fmt) + { + struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(cpu_dai); +- unsigned int clk_cfg, lin_ctrl; ++ unsigned int clk_cfg; ++ unsigned int txlin_ctrl = 0; ++ unsigned int rxlin_ctrl = 0; + + clk_cfg = ep93xx_i2s_read_reg(info, EP93XX_I2S_RXCLKCFG); +- lin_ctrl = ep93xx_i2s_read_reg(info, EP93XX_I2S_RXLINCTRLDATA); + + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { + case SND_SOC_DAIFMT_I2S: + clk_cfg |= EP93XX_I2S_CLKCFG_REL; +- lin_ctrl &= ~EP93XX_I2S_LINCTRLDATA_R_JUST; + break; + + case SND_SOC_DAIFMT_LEFT_J: + clk_cfg &= ~EP93XX_I2S_CLKCFG_REL; +- lin_ctrl &= ~EP93XX_I2S_LINCTRLDATA_R_JUST; + break; + + case SND_SOC_DAIFMT_RIGHT_J: + clk_cfg &= ~EP93XX_I2S_CLKCFG_REL; +- lin_ctrl |= EP93XX_I2S_LINCTRLDATA_R_JUST; ++ rxlin_ctrl |= EP93XX_I2S_RXLINCTRLDATA_R_JUST; ++ txlin_ctrl |= EP93XX_I2S_TXLINCTRLDATA_R_JUST; + break; + + default: +@@ -237,8 +239,8 @@ static int ep93xx_i2s_set_dai_fmt(struct + /* Write new register values */ + ep93xx_i2s_write_reg(info, EP93XX_I2S_RXCLKCFG, clk_cfg); + ep93xx_i2s_write_reg(info, EP93XX_I2S_TXCLKCFG, clk_cfg); +- ep93xx_i2s_write_reg(info, EP93XX_I2S_RXLINCTRLDATA, lin_ctrl); +- ep93xx_i2s_write_reg(info, EP93XX_I2S_TXLINCTRLDATA, lin_ctrl); ++ ep93xx_i2s_write_reg(info, EP93XX_I2S_RXLINCTRLDATA, rxlin_ctrl); ++ ep93xx_i2s_write_reg(info, EP93XX_I2S_TXLINCTRLDATA, txlin_ctrl); + return 0; + } + diff --git a/queue-4.9/asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch b/queue-4.9/asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch new file mode 100644 index 00000000000..8a789f7d175 --- /dev/null +++ b/queue-4.9/asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch @@ -0,0 +1,38 @@ +From ff2faf1289c1f81b5b26b9451dd1c2006aac8db8 Mon Sep 17 00:00:00 2001 +From: Srinivas Kandagatla +Date: Mon, 4 Jun 2018 12:13:26 +0100 +Subject: ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it + +From: Srinivas Kandagatla + +commit ff2faf1289c1f81b5b26b9451dd1c2006aac8db8 upstream. + +dapm_kcontrol_data is freed as part of dapm_kcontrol_free(), leaving the +paths pointer dangling in the list. + +This leads to system crash when we try to unload and reload sound card. +I hit this bug during ADSP crash/reboot test case on Dragon board DB410c. + +Without this patch, on SLAB Poisoning enabled build, kernel crashes with +"BUG kmalloc-128 (Tainted: G W ): Poison overwritten" + +Signed-off-by: Srinivas Kandagatla +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/soc-dapm.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/soc/soc-dapm.c ++++ b/sound/soc/soc-dapm.c +@@ -425,6 +425,8 @@ err_data: + static void dapm_kcontrol_free(struct snd_kcontrol *kctl) + { + struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl); ++ ++ list_del(&data->paths); + kfree(data->wlist); + kfree(data); + } diff --git a/queue-4.9/clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch b/queue-4.9/clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch new file mode 100644 index 00000000000..02cf6b8af94 --- /dev/null +++ b/queue-4.9/clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch @@ -0,0 +1,79 @@ +From ef4b0be62641d296cf4c0ad8f75ab83ab066ed51 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Fri, 1 Jun 2018 11:28:19 +0200 +Subject: clk: renesas: cpg-mssr: Stop using printk format %pCr + +From: Geert Uytterhoeven + +commit ef4b0be62641d296cf4c0ad8f75ab83ab066ed51 upstream. + +Printk format "%pCr" will be removed soon, as clk_get_rate() must not be +called in atomic context. + +Replace it by open-coding the operation. This is safe here, as the code +runs in task context. + +Link: http://lkml.kernel.org/r/1527845302-12159-2-git-send-email-geert+renesas@glider.be +To: Jia-Ju Bai +To: Jonathan Corbet +To: Michael Turquette +To: Stephen Boyd +To: Zhang Rui +To: Eduardo Valentin +To: Eric Anholt +To: Stefan Wahren +To: Greg Kroah-Hartman +Cc: Sergey Senozhatsky +Cc: Petr Mladek +Cc: Linus Torvalds +Cc: Steven Rostedt +Cc: linux-doc@vger.kernel.org +Cc: linux-clk@vger.kernel.org +Cc: linux-pm@vger.kernel.org +Cc: linux-serial@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-renesas-soc@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: Geert Uytterhoeven +Cc: stable@vger.kernel.org # 4.5+ +Signed-off-by: Geert Uytterhoeven +Acked-by: Stephen Boyd +Signed-off-by: Petr Mladek +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/renesas/renesas-cpg-mssr.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/clk/renesas/renesas-cpg-mssr.c ++++ b/drivers/clk/renesas/renesas-cpg-mssr.c +@@ -243,8 +243,9 @@ struct clk *cpg_mssr_clk_src_twocell_get + dev_err(dev, "Cannot get %s clock %u: %ld", type, clkidx, + PTR_ERR(clk)); + else +- dev_dbg(dev, "clock (%u, %u) is %pC at %pCr Hz\n", +- clkspec->args[0], clkspec->args[1], clk, clk); ++ dev_dbg(dev, "clock (%u, %u) is %pC at %lu Hz\n", ++ clkspec->args[0], clkspec->args[1], clk, ++ clk_get_rate(clk)); + return clk; + } + +@@ -304,7 +305,7 @@ static void __init cpg_mssr_register_cor + if (IS_ERR_OR_NULL(clk)) + goto fail; + +- dev_dbg(dev, "Core clock %pC at %pCr Hz\n", clk, clk); ++ dev_dbg(dev, "Core clock %pC at %lu Hz\n", clk, clk_get_rate(clk)); + priv->clks[id] = clk; + return; + +@@ -372,7 +373,7 @@ static void __init cpg_mssr_register_mod + if (IS_ERR(clk)) + goto fail; + +- dev_dbg(dev, "Module clock %pC at %pCr Hz\n", clk, clk); ++ dev_dbg(dev, "Module clock %pC at %lu Hz\n", clk, clk_get_rate(clk)); + priv->clks[id] = clk; + return; + diff --git a/queue-4.9/lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch b/queue-4.9/lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch new file mode 100644 index 00000000000..b24e7281482 --- /dev/null +++ b/queue-4.9/lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch @@ -0,0 +1,80 @@ +From 666902e42fd8344b923c02dc5b0f37948ff4f225 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Fri, 1 Jun 2018 11:28:22 +0200 +Subject: lib/vsprintf: Remove atomic-unsafe support for %pCr + +From: Geert Uytterhoeven + +commit 666902e42fd8344b923c02dc5b0f37948ff4f225 upstream. + +"%pCr" formats the current rate of a clock, and calls clk_get_rate(). +The latter obtains a mutex, hence it must not be called from atomic +context. + +Remove support for this rarely-used format, as vsprintf() (and e.g. +printk()) must be callable from any context. + +Any remaining out-of-tree users will start seeing the clock's name +printed instead of its rate. + +Reported-by: Jia-Ju Bai +Fixes: 900cca2944254edd ("lib/vsprintf: add %pC{,n,r} format specifiers for clocks") +Link: http://lkml.kernel.org/r/1527845302-12159-5-git-send-email-geert+renesas@glider.be +To: Jia-Ju Bai +To: Jonathan Corbet +To: Michael Turquette +To: Stephen Boyd +To: Zhang Rui +To: Eduardo Valentin +To: Eric Anholt +To: Stefan Wahren +To: Greg Kroah-Hartman +Cc: Sergey Senozhatsky +Cc: Petr Mladek +Cc: Linus Torvalds +Cc: Steven Rostedt +Cc: linux-doc@vger.kernel.org +Cc: linux-clk@vger.kernel.org +Cc: linux-pm@vger.kernel.org +Cc: linux-serial@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-renesas-soc@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: Geert Uytterhoeven +Cc: stable@vger.kernel.org # 4.1+ +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Petr Mladek +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/printk-formats.txt | 3 +-- + lib/vsprintf.c | 3 --- + 2 files changed, 1 insertion(+), 5 deletions(-) + +--- a/Documentation/printk-formats.txt ++++ b/Documentation/printk-formats.txt +@@ -279,11 +279,10 @@ struct clk: + + %pC pll1 + %pCn pll1 +- %pCr 1560000000 + + For printing struct clk structures. '%pC' and '%pCn' print the name + (Common Clock Framework) or address (legacy clock framework) of the +- structure; '%pCr' prints the current clock rate. ++ structure. + + Passed by reference. + +--- a/lib/vsprintf.c ++++ b/lib/vsprintf.c +@@ -1391,9 +1391,6 @@ char *clock(char *buf, char *end, struct + return string(buf, end, NULL, spec); + + switch (fmt[1]) { +- case 'r': +- return number(buf, end, clk_get_rate(clk), spec); +- + case 'n': + default: + #ifdef CONFIG_COMMON_CLK diff --git a/queue-4.9/m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch b/queue-4.9/m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch new file mode 100644 index 00000000000..7a28e81b1f2 --- /dev/null +++ b/queue-4.9/m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch @@ -0,0 +1,56 @@ +From 3f90f9ef2dda316d64e420d5d51ba369587ccc55 Mon Sep 17 00:00:00 2001 +From: Michael Schmitz +Date: Mon, 14 May 2018 23:10:53 +1200 +Subject: m68k/mm: Adjust VM area to be unmapped by gap size for __iounmap() + +From: Michael Schmitz + +commit 3f90f9ef2dda316d64e420d5d51ba369587ccc55 upstream. + +If 020/030 support is enabled, get_io_area() leaves an IO_SIZE gap +between mappings which is added to the vm_struct representing the +mapping. __ioremap() uses the actual requested size (after alignment), +while __iounmap() is passed the size from the vm_struct. + +On 020/030, early termination descriptors are used to set up mappings of +extent 'size', which are validated on unmapping. The unmapped gap of +size IO_SIZE defeats the sanity check of the pmd tables, causing +__iounmap() to loop forever on 030. + +On 040/060, unmapping of page table entries does not check for a valid +mapping, so the umapping loop always completes there. + +Adjust size to be unmapped by the gap that had been added in the +vm_struct prior. + +This fixes the hang in atari_platform_init() reported a long time ago, +and a similar one reported by Finn recently (addressed by removing +ioremap() use from the SWIM driver. + +Tested on my Falcon in 030 mode - untested but should work the same on +040/060 (the extra page tables cleared there would never have been set +up anyway). + +Signed-off-by: Michael Schmitz +[geert: Minor commit description improvements] +[geert: This was fixed in 2.4.23, but not in 2.5.x] +Signed-off-by: Geert Uytterhoeven +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + arch/m68k/mm/kmap.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/m68k/mm/kmap.c ++++ b/arch/m68k/mm/kmap.c +@@ -88,7 +88,8 @@ static inline void free_io_area(void *ad + for (p = &iolist ; (tmp = *p) ; p = &tmp->next) { + if (tmp->addr == addr) { + *p = tmp->next; +- __iounmap(tmp->addr, tmp->size); ++ /* remove gap added in get_io_area() */ ++ __iounmap(tmp->addr, tmp->size - IO_SIZE); + kfree(tmp); + return; + } diff --git a/queue-4.9/mips-ftrace-fix-static-function-graph-tracing.patch b/queue-4.9/mips-ftrace-fix-static-function-graph-tracing.patch new file mode 100644 index 00000000000..67b00934294 --- /dev/null +++ b/queue-4.9/mips-ftrace-fix-static-function-graph-tracing.patch @@ -0,0 +1,80 @@ +From 6fb8656646f996d1eef42e6d56203c4915cb9e08 Mon Sep 17 00:00:00 2001 +From: Matthias Schiffer +Date: Sat, 24 Mar 2018 17:57:49 +0100 +Subject: mips: ftrace: fix static function graph tracing + +From: Matthias Schiffer + +commit 6fb8656646f996d1eef42e6d56203c4915cb9e08 upstream. + +ftrace_graph_caller was never run after calling ftrace_trace_function, +breaking the function graph tracer. Fix this, bringing it in line with the +x86 implementation. + +While we're at it, also streamline the control flow of _mcount a bit to +reduce the number of branches. + +This issue was reported before: +https://www.linux-mips.org/archives/linux-mips/2014-11/msg00295.html + +Signed-off-by: Matthias Schiffer +Tested-by: Matt Redfearn +Patchwork: https://patchwork.linux-mips.org/patch/18929/ +Signed-off-by: Paul Burton +Cc: stable@vger.kernel.org # v3.17+ +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/kernel/mcount.S | 27 ++++++++++++--------------- + 1 file changed, 12 insertions(+), 15 deletions(-) + +--- a/arch/mips/kernel/mcount.S ++++ b/arch/mips/kernel/mcount.S +@@ -116,10 +116,20 @@ ftrace_stub: + NESTED(_mcount, PT_SIZE, ra) + PTR_LA t1, ftrace_stub + PTR_L t2, ftrace_trace_function /* Prepare t2 for (1) */ +- bne t1, t2, static_trace ++ beq t1, t2, fgraph_trace + nop + ++ MCOUNT_SAVE_REGS ++ ++ move a0, ra /* arg1: self return address */ ++ jalr t2 /* (1) call *ftrace_trace_function */ ++ move a1, AT /* arg2: parent's return address */ ++ ++ MCOUNT_RESTORE_REGS ++ ++fgraph_trace: + #ifdef CONFIG_FUNCTION_GRAPH_TRACER ++ PTR_LA t1, ftrace_stub + PTR_L t3, ftrace_graph_return + bne t1, t3, ftrace_graph_caller + nop +@@ -128,24 +138,11 @@ NESTED(_mcount, PT_SIZE, ra) + bne t1, t3, ftrace_graph_caller + nop + #endif +- b ftrace_stub +-#ifdef CONFIG_32BIT +- addiu sp, sp, 8 +-#else +- nop +-#endif +- +-static_trace: +- MCOUNT_SAVE_REGS +- +- move a0, ra /* arg1: self return address */ +- jalr t2 /* (1) call *ftrace_trace_function */ +- move a1, AT /* arg2: parent's return address */ + +- MCOUNT_RESTORE_REGS + #ifdef CONFIG_32BIT + addiu sp, sp, 8 + #endif ++ + .globl ftrace_stub + ftrace_stub: + RETURN_BACK diff --git a/queue-4.9/serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch b/queue-4.9/serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch new file mode 100644 index 00000000000..1500a6ffae4 --- /dev/null +++ b/queue-4.9/serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch @@ -0,0 +1,104 @@ +From 8afb1d2c12163f77777f84616a8e9444d0050ebe Mon Sep 17 00:00:00 2001 +From: Daniel Wagner +Date: Tue, 8 May 2018 10:55:09 +0200 +Subject: serial: sh-sci: Use spin_{try}lock_irqsave instead of open coding version + +From: Daniel Wagner + +commit 8afb1d2c12163f77777f84616a8e9444d0050ebe upstream. + +Commit 40f70c03e33a ("serial: sh-sci: add locking to console write +function to avoid SMP lockup") copied the strategy to avoid locking +problems in conjuncture with the console from the UART8250 +driver. Instead using directly spin_{try}lock_irqsave(), +local_irq_save() followed by spin_{try}lock() was used. While this is +correct on mainline, for -rt it is a problem. spin_{try}lock() will +check if it is running in a valid context. Since the local_irq_save() +has already been executed, the context has changed and +spin_{try}lock() will complain. The reason why spin_{try}lock() +complains is that on -rt the spin locks are turned into mutexes and +therefore can sleep. Sleeping with interrupts disabled is not valid. + +BUG: sleeping function called from invalid context at /home/wagi/work/rt/v4.4-cip-rt/kernel/locking/rtmutex.c:995 +in_atomic(): 0, irqs_disabled(): 128, pid: 778, name: irq/76-eth0 +CPU: 0 PID: 778 Comm: irq/76-eth0 Not tainted 4.4.126-test-cip22-rt14-00403-gcd03665c8318 #12 +Hardware name: Generic RZ/G1 (Flattened Device Tree) +Backtrace: +[] (dump_backtrace) from [] (show_stack+0x18/0x1c) + r7:c06b01f0 r6:60010193 r5:00000000 r4:c06b01f0 +[] (show_stack) from [] (dump_stack+0x78/0x94) +[] (dump_stack) from [] (___might_sleep+0x134/0x194) + r7:60010113 r6:c06d3559 r5:00000000 r4:ffffe000 +[] (___might_sleep) from [] (rt_spin_lock+0x20/0x74) + r5:c06f4d60 r4:c06f4d60 +[] (rt_spin_lock) from [] (serial_console_write+0x100/0x118) + r5:c06f4d60 r4:c06f4d60 +[] (serial_console_write) from [] (call_console_drivers.constprop.15+0x10c/0x124) + r10:c06d2894 r9:c04e18b0 r8:00000028 r7:00000000 r6:c06d3559 r5:c06d2798 + r4:c06b9914 r3:c02576e4 +[] (call_console_drivers.constprop.15) from [] (console_unlock+0x32c/0x430) + r10:c06d30d8 r9:00000028 r8:c06dd518 r7:00000005 r6:00000000 r5:c06d2798 + r4:c06d2798 r3:00000028 +[] (console_unlock) from [] (vprintk_emit+0x394/0x4f0) + r10:c06d2798 r9:c06d30ee r8:00000006 r7:00000005 r6:c06a78fc r5:00000027 + r4:00000003 +[] (vprintk_emit) from [] (vprintk+0x28/0x30) + r10:c060bd46 r9:00001000 r8:c06b9a90 r7:c06b9a90 r6:c06b994c r5:c06b9a3c + r4:c0062fa8 +[] (vprintk) from [] (vprintk_default+0x10/0x14) +[] (vprintk_default) from [] (printk+0x78/0x84) +[] (printk) from [] (credit_entropy_bits+0x17c/0x2cc) + r3:00000001 r2:decade60 r1:c061a5ee r0:c061a523 + r4:00000006 +[] (credit_entropy_bits) from [] (add_interrupt_randomness+0x160/0x178) + r10:466e7196 r9:1f536000 r8:fffeef74 r7:00000000 r6:c06b9a60 r5:c06b9a3c + r4:dfbcf680 +[] (add_interrupt_randomness) from [] (irq_thread+0x1e8/0x248) + r10:c006537c r9:c06cdf21 r8:c0064fcc r7:df791c24 r6:df791c00 r5:ffffe000 + r4:df525180 +[] (irq_thread) from [] (kthread+0x108/0x11c) + r10:00000000 r9:00000000 r8:c0065184 r7:df791c00 r6:00000000 r5:df791d00 + r4:decac000 +[] (kthread) from [] (ret_from_fork+0x14/0x3c) + r8:00000000 r7:00000000 r6:00000000 r5:c003fa9c r4:df791d00 + +Cc: Sebastian Andrzej Siewior +Signed-off-by: Daniel Wagner +Reviewed-by: Geert Uytterhoeven +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/sh-sci.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/tty/serial/sh-sci.c ++++ b/drivers/tty/serial/sh-sci.c +@@ -2807,16 +2807,15 @@ static void serial_console_write(struct + unsigned long flags; + int locked = 1; + +- local_irq_save(flags); + #if defined(SUPPORT_SYSRQ) + if (port->sysrq) + locked = 0; + else + #endif + if (oops_in_progress) +- locked = spin_trylock(&port->lock); ++ locked = spin_trylock_irqsave(&port->lock, flags); + else +- spin_lock(&port->lock); ++ spin_lock_irqsave(&port->lock, flags); + + /* first save SCSCR then disable interrupts, keep clock source */ + ctrl = serial_port_in(port, SCSCR); +@@ -2835,8 +2834,7 @@ static void serial_console_write(struct + serial_port_out(port, SCSCR, ctrl); + + if (locked) +- spin_unlock(&port->lock); +- local_irq_restore(flags); ++ spin_unlock_irqrestore(&port->lock, flags); + } + + static int serial_console_setup(struct console *co, char *options) diff --git a/queue-4.9/series b/queue-4.9/series index 83a11971c3e..d78ff15d74d 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -4,3 +4,14 @@ x86-mce-check-for-alternate-indication-of-machine-check-recovery-on-skylake.patc x86-mce-fix-incorrect-machine-check-from-unknown-source-message.patch x86-mce-do-not-overwrite-mci_status-in-mce_no_way_out.patch x86-call-fixup_exception-before-notify_die-in-math_error.patch +m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch +serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch +signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch +usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch +1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch +asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch +asoc-cirrus-i2s-fix-lrclk-configuration.patch +asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch +clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch +lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch +mips-ftrace-fix-static-function-graph-tracing.patch diff --git a/queue-4.9/signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch b/queue-4.9/signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch new file mode 100644 index 00000000000..facd3892403 --- /dev/null +++ b/queue-4.9/signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch @@ -0,0 +1,39 @@ +From 7de712ccc096b81d23cc0a941cd9b8cb3956605d Mon Sep 17 00:00:00 2001 +From: "Eric W. Biederman" +Date: Fri, 20 Apr 2018 09:14:56 -0500 +Subject: signal/xtensa: Consistenly use SIGBUS in do_unaligned_user + +From: Eric W. Biederman + +commit 7de712ccc096b81d23cc0a941cd9b8cb3956605d upstream. + +While working on changing this code to use force_sig_fault I +discovered that do_unaliged_user is sets si_signo to SIGBUS and passes +SIGSEGV to force_sig_info. Which is just b0rked. + +The code is reporting a SIGBUS error so replace the SIGSEGV with SIGBUS. + +Cc: Chris Zankel +Cc: Max Filippov +Cc: linux-xtensa@linux-xtensa.org +Cc: stable@vger.kernel.org +Acked-by: Max Filippov +Fixes: 5a0015d62668 ("[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 3") +Signed-off-by: "Eric W. Biederman" +Signed-off-by: Greg Kroah-Hartman + +--- + arch/xtensa/kernel/traps.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/xtensa/kernel/traps.c ++++ b/arch/xtensa/kernel/traps.c +@@ -334,7 +334,7 @@ do_unaligned_user (struct pt_regs *regs) + info.si_errno = 0; + info.si_code = BUS_ADRALN; + info.si_addr = (void *) regs->excvaddr; +- force_sig_info(SIGSEGV, &info, current); ++ force_sig_info(SIGBUS, &info, current); + + } + #endif diff --git a/queue-4.9/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch b/queue-4.9/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch new file mode 100644 index 00000000000..b9e67db3fc2 --- /dev/null +++ b/queue-4.9/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch @@ -0,0 +1,37 @@ +From 6e01827ed93947895680fbdad68c072a0f4e2450 Mon Sep 17 00:00:00 2001 +From: Maxim Moseychuk +Date: Thu, 4 Jan 2018 21:43:03 +0300 +Subject: usb: do not reset if a low-speed or full-speed device timed out + +From: Maxim Moseychuk + +commit 6e01827ed93947895680fbdad68c072a0f4e2450 upstream. + +Some low-speed and full-speed devices (for example, bluetooth) +do not have time to initialize. For them, ETIMEDOUT is a valid error. +We need to give them another try. Otherwise, they will +never be initialized correctly and in dmesg will be messages +"Bluetooth: hci0 command 0x1002 tx timeout" or similars. + +Fixes: 264904ccc33c ("usb: retry reset if a device times out") +Cc: stable +Signed-off-by: Maxim Moseychuk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hub.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4509,7 +4509,9 @@ hub_port_init(struct usb_hub *hub, struc + * reset. But only on the first attempt, + * lest we get into a time out/reset loop + */ +- if (r == 0 || (r == -ETIMEDOUT && retries == 0)) ++ if (r == 0 || (r == -ETIMEDOUT && ++ retries == 0 && ++ udev->speed > USB_SPEED_FULL)) + break; + } + udev->descriptor.bMaxPacketSize0 = -- 2.47.3