[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] Re: [uClinux-dev] Regarding the xmbserial driver
Hi Anand,
anand_12 wrote:
> I am running uclinux on a spartan 2E microblaze board.
> Sometime back I had posted to the groups regarding a problem
> I was facing.The microblaze-uclinux system used to crash(atleast apparently) if the user typed commands or text at a very fast rate at the shell prompt over the serial console(hyperterm in my case).
This is a known bug in the UARTlite driver (xmbserial.c)
> As suspected,the slow response of the serial driver was because of some buffering issue.The interrupt service routine invokes a "receive_chars" function in its handler..
> that function basically receives every character and puts it into a buffer(if i got it right)..called a "flip buffer"..which as shown below
> (uclinux-dist/linux-2.4.x/include/linux/tty.h)
>
> has a size # defined to 512 bytes...i changed this to 1024 bytes(also shown below)..and now the problem is solved..I am able to type and issue commands at a very fast rate without the system crashing...
>
> the problem seems to be solved but i do need to look at the implications of having increased the size of this buffer..but as it is..there is big difference now when i issue commands or just type some text and a very fast rate..it does not crash at all!!...
This is probably not an acceptable fix, because that header file is
global to all uClinux targets. There's nothing stopping you or anyone
else applying this fix to their local source tree, but I wouldn't try to
push it into the CVS.
Much better would be for us to identify the source of the bug in
xmbserial (we've got some good ideas) and fix it there.
The problem seems to be related to a code path in the interrupt handler
of xmbserial.c - from memory if the flip_buffer is full, the handler
exits without stripping the incoming chars in the hardware buffer. This
causes an endless interrupt loop because the interrupt is still
asserted, but there's no room in the filp_buf. Or something like that.
Unfortunately this issue is intertwined with a general unresolved
question about the behaviour of the interrupt controller regarding
level-sensitive interrupts. There was much discussion about this on the
microblaze list a while back, a search of the archives should track it down.
Cheers,
John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/