Thread (33 messages) flat view 33 messages, 7 authors, 2011-06-22

Re: [PATCH 6/7] tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver

From: Alan Cox <hidden>
Date: 2011-05-20 09:53:11
Also in: lkml

On Thu, 19 May 2011 11:05:49 -0500
Timur Tabi [off-list ref] wrote:
Alan Cox wrote:
quoted
quoted
quoted
+		/* Pass the received data to the tty layer.  Note that this
+		 * function calls tty_buffer_request_room(), so I'm not sure if
+		 * we should have also called tty_buffer_request_room().
+		 */
+		ret = tty_insert_flip_string(ttys, buffer, len);
quoted
You only need to request_room in advance if you can't handle the case
where the insert_flip_string returns less than you stuffed down it.
If tty_insert_flip_string() returns less than I stuffed down it, the characters
it didn't accept will be dropped.  That's because once I receive them, I have
nowhere else to put them.  I suppose I could implement a receive FIFO, but that
seems overkill.  If calling tty_buffer_request_room() ensures that
tty_insert_flip_string() always accepts all the characters, I would rather do that.
I was answering the question in the comment in the code...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help