[#4455] serial port transfer big file from host to target would have more lines

Document created by Aaronwu Employee on Aug 29, 2013
Version 1Show Document
  • View in full screen mode

[#4455] serial port transfer big file from host to target would have more lines

Submitted By: Mingquan Pan

Open Date

2008-10-07 05:57:48     Close Date

2008-10-22 06:09:51

Priority:

Medium     Assignee:

Sonic Zhang

Status:

Closed     Fixed In Release:

N/A

Found In Release:

N/A     Release:

Category:

N/A     Board:

N/A

Processor:

N/A     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

Sep 23 trunk toolchain

App binary format:

N/A     

Summary: serial port transfer big file from host to target would have more lines

Details:

 

serial port transfer big file from host to target would have more lines than the original file. It can be seen both on uart0 and uart1.

 

## Starting application at 0x001882a8 ...

Linux version 2.6.26.5-ADI-2009R1-pre-svn5384 (test@my-local-machine) (gcc version 4.1.2 (ADI svn)) #5 Tue Oct 7 12:02:24 CST 2008

console [early_BFuart0] enabled

early printk enabled on early_BFuart0

Warning: limiting memory to 56MB due to hardware anomaly 05000263

Board Memory: 64MB

Kernel Managed Memory: 64MB

...

 

root:/> catPHY: 0:01 - Link is Up - 100/Full

/proc/kallsyms > ccc

root:/> stty -F /dev/ttyBF1 ispeed 57600 ospeed 57600 -icrnl igncr

root:/> cat /dev/ttyBF1 > aaa

spawn /bin/sh

uclinux50-bf537-stamp-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/serial> rcp root@10.100.4.50:/ccc .

uclinux50-bf537-stamp-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/serial> stty -F /dev/ttyUSB0 ispeed 57600 ospeed 57600

uclinux50-bf537-stamp-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/serial>  cat ccc > /dev/ttyUSB0

uclinux50-bf537-stamp-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/serial>

Still wait.

 

^C

root:/>

root:/> diff -u ccc aaa

--- ccc Thu Jan  1 02:31:46 1970

+++ aaa Thu Jan  1 02:32:50 1970

@@ -6182,6 +6182,137 @@

000e20d4 t _tcp_fast_parse_options

000e2174 T _tcp_cwnd_application_limited

000e2200 T _tcp_enter_frto

+000e_send_pkt

+000d6aec T _ip_getsockopt

+000d6f0c T _ip_ra_control

+000d7014 T _ip_setsockopt

+000d7910 T _ip_cmsg_send

+000d79d4 T _ip_cmsg_recv

+000d7b08 T _ip_recv_error

+000d7c80 T _ip_local_error

+000d7de4 T _ip_icmp_error

+000d7f04 T _inet_bind_hash

+000d7f2c T ___inet_hash_nolisten

+000d8024 T _inet_listen_wlock

+000d809c T _inet_unhash

+000d8130 T _inet_hash

+000d81f8 T _inet_bind_bucket_destroy

+000d8220 T _inet_put_port

+000d8260 T _inet_bind_bucket_create

+000d82a8 T ___inet_hash_connect

+000d8478 T _inet_hash_connect

+000d84b8 T ___inet_lookup_listener

+000d858c T ___inet_inherit_port

+000d85b4 T ___inet_lookup_established

+000d8718 t ___inet_check_established

+000d8930 T _inet_twsk_schedule

+000d8abc T _inet_twsk_alloc

+000d8bb0 T _inet_twsk_put

+000d8c80 t ___inet_twsk_kill

+000d8cdc T _inet_twdr_twcal_tick

+000d8ddc t _inet_twdr_do_twkill_work

+000d8e5c T _inet_twdr_twkill_work

+000d8ee8 T _inet_twdr_hangman

+000d8f84 T ___inet_twsk_hashdance

+000d905c T _inet_twsk_deschedule

+000d90c4 T _inet_csk_addr2sockaddr

+000d90dc T _inet_get_local_port_range

+000d9114 T _inet_csk_destroy_sock

+000d929c T _inet_csk_reset_keepalive_timer

+000d92b8 T _inet_csk_delete_keepalive_timer

+000d92c4 T _inet_csk_listen_stop

+000d9400 T _inet_csk_route_req

+000d94e4 T _inet_csk_accept

+000d96cc T _inet_csk_clear_xmit_timers

+000d970c T _inet_csk_reqsk_queue_hash_add

+000d97d0 T _inet_csk_reqsk_queue_prune

+000d9970 T _inet_csk_clone

+000d99d0 T _inet_csk_listen_start

+000d9a74 T _inet_csk_get_port

+000d9c64 T _inet_csk_search_req

+000d9d50 T _inet_csk_bind_conflict

+000d9e04 T _inet_csk_init_xmit_timers

+000d9e54 T _tcp_enter_memory_pressure

+000d9e94 T _tcp_get_info

+000da048 T _tcp_getsockopt

+000da2e4 t _tcp_prequeue_process

+000da350 T _tcp_set_state

+000da454 T _tcp_done

+000da4c4 t _tcp_close_state

+000da4fc T _tcp_shutdown

+000da53c T _tcp_cleanup_rbuf

+000da654 T _tcp_read_sock

+000da7c4 T _sk_stream_alloc_skb

+000da88c t _tcp_splice_data_recv

+000da8b0 T _tcp_setsockopt

+000dac3c T _tcp_poll

+000dadb4 T _tcp_tso_segment

+000db018 T _tcp_ioctl

+000db15c T _tcp_splice_read

+000db314 T _tcp_sendpage

+000db88c T _tcp_sendmsg

+000dc214 T _tcp_recvmsg

+000dc87c T _tcp_close

+000dcbf8 T _tcp_disconnect

+000dcec0 t _tcp_incr_quickack

+000dcef8 T _tcp_enter_quickack_mode

+000dcf18 t _tcp_init_buffer_space

+000dd07c T _tcp_initialize_rcv_mss

+000dd0ac t _tcp_rcv_rtt_update

+000dd0dc T _tcp_rcv_space_adjust

+000dd1cc t _tcp_rto_min

+000dd1f4 t _tcp_rtt_estimator

...

+000e2174 T _tcp_cwnd_application_limited

+000e2200 T _tcp_enter_frto

000e23d8 T _tcp_use_frto

000e2484 T _tcp_rcv_state_process

000e2d94 T _tcp_rcv_established

 

Follow-ups

 

--- Sonic Zhang                                              2008-10-14 01:55:02

Duplicated bug of [#4459]

 

--- Mingquan Pan                                             2008-10-15 02:20:52

It should be different with [#4459], and it still exists on trunk head.

 

--- Sonic Zhang                                              2008-10-17 02:09:17

This bug is finally root caused.

2d dma is used in serial driver. The dma register curr_x_count and curr_y_count

can't be read as an atomic operation. curr_y_count is read before curr_x_count.

When curr_x_count is read, curr_y_count may move to next line. But, the position

calculated still indicate a byte in the original line and may be smaller than

the buffer tail in the same line. This cause garbages are received from buffer

tail loop to the wrong position in the ring.

 

New solution is to ignore this case in dma rx handler. Applied to 2008R1 branch

and trunk.

 

--- Mingquan Pan                                             2008-10-22 06:09:51

Yes, this bug is not shown these days. Close.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes