Hi, >> > you should an interrupt handler to handle interrupts from your device. >> > Also, there are way too many mistakes on your driver, run checkpatch.pl, >> > compile it with sparse, don't hardcode addresses, don't reimplement a >> > bunch of infrastructure the kernel already gives you and check your >> > list_head usage! >> >> I have run checkpatch.pl and read the linux/usb/gadget.h. The Soc >> interrupt controller has problem, so i use a kernel thread to read >> from USB controller directly. >> >> > don't reimplement a bunch of infrastructure the kernel already gives you >> i don't understand this. please kindly show an example. > > #define IO_OFFSET 0x55000000 > #define __IO_ADDRESS(x) ((x) + IO_OFFSET) > > #define IO_ADDRESS(pa) IOMEM(__IO_ADDRESS(pa)) > > #ifdef IOMEM // Override asm/io.h > #undef IOMEM > #endif // IOMEM > #ifdef __ASSEMBLER__ > #define IOMEM(x) x > #else > #define IOMEM(x) ((void __force __iomem *)(x)) > #endif > > none of this should be in the driver. this can be removed. >> > Also, you shouldn't requeue the request yourself, gadget driver owns the >> > request. >> which request do i requeue? please kindly point that out. Thanks! > > look at your code. Look what you do after you call complete. is it this code? i will remove the redundant code after complete. ka_ep_p->req.complete(&ka_ep_p->ep, &req->req); if (num == 0) { ka_ep_p->req.length = 0; usb_ep_queue(&ka_ep_p->ep, &req->req, 0); ka_ep_p->desc = &ep0_in_desc; } i read the net2272.c, the net2272_enable() is called by gadget driver enable_endpoint(). When i run the gadget driver, enable_endpoint() is called for fsg->bulk_in and fsg->bulk_out. The enable_endpoint() of fsg->intr_in is not called because transport_is_cbi() is false. So how can the endpoint 0 be enabled? thanks, 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