Hi,
This makes the hcds stop expecting urb->next to exist.
ehci-hcd ... remove obsolete sanity check
usb-uhci-hcd ... remove code (wouldn't be called)
Two "old style" drivers got updated too (uhci, usb-uhci)
so that folk can use them in case of problems with their
"new style" analogues.
- Dave
--- ./drivers/usb-dist/host/ehci-sched.c Thu May 9 21:00:01 2002
+++ ./drivers/usb/host/ehci-sched.c Tue May 21 09:37:56 2002
@@ -964,15 +964,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)
--- ./drivers/usb-dist/host/usb-uhci-hcd.c Sat May 18 18:42:08 2002
+++ ./drivers/usb/host/usb-uhci-hcd.c Tue May 21 09:48:08 2002
@@ -100,9 +100,6 @@
// NO serviceable parts below!
/*--------------------------------------------------------------------------*/
-// How much URBs with ->next are walked
-#define MAX_NEXT_COUNT 2048
-
static struct uhci *devs = NULL;
/* used by userspace UHCI data structure dumper */
--- ./drivers/usb-dist/host/usb-uhci-q.c Sat May 18 18:42:08 2002
+++ ./drivers/usb/host/usb-uhci-q.c Tue May 21 09:53:08 2002
@@ -1215,10 +1215,9 @@
// called with urb_list_lock set
static int process_urb (struct uhci_hcd *uhci, struct list_head *p)
{
- struct urb *urb, *urbt;
- struct usb_device *usb_dev;
+ struct urb *urb;
urb_priv_t *priv;
- int type, n, ret = 0;
+ int type, ret = 0;
priv=list_entry (p, urb_priv_t, urb_list);
urb=priv->urb;
@@ -1251,40 +1250,11 @@
uhci_free_priv(uhci, urb, urb->hcpriv);
if (type != PIPE_INTERRUPT) { // process_interrupt does completion on
its own
- // FIXME: How to detect killed URBs in a ring?
-
- if (type == PIPE_ISOCHRONOUS) {
- for (n=0, urbt = urb->next; urbt && (urbt != urb) &&
(n<MAX_NEXT_COUNT); urbt = urbt->next, n++)
- continue;
-
- if (urbt && (n<MAX_NEXT_COUNT)) {
- usb_dev=urb->dev;
- urb->dev = NULL;
- spin_unlock(&uhci->urb_list_lock);
- if (urb->complete)
- urb->complete (urb);
-
- urb->dev=usb_dev;
- uhci_urb_enqueue(&uhci->hcd, urb, GFP_ATOMIC);
// FIXME memflags!
- spin_lock(&uhci->urb_list_lock);
- }
- else {
- spin_unlock(&uhci->urb_list_lock);
- dbg("giveback iso urb %p, status %i, length
%i\n",
- urb, urb->status,
urb->transfer_buffer_length);
-
- usb_hcd_giveback_urb(&uhci->hcd, urb);
- spin_lock(&uhci->urb_list_lock);
- }
- }
- else {
- spin_unlock(&uhci->urb_list_lock);
- dbg("giveback urb %p, status %i, length %i\n",
- urb, urb->status, urb->transfer_buffer_length);
-
- usb_hcd_giveback_urb(&uhci->hcd, urb);
- spin_lock(&uhci->urb_list_lock);
- }
+ spin_unlock(&uhci->urb_list_lock);
+ dbg("giveback urb %p, status %i, length %i\n",
+ urb, urb->status, urb->transfer_buffer_length);
+ usb_hcd_giveback_urb(&uhci->hcd, urb);
+ spin_lock(&uhci->urb_list_lock);
}
}
return ret;
--- ./drivers/usb-dist/host/usb-uhci.c Sat May 18 18:42:08 2002
+++ ./drivers/usb/host/usb-uhci.c Tue May 21 09:51:50 2002
@@ -125,9 +125,6 @@
_static int process_interrupt (uhci_t *s, struct urb *urb);
_static int process_iso (uhci_t *s, struct urb *urb, int force);
-// How much URBs with ->next are walked
-#define MAX_NEXT_COUNT 2048
-
static uhci_t *devs = NULL;
/* used by userspace UHCI data structure dumper */
@@ -2662,78 +2659,12 @@
#endif
if ((usb_pipetype (urb->pipe) != PIPE_INTERRUPT)) { //
process_interrupt does completion on its own
- struct urb *next_urb = urb->next;
- int is_ring = 0;
- int contains_killed = 0;
- int loop_count=0;
-
- if (next_urb) {
- // Find out if the URBs are linked to a ring
- while (next_urb != NULL && next_urb != urb &&
loop_count < MAX_NEXT_COUNT) {
- if (next_urb->status == -ENOENT) {// killed
URBs break ring structure & resubmission
- contains_killed = 1;
- break;
- }
- next_urb = next_urb->next;
- loop_count++;
- }
-
- if (loop_count == MAX_NEXT_COUNT)
- err("process_urb: Too much linked URBs in ring
detection!");
-
- if (next_urb == urb)
- is_ring=1;
- }
-
- // Submit idle/non-killed URBs linked with urb->next
- // Stop before the current URB
- next_urb = urb->next;
- if (next_urb && !contains_killed) {
- int ret_submit;
- next_urb = urb->next;
-
- loop_count=0;
- while (next_urb != NULL && next_urb != urb &&
loop_count < MAX_NEXT_COUNT) {
- if (next_urb->status != -EINPROGRESS) {
-
- if (next_urb->status == -ENOENT)
- break;
-
- spin_unlock(&s->urb_list_lock);
-
- // FIXME!!!
- // We need to know the real state, so
- // GFP_ATOMIC is probably not correct
- ret_submit=uhci_submit_urb(next_urb,
GFP_ATOMIC);
- spin_lock(&s->urb_list_lock);
-
- if (ret_submit)
- break;
- }
- loop_count++;
- next_urb = next_urb->next;
- }
- if (loop_count == MAX_NEXT_COUNT)
- err("process_urb: Too much linked URBs in
resubmission!");
- }
-
// Completion
if (urb->complete) {
- int was_unlinked = (urb->status == -ENOENT);
urb->dev = NULL;
spin_unlock(&s->urb_list_lock);
-
urb->complete ((struct urb *) urb);
-
- // Re-submit the URB if ring-linked
- if (is_ring && !was_unlinked && !contains_killed) {
- urb->dev=usb_dev;
- // FIXME!!!
- // We need to know the real state, so
- // GFP_ATOMIC is probably not correct
- uhci_submit_urb (urb, GFP_ATOMIC);
- }
spin_lock(&s->urb_list_lock);
}
--- ./drivers/usb-dist/host/uhci.c Sat May 18 18:42:08 2002
+++ ./drivers/usb/host/uhci.c Tue May 21 09:46:16 2002
@@ -106,8 +106,6 @@
/* to make sure it doesn't hog all of the bandwidth */
#define DEPTH_INTERVAL 5
-#define MAX_URB_LOOP 2048 /* Maximum number of linked URB's */
-
/*
* Technically, updating td->status here is a race, but it's not really a
* problem. The worst that can happen is that we set the IOC bit again
@@ -2296,8 +2294,7 @@
struct urb_priv *urbp;
struct usb_device *dev = urb->dev;
struct uhci *uhci = (struct uhci *)dev->bus->hcpriv;
- int is_ring = 0, killed, resubmit_interrupt, status;
- struct urb *nurb;
+ int killed, resubmit_interrupt, status;
unsigned long flags;
spin_lock_irqsave(&urb->lock, flags);
@@ -2313,29 +2310,6 @@
resubmit_interrupt = (usb_pipetype(urb->pipe) == PIPE_INTERRUPT &&
urb->interval);
- nurb = urb->next;
- if (nurb && !killed) {
- int count = 0;
-
- while (nurb && nurb != urb && count < MAX_URB_LOOP) {
- if (nurb->status == -ENOENT ||
- nurb->status == -ECONNABORTED ||
- nurb->status == -ECONNRESET) {
- killed = 1;
- break;
- }
-
- nurb = nurb->next;
- count++;
- }
-
- if (count == MAX_URB_LOOP)
- err("uhci_call_completion: too many linked URB's, loop? (first
loop)");
-
- /* Check to see if chain is a ring */
- is_ring = (nurb == urb);
- }
-
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) ?
@@ -2370,15 +2344,10 @@
urb->dev = dev;
uhci_reset_interrupt(urb);
} else {
- if (is_ring && !killed) {
- urb->dev = dev;
- uhci_submit_urb(urb, GFP_ATOMIC);
- } else {
- /* We decrement the usage count after we're done */
- /* with everything */
- usb_put_dev(dev);
- usb_put_urb(urb);
- }
+ /* We decrement the usage count after we're done */
+ /* with everything */
+ usb_put_dev(dev);
+ usb_put_urb(urb);
}
}