From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 10 Apr 2014 09:50:55 +0200 Subject: [U-Boot] [PATCH 1/2] musb-new, dfu: first send request answer then call completions In-Reply-To: <1397106486-1233-1-git-send-email-hs@denx.de> References: <1397106486-1233-1-git-send-email-hs@denx.de> Message-ID: <201404100950.55501.marex@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 On Thursday, April 10, 2014 at 07:08:05 AM, Heiko Schocher wrote: > comment in ep0_txstate() states: > > "report completions as soon as the fifo's loaded; there's no win > in waiting till this last packet gets acked". > > This is wrong for using dfu. In the dfu usecase we must send > a PollTimeout to the host, so the host can wait until the > U-Boot Code is ready for answering new usb requests. So the > answer which contains the PollTimeout must send *before* > U-Boot calls req->complete. > > The req->complete is used in the dfu case for flushing the > medium, when entering DFU_STATE_dfuMANIFEST_SYNC state. > > Signed-off-by: Heiko Schocher > Cc: Lukasz Majewski > Cc: Kyungmin Park > Cc: Marek Vasut > Cc: Pantelis Antoniou To me, this looks OK, yes. We need to "commit" the packet into the hardware before calling ->complete. Acked-by: Marek Vasut Best regards, Marek Vasut