ChangeSet 1.2181.4.43, 2005/03/21 22:26:12-08:00, [EMAIL PROTECTED]
[PATCH] UHCI updates
This is the first of five updates to the uhci-hcd driver:
Rename the uhci->schedule_lock to just plain uhci->lock.
Originally I had thought of adding a separate device-management
lock, but now it seems better to use a single lock for both
purposes.
Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
uhci-debug.c | 4 ++--
uhci-hcd.c | 14 +++++++-------
uhci-hcd.h | 24 ++++++++++++------------
uhci-q.c | 16 ++++++++--------
4 files changed, 29 insertions(+), 29 deletions(-)
diff -Nru a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
--- a/drivers/usb/host/uhci-debug.c 2005-03-30 15:13:16 -08:00
+++ b/drivers/usb/host/uhci-debug.c 2005-03-30 15:13:16 -08:00
@@ -406,7 +406,7 @@
struct uhci_td *td;
struct list_head *tmp, *head;
- spin_lock_irqsave(&uhci->schedule_lock, flags);
+ spin_lock_irqsave(&uhci->lock, flags);
out += sprintf(out, "HC status\n");
out += uhci_show_status(uhci, out, len - (out - buf));
@@ -492,7 +492,7 @@
if (debug > 2)
out += uhci_show_lists(uhci, out, len - (out - buf));
- spin_unlock_irqrestore(&uhci->schedule_lock, flags);
+ spin_unlock_irqrestore(&uhci->lock, flags);
return out - buf;
}
diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
--- a/drivers/usb/host/uhci-hcd.c 2005-03-30 15:13:16 -08:00
+++ b/drivers/usb/host/uhci-hcd.c 2005-03-30 15:13:16 -08:00
@@ -115,7 +115,7 @@
unsigned long flags;
int called_uhci_finish_completion = 0;
- spin_lock_irqsave(&uhci->schedule_lock, flags);
+ spin_lock_irqsave(&uhci->lock, flags);
if (!list_empty(&uhci->urb_remove_list) &&
uhci_get_current_frame_number(uhci) != uhci->urb_remove_age) {
uhci_remove_pending_urbps(uhci);
@@ -134,7 +134,7 @@
spin_unlock(&u->lock);
}
- spin_unlock_irqrestore(&uhci->schedule_lock, flags);
+ spin_unlock_irqrestore(&uhci->lock, flags);
/* Wake up anyone waiting for an URB to complete */
if (called_uhci_finish_completion)
@@ -202,7 +202,7 @@
if (status & USBSTS_RD)
uhci->resume_detect = 1;
- spin_lock(&uhci->schedule_lock);
+ spin_lock(&uhci->lock);
age = uhci_get_current_frame_number(uhci);
if (age != uhci->qh_remove_age)
@@ -229,7 +229,7 @@
}
uhci_finish_completion(hcd, regs);
- spin_unlock(&uhci->schedule_lock);
+ spin_unlock(&uhci->lock);
/* Wake up anyone waiting for an URB to complete */
wake_up_all(&uhci->waitqh);
@@ -526,7 +526,7 @@
uhci->fsbr = 0;
uhci->fsbrtimeout = 0;
- spin_lock_init(&uhci->schedule_lock);
+ spin_lock_init(&uhci->lock);
INIT_LIST_HEAD(&uhci->qh_remove_list);
INIT_LIST_HEAD(&uhci->td_remove_list);
@@ -743,7 +743,7 @@
reset_hc(uhci);
- spin_lock_irq(&uhci->schedule_lock);
+ spin_lock_irq(&uhci->lock);
uhci_free_pending_qhs(uhci);
uhci_free_pending_tds(uhci);
uhci_remove_pending_urbps(uhci);
@@ -751,7 +751,7 @@
uhci_free_pending_qhs(uhci);
uhci_free_pending_tds(uhci);
- spin_unlock_irq(&uhci->schedule_lock);
+ spin_unlock_irq(&uhci->lock);
/* Wake up anyone waiting for an URB to complete */
wake_up_all(&uhci->waitqh);
diff -Nru a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
--- a/drivers/usb/host/uhci-hcd.h 2005-03-30 15:13:16 -08:00
+++ b/drivers/usb/host/uhci-hcd.h 2005-03-30 15:13:16 -08:00
@@ -358,8 +358,8 @@
struct uhci_td *term_td; /* Terminating TD, see UHCI bug */
struct uhci_qh *skelqh[UHCI_NUM_SKELQH]; /* Skeleton QH's */
- spinlock_t schedule_lock;
- struct uhci_frame_list *fl; /* P: uhci->schedule_lock */
+ spinlock_t lock;
+ struct uhci_frame_list *fl; /* P: uhci->lock */
int fsbr; /* Full-speed bandwidth
reclamation */
unsigned long fsbrtimeout; /* FSBR delay */
@@ -375,22 +375,22 @@
unsigned long resume_timeout; /* Time to stop signalling */
/* Main list of URB's currently controlled by this HC */
- struct list_head urb_list; /* P: uhci->schedule_lock */
+ struct list_head urb_list; /* P: uhci->lock */
/* List of QH's that are done, but waiting to be unlinked (race) */
- struct list_head qh_remove_list; /* P: uhci->schedule_lock */
+ struct list_head qh_remove_list; /* P: uhci->lock */
unsigned int qh_remove_age; /* Age in frames */
/* List of TD's that are done, but waiting to be freed (race) */
- struct list_head td_remove_list; /* P: uhci->schedule_lock */
+ struct list_head td_remove_list; /* P: uhci->lock */
unsigned int td_remove_age; /* Age in frames */
/* List of asynchronously unlinked URB's */
- struct list_head urb_remove_list; /* P: uhci->schedule_lock */
+ struct list_head urb_remove_list; /* P: uhci->lock */
unsigned int urb_remove_age; /* Age in frames */
/* List of URB's awaiting completion callback */
- struct list_head complete_list; /* P: uhci->schedule_lock */
+ struct list_head complete_list; /* P: uhci->lock */
int rh_numports;
@@ -436,13 +436,13 @@
* Locking in uhci.c
*
* Almost everything relating to the hardware schedule and processing
- * of URBs is protected by uhci->schedule_lock. urb->status is protected
- * by urb->lock; that's the one exception.
+ * of URBs is protected by uhci->lock. urb->status is protected by
+ * urb->lock; that's the one exception.
*
- * To prevent deadlocks, never lock uhci->schedule_lock while holding
- * urb->lock. The safe order of locking is:
+ * To prevent deadlocks, never lock uhci->lock while holding urb->lock.
+ * The safe order of locking is:
*
- * #1 uhci->schedule_lock
+ * #1 uhci->lock
* #2 urb->lock
*/
diff -Nru a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
--- a/drivers/usb/host/uhci-q.c 2005-03-30 15:13:16 -08:00
+++ b/drivers/usb/host/uhci-q.c 2005-03-30 15:13:16 -08:00
@@ -1184,7 +1184,7 @@
struct urb *eurb;
int bustime;
- spin_lock_irqsave(&uhci->schedule_lock, flags);
+ spin_lock_irqsave(&uhci->lock, flags);
ret = urb->status;
if (ret != -EINPROGRESS) /* URB already unlinked! */
@@ -1242,7 +1242,7 @@
ret = 0;
out:
- spin_unlock_irqrestore(&uhci->schedule_lock, flags);
+ spin_unlock_irqrestore(&uhci->lock, flags);
return ret;
}
@@ -1373,7 +1373,7 @@
struct urb_priv *urbp;
unsigned int age;
- spin_lock_irqsave(&uhci->schedule_lock, flags);
+ spin_lock_irqsave(&uhci->lock, flags);
urbp = urb->hcpriv;
if (!urbp) /* URB was never linked! */
goto done;
@@ -1393,7 +1393,7 @@
list_add_tail(&urbp->urb_list, &uhci->urb_remove_list);
done:
- spin_unlock_irqrestore(&uhci->schedule_lock, flags);
+ spin_unlock_irqrestore(&uhci->lock, flags);
return 0;
}
@@ -1455,16 +1455,16 @@
static void
uhci_finish_urb(struct usb_hcd *hcd, struct urb *urb, struct pt_regs *regs)
-__releases(uhci->schedule_lock)
-__acquires(uhci->schedule_lock)
+__releases(uhci->lock)
+__acquires(uhci->lock)
{
struct uhci_hcd *uhci = hcd_to_uhci(hcd);
uhci_destroy_urb_priv(uhci, urb);
- spin_unlock(&uhci->schedule_lock);
+ spin_unlock(&uhci->lock);
usb_hcd_giveback_urb(hcd, urb, regs);
- spin_lock(&uhci->schedule_lock);
+ spin_lock(&uhci->lock);
}
static void uhci_finish_completion(struct usb_hcd *hcd, struct pt_regs *regs)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html