Re: [PATCH 1/2] musb: sanitize clearing TXCSR DMA bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

David Brownell wrote:

@@ -165,9 +165,19 @@ static void nuke(struct musb_ep *ep, con
     if (is_dma_capable() && ep->dma) {
             struct dma_controller   *c = ep->musb->dma_controller;
             int value;
+
             if (ep->is_in) {
+                     u16 txcsr = musb_readw(epio, MUSB_TXCSR);

this looks unnecessary, in the end you just wanna keep FLUSHFIFO set
so...

Besides, FIFO flsuhing doesn;t look sane too. The programming guide has that you need to set TxPktRdy along with FlushFIFO (otherwise the effect of the latter is unspecifiedm IIRC).

+
+                     /*
+                      * The programming guide says that we must not clear
+                      * the DMAReqMode bit before DMAReqEnab, so we only
+                      * clear it in the second write...
+                      */
+                     txcsr &= MUSB_TXCSR_DMAMODE;
+
                     musb_writew(epio, MUSB_TXCSR,
-                                     0 | MUSB_TXCSR_FLUSHFIFO);
+                                 txcsr | MUSB_TXCSR_FLUSHFIFO);

musb_writew(epio, MUSB_TXCSR,
       0 | MUSB_TXCSR_DMAMODE | MUSB_TXCSR_FLUSHFIFO);
musb_writew(epio, MUSB_TXCSR, 0 | MUSB_TXCSR_FLUSHFIFO);

should do it.

Will we be seeing an updated patch?

   Perhaps... our office has been moved, and I wasn't able to send mail before.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux