From 1e7fb2710eea21722cbd32cb6048b87c0d93769e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 1 Jul 2018 11:00:59 +0200 Subject: [PATCH] 4.14-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-cs35l35-add-use_single_rw-to-regmap-config.patch asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch ftrace-selftest-have-the-reset_trigger-code-be-a-bit-more-careful.patch lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch m68k-mac-fix-swim-memory-resource-end-address.patch m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch mips-ftrace-fix-static-function-graph-tracing.patch pm-core-fix-supplier-device-runtime-pm-usage-counter-imbalance.patch pm-domains-fix-error-path-during-attach-in-genpd.patch pm-opp-update-voltage-in-case-freq-old_freq.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 thermal-bcm2835-stop-using-printk-format-pcr.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 ++++++++++++++ ...5-add-use_single_rw-to-regmap-config.patch | 31 ++++++ ...ol_data-paths-list-before-freeing-it.patch | 38 +++++++ ...pg-mssr-stop-using-printk-format-pcr.patch | 79 +++++++++++++ ...t_trigger-code-be-a-bit-more-careful.patch | 66 +++++++++++ ...remove-atomic-unsafe-support-for-pcr.patch | 80 ++++++++++++++ ...fix-swim-memory-resource-end-address.patch | 35 ++++++ ...e-unmapped-by-gap-size-for-__iounmap.patch | 56 ++++++++++ ...ce-fix-static-function-graph-tracing.patch | 80 ++++++++++++++ ...e-runtime-pm-usage-counter-imbalance.patch | 72 ++++++++++++ ...ix-error-path-during-attach-in-genpd.patch | 45 ++++++++ ...update-voltage-in-case-freq-old_freq.patch | 71 ++++++++++++ ...qsave-instead-of-open-coding-version.patch | 104 ++++++++++++++++++ queue-4.14/series | 18 +++ ...enly-use-sigbus-in-do_unaligned_user.patch | 39 +++++++ ...bcm2835-stop-using-printk-format-pcr.patch | 60 ++++++++++ ...speed-or-full-speed-device-timed-out.patch | 37 +++++++ 19 files changed, 1111 insertions(+) create mode 100644 queue-4.14/1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch create mode 100644 queue-4.14/asoc-cirrus-i2s-fix-lrclk-configuration.patch create mode 100644 queue-4.14/asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch create mode 100644 queue-4.14/asoc-cs35l35-add-use_single_rw-to-regmap-config.patch create mode 100644 queue-4.14/asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch create mode 100644 queue-4.14/clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch create mode 100644 queue-4.14/ftrace-selftest-have-the-reset_trigger-code-be-a-bit-more-careful.patch create mode 100644 queue-4.14/lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch create mode 100644 queue-4.14/m68k-mac-fix-swim-memory-resource-end-address.patch create mode 100644 queue-4.14/m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch create mode 100644 queue-4.14/mips-ftrace-fix-static-function-graph-tracing.patch create mode 100644 queue-4.14/pm-core-fix-supplier-device-runtime-pm-usage-counter-imbalance.patch create mode 100644 queue-4.14/pm-domains-fix-error-path-during-attach-in-genpd.patch create mode 100644 queue-4.14/pm-opp-update-voltage-in-case-freq-old_freq.patch create mode 100644 queue-4.14/serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch create mode 100644 queue-4.14/signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch create mode 100644 queue-4.14/thermal-bcm2835-stop-using-printk-format-pcr.patch create mode 100644 queue-4.14/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch diff --git a/queue-4.14/1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch b/queue-4.14/1wire-family-module-autoload-fails-because-of-upper-lower-case-mismatch.patch new file mode 100644 index 00000000000..2bcf3087b6e --- /dev/null +++ b/queue-4.14/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 +@@ -750,7 +750,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.14/asoc-cirrus-i2s-fix-lrclk-configuration.patch b/queue-4.14/asoc-cirrus-i2s-fix-lrclk-configuration.patch new file mode 100644 index 00000000000..37236559132 --- /dev/null +++ b/queue-4.14/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.14/asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch b/queue-4.14/asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch new file mode 100644 index 00000000000..26de25e7ce8 --- /dev/null +++ b/queue-4.14/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.14/asoc-cs35l35-add-use_single_rw-to-regmap-config.patch b/queue-4.14/asoc-cs35l35-add-use_single_rw-to-regmap-config.patch new file mode 100644 index 00000000000..137a007e01d --- /dev/null +++ b/queue-4.14/asoc-cs35l35-add-use_single_rw-to-regmap-config.patch @@ -0,0 +1,31 @@ +From 6a6ad7face95af0b9e6aaf1eb2261eb70240b89b Mon Sep 17 00:00:00 2001 +From: Paul Handrigan +Date: Fri, 4 May 2018 16:37:41 -0500 +Subject: ASoC: cs35l35: Add use_single_rw to regmap config + +From: Paul Handrigan + +commit 6a6ad7face95af0b9e6aaf1eb2261eb70240b89b upstream. + +Add the use_single_rw flag to regmap config since the +device does not support bulk transactions over i2c. + +Signed-off-by: Paul Handrigan +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/cs35l35.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/soc/codecs/cs35l35.c ++++ b/sound/soc/codecs/cs35l35.c +@@ -1106,6 +1106,7 @@ static struct regmap_config cs35l35_regm + .readable_reg = cs35l35_readable_register, + .precious_reg = cs35l35_precious_register, + .cache_type = REGCACHE_RBTREE, ++ .use_single_rw = true, + }; + + static irqreturn_t cs35l35_irq(int irq, void *data) diff --git a/queue-4.14/asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch b/queue-4.14/asoc-dapm-delete-dapm_kcontrol_data-paths-list-before-freeing-it.patch new file mode 100644 index 00000000000..e3f0e15d8ac --- /dev/null +++ b/queue-4.14/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 +@@ -430,6 +430,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.14/clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch b/queue-4.14/clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch new file mode 100644 index 00000000000..c3352e6ebe7 --- /dev/null +++ b/queue-4.14/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 +@@ -248,8 +248,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; + } + +@@ -314,7 +315,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; + +@@ -380,7 +381,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.14/ftrace-selftest-have-the-reset_trigger-code-be-a-bit-more-careful.patch b/queue-4.14/ftrace-selftest-have-the-reset_trigger-code-be-a-bit-more-careful.patch new file mode 100644 index 00000000000..26061308a62 --- /dev/null +++ b/queue-4.14/ftrace-selftest-have-the-reset_trigger-code-be-a-bit-more-careful.patch @@ -0,0 +1,66 @@ +From 756b56a9e832e063edc83be7c3889e98c536dd2b Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Mon, 14 May 2018 15:40:29 -0400 +Subject: ftrace/selftest: Have the reset_trigger code be a bit more careful + +From: Steven Rostedt (VMware) + +commit 756b56a9e832e063edc83be7c3889e98c536dd2b upstream. + +The trigger code is picky in how it can be disabled as there may be +dependencies between different events and synthetic events. Change the order +on how triggers are reset. + + 1) Reset triggers of all synthetic events first + 2) Remove triggers with actions attached to them + 3) Remove all other triggers + +If this order isn't followed, then some triggers will not be reset, and an +error may happen because a trigger is busy. + +Cc: stable@vger.kernel.org +Fixes: cfa0963dc474f ("kselftests/ftrace : Add event trigger testcases") +Reviewed-by: Namhyung Kim +Acked-by: Masami Hiramatsu +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + tools/testing/selftests/ftrace/test.d/functions | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +--- a/tools/testing/selftests/ftrace/test.d/functions ++++ b/tools/testing/selftests/ftrace/test.d/functions +@@ -15,14 +15,29 @@ reset_tracer() { # reset the current tra + echo nop > current_tracer + } + +-reset_trigger() { # reset all current setting triggers +- grep -v ^# events/*/*/trigger | ++reset_trigger_file() { ++ # remove action triggers first ++ grep -H ':on[^:]*(' $@ | ++ while read line; do ++ cmd=`echo $line | cut -f2- -d: | cut -f1 -d" "` ++ file=`echo $line | cut -f1 -d:` ++ echo "!$cmd" >> $file ++ done ++ grep -Hv ^# $@ | + while read line; do + cmd=`echo $line | cut -f2- -d: | cut -f1 -d" "` +- echo "!$cmd" > `echo $line | cut -f1 -d:` ++ file=`echo $line | cut -f1 -d:` ++ echo "!$cmd" > $file + done + } + ++reset_trigger() { # reset all current setting triggers ++ if [ -d events/synthetic ]; then ++ reset_trigger_file events/synthetic/*/trigger ++ fi ++ reset_trigger_file events/*/*/trigger ++} ++ + reset_events_filter() { # reset all current setting filters + grep -v ^none events/*/*/filter | + while read line; do diff --git a/queue-4.14/lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch b/queue-4.14/lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch new file mode 100644 index 00000000000..8e4721fef1b --- /dev/null +++ b/queue-4.14/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 +@@ -397,11 +397,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 +@@ -1392,9 +1392,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.14/m68k-mac-fix-swim-memory-resource-end-address.patch b/queue-4.14/m68k-mac-fix-swim-memory-resource-end-address.patch new file mode 100644 index 00000000000..a08e3e627c1 --- /dev/null +++ b/queue-4.14/m68k-mac-fix-swim-memory-resource-end-address.patch @@ -0,0 +1,35 @@ +From 3e2816c1078eb2b5a3276eb83d4da156b3e2d04f Mon Sep 17 00:00:00 2001 +From: Finn Thain +Date: Wed, 11 Apr 2018 20:50:14 -0400 +Subject: m68k/mac: Fix SWIM memory resource end address + +From: Finn Thain + +commit 3e2816c1078eb2b5a3276eb83d4da156b3e2d04f upstream. + +The resource size is 0x2000 == end - start + 1. +Therefore end == start + 0x2000 - 1. + +Cc: Laurent Vivier +Cc: stable@vger.kernel.org # v4.14+ +Tested-by: Stan Johnson +Signed-off-by: Finn Thain +Acked-by: Laurent Vivier +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Greg Kroah-Hartman + +--- + arch/m68k/mac/config.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/m68k/mac/config.c ++++ b/arch/m68k/mac/config.c +@@ -1017,7 +1017,7 @@ int __init mac_platform_init(void) + struct resource swim_rsrc = { + .flags = IORESOURCE_MEM, + .start = (resource_size_t)swim_base, +- .end = (resource_size_t)swim_base + 0x2000, ++ .end = (resource_size_t)swim_base + 0x1FFF, + }; + + platform_device_register_simple("swim", -1, &swim_rsrc, 1); diff --git a/queue-4.14/m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch b/queue-4.14/m68k-mm-adjust-vm-area-to-be-unmapped-by-gap-size-for-__iounmap.patch new file mode 100644 index 00000000000..b1f7a127f0b --- /dev/null +++ b/queue-4.14/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 +@@ -89,7 +89,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.14/mips-ftrace-fix-static-function-graph-tracing.patch b/queue-4.14/mips-ftrace-fix-static-function-graph-tracing.patch new file mode 100644 index 00000000000..e74e90cf513 --- /dev/null +++ b/queue-4.14/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 +@@ -119,10 +119,20 @@ NESTED(_mcount, PT_SIZE, ra) + EXPORT_SYMBOL(_mcount) + 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 +@@ -131,24 +141,11 @@ EXPORT_SYMBOL(_mcount) + 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.14/pm-core-fix-supplier-device-runtime-pm-usage-counter-imbalance.patch b/queue-4.14/pm-core-fix-supplier-device-runtime-pm-usage-counter-imbalance.patch new file mode 100644 index 00000000000..6f580dbb77c --- /dev/null +++ b/queue-4.14/pm-core-fix-supplier-device-runtime-pm-usage-counter-imbalance.patch @@ -0,0 +1,72 @@ +From 47e5abfb546a3ace23a77453dc2e9db92704c5ac Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 14 Jun 2018 10:01:52 +0200 +Subject: PM / core: Fix supplier device runtime PM usage counter imbalance + +From: Rafael J. Wysocki + +commit 47e5abfb546a3ace23a77453dc2e9db92704c5ac upstream. + +If a device link is added via device_link_add() by the driver of the +link's consumer device, the supplier's runtime PM usage counter is +going to be dropped by the pm_runtime_put_suppliers() call in +driver_probe_device(). However, in that case it is not incremented +unless the supplier driver is already present and the link is not +stateless. That leads to a runtime PM usage counter imbalance for +the supplier device in a few cases. + +To prevent that from happening, bump up the supplier runtime +PM usage counter in device_link_add() for all links with the +DL_FLAG_PM_RUNTIME flag set that are added at the consumer probe +time. Use pm_runtime_get_noresume() for that as the callers of +device_link_add() who want the supplier to be resumed by it are +expected to pass DL_FLAG_RPM_ACTIVE in flags to it anyway, but +additionally resume the supplier if the link is added during +consumer driver probe to retain the existing behavior for the +callers depending on it. + +Fixes: 21d5c57b3726 (PM / runtime: Use device links) +Reported-by: Ulf Hansson +Reviewed-by: Ulf Hansson +Tested-by: Marek Szyprowski +Cc: 4.10+ # 4.10+ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/core.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -217,6 +217,13 @@ struct device_link *device_link_add(stru + link->rpm_active = true; + } + pm_runtime_new_link(consumer); ++ /* ++ * If the link is being added by the consumer driver at probe ++ * time, balance the decrementation of the supplier's runtime PM ++ * usage counter after consumer probe in driver_probe_device(). ++ */ ++ if (consumer->links.status == DL_DEV_PROBING) ++ pm_runtime_get_noresume(supplier); + } + get_device(supplier); + link->supplier = supplier; +@@ -235,12 +242,12 @@ struct device_link *device_link_add(stru + switch (consumer->links.status) { + case DL_DEV_PROBING: + /* +- * Balance the decrementation of the supplier's +- * runtime PM usage counter after consumer probe +- * in driver_probe_device(). ++ * Some callers expect the link creation during ++ * consumer driver probe to resume the supplier ++ * even without DL_FLAG_RPM_ACTIVE. + */ + if (flags & DL_FLAG_PM_RUNTIME) +- pm_runtime_get_sync(supplier); ++ pm_runtime_resume(supplier); + + link->status = DL_STATE_CONSUMER_PROBE; + break; diff --git a/queue-4.14/pm-domains-fix-error-path-during-attach-in-genpd.patch b/queue-4.14/pm-domains-fix-error-path-during-attach-in-genpd.patch new file mode 100644 index 00000000000..c43fa4d6c91 --- /dev/null +++ b/queue-4.14/pm-domains-fix-error-path-during-attach-in-genpd.patch @@ -0,0 +1,45 @@ +From 72038df3c580c4c326b83c86149d7ac34007532a Mon Sep 17 00:00:00 2001 +From: Ulf Hansson +Date: Thu, 26 Apr 2018 10:53:00 +0200 +Subject: PM / Domains: Fix error path during attach in genpd + +From: Ulf Hansson + +commit 72038df3c580c4c326b83c86149d7ac34007532a upstream. + +In case the PM domain fails to be powered on in genpd_dev_pm_attach(), it +returns -EPROBE_DEFER, but keeping the device attached to its PM domain. +This leads to problems when the next attempt to attach is re-tried. More +precisely, in that situation an -EEXIST error code is returned, because the +device already has its PM domain pointer assigned, from the first attempt. + +Now, because of the sloppy error handling by the existing callers of +dev_pm_domain_attach(), probing is allowed to continue when -EEXIST is +returned. However, in such case there are no guarantees that the PM domain +is powered on by genpd, which may lead to hangs when buses/drivers tried to +access their devices. + +Let's fix this behaviour, simply by detaching the device when powering on +fails in genpd_dev_pm_attach(). + +Cc: v4.11+ # v4.11+ +Signed-off-by: Ulf Hansson +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/power/domain.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/base/power/domain.c ++++ b/drivers/base/power/domain.c +@@ -2162,6 +2162,9 @@ int genpd_dev_pm_attach(struct device *d + genpd_lock(pd); + ret = genpd_power_on(pd, 0); + genpd_unlock(pd); ++ ++ if (ret) ++ genpd_remove_device(pd, dev); + out: + return ret ? -EPROBE_DEFER : 0; + } diff --git a/queue-4.14/pm-opp-update-voltage-in-case-freq-old_freq.patch b/queue-4.14/pm-opp-update-voltage-in-case-freq-old_freq.patch new file mode 100644 index 00000000000..8d15fa267ca --- /dev/null +++ b/queue-4.14/pm-opp-update-voltage-in-case-freq-old_freq.patch @@ -0,0 +1,71 @@ +From c5c2a97b3ac7d1ec19e7cff9e38caca6afefc3de Mon Sep 17 00:00:00 2001 +From: Waldemar Rymarkiewicz +Date: Thu, 14 Jun 2018 15:56:08 +0200 +Subject: PM / OPP: Update voltage in case freq == old_freq + +From: Waldemar Rymarkiewicz + +commit c5c2a97b3ac7d1ec19e7cff9e38caca6afefc3de upstream. + +This commit fixes a rare but possible case when the clk rate is updated +without update of the regulator voltage. + +At boot up, CPUfreq checks if the system is running at the right freq. This +is a sanity check in case a bootloader set clk rate that is outside of freq +table present with cpufreq core. In such cases system can be unstable so +better to change it to a freq that is preset in freq-table. + +The CPUfreq takes next freq that is >= policy->cur and this is our +target_freq that needs to be set now. + +dev_pm_opp_set_rate(dev, target_freq) checks the target_freq and the +old_freq (a current rate). If these are equal it returns early. If not, +it searches for OPP (old_opp) that fits best to old_freq (not listed in +the table) and updates old_freq (!). + +Here, we can end up with old_freq = old_opp.rate = target_freq, which +is not handled in _generic_set_opp_regulator(). It's supposed to update +voltage only when freq > old_freq || freq > old_freq. + +if (freq > old_freq) { + ret = _set_opp_voltage(dev, reg, new_supply); +[...] +if (freq < old_freq) { + ret = _set_opp_voltage(dev, reg, new_supply); + if (ret) + +It results in, no voltage update while clk rate is updated. + +Example: +freq-table = { + 1000MHz 1.15V + 666MHZ 1.10V + 333MHz 1.05V +} +boot-up-freq = 800MHz # not listed in freq-table +freq = target_freq = 1GHz +old_freq = 800Mhz +old_opp = _find_freq_ceil(opp_table, &old_freq); #(old_freq is modified!) +old_freq = 1GHz + +Fixes: 6a0712f6f199 ("PM / OPP: Add dev_pm_opp_set_rate()") +Cc: 4.6+ # v4.6+ +Signed-off-by: Waldemar Rymarkiewicz +Signed-off-by: Viresh Kumar +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/power/opp/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/base/power/opp/core.c ++++ b/drivers/base/power/opp/core.c +@@ -552,7 +552,7 @@ static int _generic_set_opp_regulator(co + } + + /* Scaling up? Scale voltage before frequency */ +- if (freq > old_freq) { ++ if (freq >= old_freq) { + ret = _set_opp_voltage(dev, reg, new_supply); + if (ret) + goto restore_voltage; diff --git a/queue-4.14/serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch b/queue-4.14/serial-sh-sci-use-spin_-try-lock_irqsave-instead-of-open-coding-version.patch new file mode 100644 index 00000000000..6608d00a984 --- /dev/null +++ b/queue-4.14/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 +@@ -2854,16 +2854,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); +@@ -2883,8 +2882,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.14/series b/queue-4.14/series index d308ffdd034..e7018641253 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -5,3 +5,21 @@ 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 +m68k-mac-fix-swim-memory-resource-end-address.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 +pm-domains-fix-error-path-during-attach-in-genpd.patch +pm-core-fix-supplier-device-runtime-pm-usage-counter-imbalance.patch +pm-opp-update-voltage-in-case-freq-old_freq.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-cs35l35-add-use_single_rw-to-regmap-config.patch +asoc-cirrus-i2s-fix-lrclk-configuration.patch +asoc-cirrus-i2s-fix-tx-rx-linctrldata-setup.patch +thermal-bcm2835-stop-using-printk-format-pcr.patch +clk-renesas-cpg-mssr-stop-using-printk-format-pcr.patch +lib-vsprintf-remove-atomic-unsafe-support-for-pcr.patch +ftrace-selftest-have-the-reset_trigger-code-be-a-bit-more-careful.patch +mips-ftrace-fix-static-function-graph-tracing.patch diff --git a/queue-4.14/signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch b/queue-4.14/signal-xtensa-consistenly-use-sigbus-in-do_unaligned_user.patch new file mode 100644 index 00000000000..c6eac03b89c --- /dev/null +++ b/queue-4.14/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 +@@ -336,7 +336,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.14/thermal-bcm2835-stop-using-printk-format-pcr.patch b/queue-4.14/thermal-bcm2835-stop-using-printk-format-pcr.patch new file mode 100644 index 00000000000..d226b991fda --- /dev/null +++ b/queue-4.14/thermal-bcm2835-stop-using-printk-format-pcr.patch @@ -0,0 +1,60 @@ +From bd2a07f71a1e2e198f8a30cb551d9defe422d83d Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Fri, 1 Jun 2018 11:28:20 +0200 +Subject: thermal: bcm2835: Stop using printk format %pCr + +From: Geert Uytterhoeven + +commit bd2a07f71a1e2e198f8a30cb551d9defe422d83d upstream. + +Printk format "%pCr" will be removed soon, as clk_get_rate() must not be +called in atomic context. + +Replace it by printing the variable that already holds the clock rate. +Note that calling clk_get_rate() is safe here, as the code runs in task +context. + +Link: http://lkml.kernel.org/r/1527845302-12159-3-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: stable@vger.kernel.org # 4.12+ +Signed-off-by: Geert Uytterhoeven +Acked-by: Stefan Wahren +Signed-off-by: Petr Mladek +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/thermal/broadcom/bcm2835_thermal.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/thermal/broadcom/bcm2835_thermal.c ++++ b/drivers/thermal/broadcom/bcm2835_thermal.c +@@ -213,8 +213,8 @@ static int bcm2835_thermal_probe(struct + rate = clk_get_rate(data->clk); + if ((rate < 1920000) || (rate > 5000000)) + dev_warn(&pdev->dev, +- "Clock %pCn running at %pCr Hz is outside of the recommended range: 1.92 to 5MHz\n", +- data->clk, data->clk); ++ "Clock %pCn running at %lu Hz is outside of the recommended range: 1.92 to 5MHz\n", ++ data->clk, rate); + + /* register of thermal sensor and get info from DT */ + tz = thermal_zone_of_sensor_register(&pdev->dev, 0, data, diff --git a/queue-4.14/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch b/queue-4.14/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch new file mode 100644 index 00000000000..16ca56381d3 --- /dev/null +++ b/queue-4.14/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 +@@ -4519,7 +4519,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