From: Greg Kroah-Hartman Date: Tue, 2 Apr 2024 07:50:15 +0000 (+0200) Subject: drop serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch X-Git-Tag: v6.7.12~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bf6b446c4b407a5b34c32d0a27bdbf6221706c8;p=thirdparty%2Fkernel%2Fstable-queue.git drop serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch --- diff --git a/queue-6.1/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch b/queue-6.1/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch deleted file mode 100644 index 478027724f4..00000000000 --- a/queue-6.1/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch +++ /dev/null @@ -1,50 +0,0 @@ -From e5d6bd25f93d6ae158bb4cd04956cb497a85b8ef Mon Sep 17 00:00:00 2001 -From: Peter Collingbourne -Date: Thu, 22 Feb 2024 11:26:34 -0800 -Subject: serial: 8250_dw: Do not reclock if already at correct rate - -From: Peter Collingbourne - -commit e5d6bd25f93d6ae158bb4cd04956cb497a85b8ef upstream. - -When userspace opens the console, we call set_termios() passing a -termios with the console's configured baud rate. Currently this causes -dw8250_set_termios() to disable and then re-enable the UART clock at -the same frequency as it was originally. This can cause corruption -of any concurrent console output. Fix it by skipping the reclocking -if we are already at the correct rate. - -Signed-off-by: Peter Collingbourne -Fixes: 4e26b134bd17 ("serial: 8250_dw: clock rate handling for all ACPI platforms") -Cc: stable@vger.kernel.org -Reviewed-by: Andy Shevchenko -Link: https://lore.kernel.org/r/20240222192635.1050502-1-pcc@google.com -Signed-off-by: Greg Kroah-Hartman ---- - drivers/tty/serial/8250/8250_dw.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/tty/serial/8250/8250_dw.c -+++ b/drivers/tty/serial/8250/8250_dw.c -@@ -357,9 +357,9 @@ static void dw8250_set_termios(struct ua - long rate; - int ret; - -- clk_disable_unprepare(d->clk); - rate = clk_round_rate(d->clk, newrate); -- if (rate > 0) { -+ if (rate > 0 && p->uartclk != rate) { -+ clk_disable_unprepare(d->clk); - /* - * Note that any clock-notifer worker will block in - * serial8250_update_uartclk() until we are done. -@@ -367,8 +367,8 @@ static void dw8250_set_termios(struct ua - ret = clk_set_rate(d->clk, newrate); - if (!ret) - p->uartclk = rate; -+ clk_prepare_enable(d->clk); - } -- clk_prepare_enable(d->clk); - - dw8250_do_set_termios(p, termios, old); - } diff --git a/queue-6.1/series b/queue-6.1/series index 31268b17a1f..f52b6bbcba1 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -158,7 +158,6 @@ usb-usb-storage-prevent-divide-by-0-error-in-isd200_ata_command.patch usb-gadget-ncm-fix-handling-of-zero-block-length-packets.patch usb-port-don-t-try-to-peer-unused-usb-ports-based-on-location.patch tty-serial-fsl_lpuart-avoid-idle-preamble-pending-if-cts-is-enabled.patch -serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch misc-lis3lv02d_i2c-fix-regulators-getting-en-dis-abled-twice-on-suspend-resume.patch mei-me-add-arrow-lake-point-s-did.patch mei-me-add-arrow-lake-point-h-did.patch diff --git a/queue-6.6/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch b/queue-6.6/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch deleted file mode 100644 index 478027724f4..00000000000 --- a/queue-6.6/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch +++ /dev/null @@ -1,50 +0,0 @@ -From e5d6bd25f93d6ae158bb4cd04956cb497a85b8ef Mon Sep 17 00:00:00 2001 -From: Peter Collingbourne -Date: Thu, 22 Feb 2024 11:26:34 -0800 -Subject: serial: 8250_dw: Do not reclock if already at correct rate - -From: Peter Collingbourne - -commit e5d6bd25f93d6ae158bb4cd04956cb497a85b8ef upstream. - -When userspace opens the console, we call set_termios() passing a -termios with the console's configured baud rate. Currently this causes -dw8250_set_termios() to disable and then re-enable the UART clock at -the same frequency as it was originally. This can cause corruption -of any concurrent console output. Fix it by skipping the reclocking -if we are already at the correct rate. - -Signed-off-by: Peter Collingbourne -Fixes: 4e26b134bd17 ("serial: 8250_dw: clock rate handling for all ACPI platforms") -Cc: stable@vger.kernel.org -Reviewed-by: Andy Shevchenko -Link: https://lore.kernel.org/r/20240222192635.1050502-1-pcc@google.com -Signed-off-by: Greg Kroah-Hartman ---- - drivers/tty/serial/8250/8250_dw.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/tty/serial/8250/8250_dw.c -+++ b/drivers/tty/serial/8250/8250_dw.c -@@ -357,9 +357,9 @@ static void dw8250_set_termios(struct ua - long rate; - int ret; - -- clk_disable_unprepare(d->clk); - rate = clk_round_rate(d->clk, newrate); -- if (rate > 0) { -+ if (rate > 0 && p->uartclk != rate) { -+ clk_disable_unprepare(d->clk); - /* - * Note that any clock-notifer worker will block in - * serial8250_update_uartclk() until we are done. -@@ -367,8 +367,8 @@ static void dw8250_set_termios(struct ua - ret = clk_set_rate(d->clk, newrate); - if (!ret) - p->uartclk = rate; -+ clk_prepare_enable(d->clk); - } -- clk_prepare_enable(d->clk); - - dw8250_do_set_termios(p, termios, old); - } diff --git a/queue-6.6/series b/queue-6.6/series index 144d5d66d63..bea5be012b8 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -224,7 +224,6 @@ usb-gadget-ncm-fix-handling-of-zero-block-length-packets.patch usb-port-don-t-try-to-peer-unused-usb-ports-based-on-location.patch xhci-fix-failure-to-detect-ring-expansion-need.patch tty-serial-fsl_lpuart-avoid-idle-preamble-pending-if-cts-is-enabled.patch -serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch misc-lis3lv02d_i2c-fix-regulators-getting-en-dis-abled-twice-on-suspend-resume.patch misc-fastrpc-pass-proper-arguments-to-scm-call.patch serial-port-don-t-suspend-if-the-port-is-still-busy.patch diff --git a/queue-6.7/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch b/queue-6.7/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch deleted file mode 100644 index 478027724f4..00000000000 --- a/queue-6.7/serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch +++ /dev/null @@ -1,50 +0,0 @@ -From e5d6bd25f93d6ae158bb4cd04956cb497a85b8ef Mon Sep 17 00:00:00 2001 -From: Peter Collingbourne -Date: Thu, 22 Feb 2024 11:26:34 -0800 -Subject: serial: 8250_dw: Do not reclock if already at correct rate - -From: Peter Collingbourne - -commit e5d6bd25f93d6ae158bb4cd04956cb497a85b8ef upstream. - -When userspace opens the console, we call set_termios() passing a -termios with the console's configured baud rate. Currently this causes -dw8250_set_termios() to disable and then re-enable the UART clock at -the same frequency as it was originally. This can cause corruption -of any concurrent console output. Fix it by skipping the reclocking -if we are already at the correct rate. - -Signed-off-by: Peter Collingbourne -Fixes: 4e26b134bd17 ("serial: 8250_dw: clock rate handling for all ACPI platforms") -Cc: stable@vger.kernel.org -Reviewed-by: Andy Shevchenko -Link: https://lore.kernel.org/r/20240222192635.1050502-1-pcc@google.com -Signed-off-by: Greg Kroah-Hartman ---- - drivers/tty/serial/8250/8250_dw.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/tty/serial/8250/8250_dw.c -+++ b/drivers/tty/serial/8250/8250_dw.c -@@ -357,9 +357,9 @@ static void dw8250_set_termios(struct ua - long rate; - int ret; - -- clk_disable_unprepare(d->clk); - rate = clk_round_rate(d->clk, newrate); -- if (rate > 0) { -+ if (rate > 0 && p->uartclk != rate) { -+ clk_disable_unprepare(d->clk); - /* - * Note that any clock-notifer worker will block in - * serial8250_update_uartclk() until we are done. -@@ -367,8 +367,8 @@ static void dw8250_set_termios(struct ua - ret = clk_set_rate(d->clk, newrate); - if (!ret) - p->uartclk = rate; -+ clk_prepare_enable(d->clk); - } -- clk_prepare_enable(d->clk); - - dw8250_do_set_termios(p, termios, old); - } diff --git a/queue-6.7/series b/queue-6.7/series index 8f82247cdb9..a2966dd7483 100644 --- a/queue-6.7/series +++ b/queue-6.7/series @@ -264,7 +264,6 @@ usb-gadget-ncm-fix-handling-of-zero-block-length-packets.patch usb-port-don-t-try-to-peer-unused-usb-ports-based-on-location.patch xhci-fix-failure-to-detect-ring-expansion-need.patch tty-serial-fsl_lpuart-avoid-idle-preamble-pending-if-cts-is-enabled.patch -serial-8250_dw-do-not-reclock-if-already-at-correct-rate.patch misc-lis3lv02d_i2c-fix-regulators-getting-en-dis-abled-twice-on-suspend-resume.patch misc-fastrpc-pass-proper-arguments-to-scm-call.patch serial-port-don-t-suspend-if-the-port-is-still-busy.patch