Output character lost with 8250 UART driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

When I boot one of my target I find the UART(8250) works improperly.
Sometimes lost output characters. When I dig in the 8250.c I find
something strange in function transmit_chars. 

Below is the very piece of this function:

...
1	count = up->tx_loadsz;
2	do {
3		serial_out(up, UART_TX, xmit->buf[xmit->tail]);
4		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
5		up->port.icount.tx++;
6		if (uart_circ_empty(xmit))
7			break;
8	} while (--count > 0);
...

Based on theses lines, characters should be written to the THR
continuous, no matter if it had already move the character to the TSR. I
think it is not safe in some cases so I add a line

	wait_for_xmitr(up, UART_LSR_THRE);

before line 3. And then the issue in my target was disappeared. This is
a static function that was already exist in the same file. It just check
and wait until the THR was empty.

I noticed that in the same file (8250.c), in console part, all data
written to THR was protected by the "wait_for_xmitr". So for the
function "transmit_chars", does that a bug and should be resolved? Or
there are any reasons that it needn't this protection?

Thanks a lot
Xiao
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux