From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Thu, 12 Aug 2010 14:33:12 +0200 Subject: [U-Boot] [PATCH] USB-CDC: called handle_interrupts inside usb_eth_send In-Reply-To: References: <1281562824-6471-1-git-send-email-sbabic@denx.de> <4C63B46D.1080000@denx.de> Message-ID: <4C63EA08.6010204@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Remy Bohmer wrote: > Looking at this I agree that this packet_sent flag should be reset on > every usb_eth_send(). Ok >> Should I protect the line with some AT91 CONFIG or am I missing something ? > > No, it should be AT91 specific... > > Looking at the flow on at91 we see that this happens: > ether.c:usb_eth_send() > gadget.h:usb_ep_queue() > at91_udc.c:at91_ep_queue() > at91_udc.c:write_fifo() > at91_udc.c:done() > req->req.complete() > tx_complete() > packet_send = 1 > Ok, understood. > The packet is transmitted in the context of the usb_ep_queue() > routine, not in the context of the interrupt handler. > So, the timeout should incorporate usb_ep_queue also. > > I think this is better: > ts = get_timer(0); > packet_sent=0; > retval = usb_ep_queue (dev->in_ep, req, GFP_ATOMIC); > > compared to: > ts = get_timer(0); > packet_sent=0; > while(!packet_sent) > Yes, agree, it should be enough to call usb_ep_queue after clearing the flag as you suggest. > But I must mention that I have not yet tested it though... It does not matter. I will repost the whole patch series with the comments we get up now. After that we can do some more tests to check if I break something... Best regards, Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================