From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] USB-CDC: called handle_interrupts inside usb_eth_send
Date: Thu, 12 Aug 2010 14:33:12 +0200 [thread overview]
Message-ID: <4C63EA08.6010204@denx.de> (raw)
In-Reply-To: <AANLkTik+48Jgk9zJpjriv2h2Zh62egKKMR8pgVPR-Lzs@mail.gmail.com>
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
=====================================================================
prev parent reply other threads:[~2010-08-12 12:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-11 21:40 [U-Boot] [PATCH] USB-CDC: called handle_interrupts inside usb_eth_send Stefano Babic
2010-08-11 22:28 ` Remy Bohmer
2010-08-12 8:44 ` Stefano Babic
2010-08-12 9:52 ` Remy Bohmer
2010-08-12 12:33 ` Stefano Babic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C63EA08.6010204@denx.de \
--to=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox