Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1592343
| From | James Hogan <james.hogan@imgtec.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used |
| Date | 2017-03-04 00:30 +0100 |
| Message-ID | <th4O6-8mo-13@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <sYx4e-2yO-45@gated-at.bofh.it> <tghDI-77b-31@gated-at.bofh.it> <tghDI-77b-29@gated-at.bofh.it> <tgJgB-1xs-7@gated-at.bofh.it> <tgVB7-1Rv-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Fri, Mar 03, 2017 at 03:31:06PM +0200, Andy Shevchenko wrote:
> On Fri, 2017-03-03 at 00:21 +0000, James Hogan wrote:
> > The CONFIG_HAVE_CLK=n implementation of devm_clk_get() in particular
> > seems highly questionable to me, given that commit 93abe8e4b13a ("clk:
> > add non CONFIG_HAVE_CLK routines") which added it 5 years ago says:
> >
> > > These calls will return error for platforms that don't select
> > > HAVE_CLK
> >
> > And NULL isn't an error in this API.
>
> Which is okay. I dunno what should be returned from clk_round_rate() if
> clk is NULL. I would fix CLK framework, though I would like to gather
> more details.
Hmm, the common clock framwork is just one implementation of the clock
API that won't use NULL as a valid clock handle. HAVE_CLK=n is just
another implementation that does return NULL as a valid value, and
accepts that value in the other clk functions.
> Btw, I hope you also noticed this one:
>
> http://www.spinics.net/lists/linux-serial/msg25314.html
Interesting.
Following Russel's past advise[1], the following patch on top of Heiko's
patch also fixes things for me on Octeon:
[1] https://lists.gt.net/linux/kernel/2102623
If thats an acceptable fix I'll post it properly. Thoughts?
Cheers
James
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 223ac234ddb2..e65808c482f1 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -267,6 +267,8 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
rate = clk_round_rate(d->clk, baud * 16);
if (rate < 0)
ret = rate;
+ else if (rate == 0)
+ ret = -ENOENT;
else
ret = clk_set_rate(d->clk, rate);
clk_prepare_enable(d->clk);
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