aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--queue-5.15/revert-cpufreq-tegra186-share-policy-per-cluster.patch47
-rw-r--r--queue-5.15/serial-sh-sci-increment-the-runtime-usage-counter-for-the-earlycon-device.patch85
-rw-r--r--queue-5.15/series2
3 files changed, 134 insertions, 0 deletions
diff --git a/queue-5.15/revert-cpufreq-tegra186-share-policy-per-cluster.patch b/queue-5.15/revert-cpufreq-tegra186-share-policy-per-cluster.patch
new file mode 100644
index 0000000000..8c02665451
--- /dev/null
+++ b/queue-5.15/revert-cpufreq-tegra186-share-policy-per-cluster.patch
@@ -0,0 +1,47 @@
+From jonathanh@nvidia.com Mon Jun 23 10:07:30 2025
+From: Jon Hunter <jonathanh@nvidia.com>
+Date: Thu, 5 Jun 2025 13:52:59 +0100
+Subject: Revert "cpufreq: tegra186: Share policy per cluster"
+To: <stable@vger.kernel.org>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>, Aaron Kling <webgeek1234@gmail.com>, <linux-tegra@vger.kernel.org>, Jon Hunter <jonathanh@nvidia.com>
+Message-ID: <20250605125259.357091-1-jonathanh@nvidia.com>
+
+From: Jon Hunter <jonathanh@nvidia.com>
+
+This reverts commit 89172666228de1cefcacf5bc6f61c6281751d2ed which is
+upstream commit be4ae8c19492cd6d5de61ccb34ffb3f5ede5eec8.
+
+This commit is causing a suspend regression on Tegra186 Jetson TX2 with
+Linux v6.12.y kernels. This is not seen with Linux v6.15 that includes
+this change but indicates that there are there changes missing.
+Therefore, revert this change.
+
+Link: https://lore.kernel.org/linux-tegra/bf1dabf7-0337-40e9-8b8e-4e93a0ffd4cc@nvidia.com/
+Fixes: 89172666228d ("cpufreq: tegra186: Share policy per cluster")
+Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/cpufreq/tegra186-cpufreq.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+--- a/drivers/cpufreq/tegra186-cpufreq.c
++++ b/drivers/cpufreq/tegra186-cpufreq.c
+@@ -73,18 +73,11 @@ static int tegra186_cpufreq_init(struct
+ {
+ struct tegra186_cpufreq_data *data = cpufreq_get_driver_data();
+ unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id;
+- u32 cpu;
+
+ policy->freq_table = data->clusters[cluster].table;
+ policy->cpuinfo.transition_latency = 300 * 1000;
+ policy->driver_data = NULL;
+
+- /* set same policy for all cpus in a cluster */
+- for (cpu = 0; cpu < ARRAY_SIZE(tegra186_cpus); cpu++) {
+- if (data->cpus[cpu].bpmp_cluster_id == cluster)
+- cpumask_set_cpu(cpu, policy->cpus);
+- }
+-
+ return 0;
+ }
+
diff --git a/queue-5.15/serial-sh-sci-increment-the-runtime-usage-counter-for-the-earlycon-device.patch b/queue-5.15/serial-sh-sci-increment-the-runtime-usage-counter-for-the-earlycon-device.patch
new file mode 100644
index 0000000000..b91aa7585e
--- /dev/null
+++ b/queue-5.15/serial-sh-sci-increment-the-runtime-usage-counter-for-the-earlycon-device.patch
@@ -0,0 +1,85 @@
+From 651dee03696e1dfde6d9a7e8664bbdcd9a10ea7f Mon Sep 17 00:00:00 2001
+From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
+Date: Thu, 16 Jan 2025 20:22:49 +0200
+Subject: serial: sh-sci: Increment the runtime usage counter for the earlycon device
+
+From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
+
+commit 651dee03696e1dfde6d9a7e8664bbdcd9a10ea7f upstream.
+
+In the sh-sci driver, serial ports are mapped to the sci_ports[] array,
+with earlycon mapped at index zero.
+
+The uart_add_one_port() function eventually calls __device_attach(),
+which, in turn, calls pm_request_idle(). The identified code path is as
+follows:
+
+uart_add_one_port() ->
+ serial_ctrl_register_port() ->
+ serial_core_register_port() ->
+ serial_core_port_device_add() ->
+ serial_base_port_add() ->
+ device_add() ->
+ bus_probe_device() ->
+ device_initial_probe() ->
+ __device_attach() ->
+ // ...
+ if (dev->p->dead) {
+ // ...
+ } else if (dev->driver) {
+ // ...
+ } else {
+ // ...
+ pm_request_idle(dev);
+ // ...
+ }
+
+The earlycon device clocks are enabled by the bootloader. However, the
+pm_request_idle() call in __device_attach() disables the SCI port clocks
+while earlycon is still active.
+
+The earlycon write function, serial_console_write(), calls
+sci_poll_put_char() via serial_console_putchar(). If the SCI port clocks
+are disabled, writing to earlycon may sometimes cause the SR.TDFE bit to
+remain unset indefinitely, causing the while loop in sci_poll_put_char()
+to never exit. On single-core SoCs, this can result in the system being
+blocked during boot when this issue occurs.
+
+To resolve this, increment the runtime PM usage counter for the earlycon
+SCI device before registering the UART port.
+
+Fixes: 0b0cced19ab1 ("serial: sh-sci: Add CONFIG_SERIAL_EARLYCON support")
+Cc: stable@vger.kernel.org
+Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
+Link: https://lore.kernel.org/r/20250116182249.3828577-6-claudiu.beznea.uj@bp.renesas.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/sh-sci.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -3335,6 +3335,22 @@ static int sci_probe_single(struct platf
+
+ if (sci_uart_earlycon && sci_ports[0].port.mapbase == sci_res->start) {
+ /*
++ * In case:
++ * - this is the earlycon port (mapped on index 0 in sci_ports[]) and
++ * - it now maps to an alias other than zero and
++ * - the earlycon is still alive (e.g., "earlycon keep_bootcon" is
++ * available in bootargs)
++ *
++ * we need to avoid disabling clocks and PM domains through the runtime
++ * PM APIs called in __device_attach(). For this, increment the runtime
++ * PM reference counter (the clocks and PM domains were already enabled
++ * by the bootloader). Otherwise the earlycon may access the HW when it
++ * has no clocks enabled leading to failures (infinite loop in
++ * sci_poll_put_char()).
++ */
++ pm_runtime_get_noresume(&dev->dev);
++
++ /*
+ * Skip cleanup the sci_port[0] in early_console_exit(), this
+ * port is the same as the earlycon one.
+ */
diff --git a/queue-5.15/series b/queue-5.15/series
index a062260076..eb7f4c980b 100644
--- a/queue-5.15/series
+++ b/queue-5.15/series
@@ -384,3 +384,5 @@ net-atm-fix-proc-net-atm-lec-handling.patch
arm-dts-am335x-bone-common-add-gpio-phy-reset-on-revision-c3-board.patch
arm-dts-am335x-bone-common-increase-mdio-reset-deassert-time.patch
arm-dts-am335x-bone-common-increase-mdio-reset-deassert-delay-to-50ms.patch
+serial-sh-sci-increment-the-runtime-usage-counter-for-the-earlycon-device.patch
+revert-cpufreq-tegra186-share-policy-per-cluster.patch