diff --git a/arch/arm/src/sama5/sam_udphs.c b/arch/arm/src/sama5/sam_udphs.c index 39f72d63ff..fde1365e8a 100644 --- a/arch/arm/src/sama5/sam_udphs.c +++ b/arch/arm/src/sama5/sam_udphs.c @@ -2395,8 +2395,9 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) * REVISIT: On the SAMV7, I found that you really need to * wait for the TX completion interrupt before calling * sam_req_write(). For the SAMV7, the logic here just - * enables that TX completion interrupt. The symptom of - * the problem was occassional missing zero-length packets. + * enables that TX completion interrupt if BYCT > 0. The + * symptom of the problem was occasional missing zero-length + * packets because sam_req_write() was called too soon. */ DEBUGASSERT(USB_ISEPIN(privep->ep.eplog)); diff --git a/arch/arm/src/samv7/sam_usbdevhs.c b/arch/arm/src/samv7/sam_usbdevhs.c index 90ead9c8a8..5328727062 100644 --- a/arch/arm/src/samv7/sam_usbdevhs.c +++ b/arch/arm/src/samv7/sam_usbdevhs.c @@ -2524,6 +2524,10 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) /* All bytes have been sent to the host. We must call * sam_req_write() now in the IDLE state with the number of * bytes transferred in 'inflight' + * + * REVISIT: Isn't there a race condition here? Could TXIN + * have fired just before calculating byct? Could TXIN be + * pending here? */ privep->epstate = USBHS_EPSTATE_IDLE;