# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.220.2.3 -> 1.220.2.4 # drivers/usb/usbnet.c 1.13 -> 1.14 # drivers/usb/mdc800.c 1.9 -> 1.10 # drivers/usb/dabusb.c 1.9 -> 1.10 # drivers/usb/hid-core.c 1.9 -> 1.10 # drivers/usb/CDCEther.c 1.6 -> 1.7 # drivers/usb/wacom.c 1.7 -> 1.8 # drivers/usb/acm.c 1.12 -> 1.13 # drivers/usb/stv680.c 1.5 -> 1.6 # drivers/usb/kaweth.c 1.11 -> 1.12 # drivers/usb/printer.c 1.12 -> 1.13 # drivers/usb/bluetooth.c 1.16 -> 1.17 # drivers/usb/scanner.c 1.12 -> 1.13 # drivers/usb/se401.c 1.7 -> 1.8 # drivers/usb/ov511.c 1.12 -> 1.13 # drivers/usb/vicam.c 1.5 -> 1.6 # drivers/usb/usbmouse.c 1.7 -> 1.8 # drivers/usb/auerswald.c 1.3 -> 1.3.1.1 # drivers/usb/usbkbd.c 1.9 -> 1.10 # drivers/usb/audio.c 1.11 -> 1.12 # drivers/usb/pegasus.c 1.14 -> 1.15 # drivers/usb/usb-skeleton.c 1.6 -> 1.7 # drivers/usb/catc.c 1.7 -> 1.8 # drivers/usb/hub.c 1.13 -> 1.14 # drivers/usb/usbvideo.c 1.5 -> 1.6 # drivers/usb/devio.c 1.14 -> 1.15 # drivers/usb/microtek.c 1.11 -> 1.12 # drivers/usb/pwc-if.c 1.11 -> 1.12 # drivers/usb/hpusbscsi.c 1.5 -> 1.6 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/02/06 greg@soap.kroah.net 1.220.2.4 # usb_submit_urb() changes for the drivers/usb/*.c drivers. # Some driver changes were done by Oliver Neukum and David Brownell. # -------------------------------------------- # diff -Nru a/drivers/usb/CDCEther.c b/drivers/usb/CDCEther.c --- a/drivers/usb/CDCEther.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/CDCEther.c Wed Feb 6 20:48:11 2002 @@ -132,7 +132,7 @@ // Give this to the USB subsystem so it can tell us // when more data arrives. - if ( (res = usb_submit_urb(ether_dev->rx_urb)) ) { + if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) ) { warn( __FUNCTION__ " failed submint rx_urb %d", res); } @@ -302,7 +302,7 @@ ether_dev->tx_urb->transfer_buffer_length = count; // Send the URB on its merry way. - if ((res = usb_submit_urb(ether_dev->tx_urb))) { + if ((res = usb_submit_urb(ether_dev->tx_urb, GFP_KERNEL))) { // Hmm... It didn't go. Tell someone... warn("failed tx_urb %d", res); // update some stats... @@ -350,7 +350,7 @@ read_bulk_callback, ether_dev ); // Put it out there so the device can send us stuff - if ( (res = usb_submit_urb(ether_dev->rx_urb)) ) + if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) ) { // Hmm... Okay... warn( __FUNCTION__ " failed rx_urb %d", res ); diff -Nru a/drivers/usb/acm.c b/drivers/usb/acm.c --- a/drivers/usb/acm.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/acm.c Wed Feb 6 20:48:11 2002 @@ -261,7 +261,7 @@ urb->actual_length = 0; urb->dev = acm->dev; - if (usb_submit_urb(urb)) + if (usb_submit_urb(urb, GFP_KERNEL)) dbg("failed resubmitting read urb"); } @@ -316,11 +316,11 @@ unlock_kernel(); acm->ctrlurb.dev = acm->dev; - if (usb_submit_urb(&acm->ctrlurb)) + if (usb_submit_urb(&acm->ctrlurb, GFP_KERNEL)) dbg("usb_submit_urb(ctrl irq) failed"); acm->readurb.dev = acm->dev; - if (usb_submit_urb(&acm->readurb)) + if (usb_submit_urb(&acm->readurb, GFP_KERNEL)) dbg("usb_submit_urb(read bulk) failed"); acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS); @@ -371,7 +371,7 @@ acm->writeurb.transfer_buffer_length = count; acm->writeurb.dev = acm->dev; - if (usb_submit_urb(&acm->writeurb)) + if (usb_submit_urb(&acm->writeurb, GFP_KERNEL)) dbg("usb_submit_urb(write bulk) failed"); return count; diff -Nru a/drivers/usb/audio.c b/drivers/usb/audio.c --- a/drivers/usb/audio.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/audio.c Wed Feb 6 20:48:12 2002 @@ -917,7 +917,7 @@ if (!usbin_retire_desc(u, urb) && u->flags & FLG_RUNNING && !usbin_prepare_desc(u, urb) && - (suret = usb_submit_urb(urb)) == 0) { + (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) { u->flags |= mask; } else { u->flags &= ~(mask | FLG_RUNNING); @@ -982,7 +982,7 @@ if (!usbin_sync_retire_desc(u, urb) && u->flags & FLG_RUNNING && !usbin_sync_prepare_desc(u, urb) && - (suret = usb_submit_urb(urb)) == 0) { + (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) { u->flags |= mask; } else { u->flags &= ~(mask | FLG_RUNNING); @@ -1055,7 +1055,7 @@ urb->number_of_packets = DESCFRAMES; urb->context = as; urb->complete = usbin_completed; - if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_URB0RUNNING; else u->flags &= ~FLG_RUNNING; @@ -1068,7 +1068,7 @@ urb->number_of_packets = DESCFRAMES; urb->context = as; urb->complete = usbin_completed; - if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_URB1RUNNING; else u->flags &= ~FLG_RUNNING; @@ -1083,7 +1083,7 @@ urb->context = as; urb->complete = usbin_sync_completed; /* stride: u->syncinterval */ - if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_SYNC0RUNNING; else u->flags &= ~FLG_RUNNING; @@ -1097,7 +1097,7 @@ urb->context = as; urb->complete = usbin_sync_completed; /* stride: u->syncinterval */ - if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_SYNC1RUNNING; else u->flags &= ~FLG_RUNNING; @@ -1275,7 +1275,7 @@ if (!usbout_retire_desc(u, urb) && u->flags & FLG_RUNNING && !usbout_prepare_desc(u, urb) && - (suret = usb_submit_urb(urb)) == 0) { + (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) { u->flags |= mask; } else { u->flags &= ~(mask | FLG_RUNNING); @@ -1347,7 +1347,7 @@ if (!usbout_sync_retire_desc(u, urb) && u->flags & FLG_RUNNING && !usbout_sync_prepare_desc(u, urb) && - (suret = usb_submit_urb(urb)) == 0) { + (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) { u->flags |= mask; } else { u->flags &= ~(mask | FLG_RUNNING); @@ -1420,7 +1420,7 @@ urb->number_of_packets = DESCFRAMES; urb->context = as; urb->complete = usbout_completed; - if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_URB0RUNNING; else u->flags &= ~FLG_RUNNING; @@ -1433,7 +1433,7 @@ urb->number_of_packets = DESCFRAMES; urb->context = as; urb->complete = usbout_completed; - if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_URB1RUNNING; else u->flags &= ~FLG_RUNNING; @@ -1448,7 +1448,7 @@ urb->context = as; urb->complete = usbout_sync_completed; /* stride: u->syncinterval */ - if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_SYNC0RUNNING; else u->flags &= ~FLG_RUNNING; @@ -1462,7 +1462,7 @@ urb->context = as; urb->complete = usbout_sync_completed; /* stride: u->syncinterval */ - if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb)) + if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL)) u->flags |= FLG_SYNC1RUNNING; else u->flags &= ~FLG_RUNNING; diff -Nru a/drivers/usb/auerswald.c b/drivers/usb/auerswald.c --- a/drivers/usb/auerswald.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/auerswald.c Wed Feb 6 20:48:11 2002 @@ -330,7 +330,7 @@ urb = acep->urbp; dbg ("auerchain_complete: submitting next urb from chain"); urb->status = 0; /* needed! */ - result = usb_submit_urb( urb); + result = usb_submit_urb(urb, GFP_KERNEL); /* check for submit errors */ if (result) { @@ -408,7 +408,7 @@ if (acep) { dbg("submitting urb immediate"); urb->status = 0; /* needed! */ - result = usb_submit_urb( urb); + result = usb_submit_urb(urb, GFP_KERNEL); /* check for submit errors */ if (result) { urb->status = result; @@ -1128,7 +1128,7 @@ FILL_INT_URB (cp->inturbp, cp->usbdev, usb_rcvintpipe (cp->usbdev,AU_IRQENDP), cp->intbufp, irqsize, auerswald_int_complete, cp, ep->bInterval); /* start the urb */ cp->inturbp->status = 0; /* needed! */ - ret = usb_submit_urb (cp->inturbp); + ret = usb_submit_urb (cp->inturbp, GFP_KERNEL); intoend: if (ret < 0) { diff -Nru a/drivers/usb/bluetooth.c b/drivers/usb/bluetooth.c --- a/drivers/usb/bluetooth.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/bluetooth.c Wed Feb 6 20:48:11 2002 @@ -335,7 +335,7 @@ (unsigned char*)dr, urb->transfer_buffer, len, bluetooth_ctrl_callback, bluetooth); /* send it down the pipe */ - status = usb_submit_urb(urb); + status = usb_submit_urb(urb, GFP_KERNEL); if (status) dbg(__FUNCTION__ " - usb_submit_urb(control) failed with status = %d", status); @@ -390,7 +390,7 @@ bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, bluetooth_read_bulk_callback, bluetooth); - result = usb_submit_urb(bluetooth->read_urb); + result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL); if (result) dbg(__FUNCTION__ " - usb_submit_urb(read bulk) failed with status %d", result); #endif @@ -400,7 +400,7 @@ bluetooth->interrupt_in_buffer_size, bluetooth_int_callback, bluetooth, bluetooth->interrupt_in_interval); - result = usb_submit_urb(bluetooth->interrupt_in_urb); + result = usb_submit_urb(bluetooth->interrupt_in_urb, GFP_KERNEL); if (result) dbg(__FUNCTION__ " - usb_submit_urb(interrupt in) failed with status %d", result); } @@ -540,7 +540,7 @@ urb->transfer_flags |= USB_QUEUE_BULK; /* send it down the pipe */ - retval = usb_submit_urb(urb); + retval = usb_submit_urb(urb, GFP_KERNEL); if (retval) { dbg(__FUNCTION__ " - usb_submit_urb(write bulk) failed with error = %d", retval); goto exit; @@ -730,7 +730,7 @@ usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress), bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, bluetooth_read_bulk_callback, bluetooth); - result = usb_submit_urb(bluetooth->read_urb); + result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL); if (result) err (__FUNCTION__ " - failed submitting read urb, error %d", result); } @@ -921,7 +921,7 @@ usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress), bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, bluetooth_read_bulk_callback, bluetooth); - result = usb_submit_urb(bluetooth->read_urb); + result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL); if (result) err (__FUNCTION__ " - failed resubmitting read urb, error %d", result); @@ -982,7 +982,7 @@ usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress), bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, bluetooth_read_bulk_callback, bluetooth); - result = usb_submit_urb(bluetooth->read_urb); + result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL); if (result) err (__FUNCTION__ " - failed resubmitting read urb, error %d", result); diff -Nru a/drivers/usb/catc.c b/drivers/usb/catc.c --- a/drivers/usb/catc.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/catc.c Wed Feb 6 20:48:12 2002 @@ -257,7 +257,7 @@ if ((data[1] & 0x80) && !test_and_set_bit(RX_RUNNING, &catc->flags)) { catc->rx_urb->dev = catc->usbdev; - if ((status = usb_submit_urb(catc->rx_urb)) < 0) { + if ((status = usb_submit_urb(catc->rx_urb, GFP_KERNEL)) < 0) { err("submit(rx_urb) status %d", status); return; } @@ -286,7 +286,7 @@ catc->tx_urb->transfer_buffer = catc->tx_buf[catc->tx_idx]; catc->tx_urb->dev = catc->usbdev; - if ((status = usb_submit_urb(catc->tx_urb)) < 0) + if ((status = usb_submit_urb(catc->tx_urb, GFP_KERNEL)) < 0) err("submit(tx_urb), status %d", status); catc->tx_idx = !catc->tx_idx; @@ -402,7 +402,7 @@ if (!q->dir && q->buf && q->len) memcpy(catc->ctrl_buf, q->buf, q->len); - if ((status = usb_submit_urb(catc->ctrl_urb))) + if ((status = usb_submit_urb(catc->ctrl_urb, GFP_KERNEL))) err("submit(ctrl_urb) status %d", status); } @@ -625,7 +625,7 @@ int status; catc->irq_urb->dev = catc->usbdev; - if ((status = usb_submit_urb(catc->irq_urb)) < 0) { + if ((status = usb_submit_urb(catc->irq_urb, GFP_KERNEL)) < 0) { err("submit(irq_urb) status %d", status); return -1; } diff -Nru a/drivers/usb/dabusb.c b/drivers/usb/dabusb.c --- a/drivers/usb/dabusb.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/dabusb.c Wed Feb 6 20:48:11 2002 @@ -458,7 +458,7 @@ end = list_entry (s->rec_buff_list.prev, buff_t, buff_list); - ret = usb_submit_urb (end->purb); + ret = usb_submit_urb (end->purb, GFP_KERNEL); if (ret) { err("usb_submit_urb returned:%d", ret); if (dabusb_add_buf_tail (s, &s->free_buff_list, &s->rec_buff_list)) diff -Nru a/drivers/usb/devio.c b/drivers/usb/devio.c --- a/drivers/usb/devio.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/devio.c Wed Feb 6 20:48:12 2002 @@ -364,7 +364,7 @@ if (test_bit(intf, &ps->ifclaimed)) return 0; /* if not yet claimed, claim it for the driver */ - printk(KERN_WARNING "usbdevfs: process %d (%s) did not claim interface %u before use\n", + printk(KERN_WARNING "usbfs: process %d (%s) did not claim interface %u before use\n", current->pid, current->comm, intf); return claimintf(ps, intf); } @@ -563,7 +563,7 @@ } free_page((unsigned long)tbuf); if (i<0) { - printk(KERN_DEBUG "usbdevfs: USBDEVFS_CONTROL failed dev %d rqt %u rq %u len %u ret %d\n", + printk(KERN_DEBUG "usbfs: USBDEVFS_CONTROL failed dev %d rqt %u rq %u len %u ret %d\n", dev->devnum, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); } return i; @@ -619,7 +619,7 @@ } free_page((unsigned long)tbuf); if (i < 0) { - printk(KERN_WARNING "usbdevfs: USBDEVFS_BULK failed dev %d ep 0x%x len %u ret %d\n", + printk(KERN_WARNING "usbfs: USBDEVFS_BULK failed dev %d ep 0x%x len %u ret %d\n", dev->devnum, bulk.ep, bulk.len, i); return i; } @@ -906,8 +906,8 @@ } } async_newpending(as); - if ((ret = usb_submit_urb(as->urb))) { - printk(KERN_DEBUG "usbdevfs: usb_submit_urb returned %d\n", ret); + if ((ret = usb_submit_urb(as->urb, GFP_KERNEL))) { + printk(KERN_DEBUG "usbfs: usb_submit_urb returned %d\n", ret); async_removepending(as); free_async(as); return ret; diff -Nru a/drivers/usb/hid-core.c b/drivers/usb/hid-core.c --- a/drivers/usb/hid-core.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/hid-core.c Wed Feb 6 20:48:11 2002 @@ -992,7 +992,7 @@ hid->urbout.setup_packet = (void *) &(hid->out[hid->outtail].dr); hid->urbout.dev = hid->dev; - if (usb_submit_urb(&hid->urbout)) { + if (usb_submit_urb(&hid->urbout, GFP_KERNEL)) { err("usb_submit_urb(out) failed"); return -1; } @@ -1036,7 +1036,7 @@ hid->urb.dev = hid->dev; - if (usb_submit_urb(&hid->urb)) + if (usb_submit_urb(&hid->urb, GFP_KERNEL)) return -EIO; return 0; diff -Nru a/drivers/usb/hpusbscsi.c b/drivers/usb/hpusbscsi.c --- a/drivers/usb/hpusbscsi.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/hpusbscsi.c Wed Feb 6 20:48:12 2002 @@ -245,7 +245,7 @@ desc->interrupt_interval ); - if ( 0 > usb_submit_urb(desc->controlurb)) { + if ( 0 > usb_submit_urb(desc->controlurb, GFP_KERNEL)) { kfree(sht->proc_name); return 0; } @@ -321,7 +321,7 @@ hpusbscsi->scallback = callback; hpusbscsi->srb = srb; - res = usb_submit_urb(hpusbscsi->dataurb); + res = usb_submit_urb(hpusbscsi->dataurb, GFP_ATOMIC); if (unlikely(res)) { hpusbscsi->state = HP_STATE_FREE; TRACE_STATE; @@ -460,7 +460,7 @@ hpusbscsi ); - res = usb_submit_urb(u); + res = usb_submit_urb(u, GFP_ATOMIC); if (unlikely(res)) hpusbscsi->state = HP_STATE_ERROR; TRACE_STATE; @@ -509,7 +509,7 @@ hpusbscsi ); - res = usb_submit_urb(u); + res = usb_submit_urb(u, GFP_ATOMIC); if (unlikely(res)) { handle_usb_error(hpusbscsi); return; diff -Nru a/drivers/usb/hub.c b/drivers/usb/hub.c --- a/drivers/usb/hub.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/hub.c Wed Feb 6 20:48:12 2002 @@ -312,7 +312,7 @@ FILL_INT_URB(hub->urb, dev, pipe, hub->buffer, maxp, hub_irq, hub, endpoint->bInterval); - ret = usb_submit_urb(hub->urb); + ret = usb_submit_urb(hub->urb, GFP_KERNEL); if (ret) { err("usb_submit_urb failed (%d)", ret); kfree(hub->descriptor); @@ -498,7 +498,7 @@ return -1; hub->urb->dev = dev; - if (usb_submit_urb(hub->urb)) + if (usb_submit_urb(hub->urb, GFP_KERNEL)) return -1; usb_hub_power_on(hub); diff -Nru a/drivers/usb/kaweth.c b/drivers/usb/kaweth.c --- a/drivers/usb/kaweth.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/kaweth.c Wed Feb 6 20:48:11 2002 @@ -447,7 +447,8 @@ /**************************************************************** * kaweth_resubmit_rx_urb ****************************************************************/ -static inline void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth) +static inline void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth, + int mem_flags) { int result; @@ -461,7 +462,7 @@ kaweth_usb_receive, kaweth); - if((result = usb_submit_urb(kaweth->rx_urb))) { + if((result = usb_submit_urb(kaweth->rx_urb, mem_flags))) { kaweth_err("resubmitting rx_urb %d failed", result); } } @@ -493,7 +494,7 @@ urb->status, count, (int)pkt_len); - kaweth_resubmit_rx_urb(kaweth); + kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); return; } @@ -502,12 +503,12 @@ kaweth_err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count); kaweth_err("Packet len & 2047: %x", pkt_len & 2047); kaweth_err("Count 2: %x", count2); - kaweth_resubmit_rx_urb(kaweth); + kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); return; } if(!(skb = dev_alloc_skb(pkt_len+2))) { - kaweth_resubmit_rx_urb(kaweth); + kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); return; } @@ -525,7 +526,7 @@ kaweth->stats.rx_bytes += pkt_len; } - kaweth_resubmit_rx_urb(kaweth); + kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); } /**************************************************************** @@ -539,11 +540,11 @@ kaweth_dbg("Opening network device."); - kaweth_resubmit_rx_urb(kaweth); + MOD_INC_USE_COUNT; - netif_start_queue(net); + kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL); - MOD_INC_USE_COUNT; + netif_start_queue(net); kaweth_async_set_rx_mode(kaweth); return 0; @@ -621,7 +622,7 @@ kaweth_usb_transmit_complete, kaweth); - if((res = usb_submit_urb(kaweth->tx_urb))) + if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC))) { kaweth_warn("kaweth failed tx_urb %d", res); kaweth->stats.tx_errors++; @@ -975,7 +976,7 @@ set_current_state(TASK_INTERRUPTIBLE); add_wait_queue(&awd.wqh, &wait); urb->context = &awd; - status = usb_submit_urb(urb); + status = usb_submit_urb(urb, GFP_KERNEL); if (status) { // something went wrong usb_free_urb(urb); diff -Nru a/drivers/usb/mdc800.c b/drivers/usb/mdc800.c --- a/drivers/usb/mdc800.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/mdc800.c Wed Feb 6 20:48:11 2002 @@ -605,7 +605,7 @@ retval=0; mdc800->irq_urb->dev = mdc800->dev; - if (usb_submit_urb (mdc800->irq_urb)) + if (usb_submit_urb (mdc800->irq_urb, GFP_KERNEL)) { err ("request USB irq fails (submit_retval=%i urb_status=%i).",retval, mdc800->irq_urb->status); errn = -EIO; @@ -694,7 +694,7 @@ /* Download -> Request new bytes */ mdc800->download_urb->dev = mdc800->dev; - if (usb_submit_urb (mdc800->download_urb)) + if (usb_submit_urb (mdc800->download_urb, GFP_KERNEL)) { err ("Can't submit download urb (status=%i)",mdc800->download_urb->status); up (&mdc800->io_lock); @@ -808,7 +808,7 @@ mdc800->state=WORKING; memcpy (mdc800->write_urb->transfer_buffer, mdc800->in,8); mdc800->write_urb->dev = mdc800->dev; - if (usb_submit_urb (mdc800->write_urb)) + if (usb_submit_urb (mdc800->write_urb, GFP_KERNEL)) { err ("submitting write urb fails (status=%i)", mdc800->write_urb->status); up (&mdc800->io_lock); diff -Nru a/drivers/usb/microtek.c b/drivers/usb/microtek.c --- a/drivers/usb/microtek.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/microtek.c Wed Feb 6 20:48:12 2002 @@ -499,7 +499,7 @@ transfer->status = 0; - res = usb_submit_urb( transfer ); + res = usb_submit_urb( transfer, GFP_ATOMIC ); if ( unlikely(res) ) { MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res ); context->srb->result = DID_ERROR << 16; @@ -719,7 +719,8 @@ mts_build_transfer_context( srb, desc ); desc->context.final_callback = callback; - res=usb_submit_urb(desc->urb); + /* here we need ATOMIC as we are called with the iolock */ + res=usb_submit_urb(desc->urb, GFP_ATOMIC); if(unlikely(res)){ MTS_ERROR("error %d submitting URB\n",(int)res); diff -Nru a/drivers/usb/ov511.c b/drivers/usb/ov511.c --- a/drivers/usb/ov511.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/ov511.c Wed Feb 6 20:48:11 2002 @@ -4457,7 +4457,7 @@ for (n = 0; n < OV511_NUMSBUF; n++) { ov511->sbuf[n].urb->dev = ov511->dev; - err = usb_submit_urb(ov511->sbuf[n].urb); + err = usb_submit_urb(ov511->sbuf[n].urb, GFP_KERNEL); if (err) err("init isoc: usb_submit_urb(%d) ret %d", n, err); } diff -Nru a/drivers/usb/pegasus.c b/drivers/usb/pegasus.c --- a/drivers/usb/pegasus.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/pegasus.c Wed Feb 6 20:48:12 2002 @@ -157,7 +157,8 @@ add_wait_queue( &pegasus->ctrl_wait, &wait ); set_current_state( TASK_UNINTERRUPTIBLE ); - if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { + /* using ATOMIC, we'd never wake up if we slept */ + if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) ) { err("%s: BAD CTRLs %d", __FUNCTION__, ret); goto out; } @@ -207,7 +208,7 @@ add_wait_queue( &pegasus->ctrl_wait, &wait ); set_current_state( TASK_UNINTERRUPTIBLE ); - if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { + if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) ) { err("%s: BAD CTRL %d", __FUNCTION__, ret); goto out; } @@ -257,7 +258,7 @@ add_wait_queue( &pegasus->ctrl_wait, &wait ); set_current_state( TASK_UNINTERRUPTIBLE ); - if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { + if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) ) { err("%s: BAD CTRL %d", __FUNCTION__, ret); goto out; } @@ -287,7 +288,7 @@ (char *)&pegasus->dr, pegasus->eth_regs, 3, ctrl_callback, pegasus ); - if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) + if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) ) err("%s: BAD CTRL %d, flgs %x",__FUNCTION__,ret,pegasus->flags); return ret; @@ -573,7 +574,7 @@ usb_rcvbulkpipe(pegasus->usb, 1), pegasus->rx_buff, PEGASUS_MAX_MTU, read_bulk_callback, pegasus ); - if ( (res = usb_submit_urb(pegasus->rx_urb)) ) + if ( (res = usb_submit_urb(pegasus->rx_urb, GFP_ATOMIC)) ) warn("%s: failed submint rx_urb %d", __FUNCTION__, res); pegasus->flags &= ~PEGASUS_RX_BUSY; } @@ -661,7 +662,7 @@ pegasus->tx_buff, PEGASUS_MAX_MTU, write_bulk_callback, pegasus ); pegasus->tx_urb->transfer_buffer_length = count; - if ((res = usb_submit_urb(pegasus->tx_urb))) { + if ((res = usb_submit_urb(pegasus->tx_urb, GFP_ATOMIC))) { warn("failed tx_urb %d", res); pegasus->stats.tx_errors++; netif_start_queue( net ); @@ -721,14 +722,14 @@ usb_rcvbulkpipe(pegasus->usb, 1), pegasus->rx_buff, PEGASUS_MAX_MTU, read_bulk_callback, pegasus ); - if ( (res = usb_submit_urb(pegasus->rx_urb)) ) + if ( (res = usb_submit_urb(pegasus->rx_urb, GFP_KERNEL)) ) warn("%s: failed rx_urb %d", __FUNCTION__, res); #ifdef PEGASUS_USE_INTR FILL_INT_URB( pegasus->intr_urb, pegasus->usb, usb_rcvintpipe(pegasus->usb, 3), pegasus->intr_buff, sizeof(pegasus->intr_buff), intr_callback, pegasus, pegasus->intr_interval ); - if ( (res = usb_submit_urb(pegasus->intr_urb)) ) + if ( (res = usb_submit_urb(pegasus->intr_urb, GFP_KERNEL)) ) warn("%s: failed intr_urb %d", __FUNCTION__, res); #endif netif_start_queue( net ); diff -Nru a/drivers/usb/printer.c b/drivers/usb/printer.c --- a/drivers/usb/printer.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/printer.c Wed Feb 6 20:48:11 2002 @@ -261,7 +261,7 @@ if (usblp->bidir) { usblp->readcount = 0; usblp->readurb.dev = usblp->dev; - if (usb_submit_urb(&usblp->readurb) < 0) { + if (usb_submit_urb(&usblp->readurb, GFP_KERNEL) < 0) { retval = -EIO; usblp->used = 0; file->private_data = NULL; @@ -456,7 +456,7 @@ usblp->writeurb.dev = usblp->dev; usblp->wcomplete = 0; - if (usb_submit_urb(&usblp->writeurb)) { + if (usb_submit_urb(&usblp->writeurb, GFP_KERNEL)) { count = -EIO; up (&usblp->sem); break; @@ -521,7 +521,7 @@ usblp->minor, usblp->readurb.status); usblp->readurb.dev = usblp->dev; usblp->readcount = 0; - usb_submit_urb(&usblp->readurb); + usb_submit_urb(&usblp->readurb, GFP_KERNEL); count = -EIO; goto done; } @@ -538,7 +538,7 @@ usblp->readcount = 0; usblp->readurb.dev = usblp->dev; usblp->rcomplete = 0; - if (usb_submit_urb(&usblp->readurb)) { + if (usb_submit_urb(&usblp->readurb, GFP_KERNEL)) { count = -EIO; goto done; } diff -Nru a/drivers/usb/pwc-if.c b/drivers/usb/pwc-if.c --- a/drivers/usb/pwc-if.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/pwc-if.c Wed Feb 6 20:48:12 2002 @@ -869,7 +869,7 @@ /* link */ for (i = 0; i < MAX_ISO_BUFS; i++) { - ret = usb_submit_urb(pdev->sbuf[i].urb); + ret = usb_submit_urb(pdev->sbuf[i].urb, GFP_KERNEL); if (ret) Err("isoc_init() submit_urb %d failed with error %d\n", i, ret); else diff -Nru a/drivers/usb/scanner.c b/drivers/usb/scanner.c --- a/drivers/usb/scanner.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/scanner.c Wed Feb 6 20:48:11 2002 @@ -992,7 +992,7 @@ // endpoint[(int)have_intr].bInterval); 250); - if (usb_submit_urb(scn->scn_irq)) { + if (usb_submit_urb(scn->scn_irq, GFP_KERNEL)) { err("probe_scanner(%d): Unable to allocate INT URB.", scn_minor); kfree(scn); up(&scn_mutex); diff -Nru a/drivers/usb/se401.c b/drivers/usb/se401.c --- a/drivers/usb/se401.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/se401.c Wed Feb 6 20:48:11 2002 @@ -556,7 +556,7 @@ /* Resubmit urb for new data */ urb->status=0; urb->dev=se401->dev; - if(usb_submit_urb(urb)) + if(usb_submit_urb(urb, GFP_KERNEL)) info("urb burned down"); return; } @@ -657,7 +657,7 @@ se401->urb[i]=urb; - err=usb_submit_urb(se401->urb[i]); + err=usb_submit_urb(se401->urb[i], GFP_KERNEL); if(err) err("urb burned down"); } @@ -1477,7 +1477,7 @@ se401, HZ/10 ); - if (usb_submit_urb(se401->inturb)) { + if (usb_submit_urb(se401->inturb, GFP_KERNEL)) { info("int urb burned down"); return 1; } diff -Nru a/drivers/usb/stv680.c b/drivers/usb/stv680.c --- a/drivers/usb/stv680.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/stv680.c Wed Feb 6 20:48:11 2002 @@ -765,7 +765,7 @@ /* Resubmit urb for new data */ urb->status = 0; urb->dev = stv680->udev; - if (usb_submit_urb (urb)) + if (usb_submit_urb (urb, GFP_KERNEL)) PDEBUG (0, "STV(e): urb burned down in video irq"); return; } /* _video_irq */ @@ -816,7 +816,7 @@ urb->timeout = PENCAM_TIMEOUT * 2; urb->transfer_flags |= USB_QUEUE_BULK; stv680->urb[i] = urb; - err = usb_submit_urb (stv680->urb[i]); + err = usb_submit_urb (stv680->urb[i], GFP_KERNEL); if (err) PDEBUG (0, "STV(e): urb burned down in start stream"); } /* i STV680_NUMSBUF */ diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c --- a/drivers/usb/usb-skeleton.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/usb-skeleton.c Wed Feb 6 20:48:12 2002 @@ -431,7 +431,9 @@ skel_write_bulk_callback, dev); /* send the data out the bulk port */ - retval = usb_submit_urb(dev->write_urb); + /* a character device write uses GFP_KERNEL, + unless a spinlock is held */ + retval = usb_submit_urb(dev->write_urb, GFP_KERNEL); if (retval) { err(__FUNCTION__ " - failed submitting write urb, error %d", retval); diff -Nru a/drivers/usb/usbkbd.c b/drivers/usb/usbkbd.c --- a/drivers/usb/usbkbd.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/usbkbd.c Wed Feb 6 20:48:11 2002 @@ -129,7 +129,7 @@ kbd->leds = kbd->newleds; kbd->led->dev = kbd->usbdev; - if (usb_submit_urb(kbd->led)) + if (usb_submit_urb(kbd->led, GFP_KERNEL)) err("usb_submit_urb(leds) failed"); return 0; @@ -147,7 +147,7 @@ kbd->leds = kbd->newleds; kbd->led->dev = kbd->usbdev; - if (usb_submit_urb(kbd->led)) + if (usb_submit_urb(kbd->led, GFP_KERNEL)) err("usb_submit_urb(leds) failed"); } @@ -159,7 +159,7 @@ return 0; kbd->irq->dev = kbd->usbdev; - if (usb_submit_urb(kbd->irq)) + if (usb_submit_urb(kbd->irq, GFP_KERNEL)) return -EIO; return 0; diff -Nru a/drivers/usb/usbmouse.c b/drivers/usb/usbmouse.c --- a/drivers/usb/usbmouse.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/usbmouse.c Wed Feb 6 20:48:11 2002 @@ -85,7 +85,7 @@ return 0; mouse->irq->dev = mouse->usbdev; - if (usb_submit_urb(mouse->irq)) + if (usb_submit_urb(mouse->irq, GFP_KERNEL)) return -EIO; return 0; diff -Nru a/drivers/usb/usbnet.c b/drivers/usb/usbnet.c --- a/drivers/usb/usbnet.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/usbnet.c Wed Feb 6 20:48:11 2002 @@ -373,7 +373,7 @@ // issue usb interrupt read if (priv && priv->irq_urb) { // submit urb - if ((retval = usb_submit_urb (priv->irq_urb)) != 0) + if ((retval = usb_submit_urb (priv->irq_urb, GFP_KERNEL)) != 0) dbg ("gl_interrupt_read: submit fail - %X...", retval); else dbg ("gl_interrupt_read: submit success..."); @@ -1281,7 +1281,7 @@ spin_lock_irqsave (&dev->rxq.lock, lockflags); if (netif_running (&dev->net)) { - if ((retval = usb_submit_urb (urb)) != 0) { + if ((retval = usb_submit_urb (urb, GFP_ATOMIC)) != 0) { dbg ("%s rx submit, %d", dev->net.name, retval); tasklet_schedule (&dev->bh); } else { @@ -1642,7 +1642,7 @@ #endif /* CONFIG_USB_NET1080 */ netif_stop_queue (net); - if ((retval = usb_submit_urb (urb)) != 0) { + if ((retval = usb_submit_urb (urb, GFP_ATOMIC)) != 0) { netif_start_queue (net); dbg ("%s tx: submit urb err %d", net->name, retval); } else { diff -Nru a/drivers/usb/usbvideo.c b/drivers/usb/usbvideo.c --- a/drivers/usb/usbvideo.c Wed Feb 6 20:48:12 2002 +++ b/drivers/usb/usbvideo.c Wed Feb 6 20:48:12 2002 @@ -1916,7 +1916,7 @@ /* Submit all URBs */ for (i=0; i < USBVIDEO_NUMSBUF; i++) { - errFlag = usb_submit_urb(uvd->sbuf[i].urb); + errFlag = usb_submit_urb(uvd->sbuf[i].urb, GFP_KERNEL); if (errFlag) err("%s: usb_submit_isoc(%d) ret %d", proc, i, errFlag); } diff -Nru a/drivers/usb/vicam.c b/drivers/usb/vicam.c --- a/drivers/usb/vicam.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/vicam.c Wed Feb 6 20:48:11 2002 @@ -350,7 +350,7 @@ synchronize(vicam); mdelay(10); vicam_parameters(vicam); - printk("Submiting urb: %d\n", usb_submit_urb(vicam->readurb)); + printk(KERN_DEBUG "Submiting urb: %d\n", usb_submit_urb(vicam->readurb, GFP_KERNEL)); #endif } @@ -765,7 +765,7 @@ memcpy(vicam->fbuf, buf+64, 0x1e480); if (!change_pending) { - if (usb_submit_urb(urb)) + if (usb_submit_urb(urb, GFP_ATOMIC)) dbg("failed resubmitting read urb"); } else { change_pending = 0; @@ -849,7 +849,7 @@ FILL_BULK_URB(vicam->readurb, vicam->udev, usb_rcvbulkpipe(vicam->udev, 0x81), buf, 0x1e480, vicam_bulk, vicam); - printk("Submiting urb: %d\n", usb_submit_urb(vicam->readurb)); + printk(KERN_DEBUG "Submiting urb: %d\n", usb_submit_urb(vicam->readurb, GFP_KERNEL)); return 0; error: diff -Nru a/drivers/usb/wacom.c b/drivers/usb/wacom.c --- a/drivers/usb/wacom.c Wed Feb 6 20:48:11 2002 +++ b/drivers/usb/wacom.c Wed Feb 6 20:48:11 2002 @@ -336,7 +336,7 @@ return 0; wacom->irq->dev = wacom->usbdev; - if (usb_submit_urb(wacom->irq)) + if (usb_submit_urb(wacom->irq, GFP_KERNEL)) return -EIO; return 0;