From: Ian Campbell Subject: Re: [PATCH] pl011: early_panic if baud rate not set in hardware Date: Thu, 22 Aug 2013 19:49:18 +0100 Message-ID: <1377197358.23054.0.camel@dagon.hellion.org.uk> References: <1377187319-30598-1-git-send-email-ian.campbell@citrix.com> <52163D8C.5050404@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52163D8C.5050404@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2013-08-22 at 17:34 +0100, Julien Grall wrote: > On 08/22/2013 05:01 PM, Ian Campbell wrote: > > Now that the driver defaults to BAUD_AUTO this can happen if the early uart != > > console or if early printk isn't in use. > > Does the fast model set correctly the baud rate? No. > > The following division by zero causes a trap but that uses regular printk and > > not early_printk, so it is never seen. > > That's annoying. I often have this problem, is there any plan to support > early print in printk? TBH I thought it was somewhere (far down) your todo list. Maybe I'll have a poke at it tomorrow. > > > Signed-off-by: Ian Campbell > Acked-by: Julien Grall > > --- > > xen/drivers/char/pl011.c | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c > > index 0e1eb64..7eb90b0 100644 > > --- a/xen/drivers/char/pl011.c > > +++ b/xen/drivers/char/pl011.c > > @@ -104,6 +104,8 @@ static void __init pl011_init_preirq(struct serial_port *port) > > { > > /* Baud rate already set: read it out from the divisor latch. */ > > divisor = (pl011_read(uart, IBRD) << 6) | (pl011_read(uart, FBRD)); > > + if (!divisor) > > + early_panic("pl011: No Baud rate configured\n"); > > uart->baud = (uart->clock_hz << 2) / divisor; > > } > > /* This write must follow FBRD and IBRD writes. */ > > > >