Messages in this thread | | | Date | Wed, 24 Nov 1999 09:54:17 +0530 | From | Sameer <> | Subject | Re: TTY Flip buffers |
| |
In the drivers (kernel-2.2.x) for most of the multiport cards, it seems like bytes could get dropped when the current flip buffer gets full in the interrupt handlers especially at high baud rates. Is there already some code lurking in there which does throttling to avoid this? I feel otherwise since these drivers would have no prior information regarding the vacany in the flip buffer other than in the interrupt handler itself, to stop RX interrupts from occuring . Could something like a high water mark be implemented for the flip buffers? This would then definitely require a bigger flip buffer ( greater than 512 bytes), Would'nt it?
regards, sameer.
> Note that the char_buf buffer size is 2*TTY_FLIPBUF_SIZE. However, all > serial drivers check the value TTY_FLIPBUF_SIZE in order to know whether > the buffer is full or not. > > Is this correct?? Shouldn't the serial drivers be checking for > 2*TTY_FLIPBUF_SIZE?? Aren't the serial drivers subutilizing the flip
> buffers in this way??
>The existing code is correct. The reason why the buffer is >2*TTY_FLIPBUF_SIZE is that we're doing double buffering; first one half
>of the buffer is filled, while the other half is being processed by the
>line discpline, and then the two (half) buffers are flipped --- this the >name "flip buffers". It really is double buffering by another name; I >wasn't familiar with the more commonly used name when I reinvented the >technique for Linux. :-)
Another question: if I want to use a larger flip buffer, can I just allocate the required memory amount and set the pointers char_buf_ptr and flag_buf_ptr?? If not, I don't see the reason for the existence of these pointers ...
You have to change the routines that set and reset those pointers when the flip buffers are flipped. There is a patch outstanding to allow bigger flip buffers, and I'll hopefully have a chance to look at it over
Thanksgiving weekend. (My apologies Pavel for my delay in looking over your patch; I've been swamped lately.)
- Ted
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |