Re: Linux USB file storage gadget with new UDC

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

 



Hi,

>> I change that in UDC driver queue function, adding in a length check:
>>
>>                         if (len > 0)
>>                         {
>>                                 ka_req->req.complete(&ka_ep->ep, &ka_req->req);
>>                                 list_del_init(&ka_req->queue);
>>                         }
>
> What is "len"?  Is it the packet size?  If it is then this check is
> wrong, because the UDC driver must accept zero-length packets.

Yes, it is packet size. So UDC driver must accept zero-length packets
sent from USB host?

> Just before the line that calls ka_req->req.complete, add:
>
>         WARN_ON(!victor_test);
>         victor_test = 0;
>
> Then you'll get a stack dump every time the completion routine is
> called without an interrupt occurring first.  The stack dump will help
> you to figure out why this is going wrong and where the problem is.

This is the stack dump when the completion routine is called without
an interrupt occurring first, is it useful?

Backtrace:
[<c020c0fc>] (dump_backtrace+0x0/0x110) from [<c03ef5e4>] (dump_stack+0x18/0x1c)
 r6:bf030da8 r5:c12aec00 r4:c12b4c00 r3:000000f8
[<c03ef5cc>] (dump_stack+0x0/0x1c) from [<bf02fecc>]
(kagen2_ep_queue+0x520/0x598 [kagen2_udc])
[<bf02f9ac>] (kagen2_ep_queue+0x0/0x598 [kagen2_udc]) from
[<bf036068>] (fsg_lun_open+0x578/0x1278 [g_file_storage])
[<bf035f20>] (fsg_lun_open+0x430/0x1278 [g_file_storage]) from
[<bf037cd4>] (fsg_main_thread+0x10c/0x155c [g_file_storage])
 r8:00000000 r7:00000001 r6:c12896c0 r5:c12896bc r4:c1289600
[<bf037bc8>] (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:c1327e00

> Here's an example.  This shows the port status immediately after the
> first port reset in the April 22 usbmon trace:
>
> f2f4f740 1985276053 S Ci:2:002:0 s a3 00 0000 0004 0004 4 <
> f2f4f740 1985276154 C Ci:2:002:0 0 4 = 03011000
>
> The 01 in the second byte of the response indicates full speed.  If
> the connection were high speed, the second byte would be 05.  See
> Section 11.24.2.7 in the USB-2.0 specification, and especially the
> description of bit 10 in Table 11-21 and 11.24.2.7.1.8.

Thanks, i found the bit 10 in Table 11-21 Port Status Field.

0 = Full-speed device attached to this port.
1 = High-speed device attached to this port.

victor
--
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