Re: Linux USB file storage gadget with new UDC

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

 



Hi,

>> Another question from the bulk_out_complete() printout which is shown
>> below. The req->actual is 512 byte. The bh->bulk_out_intended_length
>> is 31. Is this a bug?
>>
>> g_file_storage gadget: get_next_command
>> [start_transfer] 6f007442 7000
>> ept1 out queue len 0x200, buffer 0xc1330000
>> kagen2_ep_queue 512 512 512
>> g_file_storage gadget: bulk_out_complete --> 0, 512/31
>> .....
>
> Well, it's a mistake.  It might be a bug.
>
> If the host really did send a 13-byte packet then it's definitely a
> bug.  But if the host sent a 512-byte packet then something else is
> wrong; it would mean the gadget was expecting a CBW packet but the host
> sent something else.
>
> Alan Stern

When copying a file to the USB gadget, sometimes the USB gadget will
hang, sometimes the USB gadget will crash, sometimes the copy is ok.

>From the UDC driver log, when the USB gadget crashes, the host is
sending 16384 bytes of data. It seems that bulk_out_complete() is not
able to handle it.

[<c03282ec>] (dev_printk+0x0/0x3c) from [<bf035924>]
(bulk_out_complete+0xc4/0x1a8 [g_file_storage])
 r3:152a0e00 r2:a020d0e5
[<bf02fac4>] (kagen2_ep_queue+0x0/0x680 [kagen2_udc]) from
[<bf035f9c>] (bulk_in_complete+0x24c/0x1010 [g_file_storage])

The meaning of printk of "kagen2_ep_queue 512 16384 512" in UDC driver log:
ka_req->req.actual is 512
ka_req->req.length is 16384
length from hardware FIFO is 512

Please see the attached UDC driver log and corresponding usbmon trace.

