Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: owl: add "much needed" clk_prepare_enable()

commit 8ba92cf59335 ("arm64: dts: actions: s700: Add Clock Management Unit")
breaks the UART on Cubieboard7-lite (based on S700 SoC), This is due to the
fact that generic clk routine clk_disable_unused() disables the gate clks,
and that in turns disables OWL UART (but UART driver never enables it). To
prove this theory, Andre suggested to use "clk_ignore_unused" in kernel
commnd line and it worked (Kernel happily lands into RAMFS world :)).

This commit fix this up by adding clk_prepare_enable().

Fixes: 8ba92cf59335 ("arm64: dts: actions: s700: Add Clock Management Unit")
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1587067917-1400-1-git-send-email-amittomer25@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Amit Singh Tomar and committed by
Greg Kroah-Hartman
abf42d2f 9a98e7a8

+7
+7
drivers/tty/serial/owl-uart.c
··· 680 680 return PTR_ERR(owl_port->clk); 681 681 } 682 682 683 + ret = clk_prepare_enable(owl_port->clk); 684 + if (ret) { 685 + dev_err(&pdev->dev, "could not enable clk\n"); 686 + return ret; 687 + } 688 + 683 689 owl_port->port.dev = &pdev->dev; 684 690 owl_port->port.line = pdev->id; 685 691 owl_port->port.type = PORT_OWL; ··· 718 712 719 713 uart_remove_one_port(&owl_uart_driver, &owl_port->port); 720 714 owl_uart_ports[pdev->id] = NULL; 715 + clk_disable_unprepare(owl_port->clk); 721 716 722 717 return 0; 723 718 }