All of lore.kernel.org
 help / color / mirror / Atom feed
* Poor serial (sh-shi) performance on sh7302
@ 2011-05-14 10:36 Federico Fuga
  0 siblings, 0 replies; only message in thread
From: Federico Fuga @ 2011-05-14 10:36 UTC (permalink / raw)
  To: linux-sh

Hi everybody,

I am developing a board with an sh 7302 cpu, and Linux-SH kernel 2.6.37.
Some week ago I posted here a problem with a spurious serial interrupt that locked-out the kernel.
I have isolated the problem with a unhandled overrun of the 16bytes FIFO. I solved the problem with a patch - soon posted here for reference.
But the problem was only an effect of a greater problem, that is the fact that the serial driver isn't able to handle a serial stream in time.
I made the following test: opened a console, set it at low speed (9600bps), then copied some text - at least 17 chars - in the clipboard of my PC; when pasting that chars on the terminal window, the overruns occurs.
Example: I typed 

echo "

then pasted the string "0123456789ABCDEFGHI" on the terminal window.
this is what appears on the terminal:

~ # echo "sh-sci sh-sci.0: overrun error
0123456789ABCDEF

Note that the serial port is set at 9600bps. 
Note also that only 16bytes are read from the serial port, this means (as I understand correctly) that no bytes are read from the FIFO before the buffer overruns.
Since 16 bytes enter the fifo in 16*1/1200 = 13ms, this means that it needs more than 13ms to the CPU to process the interrupt and start reading the FIFO! it's a ugly performance!
I tried many different kernel and scheduler configurations (preemptive, non-preemptive, cached, uncached, 100Hz, 1000Hz) but nothing changes. I suppose that the problem could be in the interrupt handling, but I do not know much of the internals, so I am ask you if there is some improvement I can try to increase the responsiveness of the serial port.
Note that while in uboot, I can set up the serial port at 115200bps and sustain this transfer speed without problem.

Thank you in advance!

Best regards


Federico Fuga




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-14 10:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-14 10:36 Poor serial (sh-shi) performance on sh7302 Federico Fuga

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.