]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
musb-new, dfu: first send request answer then call completions
authorHeiko Schocher <hs@denx.de>
Thu, 10 Apr 2014 05:08:05 +0000 (07:08 +0200)
committerLukasz Majewski <l.majewski@samsung.com>
Thu, 8 May 2014 08:38:30 +0000 (10:38 +0200)
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.

Change-Id: Ib2941119c72761e48e15fedbdad1ecce07ae0b3d
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
drivers/usb/musb-new/musb_gadget_ep0.c

index 6599d386dc5538ae5551ee1a2e026c6302ea732c..8c3b0a145a4dcb126107cf20e305ecd23fdc74ef 100644 (file)
@@ -576,6 +576,10 @@ static void ep0_txstate(struct musb *musb)
        } else
                request = NULL;
 
+       /* send it out, triggering a "txpktrdy cleared" irq */
+       musb_ep_select(musb->mregs, 0);
+       musb_writew(regs, MUSB_CSR0, csr);
+
        /* report completions as soon as the fifo's loaded; there's no
         * win in waiting till this last packet gets acked.  (other than
         * very precise fault reporting, needed by USB TMC; possible with
@@ -588,10 +592,6 @@ static void ep0_txstate(struct musb *musb)
                        return;
                musb->ackpend = 0;
        }
-
-       /* send it out, triggering a "txpktrdy cleared" irq */
-       musb_ep_select(musb->mregs, 0);
-       musb_writew(regs, MUSB_CSR0, csr);
 }
 
 /*