qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Calvin Lee <cyrus296@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation
Date: Fri, 31 Aug 2018 16:37:36 -0700	[thread overview]
Message-ID: <20180831233736.GA10164@roeck-us.net> (raw)

Hi,

On Fri, May 11, 2018 at 06:05:44PM -0600, Calvin Lee wrote:
> This fixes several problems I found in the UART serial implementation.
> Now all divisor values are allowed, while before divisor values of zero
> and below the base baud rate were rejected. All changes are in reference
> to http://www.sci.muni.cz/docs/pc/serport.txt
> 

This patch is causing tracebacks in all Linux kernels running the PXA serial
driver. Here is an example:

[    1.907584] ------------[ cut here ]------------
[    1.907805] WARNING: CPU: 0 PID: 1 at drivers/tty/serial/pxa.c:544 serial_pxa_set_termios+0x254/0x268
[    1.907865] Modules linked in:
[    1.908130] CPU: 0 PID: 1 Comm: swapper Not tainted 4.9.125-rc1-00067-g7236e21 #1
[    1.908155] Hardware name: Zipit Z2
[    1.908783] [<c0011f54>] (unwind_backtrace) from [<c000e9ac>] (show_stack+0x20/0x24)
[    1.908846] [<c000e9ac>] (show_stack) from [<c029aa80>] (dump_stack+0x20/0x28)
[    1.908877] [<c029aa80>] (dump_stack) from [<c002befc>] (__warn+0xec/0x114)
[    1.908905] [<c002befc>] (__warn) from [<c002bff4>] (warn_slowpath_null+0x30/0x38)
[    1.908931] [<c002bff4>] (warn_slowpath_null) from [<c033eeb4>] (serial_pxa_set_termios+0x254/0x268)
[    1.908958] [<c033eeb4>] (serial_pxa_set_termios) from [<c0339b00>] (uart_set_options+0xc8/0xf0)
[    1.908987] [<c0339b00>] (uart_set_options) from [<c0712200>] (serial_pxa_console_setup+0xb4/0xc4)
...

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.

Guenter

             reply	other threads:[~2018-08-31 23:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 23:37 Guenter Roeck [this message]
2018-09-11 13:21 ` [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation Paolo Bonzini
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=20180831233736.GA10164@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=cyrus296@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@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).