From: Greg Kroah-Hartman Date: Thu, 1 Sep 2022 10:01:23 +0000 (+0200) Subject: 5.19-stable patches X-Git-Tag: v4.9.327~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=285435c4b543096b327843790637104a3aee8893;p=thirdparty%2Fkernel%2Fstable-queue.git 5.19-stable patches added patches: arm64-errata-add-cortex-a510-to-the-repeat-tlbi-list.patch crypto-lib-remove-unneeded-selection-of-xor_blocks.patch docs-kerneldoc-preamble-test-xecjk.sty-before-loading.patch drm-vc4-hdmi-depends-on-config_pm.patch drm-vc4-hdmi-rework-power-up.patch firmware-tegra-bpmp-do-only-aligned-access-to-ipc-memory-area.patch --- diff --git a/queue-5.19/arm64-errata-add-cortex-a510-to-the-repeat-tlbi-list.patch b/queue-5.19/arm64-errata-add-cortex-a510-to-the-repeat-tlbi-list.patch new file mode 100644 index 00000000000..e3a87787269 --- /dev/null +++ b/queue-5.19/arm64-errata-add-cortex-a510-to-the-repeat-tlbi-list.patch @@ -0,0 +1,89 @@ +From 39fdb65f52e9a53d32a6ba719f96669fd300ae78 Mon Sep 17 00:00:00 2001 +From: James Morse +Date: Mon, 4 Jul 2022 16:57:32 +0100 +Subject: arm64: errata: Add Cortex-A510 to the repeat tlbi list + +From: James Morse + +commit 39fdb65f52e9a53d32a6ba719f96669fd300ae78 upstream. + +Cortex-A510 is affected by an erratum where in rare circumstances the +CPUs may not handle a race between a break-before-make sequence on one +CPU, and another CPU accessing the same page. This could allow a store +to a page that has been unmapped. + +Work around this by adding the affected CPUs to the list that needs +TLB sequences to be done twice. + +Signed-off-by: James Morse +Link: https://lore.kernel.org/r/20220704155732.21216-1-james.morse@arm.com +Signed-off-by: Will Deacon +Cc: Lucas Wei +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/arm64/silicon-errata.rst | 2 ++ + arch/arm64/Kconfig | 17 +++++++++++++++++ + arch/arm64/kernel/cpu_errata.c | 8 +++++++- + 3 files changed, 26 insertions(+), 1 deletion(-) + +--- a/Documentation/arm64/silicon-errata.rst ++++ b/Documentation/arm64/silicon-errata.rst +@@ -106,6 +106,8 @@ stable kernels. + +----------------+-----------------+-----------------+-----------------------------+ + | ARM | Cortex-A510 | #2077057 | ARM64_ERRATUM_2077057 | + +----------------+-----------------+-----------------+-----------------------------+ ++| ARM | Cortex-A510 | #2441009 | ARM64_ERRATUM_2441009 | +++----------------+-----------------+-----------------+-----------------------------+ + | ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 | + +----------------+-----------------+-----------------+-----------------------------+ + | ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 | +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -838,6 +838,23 @@ config ARM64_ERRATUM_2224489 + + If unsure, say Y. + ++config ARM64_ERRATUM_2441009 ++ bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI" ++ default y ++ select ARM64_WORKAROUND_REPEAT_TLBI ++ help ++ This option adds a workaround for ARM Cortex-A510 erratum #2441009. ++ ++ Under very rare circumstances, affected Cortex-A510 CPUs ++ may not handle a race between a break-before-make sequence on one ++ CPU, and another CPU accessing the same page. This could allow a ++ store to a page that has been unmapped. ++ ++ Work around this by adding the affected CPUs to the list that needs ++ TLB sequences to be done twice. ++ ++ If unsure, say Y. ++ + config ARM64_ERRATUM_2064142 + bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled" + depends on CORESIGHT_TRBE +--- a/arch/arm64/kernel/cpu_errata.c ++++ b/arch/arm64/kernel/cpu_errata.c +@@ -214,6 +214,12 @@ static const struct arm64_cpu_capabiliti + ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe), + }, + #endif ++#ifdef CONFIG_ARM64_ERRATUM_2441009 ++ { ++ /* Cortex-A510 r0p0 -> r1p1. Fixed in r1p2 */ ++ ERRATA_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1), ++ }, ++#endif + {}, + }; + #endif +@@ -490,7 +496,7 @@ const struct arm64_cpu_capabilities arm6 + #endif + #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI + { +- .desc = "Qualcomm erratum 1009, or ARM erratum 1286807", ++ .desc = "Qualcomm erratum 1009, or ARM erratum 1286807, 2441009", + .capability = ARM64_WORKAROUND_REPEAT_TLBI, + .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, + .matches = cpucap_multi_entry_cap_matches, diff --git a/queue-5.19/crypto-lib-remove-unneeded-selection-of-xor_blocks.patch b/queue-5.19/crypto-lib-remove-unneeded-selection-of-xor_blocks.patch new file mode 100644 index 00000000000..743ef91fbce --- /dev/null +++ b/queue-5.19/crypto-lib-remove-unneeded-selection-of-xor_blocks.patch @@ -0,0 +1,37 @@ +From 874b301985ef2f89b8b592ad255e03fb6fbfe605 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Thu, 25 Aug 2022 22:04:56 -0700 +Subject: crypto: lib - remove unneeded selection of XOR_BLOCKS + +From: Eric Biggers + +commit 874b301985ef2f89b8b592ad255e03fb6fbfe605 upstream. + +CRYPTO_LIB_CHACHA_GENERIC doesn't need to select XOR_BLOCKS. It perhaps +was thought that it's needed for __crypto_xor, but that's not the case. + +Enabling XOR_BLOCKS is problematic because the XOR_BLOCKS code runs a +benchmark when it is initialized. That causes a boot time regression on +systems that didn't have it enabled before. + +Therefore, remove this unnecessary and problematic selection. + +Fixes: e56e18985596 ("lib/crypto: add prompts back to crypto libraries") +Cc: stable@vger.kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + lib/crypto/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +--- a/lib/crypto/Kconfig ++++ b/lib/crypto/Kconfig +@@ -33,7 +33,6 @@ config CRYPTO_ARCH_HAVE_LIB_CHACHA + + config CRYPTO_LIB_CHACHA_GENERIC + tristate +- select XOR_BLOCKS + help + This symbol can be depended upon by arch implementations of the + ChaCha library interface that require the generic code as a diff --git a/queue-5.19/docs-kerneldoc-preamble-test-xecjk.sty-before-loading.patch b/queue-5.19/docs-kerneldoc-preamble-test-xecjk.sty-before-loading.patch new file mode 100644 index 00000000000..9adbcf38f9d --- /dev/null +++ b/queue-5.19/docs-kerneldoc-preamble-test-xecjk.sty-before-loading.patch @@ -0,0 +1,90 @@ +From cee7db1b0239468b22c295cf04a8c40c34ecd35a Mon Sep 17 00:00:00 2001 +From: Akira Yokosawa +Date: Mon, 8 Aug 2022 17:53:57 +0900 +Subject: docs: kerneldoc-preamble: Test xeCJK.sty before loading + +From: Akira Yokosawa + +commit cee7db1b0239468b22c295cf04a8c40c34ecd35a upstream. + +On distros whose texlive packaging is fine-grained, texlive-xecjk +can be installed/removed independently of other texlive packages. +Conditionally loading xeCJK depending only on the existence of the +"Noto Sans CJK SC" font might end up in xelatex error of +"xeCJK.sty not found!". + +Improve the situation by testing existence of xeCJK.sty before +loading it. + +This is useful on RHEL 9 and its clone distros where texlive-xecjk +doesn't work at the moment due to a missing dependency [1]. +"make pdfdocs" for non-CJK contents should work after removing +texlive-xecjk. + +Link: [1] https://bugzilla.redhat.com/show_bug.cgi?id=2086254 +Fixes: 398f7abdcb7e ("docs: pdfdocs: Pull LaTeX preamble part out of conf.py") +Cc: stable@vger.kernel.org # v5.18+ +Signed-off-by: Akira Yokosawa +Acked-by: Mauro Carvalho Chehab +Link: https://lore.kernel.org/r/c24c2a87-70b2-5342-bcc9-de467940466e@gmail.com +Signed-off-by: Jonathan Corbet +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/sphinx/kerneldoc-preamble.sty | 22 +++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/Documentation/sphinx/kerneldoc-preamble.sty b/Documentation/sphinx/kerneldoc-preamble.sty +index 2a29cbe51396..9707e033c8c4 100644 +--- a/Documentation/sphinx/kerneldoc-preamble.sty ++++ b/Documentation/sphinx/kerneldoc-preamble.sty +@@ -70,8 +70,16 @@ + + % Translations have Asian (CJK) characters which are only displayed if + % xeCJK is used ++\usepackage{ifthen} ++\newboolean{enablecjk} ++\setboolean{enablecjk}{false} + \IfFontExistsTF{Noto Sans CJK SC}{ +- % Load xeCJK when CJK font is available ++ \IfFileExists{xeCJK.sty}{ ++ \setboolean{enablecjk}{true} ++ }{} ++}{} ++\ifthenelse{\boolean{enablecjk}}{ ++ % Load xeCJK when both the Noto Sans CJK font and xeCJK.sty are available. + \usepackage{xeCJK} + % Noto CJK fonts don't provide slant shape. [AutoFakeSlant] permits + % its emulation. +@@ -196,7 +204,7 @@ + % Inactivate CJK after tableofcontents + \apptocmd{\sphinxtableofcontents}{\kerneldocCJKoff}{}{} + \xeCJKsetup{CJKspace = true}% For inter-phrase space of Korean TOC +-}{ % No CJK font found ++}{ % Don't enable CJK + % Custom macros to on/off CJK and switch CJK fonts (Dummy) + \newcommand{\kerneldocCJKon}{} + \newcommand{\kerneldocCJKoff}{} +@@ -204,14 +212,16 @@ + %% and ignore the argument (#1) in their definitions, whole contents of + %% CJK chapters can be ignored. + \newcommand{\kerneldocBeginSC}[1]{% +- %% Put a note on missing CJK fonts in place of zh_CN translation. +- \begin{sphinxadmonition}{note}{Note on missing fonts:} ++ %% Put a note on missing CJK fonts or the xecjk package in place of ++ %% zh_CN translation. ++ \begin{sphinxadmonition}{note}{Note on missing fonts and a package:} + Translations of Simplified Chinese (zh\_CN), Traditional Chinese + (zh\_TW), Korean (ko\_KR), and Japanese (ja\_JP) were skipped +- due to the lack of suitable font families. ++ due to the lack of suitable font families and/or the texlive-xecjk ++ package. + + If you want them, please install ``Noto Sans CJK'' font families +- by following instructions from ++ along with the texlive-xecjk package by following instructions from + \sphinxcode{./scripts/sphinx-pre-install}. + Having optional ``Noto Serif CJK'' font families will improve + the looks of those translations. +-- +2.37.2 + diff --git a/queue-5.19/drm-vc4-hdmi-depends-on-config_pm.patch b/queue-5.19/drm-vc4-hdmi-depends-on-config_pm.patch new file mode 100644 index 00000000000..e9160e55732 --- /dev/null +++ b/queue-5.19/drm-vc4-hdmi-depends-on-config_pm.patch @@ -0,0 +1,47 @@ +From 72e2329e7c9bbe15e7a813670497ec9c6f919af3 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 29 Jun 2022 14:34:36 +0200 +Subject: drm/vc4: hdmi: Depends on CONFIG_PM + +From: Maxime Ripard + +commit 72e2329e7c9bbe15e7a813670497ec9c6f919af3 upstream. + +We already depend on runtime PM to get the power domains and clocks for +most of the devices supported by the vc4 driver, so let's just select it +to make sure it's there. + +Link: https://lore.kernel.org/r/20220629123510.1915022-38-maxime@cerno.tech +Acked-by: Thomas Zimmermann +Tested-by: Stefan Wahren +Signed-off-by: Maxime Ripard +(cherry picked from commit f1bc386b319e93e56453ae27e9e83817bb1f6f95) +Signed-off-by: Maxime Ripard +Cc: "Sudip Mukherjee (Codethink)" +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/vc4/Kconfig | 1 + + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/Kconfig ++++ b/drivers/gpu/drm/vc4/Kconfig +@@ -8,6 +8,7 @@ config DRM_VC4 + depends on DRM + depends on SND && SND_SOC + depends on COMMON_CLK ++ depends on PM + select DRM_DISPLAY_HDMI_HELPER + select DRM_DISPLAY_HELPER + select DRM_KMS_HELPER +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2875,7 +2875,7 @@ static int vc5_hdmi_init_resources(struc + return 0; + } + +-static int __maybe_unused vc4_hdmi_runtime_suspend(struct device *dev) ++static int vc4_hdmi_runtime_suspend(struct device *dev) + { + struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); + diff --git a/queue-5.19/drm-vc4-hdmi-rework-power-up.patch b/queue-5.19/drm-vc4-hdmi-rework-power-up.patch new file mode 100644 index 00000000000..f22e3f1730f --- /dev/null +++ b/queue-5.19/drm-vc4-hdmi-rework-power-up.patch @@ -0,0 +1,75 @@ +From 258e483a4d5e97a6a8caa74381ddc1f395ac1c71 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 29 Jun 2022 14:34:37 +0200 +Subject: drm/vc4: hdmi: Rework power up + +From: Maxime Ripard + +commit 258e483a4d5e97a6a8caa74381ddc1f395ac1c71 upstream. + +The current code tries to handle the case where CONFIG_PM isn't selected +by first calling our runtime_resume implementation and then properly +report the power state to the runtime_pm core. + +This allows to have a functionning device even if pm_runtime_get_* +functions are nops. + +However, the device power state if CONFIG_PM is enabled is +RPM_SUSPENDED, and thus our vc4_hdmi_write() and vc4_hdmi_read() calls +in the runtime_pm hooks will now report a warning since the device might +not be properly powered. + +Even more so, we need CONFIG_PM enabled since the previous RaspberryPi +have a power domain that needs to be powered up for the HDMI controller +to be usable. + +The previous patch has created a dependency on CONFIG_PM, now we can +just assume it's there and only call pm_runtime_resume_and_get() to make +sure our device is powered in bind. + +Link: https://lore.kernel.org/r/20220629123510.1915022-39-maxime@cerno.tech +Acked-by: Thomas Zimmermann +Tested-by: Stefan Wahren +Signed-off-by: Maxime Ripard +(cherry picked from commit 53565c28e6af2cef6bbf438c34250135e3564459) +Signed-off-by: Maxime Ripard +Cc: "Sudip Mukherjee (Codethink)" +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2992,17 +2992,15 @@ static int vc4_hdmi_bind(struct device * + vc4_hdmi->disable_4kp60 = true; + } + ++ pm_runtime_enable(dev); ++ + /* +- * We need to have the device powered up at this point to call +- * our reset hook and for the CEC init. ++ * We need to have the device powered up at this point to call ++ * our reset hook and for the CEC init. + */ +- ret = vc4_hdmi_runtime_resume(dev); ++ ret = pm_runtime_resume_and_get(dev); + if (ret) +- goto err_put_ddc; +- +- pm_runtime_get_noresume(dev); +- pm_runtime_set_active(dev); +- pm_runtime_enable(dev); ++ goto err_disable_runtime_pm; + + if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || + of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && +@@ -3048,6 +3046,7 @@ err_destroy_conn: + err_destroy_encoder: + drm_encoder_cleanup(encoder); + pm_runtime_put_sync(dev); ++err_disable_runtime_pm: + pm_runtime_disable(dev); + err_put_ddc: + put_device(&vc4_hdmi->ddc->dev); diff --git a/queue-5.19/firmware-tegra-bpmp-do-only-aligned-access-to-ipc-memory-area.patch b/queue-5.19/firmware-tegra-bpmp-do-only-aligned-access-to-ipc-memory-area.patch new file mode 100644 index 00000000000..127de6410fa --- /dev/null +++ b/queue-5.19/firmware-tegra-bpmp-do-only-aligned-access-to-ipc-memory-area.patch @@ -0,0 +1,53 @@ +From a4740b148a04dc60e14fe6a1dfe216d3bae214fd Mon Sep 17 00:00:00 2001 +From: Timo Alho +Date: Wed, 22 Jun 2022 16:22:59 +0300 +Subject: firmware: tegra: bpmp: Do only aligned access to IPC memory area + +From: Timo Alho + +commit a4740b148a04dc60e14fe6a1dfe216d3bae214fd upstream. + +Use memcpy_toio and memcpy_fromio variants of memcpy to guarantee no +unaligned access to IPC memory area. This is to allow the IPC memory to +be mapped as Device memory to further suppress speculative reads from +happening within the 64 kB memory area above the IPC memory when 64 kB +memory pages are used. + +Signed-off-by: Timo Alho +Signed-off-by: Mikko Perttunen +Signed-off-by: Thierry Reding +Cc: Jon Hunter +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firmware/tegra/bpmp.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/firmware/tegra/bpmp.c ++++ b/drivers/firmware/tegra/bpmp.c +@@ -201,7 +201,7 @@ static ssize_t __tegra_bpmp_channel_read + int err; + + if (data && size > 0) +- memcpy(data, channel->ib->data, size); ++ memcpy_fromio(data, channel->ib->data, size); + + err = tegra_bpmp_ack_response(channel); + if (err < 0) +@@ -245,7 +245,7 @@ static ssize_t __tegra_bpmp_channel_writ + channel->ob->flags = flags; + + if (data && size > 0) +- memcpy(channel->ob->data, data, size); ++ memcpy_toio(channel->ob->data, data, size); + + return tegra_bpmp_post_request(channel); + } +@@ -420,7 +420,7 @@ void tegra_bpmp_mrq_return(struct tegra_ + channel->ob->code = code; + + if (data && size > 0) +- memcpy(channel->ob->data, data, size); ++ memcpy_toio(channel->ob->data, data, size); + + err = tegra_bpmp_post_response(channel); + if (WARN_ON(err < 0)) diff --git a/queue-5.19/series b/queue-5.19/series new file mode 100644 index 00000000000..d4b7649556a --- /dev/null +++ b/queue-5.19/series @@ -0,0 +1,6 @@ +drm-vc4-hdmi-rework-power-up.patch +drm-vc4-hdmi-depends-on-config_pm.patch +firmware-tegra-bpmp-do-only-aligned-access-to-ipc-memory-area.patch +crypto-lib-remove-unneeded-selection-of-xor_blocks.patch +docs-kerneldoc-preamble-test-xecjk.sty-before-loading.patch +arm64-errata-add-cortex-a510-to-the-repeat-tlbi-list.patch