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

Re: [microblaze-uclinux] Uart lite hanging



On 7 nov 2008, at 17.23, Giulio Mazzoleni wrote:

I already did some tests, but could only collect some hints. I'm far
from having a clear vision of what is really happening.
Sorry for my lack of debug skills.


WHat happens if you apply the patch from xmbserial.c receive_chars():

	while ((status=uartp[XUL_STATUS_REG_OFFSET/4]) &
			XUL_SR_RX_FIFO_VALID_DATA)
	{
		if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
			/*
			 * FLIP buf can't take any more data.
			 * A few options - we pick the "leanest" in terms
			 * of IRQ processing time.
			 *
			 * We can either:
			 *
			 *  (a) empty RX FIFO  */
#if 1
			Reset_RX_FIFO(uartp);
			info->stats.rxoverrun++;
			break;
#else	
			/* Or
			 * (b) Try processing the flip buf immediately, see
			 *     if that helps (see drivers/char/serial for
		         *     details/inspiration)
			 */
			tty->flip.tqueue.routine((void *) tty);
			if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
				unsigned int max_count=256;
				/* Really stuck, drain the RX fifo */
				do {
					in_word=uartp[XUL_RX_FIFO_OFFSET/4];
					info->stats.rxoverrun++;
					status=uartp[XUL_STATUS_REG_OFFSET/4];
				} while ((status & XUL_SR_RX_FIFO_VALID_DATA) &&
						max_count-- > 0);

				break;
			}
#endif
		}

		/* Grab char from RX FIFO */
		in_word = uartp[XUL_RX_FIFO_OFFSET/4];
		ch = (unsigned char)in_word;

/Olof
--
Olof Backing
CAG Contactor AB                              Office: +46 (0)8 752 81 00
Finlandsgatan 14                             Mobile: +46 (0)70 995 98 99
SE-164 74  KISTA                                 Fax: +46 (0)8 752 05 30

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/