Thanks,
victor
bulk_in_complete --> 0, 512/512
bulk_in_complete --> 0, 13/13
kagen2_ep_queue 31 512 31
bulk_in_complete --> 0, 512/512
bulk_in_complete --> 0, 13/13
kagen2_ep_queue 31 512 31
EP1 OUT IRQ 0x28
ep1_out: RX DMA done : NULL REQ on OUT EP-1
bulk_in_complete --> 0, 512/512
bulk_in_complete --> 0, 13/13
kagen2_ep_queue 31 512 31
EP1 OUT IRQ 0x28
ep1_out: RX DMA done : NULL REQ on OUT EP-1
kagen2_ep_queue 512 16384 512
kagen2_ep_queue 1024 16384 512
kagen2_ep_queue 1536 16384 512
kagen2_ep_queue 2048 16384 512
kagen2_ep_queue 2560 16384 512
kagen2_ep_queue 3072 16384 512
kagen2_ep_queue 3584 16384 512
kagen2_ep_queue 4096 16384 512
kagen2_ep_queue 4608 16384 512
kagen2_ep_queue 5120 16384 512
kagen2_ep_queue 5632 16384 512
kagen2_ep_queue 6144 16384 512
kagen2_ep_queue 6656 16384 512
kagen2_ep_queue 7168 16384 512
kagen2_ep_queue 7680 16384 512
kagen2_ep_queue 8192 16384 512
kagen2_ep_queue 8704 16384 512
kagen2_ep_queue 9216 16384 512
kagen2_ep_queue 9728 16384 512
kagen2_ep_queue 10240 16384 512
kagen2_ep_queue 10752 16384 512
kagen2_ep_queue 11264 16384 512
kagen2_ep_queue 11776 16384 512
kagen2_ep_queue 12288 16384 512
kagen2_ep_queue 12800 16384 512
kagen2_ep_queue 13312 16384 512
kagen2_ep_queue 13824 16384 512
kagen2_ep_queue 14336 16384 512
kagen2_ep_queue 14848 16384 512
kagen2_ep_queue 15360 16384 512
kagen2_ep_queue 15872 16384 512
kagen2_ep_queue 16384 16384 512
Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = c0204000
[00000004] *pgd=00000000
Internal error: Oops - BUG: 17 [#1] PREEMPT ARM
Modules linked in: g_file_storage kagen2_udc ath6kl_sdio ath6kl_core ka2000_sdio ka2000_sdhc
CPU: 0    Not tainted  (3.4.4+ #43)
PC is at dev_driver_string+0x30/0x44
LR is at __dev_printk+0x38/0x68
pc : [<c0327ef8>]    lr : [<c03280c4>]    psr: 20000093
sp : c1333c08  ip : c1333c18  fp : c1333c14
r10: c0c38000  r9 : c12a0e34  r8 : 00000001
r7 : c1289600  r6 : c129ec00  r5 : c1333c44  r4 : c129edd0
r3 : 00000004  r2 : c1333c44  r1 : c129ec00  r0 : c129ec00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005717f  Table: 01308000  DAC: 00000017
Process file-storage-ga (pid: 123, stack limit = 0xc1332270)
Stack: (0xc1333c08 to 0xc1334000)
3c00:                   c1333c3c c1333c18 c03280c4 c0327ed8 c0208eb8 c0208564
3c20: c129edd0 c12a0e00 c12896bc 00000200 c1333c5c c1333c40 c0328320 c032809c
3c40: 00000001 a020d0e5 c1333c4c c1333c64 c1333eb4 c1333c68 bf035924 c0328300
3c60: a020d0e5 152a0e00 152a0e00 c1333c78 00000000 00000000 0000000a 60000013
3c80: c0c38000 c12a0e34 20313320 34660a3e 32613231 32203034 32323434 31363639
3ca0: 20532033 323a6942 3435303a 2d20313a 20353131 36393034 660a3c20 61323134
3cc0: 20303432 32343432 37313435 43203534 3a694220 35303a32 20313a34 30342030
3ce0: 3d203639 30303020 30303030 30302030 30303030 30203030 30303030 20303030
3d00: 30303030 30303030 30303020 30303030 30302030 30303030 30203030 30303030
3d20: 20303030 30303030 30303030 6166640a 34313936 34322030 34353234 34323831
3d40: 42205320 3a323a69 3a343530 312d2031 31203531 0a3c2033 36616664 30343139
3d60: 34343220 38343532 20323934 69422043 303a323a 313a3435 31203020 203d2033
3d80: 33353535 33353234 30613520 30303030 30302030 30303030 30203030 66640a30
3da0: 31393661 32203034 35323434 38353834 20532037 323a6f42 3435303a 2d20313a
3dc0: 20353131 3d203133 35353520 34323433 62352033 30303030 30203030 30303130
3de0: 20303030 30303038 38326130 30303020 30303030 30382033 30303030 30203830
3e00: 30303030 20303030 30303030 640a3030 39366166 20303431 32343432 37383435
3e20: 43203932 3a6f4220 35303a32 20313a34 31332030 660a3e20 61323134 20303432
3e40: 32343432 37383435 53203833 3a694220 35303a32 20313a34 3531312d 39303420
3e60: 0a3c2036 32313466 30343261 34343220 36393732 20393638 69422043 303a323a
3e80: 313a3435 34203020 c03ef7b0 c12a0e00 c129edd0 c1289600 c12896d8 c12896c0
3ea0: 00002a00 c1332018 c1333eec c1333eb8 bf035f9c bf02fad4 bf036b14 bf035e5c
3ec0: 60000013 ffffffff c1333ef0 c12896bc 00000000 c1289700 c1289600 00009c00
3ee0: c1333f54 c1333ef0 bf036b14 bf035e64 c12896c0 0000000a c1333f04 0000000a
3f00: 00000001 00006a00 00002a00 00000001 00009c00 00000000 00005c00 00000000
3f20: 00000001 00000035 c12896bc c1289600 00000000 00000001 00000035 c12896bc
3f40: 00000000 c1332018 c1333fbc c1333f58 bf038ce8 bf0368d8 bf03a316 bf03a26f
3f60: 00000015 c127e180 c1333f8c c1333f78 c02349c8 c1289604 c13207e0 c1320540
3f80: c1333fac c1333f90 c03f2fc0 c02365d0 c1337e00 c1337e00 c1289600 bf037bc0
3fa0: 00000013 00000000 00000000 00000000 c1333ff4 c1333fc0 c022f8f4 bf037bd0
3fc0: c1337e00 00000000 c1289600 00000000 c1333fd0 c1333fd0 00000000 c1337e00
3fe0: c022f860 c02191c8 00000000 c1333ff8 c02191c8 c022f870 e3550000 1afffff8
Backtrace: 
[<c0327ec8>] (dev_driver_string+0x0/0x44) from [<c03280c4>] (__dev_printk+0x38/0x68)
[<c032808c>] (__dev_printk+0x0/0x68) from [<c0328320>] (dev_printk+0x34/0x3c)
 r6:00000200 r5:c12896bc r4:c12a0e00
[<c03282ec>] (dev_printk+0x0/0x3c) from [<bf035924>] (bulk_out_complete+0xc4/0x1a8 [g_file_storage])
 r3:152a0e00 r2:a020d0e5
[<bf02fac4>] (kagen2_ep_queue+0x0/0x680 [kagen2_udc]) from [<bf035f9c>] (bulk_in_complete+0x24c/0x1010 [g_file_storage])
[<bf035e54>] (bulk_in_complete+0x104/0x1010 [g_file_storage]) from [<bf036b14>] (bulk_in_complete+0xdc4/0x1010 [g_file_storage])
 r8:00009c00 r7:c1289600 r6:c1289700 r5:00000000 r4:c12896bc
[<bf0368c8>] (bulk_in_complete+0xb78/0x1010 [g_file_storage]) from [<bf038ce8>] (fsg_main_thread+0x1128/0x155c [g_file_storage])
[<bf037bc0>] (fsg_main_thread+0x0/0x155c [g_file_storage]) from [<c022f8f4>] (kthread+0x94/0xa0)
[<c022f860>] (kthread+0x0/0xa0) from [<c02191c8>] (do_exit+0x0/0x6f0)
 r6:c02191c8 r5:c022f860 r4:c1337e00
Code: 1a000002 e59030bc e3530000 0a000001 (e5930000)

Attachment: scsi_write_10_again07.log
Description: Binary data


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

  Powered by Linux