ia64/xen-unstable
changeset 3840:5e0509758416
bitkeeper revision 1.1208 (4212ad8c5vLMbRL8isvvSTbC88iL5Q)
usbfront: eliminate the urb_remove_list
Signed-off-by: mark.williamson@cl.cam.ac.uk
usbfront: eliminate the urb_remove_list
Signed-off-by: mark.williamson@cl.cam.ac.uk
author | mwilli2@equilibrium.research |
---|---|
date | Wed Feb 16 02:18:52 2005 +0000 (2005-02-16) |
parents | d52b92174eee |
children | 8f257979f5c7 |
files | linux-2.6.10-xen-sparse/drivers/xen/usbfront/usbfront.c linux-2.6.10-xen-sparse/drivers/xen/usbfront/xhci.h |
line diff
1.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/usbfront/usbfront.c Wed Feb 16 01:40:51 2005 +0000 1.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/usbfront/usbfront.c Wed Feb 16 02:18:52 2005 +0000 1.3 @@ -380,8 +380,6 @@ static void receive_usb_io(usbif_respons 1.4 struct urb *urb = urbp->urb; 1.5 1.6 urb->actual_length = resp->length; 1.7 - urb->status = resp->status; 1.8 - urbp->status = resp->status; 1.9 urbp->in_progress = 0; 1.10 1.11 if( usb_pipetype(urb->pipe) == 0 ) /* ISO */ 1.12 @@ -398,6 +396,12 @@ static void receive_usb_io(usbif_respons 1.13 } 1.14 free_page((unsigned long)urbp->schedule); 1.15 } 1.16 + 1.17 + /* Only set status if it's not been changed since submission. It might 1.18 + * have been changed if the URB has been unlinked asynchronously, for 1.19 + * instance. */ 1.20 + if ( urb->status == -EINPROGRESS ) 1.21 + urbp->status = urb->status = resp->status; 1.22 } 1.23 1.24 /** 1.25 @@ -567,7 +571,7 @@ static void xhci_destroy_urb_priv(struct 1.26 return; 1.27 1.28 if (!list_empty(&urb->urb_list)) 1.29 - warn("xhci_destroy_urb_priv: urb %p still on xhci->urb_list or xhci->remove_list", urb); 1.30 + warn("xhci_destroy_urb_priv: urb %p still on xhci->urb_list", urb); 1.31 1.32 if (!list_empty(&urbp->complete_list)) 1.33 warn("xhci_destroy_urb_priv: urb %p still on xhci->complete_list", urb); 1.34 @@ -849,8 +853,6 @@ static int xhci_unlink_urb(struct urb *u 1.35 1.36 list_del_init(&urb->urb_list); 1.37 1.38 - xhci_delete_urb(urb); 1.39 - 1.40 /* Short circuit the virtual root hub */ 1.41 if (urb->dev == xhci->rh.dev) { 1.42 rh_unlink_urb(urb); 1.43 @@ -861,17 +863,12 @@ static int xhci_unlink_urb(struct urb *u 1.44 xhci_call_completion(urb); 1.45 } else { 1.46 if (urb->transfer_flags & USB_ASYNC_UNLINK) { 1.47 + /* We currently don't currently attempt to cancel URBs 1.48 + * that have been queued in the ring. We handle async 1.49 + * unlinked URBs when they complete. */ 1.50 urbp->status = urb->status = -ECONNABORTED; 1.51 - 1.52 - spin_lock(&xhci->urb_remove_list_lock); 1.53 - 1.54 - list_add(&urb->urb_list, &xhci->urb_remove_list); 1.55 - 1.56 - spin_unlock(&xhci->urb_remove_list_lock); 1.57 - 1.58 spin_unlock(&urb->lock); 1.59 spin_unlock_irqrestore(&xhci->urb_list_lock, flags); 1.60 - 1.61 } else { 1.62 urb->status = -ENOENT; 1.63 1.64 @@ -887,6 +884,8 @@ static int xhci_unlink_urb(struct urb *u 1.65 } else 1.66 schedule_timeout(1+1*HZ/1000); 1.67 1.68 + xhci_delete_urb(urb); 1.69 + 1.70 xhci_call_completion(urb); 1.71 } 1.72 } 1.73 @@ -1419,9 +1418,6 @@ static int alloc_xhci(void) 1.74 1.75 xhci->state = USBIF_STATE_CLOSED; 1.76 1.77 - spin_lock_init(&xhci->urb_remove_list_lock); 1.78 - INIT_LIST_HEAD(&xhci->urb_remove_list); 1.79 - 1.80 spin_lock_init(&xhci->urb_list_lock); 1.81 INIT_LIST_HEAD(&xhci->urb_list); 1.82
2.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/usbfront/xhci.h Wed Feb 16 01:40:51 2005 +0000 2.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/usbfront/xhci.h Wed Feb 16 02:18:52 2005 +0000 2.3 @@ -68,10 +68,6 @@ struct xhci { 2.4 spinlock_t urb_list_lock; 2.5 struct list_head urb_list; /* P: xhci->urb_list_lock */ 2.6 2.7 - /* List of asynchronously unlinked URB's */ 2.8 - spinlock_t urb_remove_list_lock; 2.9 - struct list_head urb_remove_list; /* P: xhci->urb_remove_list_lock */ 2.10 - 2.11 /* List of URB's awaiting completion callback */ 2.12 spinlock_t complete_list_lock; 2.13 struct list_head complete_list; /* P: xhci->complete_list_lock */