On Wed, 24 Apr 2013, victor yeo wrote:
> 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?
Yes, it must.
> 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
This shows that kagen2_ep_queue() calls kareq->req.complete. Perhaps
indirectly, through another function. If this is true then it's
probably a bug. You should check it out.
On the other hand, it also shows that fsg_lun_open() calls
kagen2_ep_queue() -- again, perhaps indirectly. That isn't right.
So you may need to do more exploring. Add printk statements to a bunch
of places in the UDC driver so you can follow the flow of control.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html