Re: Problem of g_serial

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 16, 2010 at 10:52 PM, 王智 <coredump007@xxxxxxxxx> wrote:
> Hi all,
>    I met the crash this afternoon in 2.6.31.3 on JZ4750 when I tried
> to use lrz/sz to transfer files between board and PC by serial port .
> I had modified the code to use workqueue instead of tasklet in
> u_serial.c.It looks fine.This crash has not got fixed in 2.6.32. I
> have checked the newest code. It there any better way we can try to
> handle this issue?

Yes,I think using workqueue is a proper way to solve this problem.
Could you send a patch to this mailing list?

Cliff


> 2010/1/13 Cliff Cai <cliffcai.sh@xxxxxxxxx>:
>> On Tue, Jan 12, 2010 at 8:14 PM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
>>> On Tue, 12 Jan 2010 11:39:41 +0800
>>> Cliff Cai <cliffcai.sh@xxxxxxxxx> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Recently, I ran into a problem of running g_serial,that is kernel
>>>> crashes when running "cat myfile > /dev/ttyGS0"
>>>
>>> Which kernel, which architecture, what kind of crash, what diagnostics
>>> are displayed when it crashes ?
>>
>> Kernel:2.6.32,arch:Blackfin,see the crash information.
>> the test works fine with 2.6.28.
>> on 2.6.32,echoing character string to /dev/ttyGS0 works, I've tried to
>> echo out a 200 characters string.
>> and also catting a small file to /dev/ttyGS0  works.
>> but if cat a big file,it will cause the crash.
>>
>>>
>>>> When low_latency is disabled,tty_flip_buffer_push(tty) will hire a
>>>> work queue to push the buffer,obviously,this is a deferred job.
>>>> So, it's not proper  to wake up the read thread right after calling
>>>> tty_flip_buffer_push().I have few knowledge about tty stuff.
>>>> Does anyone here could give some hints on this problem?
>>>
>>> low_latency should only be set if
>>> - You are queuing data from a context that can sleep
>>> - Your queueing path can cope with callbacks into your transmit path
>>
>> g_serial calls tty_flip_buffer_push(tty) in a tasklet context,So
>> low_latency should not be set.
>> otherwise there will be a "scheduling while atomic" error.
>>
>> Cliff
>>
>> root:/> cat /etc/boa.conf > /dev/ttyGS0
>> NULL pointer access
>> Kernel OOPS in progress
>> Deferred Exception context
>> CURRENT PROCESS:
>> COMM=events/0 PID=5 CPU=0
>> invalid mm
>> return address: [0x02c2181a]; contents of:
>> 0x02c217f0:  0c00  1807  e14a  001f  e10a  62b0  9110  0040
>> 0x02c21800:  6c66  0127  0538  0010  3210  0578  0167  6fa6
>> 0x02c21810:  e512  0041  0037  61f8  0040 [9110] 0c00  181a
>> 0x02c21820:  304a  e120  0048  e14a  02c2  5001  e10a  0148
>>
>> ADSP-BF527-0.0 525(MHz CCLK) 131(MHz SCLK) (mpu off)
>> Linux version 2.6.32.3-ADI-2010R1-pre-svn8127 (cliff@debiancliff) (gcc
>> version 4.1.2 (ADI svn)) #1136 Wed Jan 13 23:24:33 CST0
>>
>> SEQUENCER STATUS:               Not tainted
>>  SEQSTAT: 00000027  IPEND: 8008  IMASK: 003f  SYSCFG: 0006
>>  Peripheral interrupts masked off
>>  Kernel interrupts masked off
>>  EXCAUSE   : 0x27
>>  physical IVG3 asserted : <0xffa00698> { _trap + 0x0 }
>>  physical IVG15 asserted : <0xffa00ec4> { _evt_system_call + 0x0 }
>>  logical irq   6 mapped  : <0xffa00334> { _bfin_coretmr_interrupt + 0x0 }
>>  logical irq  13 mapped  : <0x000a0c40> { _bfin_t350mcqb_irq_error + 0x0 }
>>  logical irq  15 mapped  : <0x00114150> { _err_handler + 0x0 }
>>  logical irq  21 mapped  : <0x000e6880> { _bfin_rtc_interrupt + 0x0 }
>>  logical irq  23 mapped  : <0x001133d4> { _rx_handler + 0x0 }
>>  logical irq  24 mapped  : <0x00113370> { _tx_handler + 0x0 }
>>  logical irq  27 mapped  : <0x000e909c> { _bfin_twi_interrupt_entry + 0x0 }
>>  logical irq  31 mapped  : <0x000ad7fc> { _bfin_serial_dma_rx_int + 0x0 }
>>  logical irq  32 mapped  : <0x000ade8c> { _bfin_serial_dma_tx_int + 0x0 }
>>  logical irq  35 mapped  : <0x000c9560> { _bfin_mac_interrupt + 0x0 }
>>  logical irq  59 mapped  : <0x000dfd20> { _blackfin_interrupt + 0x0 }
>>  RETE: <0x00000000> /* Maybe null pointer? */
>>  RETN: <0x02027e54> /* kernel dynamic memory (maybe user-space) */
>>  RETX: <0x00000480> /* Maybe fixed code section */
>>  RETS: <0x000a5520> { _process_echoes + 0x38 }
>>  PC  : <0x02c2181a> { :g_serial:_usb_gadget_get_string + 0x5f6 }
>> DCPLB_FAULT_ADDR: <0x00000000> /* Maybe null pointer? */
>> ICPLB_FAULT_ADDR: <0x02c2181a> { :g_serial:_usb_gadget_get_string + 0x5f6 }
>> PROCESSOR STATE:
>>  R0 : 0000003f    R1 : 0000ffc0    R2 : 00000000    R3 : 00000000
>>  R4 : 00000000    R5 : 00000000    R6 : 00000073    R7 : 0000ffff
>>  P0 : ffa008f0    P1 : 02bd5c00    P2 : 00000000    P3 : 02c26536
>>  P4 : 02bd5c00    P5 : 02bd5c00    FP : 02027e74    SP : 02027d78
>>  LB0: 0009544c    LT0: 0009544a    LC0: 00000000
>>  LB1: 00036356    LT1: 000362da    LC1: 0000000b
>>  B0 : 00000000    L0 : 00000000    M0 : ffffffac    I0 : 00000008
>>  B1 : 00000000    L1 : 00000000    M1 : 00000000    I1 : 02bd9940
>>  B2 : 00000000    L2 : 00000000    M2 : 00000000    I2 : 00000000
>>  B3 : 00000000    L3 : 00000000    M3 : 00000000    I3 : 00000000
>> A0.w: 00000008   A0.x: 00000000   A1.w: 00000008   A1.x: 00000000
>> USP : 00000000  ASTAT: 02003005
>>
>> Hardware Trace:
>>   0 Target : <0x00004f24> { _trap_c + 0x0 }
>>     Source : <0xffa0062c> { _exception_to_level5 + 0xa4 } CALL pcrel
>>   1 Target : <0xffa00588> { _exception_to_level5 + 0x0 }
>>     Source : <0xffa0043c> { _bfin_return_from_exception + 0x18 } RTX
>>   2 Target : <0xffa00424> { _bfin_return_from_exception + 0x0 }
>>     Source : <0xffa004e0> { _ex_trap_c + 0x74 } JUMP.S
>>   3 Target : <0xffa0046c> { _ex_trap_c + 0x0 }
>>     Source : <0xffa006f2> { _trap + 0x5a } JUMP (P4)
>>   4 Target : <0xffa00698> { _trap + 0x0 }
>>     Source : <0x02c21818> { :g_serial:_usb_gadget_get_string + 0x5f4 } STI R0
>>   5 Target : <0x02c21808> { :g_serial:_usb_gadget_get_string + 0x5e4 }
>>     Source : <0x000a726a> { _tty_write_room + 0xa } JUMP (P2)
>>   6 Target : <0x000a7260> { _tty_write_room + 0x0 }
>>     Source : <0x000a551c> { _process_echoes + 0x34 } CALL pcrel
>>   7 Target : <0x000a551a> { _process_echoes + 0x32 }
>>     Source : <0x00163e80> { _mutex_lock + 0x38 } RTS
>>   8 Target : <0x00163e54> { _mutex_lock + 0xc }
>>     Source : <0x00163676> { __cond_resched + 0x1a } RTS
>>   9 Target : <0x0016365c> { __cond_resched + 0x0 }
>>     Source : <0x00163e50> { _mutex_lock + 0x8 } CALL pcrel
>>  10 Target : <0x00163e48> { _mutex_lock + 0x0 }
>>     Source : <0x000a5516> { _process_echoes + 0x2e } CALL pcrel
>>  11 Target : <0x000a550e> { _process_echoes + 0x26 }
>>     Source : <0x00163e80> { _mutex_lock + 0x38 } RTS
>>  12 Target : <0x00163e54> { _mutex_lock + 0xc }
>>     Source : <0x00163676> { __cond_resched + 0x1a } RTS
>>  13 Target : <0x0016365c> { __cond_resched + 0x0 }
>>     Source : <0x00163e50> { _mutex_lock + 0x8 } CALL pcrel
>>  14 Target : <0x00163e48> { _mutex_lock + 0x0 }
>>     Source : <0x000a550a> { _process_echoes + 0x22 } CALL pcrel
>>  15 Target : <0x000a5502> { _process_echoes + 0x1a }
>>     Source : <0x000a54f6> { _process_echoes + 0xe } IF !CC JUMP
>> Kernel Stack
>> Stack info:
>>  SP: [0x02027dd8] <0x02027dd8> /* kernel dynamic memory (maybe user-space) */
>>  FP: (0x02027e3c)
>>  Memory from 0x02027dd0 to 02028000
>> 02027dd0: 00000000  00000000 [00000000] 00000000  00000000  00000000
>> 00000000  00000000
>> 02027df0: 00000000  ffffffac  00000000  00000000  02bd9940  00000008
>> 00000000  02027e74
>> 02027e10: 02bd5c00  02bd5c00  02c26536  00000000  02bd5c00  ffa008f0
>> 0000ffff  00000073
>> 02027e30: 00000000  00000000  00000000 (00000000)<0000ffc0> 0000003f
>> 0000003f  ffa008f0
>> 02027e50: 00000006  ffffffc0  00000000  02c26435 <000a5520> 000000b6
>> 0000000a  02c26535
>> 02027e70: 00000073  02c26435 <000a6590> 02bd5c00  0000000a  02c26536
>> 000000b6  00000073
>> 02027e90: 00000000  029357cf  0009544c  029357ce  0009544a  00000000
>> 00000000  00000008
>> 02027eb0: 00000000  00000008  00000000  00000000  00000000  00000000
>> 00000000  00000000
>> 02027ed0: 00000000  00000000  00000000  00000000  00000000  00000000
>> ffffffac  00000000
>> 02027ef0: 00000000  02bd7150  02c1ffed  00000000  02026000  02bd5c00
>> 02001a60  02c285e0
>> 02027f10: 000a6294  02001a60  02001a60  02c2691c  0000ffff  02026000
>> <000a8dba> 02bd5c00
>> 02027f30: 02001a60  02c285e0  02c2651c  0000ffff  00000000  00000000
>> 02c1ffed  00000000
>> 02027f50: 00000000  000000cf <0001e340> 02bd5ca4  02001a60  000a8cbc
>> 001f62b0  02027fa4
>> 02027f70: 02027fa4  00000000  00000000  00000000  00000000 <0001e822>
>> 02001a60  0001e7ac
>> 02027f90: 00000000  02001a68  0000ffff  02026000  02026000  00000000
>> 02018040  00021014
>> 02027fb0: 02027fb0  02027fb0 <00020e5e> 0201bf40  02001a60  00000000
>> 00000000  00020e04
>> 02027fd0: 00001490  00000000  00000000  02027fdc  02027fdc <00001496>
>> 00000000  00000000
>> 02027ff0: 00000000  00000000  ffffffff  00000006
>> Return addresses in stack:
>>   frame  1 : <0x0000ffc0> { _copy_mm + 0x1c }
>>    address : <0x000a5520> { _process_echoes + 0x38 }
>>    address : <0x000a6590> { _n_tty_receive_buf + 0x2fc }
>>    address : <0x000a8dba> { _flush_to_ldisc + 0xfe }
>>    address : <0x0001e340> { _run_workqueue + 0x6c }
>>    address : <0x0001e822> { _worker_thread + 0x76 }
>>    address : <0x00020e5e> { _kthread + 0x5a }
>>    address : <0x00001496> { _kernel_thread_helper + 0x6 }
>> Modules linked in: g_serial
>> Kernel panic - not syncing: Kernel exception
>> Hardware Trace:
>> Stack info:
>>  SP: [0x02027c90] <0x02027c90> /* kernel dynamic memory (maybe user-space) */
>>  FP: (0x02027d4c)
>>  Memory from 0x02027c90 to 02028000
>> 02027c90:[001a5bfc]<00011324> 02027d78  001a5bfc  001e84ce  001e84ce
>> 001e84ce  02027ccc
>> 02027cb0: 02027ccc <0000529a> 02027d78  ffe02014  02c26536  001a56cc
>> <0003185e> 0000003f
>> 02027cd0: ffffffff  00000100  02c26535  0003000b <00031a54> 001fb7b4
>> <00031ac8> 001ecdec
>> 02027cf0: 00000024  02026000  00000001  00000024  00000100  00000101
>> 00000004  00000100
>> 02027d10:<0001589c><0002ee0a> 0000000a  02c26533  0000ffff <000304dc>
>> 001f9330  02027e74
>> 02027d30:<ffa002ee> 001fd74c  02bd5c00  02c26535  00000006  00000000
>> 00000000 (00000000)
>> 02027d50:<00015cee><ffa00630> 001e5000  00008008  00000027  00000000
>> 00000000  0000003b
>> 02027d70:<ffa00b68> 00000480  00000480  00008008  00000027  00000000
>> 02027e54  00000480
>> 02027d90: 02c2181a <000a5520> 0000003f  02003005  00036356  0009544c
>> 000362da  0009544a
>> 02027db0: 0000000b  00000000  00000008  00000000  00000008  00000000
>> 00000000  00000000
>> 02027dd0: 00000000  00000000  00000000  00000000  00000000  00000000
>> 00000000  00000000
>> 02027df0: 00000000  ffffffac  00000000  00000000  02bd9940  00000008
>> 00000000  02027e74
>> 02027e10: 02bd5c00  02bd5c00  02c26536  00000000  02bd5c00  ffa008f0
>> 0000ffff  00000073
>> 02027e30: 00000000  00000000  00000000  00000000 <0000ffc0> 0000003f
>> 0000003f  ffa008f0
>> 02027e50: 00000006  ffffffc0  00000000  02c26435 <000a5520> 000000b6
>> 0000000a  02c26535
>> 02027e70: 00000073  02c26435 <000a6590> 02bd5c00  0000000a  02c26536
>> 000000b6  00000073
>> 02027e90: 00000000  029357cf  0009544c  029357ce  0009544a  00000000
>> 00000000  00000008
>> 02027eb0: 00000000  00000008  00000000  00000000  00000000  00000000
>> 00000000  00000000
>> 02027ed0: 00000000  00000000  00000000  00000000  00000000  00000000
>> ffffffac  00000000
>> 02027ef0: 00000000  02bd7150  02c1ffed  00000000  02026000  02bd5c00
>> 02001a60  02c285e0
>> 02027f10: 000a6294  02001a60  02001a60  02c2691c  0000ffff  02026000
>> <000a8dba> 02bd5c00
>> 02027f30: 02001a60  02c285e0  02c2651c  0000ffff  00000000  00000000
>> 02c1ffed  00000000
>> 02027f50: 00000000  000000cf <0001e340> 02bd5ca4  02001a60  000a8cbc
>> 001f62b0  02027fa4
>> 02027f70: 02027fa4  00000000  00000000  00000000  00000000 <0001e822>
>> 02001a60  0001e7ac
>> 02027f90: 00000000  02001a68  0000ffff  02026000  02026000  00000000
>> 02018040  00021014
>> 02027fb0: 02027fb0  02027fb0 <00020e5e> 0201bf40  02001a60  00000000
>> 00000000  00020e04
>> 02027fd0: 00001490  00000000  00000000  02027fdc  02027fdc <00001496>
>> 00000000  00000000
>> 02027ff0: 00000000  00000000  ffffffff  00000006
>> Return addresses in stack:
>>    address : <0x00011324> { _panic + 0x48 }
>>    address : <0x0000529a> { _trap_c + 0x376 }
>>    address : <0x0003185e> { _rcu_check_quiescent_state + 0xe }
>>    address : <0x00031a54> { ___rcu_process_callbacks + 0x38 }
>>    address : <0x00031ac8> { _rcu_process_callbacks + 0x2c }
>>    address : <0x0001589c> { ___do_softirq + 0x7c }
>>    address : <0x0002ee0a> { _handle_IRQ_event + 0x3e }
>>    address : <0x000304dc> { _handle_simple_irq + 0x68 }
>>    address : <0xffa002ee> { _asm_do_IRQ + 0x36 }
>>   frame  1 : <0x00015cee> { _irq_enter + 0xa }
>>    address : <0xffa00630> { _exception_to_level5 + 0xa8 }
>>    address : <0xffa00b68> { __common_int_entry + 0x64 }
>>    address : <0x000a5520> { _process_echoes + 0x38 }
>>    address : <0x0000ffc0> { _copy_mm + 0x1c }
>>    address : <0x000a5520> { _process_echoes + 0x38 }
>>    address : <0x000a6590> { _n_tty_receive_buf + 0x2fc }
>>    address : <0x000a8dba> { _flush_to_ldisc + 0xfe }
>>    address : <0x0001e340> { _run_workqueue + 0x6c }
>>    address : <0x0001e822> { _worker_thread + 0x76 }
>>    address : <0x00020e5e> { _kthread + 0x5a }
>>    address : <0x00001496> { _kernel_thread_helper + 0x6 }
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux