| From c9218ede599f68376fc3ed1aa0cfa7dae5ff4014 Mon Sep 17 00:00:00 2001 |
| From: Ingo Molnar <mingo@elte.hu> |
| Date: Fri, 3 Jul 2009 08:30:22 -0500 |
| Subject: [PATCH] usb: rt support |
| |
| commit 4aee2ee40829e3a3900b16e999d17cedc2b9c0bf in tip. |
| |
| Signed-off-by: Ingo Molnar <mingo@elte.hu> |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c |
| index a678186..1f07cbf 100644 |
| --- a/drivers/usb/core/devio.c |
| +++ b/drivers/usb/core/devio.c |
| @@ -393,8 +393,9 @@ static void async_completed(struct urb *urb) |
| uid_t euid = 0; |
| u32 secid = 0; |
| int signr; |
| + unsigned long flags; |
| |
| - spin_lock(&ps->lock); |
| + spin_lock_irqsave(&ps->lock, flags); |
| list_move_tail(&as->asynclist, &ps->async_completed); |
| as->status = urb->status; |
| signr = as->signr; |
| @@ -414,7 +415,7 @@ static void async_completed(struct urb *urb) |
| if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET && |
| as->status != -ENOENT) |
| cancel_bulk_urbs(ps, as->bulk_addr); |
| - spin_unlock(&ps->lock); |
| + spin_unlock_irqrestore(&ps->lock, flags); |
| |
| if (signr) |
| kill_pid_info_as_uid(sinfo.si_signo, &sinfo, pid, uid, |
| diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c |
| index 9bc95fe..405f479 100644 |
| --- a/drivers/usb/core/message.c |
| +++ b/drivers/usb/core/message.c |
| @@ -269,8 +269,9 @@ static void sg_complete(struct urb *urb) |
| { |
| struct usb_sg_request *io = urb->context; |
| int status = urb->status; |
| + unsigned long flags; |
| |
| - spin_lock(&io->lock); |
| + spin_lock_irqsave (&io->lock, flags); |
| |
| /* In 2.5 we require hcds' endpoint queues not to progress after fault |
| * reports, until the completion callback (this!) returns. That lets |
| @@ -304,7 +305,7 @@ static void sg_complete(struct urb *urb) |
| * unlink pending urbs so they won't rx/tx bad data. |
| * careful: unlink can sometimes be synchronous... |
| */ |
| - spin_unlock(&io->lock); |
| + spin_unlock_irqrestore (&io->lock, flags); |
| for (i = 0, found = 0; i < io->entries; i++) { |
| if (!io->urbs [i] || !io->urbs [i]->dev) |
| continue; |
| @@ -319,7 +320,7 @@ static void sg_complete(struct urb *urb) |
| } else if (urb == io->urbs [i]) |
| found = 1; |
| } |
| - spin_lock(&io->lock); |
| + spin_lock_irqsave (&io->lock, flags); |
| } |
| urb->dev = NULL; |
| |
| @@ -329,7 +330,7 @@ static void sg_complete(struct urb *urb) |
| if (!io->count) |
| complete(&io->complete); |
| |
| - spin_unlock(&io->lock); |
| + spin_unlock_irqrestore (&io->lock, flags); |
| } |
| |
| |
| @@ -626,7 +627,7 @@ void usb_sg_cancel(struct usb_sg_request *io) |
| int i; |
| |
| io->status = -ECONNRESET; |
| - spin_unlock(&io->lock); |
| + spin_unlock_irqrestore(&io->lock, flags); |
| for (i = 0; i < io->entries; i++) { |
| int retval; |
| |
| @@ -637,7 +638,7 @@ void usb_sg_cancel(struct usb_sg_request *io) |
| dev_warn(&io->dev->dev, "%s, unlink --> %d\n", |
| __func__, retval); |
| } |
| - spin_lock(&io->lock); |
| + spin_lock_irqsave(&io->lock, flags); |
| } |
| spin_unlock_irqrestore(&io->lock, flags); |
| } |
| -- |
| 1.7.1.1 |
| |