]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-6.8/serial-8250_dw-revert-do-not-reclock-if-already-at-correct-rate.patch
6.8-stable patches
[thirdparty/kernel/stable-queue.git] / queue-6.8 / serial-8250_dw-revert-do-not-reclock-if-already-at-correct-rate.patch
CommitLineData
5c17fab8
GKH
1From 7dfae6cbadc1ac99e38ad19fb08810b31ff167be Mon Sep 17 00:00:00 2001
2From: Hans de Goede <hdegoede@redhat.com>
3Date: Sun, 17 Mar 2024 22:41:23 +0100
4Subject: serial: 8250_dw: Revert: Do not reclock if already at correct rate
5
6From: Hans de Goede <hdegoede@redhat.com>
7
8commit 7dfae6cbadc1ac99e38ad19fb08810b31ff167be upstream.
9
10Commit e5d6bd25f93d ("serial: 8250_dw: Do not reclock if already at
11correct rate") breaks the dw UARTs on Intel Bay Trail (BYT) and
12Cherry Trail (CHT) SoCs.
13
14Before this change the RTL8732BS Bluetooth HCI which is found
15connected over the dw UART on both BYT and CHT boards works properly:
16
17Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000b lmp_ver=06 lmp_subver=8723
18Bluetooth: hci0: RTL: rom_version status=0 version=1
19Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_fw.bin
20Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_config-OBDA8723.bin
21Bluetooth: hci0: RTL: cfg_sz 64, total sz 24508
22Bluetooth: hci0: RTL: fw version 0x365d462e
23
24where as after this change probing it fails:
25
26Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000b lmp_ver=06 lmp_subver=8723
27Bluetooth: hci0: RTL: rom_version status=0 version=1
28Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_fw.bin
29Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_config-OBDA8723.bin
30Bluetooth: hci0: RTL: cfg_sz 64, total sz 24508
31Bluetooth: hci0: command 0xfc20 tx timeout
32Bluetooth: hci0: RTL: download fw command failed (-110)
33
34Revert the changes to fix this regression.
35
36Fixes: e5d6bd25f93d ("serial: 8250_dw: Do not reclock if already at correct rate")
37Cc: stable@vger.kernel.org
38Cc: Peter Collingbourne <pcc@google.com>
39Signed-off-by: Hans de Goede <hdegoede@redhat.com>
40Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
41Acked-by: Peter Collingbourne <pcc@google.com>
42Link: https://lore.kernel.org/r/20240317214123.34482-1-hdegoede@redhat.com
43Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
44---
45 drivers/tty/serial/8250/8250_dw.c | 6 +++---
46 1 file changed, 3 insertions(+), 3 deletions(-)
47
48--- a/drivers/tty/serial/8250/8250_dw.c
49+++ b/drivers/tty/serial/8250/8250_dw.c
50@@ -357,9 +357,9 @@ static void dw8250_set_termios(struct ua
51 long rate;
52 int ret;
53
54+ clk_disable_unprepare(d->clk);
55 rate = clk_round_rate(d->clk, newrate);
56- if (rate > 0 && p->uartclk != rate) {
57- clk_disable_unprepare(d->clk);
58+ if (rate > 0) {
59 /*
60 * Note that any clock-notifer worker will block in
61 * serial8250_update_uartclk() until we are done.
62@@ -367,8 +367,8 @@ static void dw8250_set_termios(struct ua
63 ret = clk_set_rate(d->clk, newrate);
64 if (!ret)
65 p->uartclk = rate;
66- clk_prepare_enable(d->clk);
67 }
68+ clk_prepare_enable(d->clk);
69
70 dw8250_do_set_termios(p, termios, old);
71 }