Once more, with patch!  :)

David Brownell wrote:
> The patch is a small resync against the 2.5 code, which:
> 
> - fixes an oops-on-unplug for usb 2.0 hubs
> - makes the hub driver pass the right polling interval
> - merges some comment updates (some FIXMEs are gone)
> - gets rid of a duplicated error check
> 
> There are still driver features that are 2.5-only, this
> is just to fix the oops and removes needless differences.
> I think there are some PCI level issues that interfere
> with the VIA EHCI support, unfortunately.
> 
> Please merge this into Marcelo's 2.4.19 final release.
> Thanks in advance!
> 
> - Dave
> 
--- ./drivers/usb-dist/hub.c    Wed May 29 08:11:47 2002
+++ ./drivers/usb/hub.c Tue Jul  2 11:00:41 2002
@@ -287,8 +287,11 @@
                return -1;
        }
 
-       FILL_INT_URB(hub->urb, dev, pipe, hub->buffer, maxp, hub_irq,
-               hub, endpoint->bInterval);
+       FILL_INT_URB(hub->urb, dev, pipe, hub->buffer, maxp, hub_irq, hub,
+               /* NOTE:  in 2.5 fill_int_urb() converts the encoding */
+               (dev->speed == USB_SPEED_HIGH)
+                       ? 1 << (endpoint->bInterval - 1)
+                       : endpoint->bInterval);
        ret = usb_submit_urb(hub->urb);
        if (ret) {
                err("usb_submit_urb failed (%d)", ret);
--- ./drivers/usb-dist/hcd/ehci-hcd.c   Wed May 29 08:12:14 2002
+++ ./drivers/usb/hcd/ehci-hcd.c        Tue Jul  2 11:00:41 2002
@@ -434,10 +434,6 @@
        scan_async (ehci);
        if (ehci->next_uframe != -1)
                scan_periodic (ehci);
-
-       // FIXME:  when nothing is connected to the root hub,
-       // turn off the RUN bit so the host can enter C3 "sleep" power
-       // saving mode; make root hub code scan memory less often.
 }
 
 /*-------------------------------------------------------------------------*/
@@ -582,7 +578,10 @@
                return 0;
 
        case PIPE_INTERRUPT:
-               intr_deschedule (ehci, urb->start_frame, qh, urb->interval);
+               intr_deschedule (ehci, urb->start_frame, qh,
+                       (urb->dev->speed == USB_SPEED_HIGH)
+                           ? urb->interval
+                           : (urb->interval << 3));
                if (ehci->hcd.state == USB_STATE_HALT)
                        urb->status = -ESHUTDOWN;
                qh_completions (ehci, qh, 1);
--- ./drivers/usb-dist/hcd/ehci-q.c     Wed May 29 08:12:14 2002
+++ ./drivers/usb/hcd/ehci-q.c  Tue Jul  2 11:00:41 2002
@@ -817,9 +817,9 @@
                } else {
                        // dbg_qh ("empty qh", ehci, qh);
 
-// FIXME:  how handle usb_clear_halt() for an EP with queued URBs?
-// usbcore may not let us handle that cleanly...
-// likely must cancel them all first!
+                       /* NOTE: we already canceled any queued URBs
+                        * when the endpoint halted.
+                        */
 
                        /* usb_clear_halt() means qh data toggle gets reset */
                        if (usb_pipebulk (urb->pipe)
--- ./drivers/usb-dist/hcd/ehci-sched.c Wed May 29 08:12:14 2002
+++ ./drivers/usb/hcd/ehci-sched.c      Tue Jul  2 11:00:41 2002
@@ -919,17 +919,9 @@
                return flags;
 
        /*
-        * For now, always give the urb back to the driver ... expect it
-        * to submit a new urb (or resubmit this), and to have another
-        * already queued when un-interrupted transfers are needed.
-        * No, that's not what OHCI or UHCI are now doing.
-        *
-        * FIXME Revisit the ISO URB model.  It's cleaner not to have all
-        * the special case magic, but it'd be faster to reuse existing
-        * ITD/DMA setup and schedule state.  Easy to dma_sync/complete(),
-        * then either reschedule or, if unlinking, free and giveback().
-        * But we can't overcommit like the full and low speed HCs do, and
-        * there's no clean way to report an error when rescheduling...
+        * Always give the urb back to the driver ... expect it to submit
+        * a new urb (or resubmit this), and to have another already queued
+        * when un-interrupted transfers are needed.
         *
         * NOTE that for now we don't accelerate ISO unlinks; they just
         * happen according to the current schedule.  Means a delay of
@@ -964,15 +956,6 @@
        if (urb->iso_frame_desc [0].offset != 0)
                return -EINVAL;
        
-       /*
-        * NOTE doing this for now, anticipating periodic URB models
-        * get updated to be "explicit resubmit".
-        */
-       if (urb->next) {
-               dbg ("use explicit resubmit for ISO");
-               return -EINVAL;
-       }
-
        /* allocate ITDs w/o locking anything */
        status = itd_urb_transaction (ehci, urb, mem_flags);
        if (status < 0)

Reply via email to