From: Keir Fraser Date: Thu, 4 Dec 2008 11:36:18 +0000 (+0000) Subject: Fix existence check for MMIO-mapped 16550 UARTs X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14037^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=512ceccfaafe0c6175bcaaf6ffa92e008f159d8e;p=xen.git Fix existence check for MMIO-mapped 16550 UARTs Changeset 982e6fce0e47 added an existence test for UARTs. Unfortunately, the existence test happens before MMIO UARTs are ioremapped, therefore it may not be probing where it thinks it's probing. Rather than moving more code around, I think it's probably safe to assume the arch code knows what it's doing if it passes in an MMIO UART. Signed-off-by: Alex Williamson --- diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 6d5f90638b..1f88907008 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -302,6 +302,13 @@ static int check_existence(struct ns16550 *uart) { unsigned char status, scratch, scratch2, scratch3; + /* + * We can't poke MMIO UARTs until they get I/O remapped later. Assume that + * if we're getting MMIO UARTs, the arch code knows what it's doing. + */ + if ( uart->io_base >= 0x10000 ) + return 1; + /* * Do a simple existence test first; if we fail this, * there's no point trying anything else.