serial: 8250_dw: Honor clk_round_rate errors in
From: Heiko Stuebner <heiko@...> Date: Tue, 28 Feb 2017 04:09:22 +0100
Commit-Message
clk_round_rate returns a signed long and may possibly return errors in it, for example if there is no possible rate. Till now dw8250_set_termios ignored any error, the signednes and would just use the value as input to clk_set_rate. This of course falls apart if there is an actual error, so check for errors and only try to set a rate if the value is actually valid. This turned up on some Rockchip platforms after commit 6a171b299379 ("serial: 8250_dw: Allow hardware flow control to be used") enabled set_termios callback in all cases, not only ACPI. Fixes: 6a171b299379 ("serial: 8250_dw: Allow hardware flow control to be used") Signed-off-by: Heiko Stuebner <heiko@...> Reviewed-by: Andy Shevchenko <andy.shevchenko@...>
Patch-Comment
There is also another patch floating around, fixing a separate issue on top of this one: "serial: 8250_dw: Fix breakage when HAVE_CLK=n" changes in v2: - adapt commit message to make it more explicit, that this is a somewhat critical fix - add Andy's Reviewed-by drivers/tty/serial/8250/8250_dw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Statistics
- 5 lines added
- 2 lines removed