qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation
@ 2018-08-31 23:37 Guenter Roeck
  2018-09-11 13:21 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2018-08-31 23:37 UTC (permalink / raw)
  To: Calvin Lee; +Cc: Michael S. Tsirkin, Paolo Bonzini, qemu-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-11 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-31 23:37 [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation Guenter Roeck
2018-09-11 13:21 ` Paolo Bonzini
2018-09-11 21:59   ` Guenter Roeck

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).