From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Keir Fraser <keir@xen.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>, TimDeegan <tim@xen.org>
Subject: Re: [PATCH] ns16550: misc minor adjustments
Date: Thu, 12 Nov 2015 12:20:40 +0000 [thread overview]
Message-ID: <56448418.1070207@citrix.com> (raw)
In-Reply-To: <1447330218.18450.65.camel@citrix.com>
On 12/11/15 12:10, Ian Campbell wrote:
> On Thu, 2015-11-12 at 04:52 -0700, Jan Beulich wrote:
>
>>>> @@ -530,7 +531,8 @@ static void ns16550_setup_preirq(struct
>>>> /* Baud rate already set: read it out from the divisor
>>>> latch. */
>>>> divisor = ns_read_reg(uart, UART_DLL);
>>>> divisor |= ns_read_reg(uart, UART_DLM) << 8;
>>>> - uart->baud = uart->clock_hz / (divisor << 4);
>>>> + if ( divisor )
>>>> + uart->baud = uart->clock_hz / (divisor << 4);
>>> Will following code cope with uart->baud == BAUD_AUTO? Or should we
>>> pick a
>>> static fallback rate (115200?) and set the divisor appropriately?
>> The device won't work with it left as BAUD_AUTO. Setting a guessed
>> baud rate alone won't help, as we'd then also have to write it into the
>> respective registers. And I don't think anyway we should do any
>> guessing here - if the command line option was wrong (regardless of
>> whether due to using auto or just a wrong baud rate), communication
>> won't work. All I think we should really care about is to not crash, the
>> more in a way not diagnosable over serial console.
> BAUD_AUTO is the default in device-tree based situations, so it isn't
> necessarily the case that the command line is wrong. For the non-DT case I
> think it also ends up with an implicit BAUD_AUTO in some cases?
>
> That said I don't think it is worth going to the effort to distinguish
> implicit from explicit-auto configuration, and your argument about not
> writing to the registers certainly applies to the latter, so lets just
> worry about not crashing as you say.
>
> Is a printk worthwhile, due to the fact there might be a second console
> present?
Yes. Even if there isn't a second serial console, the system might boot
and `xl dmesg` should contain a record.
~Andrew
next prev parent reply other threads:[~2015-11-12 12:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 10:31 [PATCH] ns16550: misc minor adjustments Jan Beulich
2015-11-12 11:07 ` Ian Campbell
2015-11-12 11:52 ` Jan Beulich
2015-11-12 12:10 ` Ian Campbell
2015-11-12 12:20 ` Andrew Cooper [this message]
2015-11-12 12:32 ` Jan Beulich
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=56448418.1070207@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=ian.campbell@citrix.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.