There was a bug where we unmap the PCI DMA mapping and then sync the
data afterwards. This reverses the ordering as well as insures we don't
unmap the region more than once.

JE

--- linux-2.4.18-pre9.orig/drivers/usb/uhci.c   Tue Feb 19 22:08:22 2002
+++ linux-2.4.18-pre9/drivers/usb/uhci.c        Tue Feb 19 22:10:21 2002
@@ -715,14 +715,18 @@
                uhci_free_td(uhci, td);
        }
 
-       if (urbp->setup_packet_dma_handle)
+       if (urbp->setup_packet_dma_handle) {
                pci_unmap_single(uhci->dev, urbp->setup_packet_dma_handle,
                        sizeof(devrequest), PCI_DMA_TODEVICE);
+               urbp->setup_packet_dma_handle = 0;
+       }
 
-       if (urbp->transfer_buffer_dma_handle)
+       if (urbp->transfer_buffer_dma_handle) {
                pci_unmap_single(uhci->dev, urbp->transfer_buffer_dma_handle,
                        urb->transfer_buffer_length, usb_pipein(urb->pipe) ?
                        PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
+               urbp->transfer_buffer_dma_handle = 0;
+       }
 
        urb->hcpriv = NULL;
        kmem_cache_free(uhci_up_cachep, urbp);
@@ -2280,14 +2284,6 @@
                is_ring = (nurb == urb);
        }
 
-       status = urbp->status;
-       if (!resubmit_interrupt || killed)
-               /* We don't need urb_priv anymore */
-               uhci_destroy_urb_priv(urb);
-
-       if (!killed)
-               urb->status = status;
-
        if (urbp->transfer_buffer_dma_handle)
                pci_dma_sync_single(uhci->dev, urbp->transfer_buffer_dma_handle,
                        urb->transfer_buffer_length, usb_pipein(urb->pipe) ?
@@ -2296,6 +2292,14 @@
        if (urbp->setup_packet_dma_handle)
                pci_dma_sync_single(uhci->dev, urbp->setup_packet_dma_handle,
                        sizeof(devrequest), PCI_DMA_TODEVICE);
+
+       status = urbp->status;
+       if (!resubmit_interrupt || killed)
+               /* We don't need urb_priv anymore */
+               uhci_destroy_urb_priv(urb);
+
+       if (!killed)
+               urb->status = status;
 
        urb->dev = NULL;
        if (urb->complete) {

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to