From: Yoann Padioleau In a few files a function such as usb_submit_urb is taking GFP_KERNEL as an argument whereas this function call is inside a spin_lock_irqsave region of code. Documentation says that it must be GFP_ATOMIC instead. Me and my colleagues have made a tool targeting program transformations in device drivers. We have designed a scripting language for specifying easily program transformations and a transformation engine for performing them. In the spirit of Linux development practice, the language is based on the patch syntax. We call our scripts "semantic patches" because as opposed to traditional patches, our semantic patches do not work at the line level but on a high level representation of the C program. FYI here is our semantic patch detecting invalid use of GFP_KERNEL and fixing the problem: @@ identifier fn; @@ spin_lock_irqsave(...) ... when != spin_unlock_irqrestore(...) fn(..., - GFP_KERNEL + GFP_ATOMIC ,... ) And now the real patch resulting from the automated transformation: Cc: Greg KH Signed-off-by: Andrew Morton --- drivers/usb/serial/io_ti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/usb/serial/io_ti.c~usb-bugfix-gfp_kernel-gfp_atomic-in-spin_locked-region drivers/usb/serial/io_ti.c --- a/drivers/usb/serial/io_ti.c~usb-bugfix-gfp_kernel-gfp_atomic-in-spin_locked-region +++ a/drivers/usb/serial/io_ti.c @@ -2364,7 +2364,7 @@ static int restart_read(struct edgeport_ urb->complete = edge_bulk_in_callback; urb->context = edge_port; urb->dev = edge_port->port->serial->dev; - status = usb_submit_urb(urb, GFP_KERNEL); + status = usb_submit_urb(urb, GFP_ATOMIC); } edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING; edge_port->shadow_mcr |= MCR_RTS; _