qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>, Calvin Lee <cyrus296@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation
Date: Tue, 11 Sep 2018 15:21:34 +0200	[thread overview]
Message-ID: <e0b4bcce-6513-5614-88b1-5ee445d1bcc8@redhat.com> (raw)
In-Reply-To: <20180831233736.GA10164@roeck-us.net>

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

  reply	other threads:[~2018-09-11 13:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 23:37 [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation Guenter Roeck
2018-09-11 13:21 ` Paolo Bonzini [this message]
2018-09-11 21:59   ` Guenter Roeck

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=e0b4bcce-6513-5614-88b1-5ee445d1bcc8@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cyrus296@gmail.com \
    --cc=linux@roeck-us.net \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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).