From: Greg Kroah-Hartman Date: Wed, 19 Aug 2020 13:33:22 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.14.194~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=769174888fcaf7de7ad786065096d71cb223bf1d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: drm-imx-imx-ldb-disable-both-channels-for-split-mode-in-enc-disable.patch module-correctly-truncate-sysfs-sections-output.patch perf-intel-pt-fix-fup-packet-state.patch remoteproc-qcom-q6v5-update-running-state-before-requesting-stop.patch --- diff --git a/queue-4.19/drm-imx-imx-ldb-disable-both-channels-for-split-mode-in-enc-disable.patch b/queue-4.19/drm-imx-imx-ldb-disable-both-channels-for-split-mode-in-enc-disable.patch new file mode 100644 index 00000000000..6f5f0f8b9a6 --- /dev/null +++ b/queue-4.19/drm-imx-imx-ldb-disable-both-channels-for-split-mode-in-enc-disable.patch @@ -0,0 +1,52 @@ +From 3b2a999582c467d1883716b37ffcc00178a13713 Mon Sep 17 00:00:00 2001 +From: Liu Ying +Date: Thu, 9 Jul 2020 10:28:52 +0800 +Subject: drm/imx: imx-ldb: Disable both channels for split mode in enc->disable() + +From: Liu Ying + +commit 3b2a999582c467d1883716b37ffcc00178a13713 upstream. + +Both of the two LVDS channels should be disabled for split mode +in the encoder's ->disable() callback, because they are enabled +in the encoder's ->enable() callback. + +Fixes: 6556f7f82b9c ("drm: imx: Move imx-drm driver out of staging") +Cc: Philipp Zabel +Cc: Sascha Hauer +Cc: Pengutronix Kernel Team +Cc: NXP Linux Team +Cc: +Signed-off-by: Liu Ying +Signed-off-by: Philipp Zabel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/imx/imx-ldb.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/imx/imx-ldb.c ++++ b/drivers/gpu/drm/imx/imx-ldb.c +@@ -311,18 +311,19 @@ static void imx_ldb_encoder_disable(stru + { + struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder); + struct imx_ldb *ldb = imx_ldb_ch->ldb; ++ int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; + int mux, ret; + + drm_panel_disable(imx_ldb_ch->panel); + +- if (imx_ldb_ch == &ldb->channel[0]) ++ if (imx_ldb_ch == &ldb->channel[0] || dual) + ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; +- else if (imx_ldb_ch == &ldb->channel[1]) ++ if (imx_ldb_ch == &ldb->channel[1] || dual) + ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; + + regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl); + +- if (ldb->ldb_ctrl & LDB_SPLIT_MODE_EN) { ++ if (dual) { + clk_disable_unprepare(ldb->clk[0]); + clk_disable_unprepare(ldb->clk[1]); + } diff --git a/queue-4.19/module-correctly-truncate-sysfs-sections-output.patch b/queue-4.19/module-correctly-truncate-sysfs-sections-output.patch new file mode 100644 index 00000000000..5698495018a --- /dev/null +++ b/queue-4.19/module-correctly-truncate-sysfs-sections-output.patch @@ -0,0 +1,77 @@ +From 11990a5bd7e558e9203c1070fc52fb6f0488e75b Mon Sep 17 00:00:00 2001 +From: Kees Cook +Date: Thu, 6 Aug 2020 14:15:23 -0700 +Subject: module: Correctly truncate sysfs sections output + +From: Kees Cook + +commit 11990a5bd7e558e9203c1070fc52fb6f0488e75b upstream. + +The only-root-readable /sys/module/$module/sections/$section files +did not truncate their output to the available buffer size. While most +paths into the kernfs read handlers end up using PAGE_SIZE buffers, +it's possible to get there through other paths (e.g. splice, sendfile). +Actually limit the output to the "count" passed into the read function, +and report it back correctly. *sigh* + +Reported-by: kernel test robot +Link: https://lore.kernel.org/lkml/20200805002015.GE23458@shao2-debian +Fixes: ed66f991bb19 ("module: Refactor section attr into bin attribute") +Cc: stable@vger.kernel.org +Reviewed-by: Greg Kroah-Hartman +Acked-by: Jessica Yu +Signed-off-by: Kees Cook +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/module.c | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) + +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -1461,18 +1461,34 @@ struct module_sect_attrs { + struct module_sect_attr attrs[0]; + }; + ++#define MODULE_SECT_READ_SIZE (3 /* "0x", "\n" */ + (BITS_PER_LONG / 4)) + static ssize_t module_sect_read(struct file *file, struct kobject *kobj, + struct bin_attribute *battr, + char *buf, loff_t pos, size_t count) + { + struct module_sect_attr *sattr = + container_of(battr, struct module_sect_attr, battr); ++ char bounce[MODULE_SECT_READ_SIZE + 1]; ++ size_t wrote; + + if (pos != 0) + return -EINVAL; + +- return sprintf(buf, "0x%px\n", +- kallsyms_show_value(file->f_cred) ? (void *)sattr->address : NULL); ++ /* ++ * Since we're a binary read handler, we must account for the ++ * trailing NUL byte that sprintf will write: if "buf" is ++ * too small to hold the NUL, or the NUL is exactly the last ++ * byte, the read will look like it got truncated by one byte. ++ * Since there is no way to ask sprintf nicely to not write ++ * the NUL, we have to use a bounce buffer. ++ */ ++ wrote = scnprintf(bounce, sizeof(bounce), "0x%px\n", ++ kallsyms_show_value(file->f_cred) ++ ? (void *)sattr->address : NULL); ++ count = min(count, wrote); ++ memcpy(buf, bounce, count); ++ ++ return count; + } + + static void free_sect_attrs(struct module_sect_attrs *sect_attrs) +@@ -1521,7 +1537,7 @@ static void add_sect_attrs(struct module + goto out; + sect_attrs->nsections++; + sattr->battr.read = module_sect_read; +- sattr->battr.size = 3 /* "0x", "\n" */ + (BITS_PER_LONG / 4); ++ sattr->battr.size = MODULE_SECT_READ_SIZE; + sattr->battr.attr.mode = 0400; + *(gattr++) = &(sattr++)->battr; + } diff --git a/queue-4.19/perf-intel-pt-fix-fup-packet-state.patch b/queue-4.19/perf-intel-pt-fix-fup-packet-state.patch new file mode 100644 index 00000000000..dc1b476c037 --- /dev/null +++ b/queue-4.19/perf-intel-pt-fix-fup-packet-state.patch @@ -0,0 +1,76 @@ +From 401136bb084fd021acd9f8c51b52fe0a25e326b2 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Fri, 10 Jul 2020 18:10:53 +0300 +Subject: perf intel-pt: Fix FUP packet state + +From: Adrian Hunter + +commit 401136bb084fd021acd9f8c51b52fe0a25e326b2 upstream. + +While walking code towards a FUP ip, the packet state is +INTEL_PT_STATE_FUP or INTEL_PT_STATE_FUP_NO_TIP. That was mishandled +resulting in the state becoming INTEL_PT_STATE_IN_SYNC prematurely. The +result was an occasional lost EXSTOP event. + +Signed-off-by: Adrian Hunter +Reviewed-by: Andi Kleen +Cc: Jiri Olsa +Cc: stable@vger.kernel.org +Link: http://lore.kernel.org/lkml/20200710151104.15137-2-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 21 ++++++-------------- + 1 file changed, 7 insertions(+), 14 deletions(-) + +--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c ++++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +@@ -1129,6 +1129,7 @@ static int intel_pt_walk_fup(struct inte + return 0; + if (err == -EAGAIN || + intel_pt_fup_with_nlip(decoder, &intel_pt_insn, ip, err)) { ++ decoder->pkt_state = INTEL_PT_STATE_IN_SYNC; + if (intel_pt_fup_event(decoder)) + return 0; + return -EAGAIN; +@@ -1780,17 +1781,13 @@ next: + } + if (decoder->set_fup_mwait) + no_tip = true; ++ if (no_tip) ++ decoder->pkt_state = INTEL_PT_STATE_FUP_NO_TIP; ++ else ++ decoder->pkt_state = INTEL_PT_STATE_FUP; + err = intel_pt_walk_fup(decoder); +- if (err != -EAGAIN) { +- if (err) +- return err; +- if (no_tip) +- decoder->pkt_state = +- INTEL_PT_STATE_FUP_NO_TIP; +- else +- decoder->pkt_state = INTEL_PT_STATE_FUP; +- return 0; +- } ++ if (err != -EAGAIN) ++ return err; + if (no_tip) { + no_tip = false; + break; +@@ -2375,15 +2372,11 @@ const struct intel_pt_state *intel_pt_de + err = intel_pt_walk_tip(decoder); + break; + case INTEL_PT_STATE_FUP: +- decoder->pkt_state = INTEL_PT_STATE_IN_SYNC; + err = intel_pt_walk_fup(decoder); + if (err == -EAGAIN) + err = intel_pt_walk_fup_tip(decoder); +- else if (!err) +- decoder->pkt_state = INTEL_PT_STATE_FUP; + break; + case INTEL_PT_STATE_FUP_NO_TIP: +- decoder->pkt_state = INTEL_PT_STATE_IN_SYNC; + err = intel_pt_walk_fup(decoder); + if (err == -EAGAIN) + err = intel_pt_walk_trace(decoder); diff --git a/queue-4.19/remoteproc-qcom-q6v5-update-running-state-before-requesting-stop.patch b/queue-4.19/remoteproc-qcom-q6v5-update-running-state-before-requesting-stop.patch new file mode 100644 index 00000000000..ce4f038a36b --- /dev/null +++ b/queue-4.19/remoteproc-qcom-q6v5-update-running-state-before-requesting-stop.patch @@ -0,0 +1,44 @@ +From 5b7be880074c73540948f8fc597e0407b98fabfa Mon Sep 17 00:00:00 2001 +From: Sibi Sankar +Date: Tue, 2 Jun 2020 22:02:56 +0530 +Subject: remoteproc: qcom: q6v5: Update running state before requesting stop + +From: Sibi Sankar + +commit 5b7be880074c73540948f8fc597e0407b98fabfa upstream. + +Sometimes the stop triggers a watchdog rather than a stop-ack. Update +the running state to false on requesting stop to skip the watchdog +instead. + +Error Logs: +$ echo stop > /sys/class/remoteproc/remoteproc0/state +ipa 1e40000.ipa: received modem stopping event +remoteproc-modem: watchdog received: sys_m_smsm_mpss.c:291:APPS force stop +qcom-q6v5-mss 4080000.remoteproc-modem: port failed halt +ipa 1e40000.ipa: received modem offline event +remoteproc0: stopped remote processor 4080000.remoteproc-modem + +Reviewed-by: Evan Green +Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource handling") +Cc: stable@vger.kernel.org +Signed-off-by: Sibi Sankar +Link: https://lore.kernel.org/r/20200602163257.26978-1-sibis@codeaurora.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/remoteproc/qcom_q6v5.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/remoteproc/qcom_q6v5.c ++++ b/drivers/remoteproc/qcom_q6v5.c +@@ -151,6 +151,8 @@ int qcom_q6v5_request_stop(struct qcom_q + { + int ret; + ++ q6v5->running = false; ++ + qcom_smem_state_update_bits(q6v5->state, + BIT(q6v5->stop_bit), BIT(q6v5->stop_bit)); + diff --git a/queue-4.19/series b/queue-4.19/series index ee780a65b96..53ecffeb513 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -42,3 +42,7 @@ watchdog-f71808e_wdt-indicate-wdiof_cardreset-support-in-watchdog_info.options.p watchdog-f71808e_wdt-remove-use-of-wrong-watchdog_info-option.patch watchdog-f71808e_wdt-clear-watchdog-timeout-occurred-flag.patch pseries-fix-64-bit-logical-memory-block-panic.patch +module-correctly-truncate-sysfs-sections-output.patch +perf-intel-pt-fix-fup-packet-state.patch +remoteproc-qcom-q6v5-update-running-state-before-requesting-stop.patch +drm-imx-imx-ldb-disable-both-channels-for-split-mode-in-enc-disable.patch