Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1593154
| From | James Hogan <james.hogan@imgtec.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n |
| Date | 2017-03-06 11:20 +0100 |
| Message-ID | <thXUf-6JB-43@gated-at.bofh.it> (permalink) |
| References | <th8eZ-2ju-9@gated-at.bofh.it> <thhLk-18A-11@gated-at.bofh.it> <thj0J-24l-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Sat, Mar 04, 2017 at 04:37:17PM +0200, Andy Shevchenko wrote:
> On Sat, Mar 4, 2017 at 3:09 PM, James Hogan <james.hogan@imgtec.com> wrote:
> > Commit 6a171b299379 ("serial: 8250_dw: Allow hardware flow control to be
> > used") recently broke the 8250_dw driver on platforms which don't select
> > HAVE_CLK, as dw8250_set_termios() gets confused by the behaviour of the
> > fallback HAVE_CLK=n clock API in linux/clk.h which pretends everything
> > is fine but returns (valid) NULL clocks and 0 HZ clock rates.
> >
> > That 0 rate is written into the uartclk resulting in a crash at boot,
> > e.g. on Cavium Octeon III based UTM-8 we get something like this:
> >
> > 1180000000800.serial: ttyS0 at MMIO 0x1180000000800 (irq = 41, base_baud = 25000000) is a OCTEON
> > ------------[ cut here ]------------
> > WARNING: CPU: 2 PID: 1 at drivers/tty/serial/serial_core.c:441 uart_get_baud_rate+0xfc/0x1f0
> > ...
> > Call Trace:
> > ...
> > [<ffffffff8149c2e4>] uart_get_baud_rate+0xfc/0x1f0
> > [<ffffffff814a5098>] serial8250_do_set_termios+0xb0/0x440
> > [<ffffffff8149c710>] uart_set_options+0xe8/0x190
> > [<ffffffff814a6cdc>] serial8250_console_setup+0x84/0x158
> > [<ffffffff814a11ec>] univ8250_console_setup+0x54/0x70
> > [<ffffffff811901a0>] register_console+0x1c8/0x418
> > [<ffffffff8149f004>] uart_add_one_port+0x434/0x4b0
> > [<ffffffff814a1af8>] serial8250_register_8250_port+0x2d8/0x440
> > [<ffffffff814aa620>] dw8250_probe+0x388/0x5e8
> > ...
> >
> > The clock API is defined such that NULL is a valid clock handle so it
> > wouldn't be right to check explicitly for NULL. Instead treat a
> > clk_round_rate() return value of 0 as an error which prevents uartclk
> > being overwritten.
> >
>
> You forgot to add that it is dependent to Heiko's patch
> http://www.spinics.net/lists/linux-serial/msg25314.html
Indeed I did. Sorry about that.
>
> Patch looks good to me and shouldn't bring any regression to Intel
> hardware (x86 is using clock framework).
>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Thanks
James
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-01 20:00 +0100
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used James Hogan <james.hogan@imgtec.com> - 2017-03-03 01:30 +0100
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-03 14:40 +0100
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used Ray Jui <ray.jui@broadcom.com> - 2017-03-03 18:40 +0100
RE: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used Jason Uy <jason.uy@broadcom.com> - 2017-03-03 19:20 +0100
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used James Hogan <james.hogan@imgtec.com> - 2017-03-04 00:10 +0100
RE: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used Jason Uy <jason.uy@broadcom.com> - 2017-03-04 01:10 +0100
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used James Hogan <james.hogan@imgtec.com> - 2017-03-04 01:20 +0100
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used James Hogan <james.hogan@imgtec.com> - 2017-03-04 00:30 +0100
Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-04 04:10 +0100
[PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n James Hogan <james.hogan@imgtec.com> - 2017-03-04 14:20 +0100
Re: [PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-04 15:40 +0100
Re: [PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n James Hogan <james.hogan@imgtec.com> - 2017-03-06 11:20 +0100
RE: [PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n Jason Uy <jason.uy@broadcom.com> - 2017-03-07 01:20 +0100
Re: [PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n Heiko Stuebner <heiko@sntech.de> - 2017-03-05 01:50 +0100
Re: [PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n James Hogan <james.hogan@imgtec.com> - 2017-03-13 12:20 +0100
Re: [PATCH] serial: 8250_dw: Fix breakage when HAVE_CLK=n Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-14 03:30 +0100
csiph-web