]>
Commit | Line | Data |
---|---|---|
5c17fab8 GKH |
1 | From 7dfae6cbadc1ac99e38ad19fb08810b31ff167be Mon Sep 17 00:00:00 2001 |
2 | From: Hans de Goede <hdegoede@redhat.com> | |
3 | Date: Sun, 17 Mar 2024 22:41:23 +0100 | |
4 | Subject: serial: 8250_dw: Revert: Do not reclock if already at correct rate | |
5 | ||
6 | From: Hans de Goede <hdegoede@redhat.com> | |
7 | ||
8 | commit 7dfae6cbadc1ac99e38ad19fb08810b31ff167be upstream. | |
9 | ||
10 | Commit e5d6bd25f93d ("serial: 8250_dw: Do not reclock if already at | |
11 | correct rate") breaks the dw UARTs on Intel Bay Trail (BYT) and | |
12 | Cherry Trail (CHT) SoCs. | |
13 | ||
14 | Before this change the RTL8732BS Bluetooth HCI which is found | |
15 | connected over the dw UART on both BYT and CHT boards works properly: | |
16 | ||
17 | Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000b lmp_ver=06 lmp_subver=8723 | |
18 | Bluetooth: hci0: RTL: rom_version status=0 version=1 | |
19 | Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_fw.bin | |
20 | Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_config-OBDA8723.bin | |
21 | Bluetooth: hci0: RTL: cfg_sz 64, total sz 24508 | |
22 | Bluetooth: hci0: RTL: fw version 0x365d462e | |
23 | ||
24 | where as after this change probing it fails: | |
25 | ||
26 | Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000b lmp_ver=06 lmp_subver=8723 | |
27 | Bluetooth: hci0: RTL: rom_version status=0 version=1 | |
28 | Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_fw.bin | |
29 | Bluetooth: hci0: RTL: loading rtl_bt/rtl8723bs_config-OBDA8723.bin | |
30 | Bluetooth: hci0: RTL: cfg_sz 64, total sz 24508 | |
31 | Bluetooth: hci0: command 0xfc20 tx timeout | |
32 | Bluetooth: hci0: RTL: download fw command failed (-110) | |
33 | ||
34 | Revert the changes to fix this regression. | |
35 | ||
36 | Fixes: e5d6bd25f93d ("serial: 8250_dw: Do not reclock if already at correct rate") | |
37 | Cc: stable@vger.kernel.org | |
38 | Cc: Peter Collingbourne <pcc@google.com> | |
39 | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | |
40 | Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> | |
41 | Acked-by: Peter Collingbourne <pcc@google.com> | |
42 | Link: https://lore.kernel.org/r/20240317214123.34482-1-hdegoede@redhat.com | |
43 | Signed-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 | } |