diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2005-07-29 16:11:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-08 19:23:04 -0400 |
commit | b375a0495fd622037560c73c05f23ae6f127bb0c (patch) | |
tree | 7f800cfd288480625e6e9886b51aa6d159a1548e /drivers/net/irda | |
parent | a4e628328ec60873fec9d506d682155391f589ce (diff) |
[PATCH] USB: URB_ASYNC_UNLINK flag removed from the kernel
29 July 2005, Cambridge, MA:
This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK
flag from the Linux kernel. Mr. Stern explained, "This flag is a relic
from an earlier, less-well-designed system. For over a year it hasn't
been used for anything other than printing warning messages."
An anonymous spokesman for the Linux kernel development community
commented, "This is exactly the sort of thing we see happening all the
time. As the kernel evolves, support for old techniques and old code can
be jettisoned and replaced by newer, better approaches. Proprietary
operating systems do not have the freedom or flexibility to change so
quickly."
Mr. Stern, a staff member at Harvard University's Rowland Institute who
works on Linux only as a hobby, noted that the patch (labelled as548) did
not update two files, keyspan.c and option.c, in the USB drivers' "serial"
subdirectory. "Those files need more extensive changes," he remarked.
"They examine the status field of several URBs at times when they're not
supposed to. That will need to be fixed before the URB_ASYNC_UNLINK flag
is removed."
Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all
of Linux's USB drivers, did not respond to our inquiries or return our
calls. His only comment was "Applied, thanks."
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/irda-usb.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 46e0022d3258..6c766fdc51a6 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -267,7 +267,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) | |||
267 | frame, IRDA_USB_SPEED_MTU, | 267 | frame, IRDA_USB_SPEED_MTU, |
268 | speed_bulk_callback, self); | 268 | speed_bulk_callback, self); |
269 | urb->transfer_buffer_length = USB_IRDA_HEADER; | 269 | urb->transfer_buffer_length = USB_IRDA_HEADER; |
270 | urb->transfer_flags = URB_ASYNC_UNLINK; | 270 | urb->transfer_flags = 0; |
271 | 271 | ||
272 | /* Irq disabled -> GFP_ATOMIC */ | 272 | /* Irq disabled -> GFP_ATOMIC */ |
273 | if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) { | 273 | if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) { |
@@ -401,15 +401,12 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
401 | skb->data, IRDA_SKB_MAX_MTU, | 401 | skb->data, IRDA_SKB_MAX_MTU, |
402 | write_bulk_callback, skb); | 402 | write_bulk_callback, skb); |
403 | urb->transfer_buffer_length = skb->len; | 403 | urb->transfer_buffer_length = skb->len; |
404 | /* Note : unlink *must* be Asynchronous because of the code in | ||
405 | * irda_usb_net_timeout() -> call in irq - Jean II */ | ||
406 | urb->transfer_flags = URB_ASYNC_UNLINK; | ||
407 | /* This flag (URB_ZERO_PACKET) indicates that what we send is not | 404 | /* This flag (URB_ZERO_PACKET) indicates that what we send is not |
408 | * a continuous stream of data but separate packets. | 405 | * a continuous stream of data but separate packets. |
409 | * In this case, the USB layer will insert an empty USB frame (TD) | 406 | * In this case, the USB layer will insert an empty USB frame (TD) |
410 | * after each of our packets that is exact multiple of the frame size. | 407 | * after each of our packets that is exact multiple of the frame size. |
411 | * This is how the dongle will detect the end of packet - Jean II */ | 408 | * This is how the dongle will detect the end of packet - Jean II */ |
412 | urb->transfer_flags |= URB_ZERO_PACKET; | 409 | urb->transfer_flags = URB_ZERO_PACKET; |
413 | 410 | ||
414 | /* Generate min turn time. FIXME: can we do better than this? */ | 411 | /* Generate min turn time. FIXME: can we do better than this? */ |
415 | /* Trying to a turnaround time at this level is trying to measure | 412 | /* Trying to a turnaround time at this level is trying to measure |
@@ -630,8 +627,6 @@ static void irda_usb_net_timeout(struct net_device *netdev) | |||
630 | * in completion handler, because urb->status will | 627 | * in completion handler, because urb->status will |
631 | * be -ENOENT. We will fix that at the next watchdog, | 628 | * be -ENOENT. We will fix that at the next watchdog, |
632 | * leaving more time to USB to recover... | 629 | * leaving more time to USB to recover... |
633 | * Also, we are in interrupt, so we need to have | ||
634 | * URB_ASYNC_UNLINK to work properly... | ||
635 | * Jean II */ | 630 | * Jean II */ |
636 | done = 1; | 631 | done = 1; |
637 | break; | 632 | break; |
@@ -1008,9 +1003,7 @@ static int irda_usb_net_close(struct net_device *netdev) | |||
1008 | } | 1003 | } |
1009 | } | 1004 | } |
1010 | /* Cancel Tx and speed URB - need to be synchronous to avoid races */ | 1005 | /* Cancel Tx and speed URB - need to be synchronous to avoid races */ |
1011 | self->tx_urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
1012 | usb_kill_urb(self->tx_urb); | 1006 | usb_kill_urb(self->tx_urb); |
1013 | self->speed_urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
1014 | usb_kill_urb(self->speed_urb); | 1007 | usb_kill_urb(self->speed_urb); |
1015 | 1008 | ||
1016 | /* Stop and remove instance of IrLAP */ | 1009 | /* Stop and remove instance of IrLAP */ |
@@ -1521,9 +1514,7 @@ static void irda_usb_disconnect(struct usb_interface *intf) | |||
1521 | usb_kill_urb(self->rx_urb[i]); | 1514 | usb_kill_urb(self->rx_urb[i]); |
1522 | /* Cancel Tx and speed URB. | 1515 | /* Cancel Tx and speed URB. |
1523 | * Toggle flags to make sure it's synchronous. */ | 1516 | * Toggle flags to make sure it's synchronous. */ |
1524 | self->tx_urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
1525 | usb_kill_urb(self->tx_urb); | 1517 | usb_kill_urb(self->tx_urb); |
1526 | self->speed_urb->transfer_flags &= ~URB_ASYNC_UNLINK; | ||
1527 | usb_kill_urb(self->speed_urb); | 1518 | usb_kill_urb(self->speed_urb); |
1528 | } | 1519 | } |
1529 | 1520 | ||