aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-07-29 16:11:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 19:23:04 -0400
commitb375a0495fd622037560c73c05f23ae6f127bb0c (patch)
tree7f800cfd288480625e6e9886b51aa6d159a1548e /drivers/usb/core
parenta4e628328ec60873fec9d506d682155391f589ce (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/usb/core')
-rw-r--r--drivers/usb/core/message.c4
-rw-r--r--drivers/usb/core/urb.c26
2 files changed, 5 insertions, 25 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 88d1b376f67c..74197249c245 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -48,7 +48,6 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
48 48
49 init_completion(&done); 49 init_completion(&done);
50 urb->context = &done; 50 urb->context = &done;
51 urb->transfer_flags |= URB_ASYNC_UNLINK;
52 urb->actual_length = 0; 51 urb->actual_length = 0;
53 status = usb_submit_urb(urb, GFP_NOIO); 52 status = usb_submit_urb(urb, GFP_NOIO);
54 53
@@ -357,8 +356,7 @@ int usb_sg_init (
357 if (!io->urbs) 356 if (!io->urbs)
358 goto nomem; 357 goto nomem;
359 358
360 urb_flags = URB_ASYNC_UNLINK | URB_NO_TRANSFER_DMA_MAP 359 urb_flags = URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT;
361 | URB_NO_INTERRUPT;
362 if (usb_pipein (pipe)) 360 if (usb_pipein (pipe))
363 urb_flags |= URB_SHORT_NOT_OK; 361 urb_flags |= URB_SHORT_NOT_OK;
364 362
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index c0feee25ff0a..c846fefb7386 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -309,9 +309,8 @@ int usb_submit_urb(struct urb *urb, unsigned mem_flags)
309 unsigned int allowed; 309 unsigned int allowed;
310 310
311 /* enforce simple/standard policy */ 311 /* enforce simple/standard policy */
312 allowed = URB_ASYNC_UNLINK; // affects later unlinks 312 allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP |
313 allowed |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); 313 URB_NO_INTERRUPT);
314 allowed |= URB_NO_INTERRUPT;
315 switch (temp) { 314 switch (temp) {
316 case PIPE_BULK: 315 case PIPE_BULK:
317 if (is_out) 316 if (is_out)
@@ -400,14 +399,8 @@ int usb_submit_urb(struct urb *urb, unsigned mem_flags)
400 * canceled (rather than any other code) and will quickly be removed 399 * canceled (rather than any other code) and will quickly be removed
401 * from host controller data structures. 400 * from host controller data structures.
402 * 401 *
403 * In the past, clearing the URB_ASYNC_UNLINK transfer flag for the 402 * This request is always asynchronous.
404 * URB indicated that the request was synchronous. This usage is now 403 * Success is indicated by returning -EINPROGRESS,
405 * deprecated; if the flag is clear the call will be forwarded to
406 * usb_kill_urb() and the return value will be 0. In the future, drivers
407 * should call usb_kill_urb() directly for synchronous unlinking.
408 *
409 * When the URB_ASYNC_UNLINK transfer flag for the URB is set, this
410 * request is asynchronous. Success is indicated by returning -EINPROGRESS,
411 * at which time the URB will normally have been unlinked but not yet 404 * at which time the URB will normally have been unlinked but not yet
412 * given back to the device driver. When it is called, the completion 405 * given back to the device driver. When it is called, the completion
413 * function will see urb->status == -ECONNRESET. Failure is indicated 406 * function will see urb->status == -ECONNRESET. Failure is indicated
@@ -453,17 +446,6 @@ int usb_unlink_urb(struct urb *urb)
453{ 446{
454 if (!urb) 447 if (!urb)
455 return -EINVAL; 448 return -EINVAL;
456 if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) {
457#ifdef CONFIG_DEBUG_KERNEL
458 if (printk_ratelimit()) {
459 printk(KERN_NOTICE "usb_unlink_urb() is deprecated for "
460 "synchronous unlinks. Use usb_kill_urb() instead.\n");
461 WARN_ON(1);
462 }
463#endif
464 usb_kill_urb(urb);
465 return 0;
466 }
467 if (!(urb->dev && urb->dev->bus && urb->dev->bus->op)) 449 if (!(urb->dev && urb->dev->bus && urb->dev->bus->op))
468 return -ENODEV; 450 return -ENODEV;
469 return urb->dev->bus->op->unlink_urb(urb, -ECONNRESET); 451 return urb->dev->bus->op->unlink_urb(urb, -ECONNRESET);