Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

RZ/A1H (r7s72100) sh-sci fifo linux 3.14

$
0
0

Hi.

I try reduce cpu load by using fifo for serial/tty port and find strange check in sci_receive_chars():

if (!(status & SCxSR_RDxF(port)))
return;

It's mean that interrupt function does not read byte(s) from port before buffer is not accumulate enough bytes. As I understand this is not fully correct because:

Receive Interrupt Enable
Enables or disables the receive FIFO data full (RXI) interrupts requested when the RDF flag or DR flag in serial status register (SCFSR) is set to1, receive-error (ERI) interrupts requested when the ER flag in SCFSR is set to1, and break (BRI) interrupts requested when the BRK flag in SCFSR or the ORER flag in line status register (SCLSR) is set to1.

and

DR is set to 1 when SCFRDR contains less data than the specified receive trigger number, and the next data has not yet been received after the elapse of 15 ETU from the last stop bit.

So interrupt will be generated infinitely without reading bytes if numbers of received bytes less then "Receive FIFO Data Trigger". DR and DRF flag looks like interchangeable if "Receive FIFO Data Trigger" sets to zero. But this check is not correct in common case. I suppose this check is unnecessary at all because interrupt is mean that we have data for reading and real quantity of received bytes is read by sci_rxfill.

My test:

port_test1 read bytes (32 at once) on speed 115200

original code
Mem: 7860K used, 56700K free, 0K shrd, 0K buff, 0K cached
CPU: 9% usr 46% sys 0% nic 43% idle 0% io 0% irq 0% sirq
Load average: 0.54 0.15 0.05 1/38 590
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
195 2    root RW   0    0%   35% [kworker/0:1]
519 477  root S   528   1%   19% ./port_test1
508 495  root R   1284  2%    1% top

remove check and hardcoded 14 bytes fifo
Mem: 9040K used, 55520K free, 0K shrd, 0K buff, 0K cached
CPU: 6% usr 9% sys 0% nic 84% idle 0% io 0% irq 0% sirq
Load average: 0.20 0.07 0.03 1/38 638
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
195   2  root  SW   0    0%  3% [kworker/0:1]
583 473  root  S   528   1%  1% ./port_test1
541 504  root  R   1284  2%  1% top

PS: I don't find bugzilla or something similar.


Viewing all articles
Browse latest Browse all 1583

Latest Images

Trending Articles



Latest Images