[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation |
Date: |
Tue, 11 Sep 2018 15:21:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 01/09/2018 01:37, Guenter Roeck wrote:
> The patch results in an unexpected DLL register value. Here is the
> surrounding code from drivers/tty/serial/pxa.c:
>
> serial_out(up, UART_DLL, quot & 0xff); /* LS of divisor */
>
> /*
> * work around Errata #75 according to Intel(R) PXA27x
> * Processor Family Specification Update (Nov 2005)
> */
> dll = serial_in(up, UART_DLL);
> WARN_ON(dll != (quot & 0xff)); // <-- warning
>
> Reverting the patch fixes the problem.
I think it's a typo. Can you try this:
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 251f40fdac..02463e3388 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -345,9 +345,9 @@ static void serial_ioport_write(void *opaque, hwaddr addr,
uint64_t val,
default:
case 0:
if (s->lcr & UART_LCR_DLAB) {
- if (size == 2) {
+ if (size == 1) {
s->divider = (s->divider & 0xff00) | val;
- } else if (size == 4) {
+ } else {
s->divider = val;
}
serial_update_parameters(s);
Thanks,
Paolo
- Re: [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation,
Paolo Bonzini <=