[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] Regarding the xmbserial driver
Hi
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).
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!!...
---------------------start-------------------------------
/*
This is the flip buffer used for the tty driver. The buffer is located in the tty structure, and is used as a high speed interface between the tty driver and the tty line discipline.
*/
//#define TTY_FLIPBUF_SIZE 512
#define TTY_FLIPBUF_SIZE 1024 -> //size increased here
struct tty_flip_buffer {
struct tq_struct tqueue;
struct semaphore pty_sem;
char *char_buf_ptr;
unsigned char *flag_buf_ptr;
int count;
int buf_num;
unsigned char char_buf[2*TTY_FLIPBUF_SIZE];
char flag_buf[2*TTY_FLIPBUF_SIZE];
unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */
};
---------------------end-------------------------------
can anyone give me some more information on this?..why is this fix working?..:-)..and what is the upper limit of this TTY_FLIP_BUFFER size...and which other drivers/applications use this?
Moreover 512 bytes seems to be large enough but why does this seem to be insufficient in the first place?..
I have been trying to grep through the source code to find out more about this..but I guess I am losing track somewhere...it will be great if someone can help me with this...
Thanks and Regards
V.Anand
(www.tenet.res.in)
****************************************
___________________________
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/