From: "Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
To: Ed Blake <ed.blake-56FIPCJpnYtBDgjK7y7TUQ@public.gmane.org>
Cc: wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Shuyu Wei <wsy-flSAGy4ZnMjQT0dZR+AlfA@public.gmane.org>,
linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH][RFC] 8250_dw: unregister dw8250_set_termios for rk3188 chip
Date: Mon, 20 Nov 2017 18:51:37 +0100 [thread overview]
Message-ID: <1854299.UNFOX8ncyA@diego> (raw)
In-Reply-To: <0a4ce349-d386-0f1b-e973-e77af7f75d23-56FIPCJpnYtBDgjK7y7TUQ@public.gmane.org>
Am Montag, 20. November 2017, 16:26:56 CET schrieb Ed Blake:
> On 20/11/17 16:14, Shuyu Wei wrote:
> > On Mon, Nov 20, 2017 at 03:44:13PM +0000, Ed Blake wrote:
> >> On 20/11/17 14:40, Shuyu Wei wrote:
> >>> dw8250_set_termios is causing problems for rk3188 on my radxa board.
> >>> It's using a fixed clock at 24M, not baud*16 in dw8250_set_termios.
> >>> I'm not sure if other rk3xxx chips are facing the same problem.
> >>>
> >>> Signed-off-by Wei Shuyu <wsy-flSAGy4ZnMjQT0dZR+AlfA@public.gmane.org>
> >>> ---
> >>>
> >>> drivers/tty/serial/8250/8250_dw.c | 3 +++
> >>> 1 file changed, 3 insertions(+)
> >>>
> >>> diff --git a/drivers/tty/serial/8250/8250_dw.c
> >>> b/drivers/tty/serial/8250/8250_dw.c index 5bb0c42c88dd..e760a5c1f3f6
> >>> 100644
> >>> --- a/drivers/tty/serial/8250/8250_dw.c
> >>> +++ b/drivers/tty/serial/8250/8250_dw.c
> >>> @@ -340,6 +340,9 @@ static void dw8250_quirks(struct uart_port *p,
> >>> struct dw8250_data *data)>>>
> >>> data->skip_autocfg = true;
> >>>
> >>> }
> >>>
> >>> #endif
> >>>
> >>> + if (of_device_is_compatible(np, "rockchip,rk3188-uart")) {
> >>> + p->set_termios = NULL;
> >>> + }
> >>>
> >>> if (of_device_is_big_endian(p->dev->of_node)) {
> >>>
> >>> p->iotype = UPIO_MEM32BE;
> >>> p->serial_in = dw8250_serial_in32be;
> >>
> >> Can you provide more details on the problem you're trying to solve?
> >
> > Hi Ed,
> >
> > Current dw8250_set_termios() trys to set p->uartclk and d->clk to
> > baud*16, which is incorrect for rk3188. It should be a fixed 24000000.
> > The incorrect value will result in a wrong baud rate, generating bad
> > bytes on my serial console. Heikki Krogerus had worried about this,
> > see https://patchwork.kernel.org/patch/9306275/.
>
> If the clock is fixed to 24000000, shouldn't clk_round_rate() always
> return that value? In which case dw8250_set_termios() wouldn't try to
> change the rate.
>
> If clk_round_rate() is returning a different value for a fixed clock, it
> sounds like it's the clock driver which needs to change.
Also, the rk3188 uarts are definitly not fixed at 24MHz and can use other
sources as well. So I'm puzzled because at least the serial console on my
rk3188 radxarock works without issues.
Can you tell us which uart you are failing to control correctly?
I do remember that I ran into problems when the set_termios change
was introduced originally, resulting in the patch
"serial: 8250_dw: Honor clk_round_rate errors in dw8250_set_termios" [0]
but that is in mainline for quite some time now.
[0] https://patchwork.kernel.org/patch/9594657/
Heiko
next prev parent reply other threads:[~2017-11-20 17:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171120144045.juwm64m2j736h5ps@home.dogben.com>
[not found] ` <d8ba3c8a-a406-cbee-d71b-d6784d6ebacc@sondrel.com>
[not found] ` <d8ba3c8a-a406-cbee-d71b-d6784d6ebacc-56FIPCJpnYtBDgjK7y7TUQ@public.gmane.org>
2017-11-20 16:14 ` [PATCH][RFC] 8250_dw: unregister dw8250_set_termios for rk3188 chip Shuyu Wei
[not found] ` <20171120161455.orvooleyzfsslon3-ZQaglsx1qnHXWvwwbwmGMg@public.gmane.org>
2017-11-20 16:26 ` Ed Blake
[not found] ` <0a4ce349-d386-0f1b-e973-e77af7f75d23-56FIPCJpnYtBDgjK7y7TUQ@public.gmane.org>
2017-11-20 17:51 ` Heiko Stübner [this message]
2017-11-21 3:09 ` Shuyu Wei
[not found] ` <20171121030949.a6bsapueiicdbonj-ZQaglsx1qnHXWvwwbwmGMg@public.gmane.org>
2017-11-21 10:23 ` Ed Blake
[not found] ` <4010bd84-7c88-5410-820f-bd3d04f1fbb5-56FIPCJpnYtBDgjK7y7TUQ@public.gmane.org>
2017-11-21 17:17 ` Shuyu Wei
[not found] ` <20171121171712.GA4462-ZQaglsx1qnHXWvwwbwmGMg@public.gmane.org>
2017-11-21 17:33 ` Ed Blake
[not found] ` <f834a0a4-3d1e-6f97-6ff3-1d52d609f510-56FIPCJpnYtBDgjK7y7TUQ@public.gmane.org>
2017-11-23 14:56 ` Shuyu Wei
[not found] ` <20171123145622.GA1272-ZQaglsx1qnHXWvwwbwmGMg@public.gmane.org>
2017-11-23 15:11 ` Heiko Stuebner
2017-11-23 15:40 ` Shuyu Wei
[not found] ` <20171123153922.GA23503-ZQaglsx1qnHXWvwwbwmGMg@public.gmane.org>
2017-11-23 23:34 ` Heiko Stuebner
2017-11-24 17:06 ` Shuyu Wei
2017-11-20 14:49 Shuyu Wei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1854299.UNFOX8ncyA@diego \
--to=heiko-4mtyjxux2i+zqb+pc5nmwq@public.gmane.org \
--cc=ed.blake-56FIPCJpnYtBDgjK7y7TUQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=wsy-flSAGy4ZnMjQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).